Posts

Showing posts from August, 2015

Acceleo: ecore to Python generator not working -

i started work acceleo weeks ago. have problem, when try start example ecore-to-python-generator described here: ( http://www.acceleo.org/pages/ecore-to-python-generator/en ). because generator isn't available in new version of acceleo, downloaded complete eclipse package acceleo 2.7 here ( http://www.acceleo.org/pages/download-acceleo ). i did on website. after choosing "ecore python" module, asks ecore model. select "org.acceleo.module.pim.ecore.gen.python". if start generation process (by right-clicking on default.chain file , launch), there problem: [resource '/org.acceleo.module.pim.ecore.gen.python/default' not exist.] can tell me, how make simple python code generation?

ruby on rails - Issue with delayed_job gem 2.0.4 -

hi getting following error while executing controller. uninitialized constant delayed i have following code in controller. delayed::job.enqueue(delayedworker.new({:model=>object.class.to_s, :object_id=>object.id,:meth=>:create_suggestion})) delayed_worker.rb contains following code. class delayedworker < struct.new(:options) def perform if obj=object.const_get(options[:model]).find(options[:object_id]) if (options[:para] ? obj.send(options[:meth],options[:para].first) : obj.send(options[:meth])) puts "successfull" else puts "failed" end end end end i using rails 2.3.5 version rails. have run: $ script/generate delayed_job $ rake db:migrate i ran rake jobs:work task. runs successfully, while executing controller getting uninitialized constant related error. any 1 please me on this. thanks in advanced.

c# - How to remove directory from .zip -

i want delete folder inside .zip file. i tried zip.removeentry(meta-inf); but not work how delete? i´m using ioniczip you have use quotation marks, because removeentry expects filename , didn't define meta-inf . you have change code this: zip.removeentry("meta-inf");

vb.net - How to remove letters? -

i wanna ask: have label40.text content of {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z} , have have label39.text change output everytime changes happens. my question how can embed simulation through code? if label39.text = "a" content of label40.text "a" remove , list of alphabets remain alphabetically. i want happen anytime label39.text change value "randomly" example if label39.text = "a,b,c,d,x,z" label40.text = "e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y" this code far dim patterns string patterns = label39.text dim tobefollow string tobefollow = label40.text dim matches matchcollection = regex.matches(patterns, tobefollow) if regex.ismatch(patterns, tobefollow) 'this put code make example end if first of all, note populating patterns , tobefollow variables wrongly (you doing right in other question); should be: patterns = label4

c++ - reference to a const char*, error C2664: -

i'm looking @ using boost::serialization , trying use string helper given on http://www.ocoudert.com has interface serializecstringhelper(char*& s) : s_(s) {} serializecstringhelper(const char*& s) : s_(const_cast<char*&>(s)) {} i try use helper in following code (getname() returns std::string) bool myutilities::saveseriallibrarytofile(const string& filename, const mylibrary& lib) { bool saved = false; ofstream out(filename, ios::app); if(out.is_open()) { boost::archive::text_oarchive ar(out); const char* str = lib.getname().c_str(); serializecstringhelper helper(str); // serializecstringhelper helper(lib.getname().c_str()); ar & helper; saved=true; } return saved; } which compiles fine, if replace const char* str , helper lines commented out code, compilation error c2664: cannot convert parameter 1 'const char *' 'char *&' my question is, why single

xml - Xpath count number of element with different id and return parent id -

i have following xml <pizzeria> <menu> <pizza codice="p1" nome="marinara" prezzo="3"/> <pizza codice="p2" nome="margherita" prezzo="4"/> <pizza codice="p3" nome="prosciutto" prezzo="5"/> <pizza codice="p4" nome="prosciutto e funghi" prezzo="5.5"/> <pizza codice="p5" nome="crudaiola" prezzo="7"/> <pizza codice="p6" nome="tartufo" prezzo="8"/> </menu> <tavoli> <tavolo id="t01"> <pizza codice="p5" qta="2"/> <pizza codice="p1" qta="1"/> <pizza codice="p2" qta="3"/> </tavolo> <tavolo id="t02"> <pizza co

gitweb - setup git server/web with lighttpd: gives ...git-upload-pack not found -

i've setup lighttpd , gitweb. created empty repository follows: $server> git --version git version 1.7.11.7 $server> git --bare init p1 $server> cd p1 $server> git update-server-info $server> cd .. $server> chown -r lighttpd:lighttpd p1 in browser can browse repository, when try clone command line get: $> git clone https://example.com/git/project.git p1 cloning 'p1'... fatal: https://example.com/git/project.git/info/refs?service=git-upload-pack not found: did run git update-server-info on server? and, maybe helps, here lighttpd configuration alias.url += ( "/static/gitweb.css" => "/var/www/git/static/gitweb.css", "/static/git-logo.png" => "/var/www/git/static/git-logo.png", "/static/git-favicon.png" => "/var/www/git/static/git-favicon.png", "/static/gitweb.js" => "/var/www/git/static/gitweb.js", "/git"

CSS media queries don't working -

hello i've created website, 3 weeks ago media queries , worked , take break. i'm testing again site media queries don't work (yes freaking messed up). here media queries: /* media queries */ @media screen , (max-width: 980px) { #ad-container, #ad, #adnum, #adnums, #adstxt, #footer { display: none; } #adtxtspecial { display: block; } #content { padding-left: 0px; } #project-logo { display: none; } } @media screen , (max-width: 320px) { #header { height: 100px; } } in head of document got this: <meta name="viewport" content="initial-scale=1.0; maximum-scale=1.0; width = device-width;"> please answer posible. edit: these original styles elements need change. #ad-container { text-align: center; } #ad { width: 900px; height: 500px; margin-right: auto; margin-left: auto; display: block; } #adnums { padding: 2px; background-color: #f7f6f5;

c# - Does twitter api 1.1 work for windows phone -

i need twitter home_timeline tweets last few days on windows phone app. im trying different examples tweetsharp tweetsharp example , oauth1.1 . i login twitter not able post , retriev tweets twitter. tried using api v1.1 receiving error 215 can perfect example home_timeline tweets our app api v1.1? i believe need implement server side based solution leverage twitter's api 1.1.

actionmailer - Rails - URL helpers not working in mailers -

i tried: class mymailer def routes rails.application.routes.url_helpers end def my_mail @my_route = routes.my_helper ... code omitted end also inside mailer: include rails.application.routes.url_helpers def my_mail @my_route = my_helper also, simple way, in mailer template: = link_to 'asd', my_helper but when try start console get: undefined method `my_helper' #<module:0x007f9252e39b80> (nomethoderror) update i using _url form of helper, i.e. my_helper_url for rails 5, included url helpers mailer file: # mailers/invoice_mailer.rb include rails.application.routes.url_helpers class invoicemailer < applicationmailer def send_mail(invoice) @invoice = invoice mail(to: @invoice.client.email, subject: "invoice test") end end

unable to cout string in C++ -

i new programming , can use c++. have been working on rpg, , reason can't program print out value set string to. started defining string "weapon" in void main. void main() { string weapon; cin >> weapon; if(weapon = "a") { weapon == "sword"; } } i had code sort of , had function above uses "weapon" (which set sword can see code above) @ end of had print out, in function (which above void main) in order both defined variables had define them in both void main , function, when that, nothing appears in program when it's run. had written correctly (what put above example) way doesn't create error defining in both parts of code. says 1 of them hasn't been defined yet defined both function , void main. why isn't working? how fix it? thanks p.s. did include string library , namespace. at least read it, have code vaguely this: void f() { string weapon; cout << weapon; } int main(){ stri

c++ - OpenGL grayscale texture draws on one screen but not another -

i have sample code draws 8 bit rasters window using quads (glteximage2d w/ gl_luminance set both pixel format , internal format). pfd initialized this: pixelformatdescriptor pfd; int iformat; hdc = getdc( hwnd ); zeromemory( &pfd, sizeof( pfd ) ); pfd.nsize = sizeof( pfd ); pfd.nversion = 1; pfd.dwflags = pfd_draw_to_window | pfd_support_opengl | pfd_doublebuffer; pfd.ipixeltype = pfd_type_rgba; pfd.ccolorbits = 8; pfd.ilayertype = pfd_main_plane; iformat = choosepixelformat( hdc, &pfd ); setpixelformat( hdc, iformat, &pfd ); and texture initialized this: glpixelstorei (gl_unpack_alignment, 1); gltexparameteri (gl_texture_2d, gl_texture_wrap_s, gl_repeat); gltexparameteri (gl_texture_2d, gl_texture_wrap_t, gl_repeat); gltexparameteri (gl_texture_2d, gl_texture_mag_filter, gl_linear); gltexparameteri (gl_texture_2d, gl_texture_min_filter, gl_linear); gltexenvf (gl_texture_env, gl_texture_env_mode, gl_modulate); glteximage2d (gl_texture_2d, 0, gl_luminance,

performance - Moving inline Javascript to External Combined Javascript -

hi there busy moving inline javascripts combined.js file. in header have code below. working in wordpress. the code below makes slider function on page. have moved bulk part of javascript combined js file. <br /><br /><script>(function($){jssor_slider1_starter = function (containerid) {var jssor_slider1 = new $jssorslider$(containerid, {$dragorientation: 3, $arrownavigatoroptions: {$class: $jssorarrownavigator$, $chancetoshow: 2 }}); function scaleslider() { var windowwidth = $jssorutils$.$getwindowsize(window).x; if (windowwidth) jssor_slider1.$scalewidth(windowwidth); else window.settimeout(scaleslider, 30);} $jssor$.$addevent(window, "load", scaleslider); $jssor$.$addevent(window, "resize", $jssor$.$windowresizefilter(window, scaleslider)); $jssor$.$addevent(window, "orientationchange", scaleslider); };})(jquery);

html - CSS3 - Div width=100% pushes content to new line instead of using remaining space -

i have looked around solution problem, haven't found works. bit noobish apologize bit rusty in css. all have 2 div elements aligned side side horizontally take 100% of window's height , width. div on left have fixed width value , div on right take remaining space. the solution simple , sure missing basic concept css causing issue if me out , maybe point me literature me understand doing wrong appreciate it. fiddle link code the html code: <div id="leftsidebar">left sidebar</div> <div id="content">content</div> the css: html, body{ height: 100%; width: 100%; } #leftsidebar{ width:175px; height:100%; background-color:#567880; } #content{ width:100%; height:100%; background-color:#00a0a0; } you can floats instead: #leftsidebar{ width:175px; height:100%; float: left; background-color:#567880; } #content{ height:100%; background-color:#00a0a0; }

android - mapping from asynctask to intent service -

i have android app widget have used async task network calls. want shift calls asynctask intent service. doinbackground() 's work can done in onhandleintent() onpreexecute() , onpostexecute(). have progress bar code in these 2 methods give spinning effect refresh button. should put code in intent service? update public class storewidgetprovider extends appwidgetprovider { @override public void onupdate(context context, appwidgetmanager appwidgetmanager, int[] appwidgetids) { super.onupdate(context, appwidgetmanager, appwidgetids); updateviews = new remoteviews(context.getpackagename(), r.layout.widget_main_layout1); mcontext = context; mprogressbar = new progressbar(context); intent localintent = new intent(context,storewidgetservice.class); context.startservice(localintent); // try { // fetchtask.execute().get(); // } catch (interruptedexception e) { // // todo auto-generate

finance - Does SMA includes the current day? -

a bit stupid question calculation of simple moving average: includes current price in average. i.e. if prices {1, 2, 3, 4, 5}, 3-day sma looks {-, -, 2, 3, 4} or {-, -, -, 2, 3}. the question not quite 'right'. sma calculates average on number of past periods, , therefore position of periods relative person doing calculating relevant. if calculating, say, sma of dow jones closing number last 5 trading days, it's relevant when calculation. convention, not include measure on day (period) calculation, other people can generate same number without having work out whether included latest value or not. for example, it's 5pm on friday 19th , want 5d sma of dow, calculate m (15th),t, w, th , fr 19th. or calculate using fr (12th), m 15th, tu, w , end th 18th. conventional choice latter people don't have wonder if stayed around til after market close on friday 19th or left go bowling. of course, in long run not matter @ all, since set of smas takes valu

ruby on rails - How to create filterable and sortable div elements -

i using rails 3 , ruby 1.9 develop ecommerce app. have loop pulling product info database div each product populate storefront. problem have been been trying without luck figure out how make products sortable , filterable. want potential customers able filter and/or sort products listing of data associated products (e.g., sort date added or filter manufacturer). so far i've come across templates using jquery accomplish this, haven't been able find leveraging rails framework. ive included code below. assistance appreciated. <div class="store-header1"><h2>today's</h2> </div><div class="store-header2"><h2>offers</h2></div> <% @products.each |product| %> <div class="primary"> <div class="dots"> <div id="offer-title"> <%= product.title %> </div> <%= image_tag(product.image_url, :alt =>product.title, :class=>"product-

ios - Facebook app API key and UIActivityViewController -

is possible supply facebook api key when posting facebook uiactivityviewcontroller? if not, how possible add facebook sdk used uiactivityviewcontroller? i want use share sheet make facebook post, want have deep linking app. possible? i'm not sure if possible might oversharekit https://github.com/overshare/overshare-kit it allows sharing on many different mediums handles facebook api sharing using facebook api key instead of using uiactivityviewcontroller built-in methods.

osx - Syncing two folders continuously -

i'm trying for loop contents of directory , copy directory on system, faced dilemma: if loop through files , copy on other directory , vice versa, once file either directories deleted, loop think file un-synced , copy over. what best bet sync 2 separate folders on os x? in other words, how can 1 folder accessible another?

cakephp - How can I use cakeDCs search to perform a search between dates? -

i'm using search plugin cakedc https://github.com/cakedc/search (works fine far). perform search 2 date fields used search in mysql database between value cannot working. how can that? i found no working example , documentation confusing me. --edit: view code: [html table stuff] <td> <?php echo $this->form->input('from', array( 'type' => 'date', //'div' => false, 'dateformat' => 'dmy', 'minyear' => 2013, 'maxyear' => date('y'), 'style' => 'margin-right: 2px; margin-left: 2px', 'empty' => true, 'timeformat' => null, 'selected' => array( 'day' => 1, 'month' => 1, 'year' => 2013 ), 'empty' => false )); ?> </td> <td>

Remove contents between script and style tags in Objective-C -

alright, working on web crawler can take webpages , convert them passages of text. remove tags themselves, found on stack overflow: - (nsstring *) striptags:(nsstring *)str { nsmutablestring *ms = [nsmutablestring stringwithcapacity:[str length]]; nsscanner *scanner = [nsscanner scannerwithstring:str]; [scanner setcharacterstobeskipped:nil]; nsstring *s = nil; while (![scanner isatend]) { [scanner scanuptostring:@"<" intostring:&s]; if (s != nil) [ms appendstring:s]; [scanner scanuptostring:@">" intostring:null]; if (![scanner isatend]) [scanner setscanlocation:[scanner scanlocation]+1]; s = nil; } return ms; } and works, however, removes tags , not contents between script , style tags (as don't want contents between tags removed result in empty string). is there way can have script , style tags truncated? thanks lot in advance. edit: i hav

javascript - How to create horizontal div moving -

i want know please, how create div moving horizontal. for ex: http://usbek-et-rica.fr are there many prepered div moving .animate() function? want understand how works. thanks guys. animate function changes continually css values. $('#your-div').animate({ left: '+=500', // move 500px right }, 5000, function() { // animation complete. });

android - My code does not show days after today -

Image
i want display current week values in calendar. using example code: custom calendar in android | android calendar example full source code and editing few lines single row shows current week dates. the result looks this: ... code shows today's date, , not show date of tomorrow or day after tomorrow. do? i want this: sun mon tues wednes thurs fri sat 21 22 23 24 25 26 27 but code shows: sun mon tues wednes thurs fri sat 21 22 1 2 3 4 5 i changed code example code: // current month days (int = 1; <= daysinmonth; i++) { log.d(currentmonthname, string.valueof(i) + " " + getmonthasstring(currentmonth) + " " + yy); if (i == getcurrentdayofmonth()) { list.add(string.valueof(i) + "-blue" + "-" + getmonthasstring(currentmonth) + "-" + yy); } else { list.add(string.valueof(i) + "-white" + "-" +

c++ - Can the operator "(" be overloaded? -

i know operator "()" can overloaded curious operator "(" alone seems cannot overloaded. tried looking online reason still cant find one. post here doesnt "(" operator alone.i know no 1 use "(" operator alone asking question out of curiosity. thanks. ( not operator, no, can't overloaded.

Initialize Array of Pointers by Reference C++ -

basically trying initialize array within function, segfaults: void func(int **a, int x, int y) { = new int*[x]; (int i=0; i<x; i++) a[i] = new int[y]; } void main() { int **a; func(a, 2, 3); } however if init array outside function pass it, works perfectly, can assign values / print them. i'm struggling passing reference of array don't have init outside function. void func(int **a, int x, int y) { (int i=0; i<x; i++) a[i] = new int[y]; } void main() { int x = 2; int **a = new int*[x]; func(a, x, 3); } what's biting here c's (and c++'s) lack of by-reference argument passing. a in main() distinct a in func() : a declared in main . a passed value (because there's no other way) func . the a in func assigned to. func returns. a destroyed (leaking memory), , main 's a left uninitialised. ??? main tries use a . segfault! there few possible solutions here: do

.net - How should I store const strings such as validation messages? -

Image
like application, use common strings user feedback, validation messages, descriptions, button text , on. i'd store these strings in logical place. what's ideal method this? don't think matter of opinion; suspect there answer. i've looked @ other answers such this one , i'm interested in comparison of following 3 methods - i.e. explanation of why 1 technique better other two. method 1 - resource file resource files used store strings, best place it? aren't these used localisation? wouldn't resource file big? if use multiple resource files wouldn't hard track down specific strings later? method 2 - static class a sort of global "const" static class store them all? (a module c# static class) method 3 - littered throughout relevant classes with technique have relevant messages @ beginning of class. "useradded" string go in class uses string. c# or vb.net acceptable in answers. method 1 - easier local

html - Contact Form that is not a .php extension -

recently have been trying make contact form work , did after hours of struggle. http://trulyamped.com/democon/contact2.php contact form works , email gets sent account. thing wanted know how make contact form work in .html file. not want in .php file. tried save file .html file did not work. please let me know. pretty want contact2.html , still able work. first of all, why matter? but assuming moment matter, have couple of options. depend on code resides , does. if page has php code needs execute server-side needs processed php interpreter server-side. html file you'd need configure server treat .html files .php files server-side processing. isn't ideal, though. html doesn't need run through php interpreter. it's best keep php , html files separate. another option separate client-side html form , server-side php code 2 separate files. contact.html , contactprocessor.php . in html file you'd post php file in form. this: <form acti

show more in a div with php and css -

i trying implement show more links in several divs (like here http://www.gutscheinpony.de/outletcity.html , click on details , hidden div) getting via php , taxonomy 50 fields on these side , need individual ids can open each div seperatly. problem need give each div variable id via php!!! stuck. can see problem here http://cloud0815.joloshop.com/shops/1822direkt (click on both "show more" text) , first open!!!) if use jquery, not need give each div individual id. can give each "show more" link class 'show-more'. then, bind links click handler. $(this) variable tells of 50 links clicked on. how select div containing hidden text depends on markup, here's example of can do: php: /* inside loop */ <?php $full_text = get_the_content(); $period_pos = strpos($full_text, "."); $excerpt = substr($full_text, 0, $period_pos+1); // first line, assuming line ends period. $rest = substr($full_text,

performance testing - How to Load Test Application Life Cycle Management ( ALM ) application? -

recently have created new alm 11.0 infrastructure application/database/repository servers located @ single place (same geographical area). alm 11.0 application hosted on application server. there around 13 database projects in alm application users can access. physical files used during test runs (such jpeg, png, xls, , pdf) stored in repository. on environment want conduct load testing , performance testing. we want perform user actions , estimate response time’s server. below of user actions can considered. in how time user able login application? at specific point of time how many users can simultaneously login application? after logging application how time taken enter each module? module can dashboard, defect, requirements, test plan, , test lab? how time required application in order create new entities such test script, requirement, test set group of test instances, dashboard report etc? how time spent application in order display few reports accessing files rep

django - Firefox WebFont 403 Despite S3 CORS Rules -

i'm trying host , serve webfonts (specifically, fontawesome) django project on heroku aws s3, , i'm having difficulty overcoming dreaded firefox cross-domain font-loading issue . i've tried documented, accepted solutions , none of them working me. the recommended solution keep seeing edit cors configs on s3 bucket: <?xml version="1.0" encoding="utf-8"?> <corsconfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <corsrule> <allowedorigin>https://myapp.herokuapp.com</allowedorigin> <allowedorigin>https://www.myapp.herokuapp.com</allowedorigin> <allowedorigin>https://myapp.com</allowedorigin> <allowedorigin>https://www.myapp.com</allowedorigin> <allowedmethod>get</allowedmethod> <maxageseconds>3000</maxageseconds> <allowedheader>authorization</allowedheader> </corsr

Why isn't css calc function working properly in Chrome on Android -

i have following little snippet of css; ul#list li div.column { width: -moz-calc(40% - 12px); width: -o-calc(40% - 12px); width: -webkit-calc(40% - 12px); width: calc(40% - 12px); } this works expected in chrome on ipad, iphone, , osx on chrome android (4.2.2 on google nexus 7) giving width far short. don't have dev tools set query device see going on driving me insane. there known bug browser? as i'm sure you've figured out, calc not supported on android. best resource i've found determine whether feature supported caniuse.com - in case, should help: http://caniuse.com/#feat=calc

php - how to use vbulletin variables globally? -

i want use {vb:raw human_verify} on page inside vbulletin ? when use variable in template , not work. it works on templates (register, search, ..) never work in template.. i have tried add new plugin make vars global : vb_template::preregister('activity_home',array('includedphp ' => $includedphp)); but works on new (custom) vbulletin vb:raw variables. how overcome this? thanks in advance i assume using vb4 , variable set in includedphp. need change : activity_home with name of template need use variable (do multiple times if want add in several templates). basicaly : use "forumhome" put forum home or "header" put on header... this link helpful (see "save array , preregister use in existing/stock template" section ). hope helps. edit : $templater = vb_template::create('mytemplate'); // define template $templater->register('my_var', $my_var); // define variables $templater->

php - SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax -

i can't figure out wrong read method (dynamic prepared statement pdo). can point me in right direction? don't think i'm using reserved sql words. perhaps i'm missing quotes or somewhere? i'm new pdo. this read method: public function read($select_col, $table_name, $where, $where_condition=null, $where_compare=null, $other=null){ //this method return false if # of key-value pairs don't match # of $where_condition items. //if works, return 1-dimensional array if 1 row found. if more 1 row, 2d array. // return associative array. //$select_col can array or variable (words or "*") //$table_name $table_name (most $table_name var given object) //$where associative array keys column names , values value test. // code below add ":" in front of key make named parameter. //$where_condition allows user create other conditions (ie. "<" or ">". ca

asp.net mvc - How does show the updates asynchronously?

Image
on stack overflow site, can see following updates asynchronously. reputation changes new question added in question list new comment added, etc. as per understanding, can done in xmlhttprequest (xhr) request asynchronously, maybe of setinterval . confusions : in firefox, no xhr request coming , can see above changes asynchronously. which kind of implementation , how can done in asp.net mvc ? this impressive , beautiful stuff asynchronous calls made client server using ajax . a simple approach use jquery ajax make asynchronous call inside setinterval search "updates" of question (this question id 17779628. can see on url =p). so, call server can pass id , timestamp (a date) of last call made server. server brings updates occurred timestamp datetime.now . i not sure real implementation of stack overflow, did lot of stuff this. another tip: there improvement. ;) modern browsers contains implementations of websocket . since sockets "pee

objective c - ios simulator British Summer Time wrong hour -

i trying parse date string , nsdate: nsarray *expld_date = [day componentsseparatedbystring:@","]; nsstring * keyword = [[[expld_date objectatindex:1] stringbyappendingstring: @"/"] stringbyappendingstring: [nsstring stringwithformat:@"%d", year] ]; nsdate * date = [_dateformatter datefromstring: keyword]; nslog( @"other date string %@", keyword ); nslog( @"other date %@", date ); other date string 14/07/2013 other date 2013-07-13 23:00:00 +0000 is supposed happening, or simulator wrong? assumed received same date-time host computer. when call [nsdate date] returns date. not apply nsdateformatter it, needed display in local timezone. the time correct, based on fact bst 1 hour forward of gmt

cmd - batch file echo line with 0 does not write to file -

i have in batch file... echo actionnumber=0>> %wkdir%\some.ini ...problem is, never gets written file rather displayed on console this... actionnumber= if had... echo actionnumber=20>> %wkdir%\some.ini ...it get's written fine how can write line file "actionnumber=0" (without quotes, i'm showing needs 1 line no spaces, no trailing space either) >>%wkdir%\some.ini echo actionnumber=20 unfortunately, space-after-digit solution echoes space file, have trailing spaces. (that's gotcha digit preceding redirector)

c++ - How can i get xml line number from ptree exception -

i using boost ptree read xml file this: ptree mytree; ... /*open xml file*/ try{ mytree.get<string>(s); } catch(boost::exception const& ex) { /*get useful info!*/ } i know can use what() function, produces error , strings sent. is there way more useful information line numbers in xml relevant call? if want detect malformed xml (as opposed xml documents don't contain values expect, in case line numbers aren't feasible obtain): #include <iostream> #include <boost/property_tree/ptree.hpp> #include <boost/property_tree/xml_parser.hpp> int main(int argc, char* argv[]) { boost::property_tree::ptree pt; try { read_xml(argv[1], pt); } catch (const boost::property_tree::xml_parser::xml_parser_error& ex) { std::cerr << "error in file " << ex.filename() << " line " << ex.line() << std::endl; } } now given t.xml not valid xml document: $ a.out t.xml error in fi

android - error: undefined reference to 'av_free_packet(AVPacket*)' when use NDK to compile ffmpeg -

i compiled cpps use ffmpeg liberary android ndk android mk follow : local_path := $(call my-dir) defines += -dtarget_posix \ -dtarget_linux \ -d_linux \ -dtarget_android \ -d__stdc_constant_macros include $(clear_vars) local_module := libavcodec local_src_files := lib/lib/libavcodec.so include $(prebuilt_shared_library) include $(clear_vars) local_module := libavfilter local_src_files := lib/lib/libavfilter.so include $(prebuilt_shared_library) include $(clear_vars) local_module := libavformat local_src_files := lib/lib/libavformat.so include $(prebuilt_shared_library) include $(clear_vars) local_module := libavutil local_src_files := lib/lib/libavutil.so include $(prebuilt_shared_library) include $(clear_vars) local_module := libpostproc local_src_files := lib/lib/libpostproc.so include $(prebuilt_shared_

iphone - What is best place to store images -

i want develop photo journal app, allow users take pictures, record videos , arrange them in albums. best place save images. should save them documents folder or other place. please kind! as it's user generated data, store images , videos in nsdocumentdirectory

(Android) Call Fragment from other Package within the Project -

so scenario is com.example.fragment1.fragmentsample.class com.example.fragment2.fragmentsample2.class ,,, com.example.main.mainactivity.class so when app start create fragmentsample default , call fragmentsample2 when press enter button in fragmentsample... code has error how can this?? btw mainactivity extend on activity... wrong should fragmentacitivity or ok? in experience, adt unhappy (doesn't recognize r file) when fragments don't belong same package activity, in case need move fragmentsample.java & fragmentsample2.java com.example.main if doesn't solve problem, need provide more detail on error/s you're seeing.

unix - Loop for interpret the python script (.py) -

i'm beginner python. question might basic, cannot figure out. want run following command 100 times in variable "num" runs 0 through 99. python test.py input_num.txt -i 5 --cor_file=output_num.txt for example: python test.py input_0.txt -i 5 --cor_file=output_0.txt python test.py input_1.txt -i 5 --cor_file=output_1.txt ... ::: python test.py input_99.txt -i 5 --cor_file=output_99.txt i know have write script running loop, cannot figure out yet. if have recommendation, nice. i tried write script called main.py containing following commands, didn't work. #!/usr/bin/env python import test ext_str = '.txt' inp = 'input_' out = 'output_' num in range(0,99): inp += 'num' inp_str = inp + ext_str out += 'num' out_str = out + ext_str python test.py inp_str -i 5 --cor_file=out_str thank much. best, pim in case need call python interpreter on various files, e.g. need call "python

asp.net mvc 4 - Use the CsScript when you run the program for the calculation of the formula or the implementation of a function -

my program requires dynamic approach implementation of formula, method proposed formula parameters in table, , use them in application, other suggested use of csscript . don't have experience in use of csscript . way use ?

excel - Macro stopping at print PDF code -

we use single machine run our vba macros. last week changed machine - virtual "server" running windows 7: i'll use term server quite loosely more virtualised-pc. everything running smoothly apart 1 line of code: excel.activesheet.exportasfixedformat _ type:=xltypepdf, _ filename:=filepath_pdf & filename_pdf, _ quality:=xlqualitystandard, _ includedocproperties:=true, _ ignoreprintareas:=false, _ from:=1, _ to:=2, _ openafterpublish:=false unfortunately error message reported when bugs not descriptive , if go debug mode , hit f8 runs line ok! it running under credentials of network login not network login. login same 1 used our previous non-virtual excel box. is there software need double-check installed on new box? there alternative approach take move contents of file pdf file? [note third parties: not answer problem] example of error handling: public sub boo(byval calendar variant) on error goto errha

Is Python's logging.getLogger scalable with many named loggers? -

i'm using logging.getlogging() in way not forbidden documentation not directly referred to. my applications process data files , network connections, in threads. in order identify log lines each connection and/or data file, following: data_file_name = "data_file_123.xml" logger = logging.getlogger(data_file_name) logger.info("this logged.") 2013-07-22 05:58:55,721 - data_file_123.xml - info - logged. this works well: avoids passing logger instance around software. ensures every line marked appropriate source identifier without having manually perform in each logging call. my concern documentation @ http://docs.python.org/2/library/logging.html#logging.getlogger : all calls function given name return same logger instance. means logger instances never need passed between different parts of application. how the logger instances destroyed? destroyed? after processing million files there million named logger instances waiting in memory u

c# - Pass master page control values on content page on page_load -

i have dropdowlist on master page , want pass selected value on content pages when content page loads. problem value passes when change value on dropdownlist. when page load have reselect dropdownlist capture value of dropdown. if browsing content pages selected value doesnt pass on page load. master page code .net: <asp:dropdownlist id="ddlcategories" runat="server" datasourceid="sqldatasourcecategories" datatextfield="categoryname" datavaluefield="categoryid" autopostback="true" onselectedindexchanged="ddlcategories_selectedindexchanged"></asp:dropdownlist> master page cs: protected void page_load(object sender, eventargs e) { if (!ispostback) { ddlcategories.databind(); ddlcategories.items.insert(0, "uncategorized"); ddlcategories.items[0].value = "0"; ddlcategories.selectedvalue = convert.tostring(session["lblc

Save Java propertyfile into XML format in specific order -

i'm looking way save properties in specific order. property-class saves values unsorted :/ important me save them in specific order. way when saving xml format storetoxml()? want them in order in have inserted them. for example: put("name","frost"); put("surname","byte"); put("age","18"); put("country","germany"); gets stored in order: <entry key="name">frost</entry> <entry key="country">germany</entry> <entry key="surname">byte</entry> <entry key="age">18</entry> any ideas? properties wrong approach achieve this. properties extends hashtable hashmap , therefore not retain order of properties inserted. you have use technology write xml files have order. e.g. can use jaxb create xml files directly involved objects.

c++ - Left and right alignment on the same row (RTF FILE) -

i need write text - little on left , little on right , it's must on same line. i need code in rtf, because auto-generate app in c++. what rtf code can set text on same line left , flushed right? add tab ruler right aligned tab @ far right , insert tab between 2 texts. {\rtf1\ansi\deff0{\fonttbl{\f0\fnil;}} \pard\tqr\tx8236\f0 test\tab test\par }

c++ - ShowCursor has no effect until the mouse is moved -

i need hide cursor when left , right buttons both pressed. turns out code working expected except minor glitch mouse move. when call showcursor(false) cursor becomes hidden expected. after when call showcursor(true) cursor not appearing again until next mouse move. opinion - not drawn until mouse event occurs. there way force cursor redrawn? code: void sg::cursormanager::hidecursor(void) { while(showcursor(false) >= 0); } void sg::cursormanager::showcursor(void) { while(showcursor(true) <= 0); } if understand correctly how cursor work in windows, have call setcursor(idc_...) make cursor visible immediately. the thing cursor set window beneath, response message wm_setcursor . idea of showcursor() disables/enables wm_setcursor message. when disabling cursr setcursor(null) cursor dissapears. when enabling cursor cannot call setcursor(idc_...) because not know cursor should shown. waits until next wm_setcursor generated, until mouse moved.

Daylight savings time with mysql and php -

quick question: i have issue daylight savings time affecting output of data on website. everything showing being hour ahead (we in middle of bst). how make database recognise when it's dst , output accordingly? programming language php database mysql data in question formatted datetime and code is: <?php echo date('d, js f @ g:ia', strtotime($event_date)); ?> use date_default_timezone_set('utc'); (you might want take @ php manual)

c# - How do I close an image open in a picturebox so I can delete it? -

at moment form has system can save data in form directory in applications folder load again through listbox have set need add delete button delete data out of folder problem if opened it returns error cannot delete because file in use heres code use save data private void button3_click(object sender, eventargs e) { using (var writer = new streamwriter(@"cards\" + cardname.text + ".card", false)) { int lev = level.selectedindex; int race = race.selectedindex; int attribute = cardattribute.selectedindex; int cardtype = combobox1.selectedindex; int monstertype = combobox2.selectedindex; int spelltype = combobox4.selectedindex; int traptype = combobox3.selectedindex; string[] des = carddescription.text.split('\n'); imageconverter img_converter = new imageconverter();

android - How to know if I'm runnning my website in th mobile or as a mobile app? -

i'll create webapp of web. heard of lot of services make easy: i want create mobile apps using tools wrap html5/css/js deployable app-store type app, want use source html5/css/js conventional website ( appmakr, appsbuilder, appgeyser... ) there way able tell js whether running in browser or mobile app? any tip, or advice appreciated, , if need more info, let me know , i'll edit post. to tell difference between http request coming mobile application or mobile browswer can use user agent. safari/ios respective user agent examples follows: mobile browswer: mozilla/5.0 (ipad; u; cpu os 4_3_2 mac os x; en-us) applewebkit/533.17.9 (khtml, gecko) version/5.0.2 mobile/8h7 safari mobile app: mozilla/5.0 (ipad; u; cpu os 4_3_2 mac os x; en-us) applewebkit/533.17.9 (khtml, gecko) mobile the check in case being mobile vs "version/5.0.2 mobile/8h7 safari" on end. to make same check in android, can following: function() isnativeapp { return /ap