Posts

Showing posts from February, 2013

c# - Parsing multiple groups -

i have html file(i can't use html agilitypack) want extract id of div(if has one) <div id="div1">street ___________________ </div> <div id="div2">cap |__|__|__|__|__| number ______ </div> <div id="div3">city _____________________ state |__|__|</div> <div id="div4">city2 ____________________ state2 _____</div> i have pattern extracting underscores __ : [\ _]{3,} now if have div in front of underscores want extract it, if not i'll underscores. i have build far pattern (<div id(.+?)>(\w)([\ _]{3,}/*))([\ _]{3,}) the first part build out of 3 groups 1 - div tag, 2 - label, 3 - underscores 1 - <div id(.+?)> , 2 - (\w) , 3 - [\ _]{3,}/* the div id div2 not take id because contains non-alfanumeric chars. q: wrong pattern ? desired matchs 4 divs: <div id="div1">street ___________________ ______ <div id="div3">city _____________...

android - Implications of using GLSurfaceView on power consumption and battery life -

my app using glsurfaceview displaying images (and fast transformation). i've noticed when merely initialize surface, fill solid color , don't call further opengl functions, after time of activity staying in foreground tablet starts getting hot. cpu consumption 0%, assume it's gpu. right? , if so, there way throttle gpu? operations i'm using opengl not @ performance-demanding. have set render mode rendermode_ondemand? see docs here: http://developer.android.com/reference/android/opengl/glsurfaceview.html#setrendermode(int)

Android activity onPause() method -

in current project, have activity named calendarview.java , launcher activity named firstscreenactivity.java should appear whenever user press home button/back button calendar.java . added interstitial ads in firstscreenactivity.java . now, problem when start calendarview.java , ads appears, activity goes in onpause() state, when cancel ads , comes on calendarview.java activity comes in onresume() state. here don't want activity finish in onpause() method, want i'm pressing home button , come firstscreenactivity.java should open. now want is, when click home button in calendarview.java , restart project firstscreen.java should appear, , when ads appear in calendar.java , user close ads user should remains on calendarview.java only. any positive response highly appreciated.

Converting a 2D Canny Edge image to 1D edge pixel array in CUDA - Strange behaviour -

i have cuda kernel takes edge image , processes create smaller, 1d array of edge pixels. here strange behaviour. every time run kernel , calculate number of edge pixels in "d_nlist" (see code near printf), greater pixel count each time, when use same image , stop program , re-run. therefore, each time run it, takes longer run, until eventually, throws un-caught exception. my question is, how can stop happening can consistent results each time run kernel? my device geforce 620. constants: threads_x = 32 threads_y = 4 pixels_per_thread = 4 max_queue_length = threads_x * threads_y * pixels_per_thread img_width = 256 img_height = 256 img_size = img_width * img_height blocks_x = img_width / (threads_x * pixels_per_thread) blocks_y = img_height / threads_y the kernel follows: __global__ void convert2dedgeimageto1darray( unsigned char const * const image, unsigned int* const list, int* const glob_index ) { unsigned int const x = blockidx.x * threads_x*p...

ios - AFNetworking synchronous calls (like/unlike) -

i need implement like/unlike functionality in app. api calls made afnetworking , success/errors handlers ( ios blocks ). problem when user making many clicks on button in short period of time, of request received server in wrong sequence , becomes wrong. example double or double unlike happens. is there way send request via afnetworking synchronously? if no best practice design kind of api requests? disabling button (like comments suggest) not bad idea, if throw spinner or ui change let user know processing change. otherwise, limit api calls allow single call out. if user presses button, fire call , change boolean or tracking value. if press button again hold unto change state locally wait first callback come in. if keep pressing button keep track of change never fire response until receive notification api call has completed (probably 10-30 second timeout in case fails). once call completed, see if new value user wants different. if is, send , prevent future ...

database - Mysql join query help to show 2 seperate records -

i have query returns courses has status = "offering" , offered user has course courseid "3" problem there sc_c_material table has 2 records against course want show 2 seperate rows against this, 1 row has sc_course data 1st record of sc_c_material , 2nd row again sc_course data 2nd record of sc_c_material the below query only return 1 record course has id 9 id 9 has 2 records in sc_c_materials table. want both of record sc_c_material table i hope have cleared point, because bit hard explain select c.`id`, c.`coursecode`, m.`title`, a.`author_name`, q.`quality`, m.`comments`, s.status, u.id, m.`material` sc_courses c, sc_status s, sc_c_materials m, sc_authors a, sc_quality q, users u c.`statusid`=s.`id` , c.`userid`=u.`id` , m.`qualityid`=q.`id` , m.`authorid`=a.`id` , c.`id`=m.`courseid` , s.`status`="offering" , c.`userid` in (select useri...

c++ - Qt connection type between threads: why does this work? -

while trying make multi-camera system work different thread handling different camera, couldn't signals , slots working correctly between different threads. knew wrong fact object sending signal , related slot's object living in different threads, , knew had find appropriate "connection type" parameter connection. eventually, ended discovering using qt::directconnection make work should. find simplified code below. here's small description of how should work. application main program supposed create threads , start them. in simplified version, waits worker finish jobs through slot "quit". worker object performs 1 of threaded tasks. in simplified example, wait time before finishing computation. worker emits signal directed application instance, allowed wait threads , quit qcoreapplication. what finding if don't use qt::directconnection in second connect, finished() signal of worker not trigger quit() slot of thread, means application rema...

.net - Visual Studio Development Server - CSS is lost. On IIS Server is working -

when i'm using visual studio development server ( http://localhost:64217/application ) css gets lost , chrome showing following warnings , errors: resource interpreted stylesheet transferred mime type text/html: uncaught syntaxerror: unexpected token < when using iis server ( http://localhost/application ) styles fine. i've checked these duplicate questions visual studio development server not updating css , javascript? , lose “modern” (css3) styles when viewing on iis vs vs development server [closed] . unfortunately none of them helped me. i've tried clearing cache , didn't help. guesses might cause happen appreciated. also have mention happened today. in past using both iis , development server , didn't have problem. edit i'm using jquery mobile , i've included jqm css in master page: <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css" runat="server...

sql - OpenXava customise -

im looking @ creating frontend postgresql database, i'am using drupal 6 (forced use) looking @ solutions allow me rather create module breaking head. code within page node, found openxava link seems me link too. wondering allow embedding within page, possible alter submit function when record changed, xyz happens too? (just basics on if there file go add , code). if you're developing java application can embed openxava module in application using . can modify openxava behavior completely, including executing code on saving, adding validation, writing own save action. have @ openxava doc: http://www.openxava.org/doc

window.open - Force window height, javascript -

i trying force window.open height 0px, possible? the code i'm using this: window.open('', 'address','toolbar=no,location=yes,directories=no,status=no, menubar=no,scrollbars=no,resizable=no,width=100,height=0,top=100,left='+left); but won't resize 0 pixels, address bar available? can please me. thanks according the mozilla documentation , "the minimum required value 100".

extjs4.1 - Extjs 4.1 - Show and hide some special Items in a form -

i have windows items include 2 items like var win = ext.create('ext.window.window', { title: 'hello', height: 200, width: 400, layout: 'fit', items: { xtype: 'form', border: false, hidden: true, items: [{ xtype: 'textfield', fieldlabel: '1' },{ xtype: 'textfield', fieldlabel: '2' }] } }).show(); i make button , want show/hide first item ( fieldlabel : '1' ) in window like ext.create('ext.button', { text: 'show first item', visible: false, renderto: ext.getbody(), handler: function() { win.down('form').items.items[0].show(); // not working } }); but that's not working. how fix thanks ps: don't want use id comp, b/c form dynamic ...

regex - Why does this substitution also remove a whitespace character? -

i writing script extract , convert sql statements file. need convert sql unloaded froma gupta sqlbase database sql sqlserver can understand. one task replace keywords not allowed column names compatible name. in following code $commands array ref contains sql statements. (there more code here, extracted because shouldn't relevant here) my @keywords = ("left", "right", "percent", "file", "print", "cross", "plan", "top", "end", "file", "default", "check", "text"); foreach $cmd (@$commands) { foreach $kw (@keywords) { $cmd =~ s/\b$kw\b[^(]/_$kw/gi; } push @$converted, $cmd; } this works fine statements in following command "default" gets replaced "_default instead of "_default" . second quotation mark lost. create table sysadm.subtype ( id_subtype integer not null, id_type integer not nu...

javascript - Get value of twitter bootstrap radio button group in Meteor -

i know the're lot of topics around this, unfortunately, can't find working solution. here's question. i have meteor template following button group in it: <template name="test"> <form class="form-horizontal" id="search_form"> <fieldset> <div class="form-actions"> <div class="btn-group" data-toggle="buttons-radio" id="my_radiogroup"> <button type="radio" class="btn my_button" name="knop" value="1">or</button> <button type="radio" class="btn my_button" name="knop" value="2">and</button> </div> </div> </fieldset> </form> </template> now want value of selected radiobutton (or or and). therefore tried following solutions, based on find on web , on stack: first solution: template.test.events({ 'click...

ruby on rails 3.2 - Couldn't find Category without an ID Error message -

i'm new ruby on rails, , i'm experiencing problems i'm trying affect cathogory id object. so controller action: def create_card @card = card.new(params[:card]) if !params[:category].blank? @card.category_id = params[:category_id] end @category = category.find(params[:id]) @card.category_id = @category.id @card.save if @card.save flash[:notice] = "card created" redirect_to :action => "card_information", :id => @card.id else render new_card_path end end and view piece of code: = form_for @card, :url => create_card_path |f| .row .span3 = f.label "card name" = f.text_field :title .row .span3 = f.label "card category" = select_tag :category_id, options_for_select(category.all.collect{ |c| [c.title, c.id]}) %br/ .row .span3 = f.submit "submit", :class => "btn btn-primary" ...

servlets - Java - How to detect IP version -

i'm getting client ip address via below method : public static string getclientipaddr(httpservletrequest request) { string ip = request.getheader("x-forwarded-for"); ... return ip } now want detect if ipv4 or ipv6 . you create inetaddress , check if became ipv4 or ipv6 instance inetaddress address = inetaddress.getbyname(ip); if (address instanceof inet6address) { // it's ipv6 } else if (address instanceof inet4address) { // it's ipv4 } it seems bit awkward, though, , hope there better solution.

php - Mysql select date from different table -

hye guys i'v problem selecting date table. have tables like 1) users table, 2)follow table, 3) photos table, etc. i'm trying select date photos , not working. here mysql query. here i'm selecting followers follow table follower = user_id followers_photo.php $the_user = mysql_query("select * users username = '$getuser'"); $tuser=mysql_fetch_array($the_user); $isuser = mysql_num_rows($the_user); $tu_id = $tuser['id']; ////users whos following me $followers = mysql_query("select * follow followers ='$tu_id' order id desc"); $f_s_count = mysql_num_rows($followers); and here i'm retrieving photos base on date , following id . index.php include('func/followers_photos.php'); if($f_s_count > '0') { while($uim = mysql_fetch_assoc($followers)){ $i_id = $uim['following']; $followers_image = mysql_query("select * ...

associative array - iterating over keys of indirect bash hash -

i writing script reads number of variables in config file. number of variables associative arrays. 1 or more of hashes need parsed @ runtime in order set number of session related parameters. while can access values each key individually this: declare -a $(echo $1) . /path-to-config/script.conf _hashid=$1 param=${_hashid_}[string] echo ${!param} ...i unable access keys themselves. i'd this: declare -a $(echo $1) . /path-to-config/script.conf _hashref_=${1}[@] key in "${!_hashref_}" ; echo ${_hashref_[$key]} done this sets $key value of each element. , other variations i've tried on haven't worked either. can explain me how iterate on keys when hash name dynamic?

SVN server line with password w/ svn+ssh transport -

i can connect svn having login in server address this svn+ssh://login@someip/somepath is possible have password there? no, not. subversion's delegation external ssh process has no support passing passwords. part of point of using ssh avoid interception of plaintext passwords, (by caching passwords) serious bug if supported, , lack of "feature" by-design. what can use rsa key authentication allow single-sign-on (ideally, encrypting key, such operating system prompts key's password first time try use it, remembers thereafter; macos x , modern gnome -- stock ubuntu -- out-of-the-box). use ssh-keygen command generate rsa key pair, , cause public half of installed in authorized_keys file user on svn server. (some sites may allow rsa public keys installed in ldap; system administrator able tell more). incidentally, it's not necessary have username in url either. can apply appropriate configuration in ~/.ssh/config : host your-svn-server user...

clojure - Out of memory on spit -

i don't understand why code raise out of memory exception. i have agent call function append line "test.log" file. out of memory on persistenthashmap $ bitmapindexednode.assoc(persistenthashmap.java:624) . (use 'clojure.java.io) (def the-agent(agent nil)) (defn process [_o content] (spit "test.log" content :append true) ) (defn write-all [] (doseq [x (range 1 5000000)] (send-off the-agent process "line appended\n" ) ) ) thanks ! the dispatched sends blocked on i/o on individual spits. dispatches created faster can completed , accumulating. (defn write-all [] (doseq [x (range 1 5000000)] (send-off the-agent process "foo") (when (zero? (mod x 100000)) (println (. the-agent clojure.lang.agent/getqueuecount))))) user=> (write-all) 99577 199161 298644 398145 497576 596548 exception in thread "nrepl-worker-0" java.l...

javascript - Spotify API - Remove all tracks from temporary playlist -

i have temporary playlist want button remove tracks said playlist. how done? if using api version 1.0 can remove tracks var mytempplaylist; models.playlist.createtemporary("mytemplist").done(function(playlist) { mytempplaylist = playlist; playlist.load("tracks").done(function(loadedplaylist) { //.... }); }); //remove existing tracks temp playlist mytempplaylist.tracks.clear();

html - Openweathermaps parse json jquery forecast -

i'd display weather forecast. far managed display 1 day. html & jquery code: http://pastebin.com/cpz0pe7g the json displayed in format. { "cod":"200", "message":0.0152, "city":{ "id":524901, "name":"moscow", "coord":{ "lon":37.615555, "lat":55.75222 }, "country":"ru", "population":1000000 }, "cnt":4, "list":[ { "dt":1375866000, "temp":{ "day":26.19, "min":21.82, "max":26.19, "night":21.82, "eve":25.22, "morn":26.19 }, "pressure":1010.53, "humidity":77, "weather":[ { "id":80...

"fatal: ref HEAD is not a symbolic ref" during interactive git rebase -

got 3 commits - 1 proper, , 2 silly cleanup ones, typos etc. want squash them. fire away: git rebase -i head~3 sounds simple, , should work - i've tried after running problem, in brand new repo, , works expected. editor shows 3 commits, pick top, squash other two, save , quit, done. if run in verbose mode, see more details - git enters detached head state checking out 1st commit 'picked', 'rebasing 2/3' , 'rebasing 3/3', apparently creating temp commits along way -- , success message; editor pops again @ point, offering me change commit message. all's good. but same command dies in work repo! 3 commits in editor, pick-squash-squash.. time, don't see 'rebasing 2/3', instead first line after 'head @ my-sha-1', runs fatal! head @ 48a6c3d... <commit message> fatal: ref head not symbolic ref but why would git expect head symbolic ref? rebase process detach head - same see in exploratory example - why fatal in second ex...

jQuery, CSS, -webkit-transform: NO animation -

i using code change -webkit-transform property of element. however, want without transition animation playing: e.g. want go transformx(-300px) transformx(0) without slide in-between. code have far, ineffective. have have "list-style-type" set none otherwise step function not run. $("#slider > ul").animate({"list-style-type": "none"}, {step: function(now, fx) { $(this).css('-webkit-transform', 'translatex(0)') } }); any ideas? just do $("#slider > ul").css('-webkit-transform', 'translatex(0)');

javascript - jQuery .on("click") - alternative to .live() -

in project appending several buttons div: $(".tab-content").append("<div class='landing_content'><button class='off-screen-nav-button btn btn-info btn_edit' data-effeckt='effeckt-off-screen-nav-right-overlay'>edit</button></div>"); and listen click following code: $(".tab-content").on("click",".btn-edit",function(){ console.log('edit'); }); why not working? used use .live() has been deprecated. thanks. in markup have btn_edit , in jquery have btn-edit . change markup class match jquery selector, this: $(".tab-content").append("<div class='landing_content'><button class='off-screen-nav-button btn btn-info btn-edit' data-effeckt='effeckt-off-screen-nav-right-overlay'>edit</button></div>");

c++ - What are the differences between those two approaches of threading? -

i going implement job based threading architecture. means on 1 hand, there queue main thread can append jobs to. on other hand there worker threads, dependent on number of available cpu cores, consuming jobs , removing them queue. now, there 2 approaches implement in c++ coming mind. first 1 template based. there task template representing 1 job. holds function, might lamda , provides access data. to use this, we'd have store in work function object, lambda expression. moreover, need point data pointer our data object , set empty false after that. of course object must attached job queue. worker thread fetching job lock access , , main thread can check lock free every time work result then. template <class t> class task { public: task() { empty.store(true); data = nullptr; } std::mutex access; std::atomic<bool> empty; std::function<void(t*)> work; t *data; }; the second approach inheritance based. empty f...

php - Run console command background after login Symfony2 -

i want run custom symfony2 console command background after login. make listener , try use process run command @ background function not work well. here code class loginlistener { protected $doctrine; private $recommendjobservice; public function __construct(doctrine $doctrine) { $this->doctrine = $doctrine; } public function onlogin(interactiveloginevent $event) { $user = $event->getauthenticationtoken()->getuser(); if($user) { $process = new process('ls -lsa'); $process->start(function ($type, $buffer) { $command = $this->recommendjobservice; $input = new argvinput(); $output = new consoleoutput(); $command->execute($input, $output); echo "1"; }); } } public function setrecommendjobservice($recommendjobservice) { $this->recommendjobservice = $recommendjo...

javascript - jQuery - checkboxes selecting all on a row or with similar names & ID's -

Image
using jquery 1.9.1 & getting xml returned query needs displayed in web page shown in picture below. had asked similar question several days ago on place in asking. hope ask better questions time. for items in picture, xml input be: <classrooms> <room number="3"> <machine>310</machine> <machine>320</machine> <machine>340</machine> <machine>350</machine> </room> <room number="8"> <machine>810</machine> <machine>820</machine> <machine>840</machine> </room> <room number="10"> <machine>1010</machine> <machine>1020</machine> </room> </classrooms> the code below function called upon successful ajax get , builds checkboxes in table on web page. var $roomlist = $( items ); var roomliststring = j...

How to handle file upload windows in selenium webdriver + python? -

i have come across solutions handle file upload windows unfortunately none of them talk apis have python. hence thought ask question. i have web page button named upload open file upload window. when click on it, opens file upload window. hope not trivial question because have not found solutions on internet specific python. just emulate click on "upload" button , supply path file sendkeys. answer on stackoverflow

mySQL count occurrences with JOIN (with date parameters) -

i asked question here: mysql count occurrences join this question, asked how count occurrences of tag after joining etc. i'd know how this, checking event publish_date want include tags within past 6 months or year. **events** | id | publish_date | +-------------------------+ + 1 | 1377612000 | + 2 | 1377612000 | + 3 | 1377612000 | **event_categories** (stores tags / categories) | id | name | +-----------------+ + 1 | sport | + 2 | charity | + 3 | other_tag | **events_categories** (linking table) | event_id | event_category_id | +-------------------------------+ + 1 | 1 | + 2 | 2 | + 3 | 1 | + 3 | 2 | sql returns count of tags (not taking account publish dates)select c.name tag_name, count(ec.event_id) occurrences event_categories c inner join events_categories ec on c.id = ec.event_category_id group c...

Jenkins email-ext plugin not sending mail -

Image
i have jenkins version 1.480.3 installed on machine , email-extention plugin 2.30.2. test mail "manage jenkins" section works fine. when add editable email notification jobs, not receiving it. also tried configuring "triggers" in editable email notification advanced section. didn work. console logs of build shows email has been triggered. can me on how debug this? at first have create template http://url-to-jenkins/emailexttemplates/ . in field "project recipient list" can add emails (comma separated). can insert global variables ( manage jenkins > configure system > global properties ) with: ${env, var="path"} the "advanced settings..." option provides trigger management, add "recipient list" , should emails jenkins.

c# - Need SlimDX to display images quickly -

Image
i need display images (about 60 fps). picturebox/panel doesn't job @ higher resolutions, turning slimdx, hope right move. as slimdx uses directx, , directx uses gpu, should able quickly. understanding, gpu works images lot faster cpu. i doing this: messagepump.run(form, () => { device.beginscene(); sprite.begin(slimdx.direct3d9.spriteflags.none); tx = slimdx.direct3d9.texture.fromstream(device, (new memorystream(reader.readbytes(reader.readint32()))), slimdx.direct3d9.usage.none, slimdx.direct3d9.pool.managed); sprite.draw(tx, color.transparent); sprite.end(); device.endscene(); device.present(); }); and initializing everything: var form = new renderform("test"); form.width = 1280; form.height = 720; slimdx.direct3d9.presentparameters presentparams = new slimdx.direct3d9.presentparameters { backbufferwidth = form.width, backbufferheight = form.height, devicewindowhandle = form.handle, presentflags = slimdx.direct3d9.pres...

Excel copy paste value different worksheets -

in sheet1 want copy values of columns a,c,d,g , paste bottom of sheet2 in columns a,b,c,d i've been having difficultly because columns of a,c,d,g contain formulas when use copy/destination method ends breaking macro. i can think of 3 methods, , use copy/paste use method rwtwm suggested. example code be sheets("sheet1").range("a1:a10").copy sheets("sheet2").range("a1").pastespecial paste:=xlpastevalues, _ operation:=xlnone, skipblanks:=false, transpose:=false copy values sheets("sheet2").range("a1:a10").value = _ sheets("sheet1").range("a1:a10").value copy data array, , use copy array other sheet dim mydata mydata = sheets("sheet1").range("a1:a10") sheets("sheet2").range("a1:a10") = mydata

cannot add a report to CMC (Central Management Console) Business Objects -

hi trying add report cmc getting following error. adding crystal report "customer details.rpt" failed. server kind rptappserver returned error result. failed copy report file report object. refreshing report object properties might have failed. failed read data report file d:\business objects\businessobjects enterprise 12.0\data\crystalreportsrasserver\temp\{e95ca1ef-e3a5-4590-93c0-0739194564ae}.rpt. reason: unable launch d:\business objects\businessobjects enterprise 12.0\win32_x86\reportadd program add report system. the person in charge of before joined has left , have no 1 ask. never used cmc before check below servers whether working or not: 1.adaptive processing server 2.crystal reports processing server 3.inputfile repository server 4.it can issue of rights. user using should have rights add report. if possible restart ccm , check servers started , try add report.

bash - Execute linux command from a variable -

here trying execute linux command variable in file.sh. test.sh out= "date"; echo $out; output: working perfectly. but when try execute command pgrep vpnc out= "pgrep vpnc"; echo $out; output test.sh: 1: test.sh: pgrep vpnc: not found my expectation when above file executed,it returns pid. i did tried eval. out= "pgrep vpnc"; $ eval $out; output: test.sh: 1: test.sh: pgrep vpnc: not found test.sh: 2: test.sh: $: not found can 1 me how run command , store value in variable. any highly appreciated. it shoud ` instead of " out=`pgrep process`; echo $out; display pid of process.

c - Receive UDP datagram and parse source port -

i'm trying send commands using udp. receiver supposed receive udp datagram , reply. however, reply sent sender's source port. know how parse the port (struct header , move pointer right position...), however, i'm looking function returns whole received frame including headers , not datagram/data. what recvfrom() function? allows grab data , fills sockaddr struct can find source port of sender.

android - What are the pros and cons of using a PropertyChangeListener vs. using LocalBroadcastReceivers? -

it seems property change listeners better sending broadcasts because can pass objects property listeners whereas when broadcast intent, can contain primitives or parcelable objects. however, i'm not sure how objects passed in property change listeners garbage collected, etc. provide insight best practices regarding use of both?

jekyll changing pre to p and adding th/td to tables -

i'm trying regenerate site jekyll it's changing pre p , adding th/td tables. here's example diff of pre p problem. - indicates line replaced + line. code in markdown hasn't changed. diff -<pre><code>-dhttps.proxyhost=proxy -dhttps.proxyport=3128 -</code></pre> +<p><code> +-dhttps.proxyhost=proxy -dhttps.proxyport=3128 +</code></p> markdown ``` runscriptonnode.factory .runscript → create submit → submit ``` here's example diff of th/td problem. + indicates new column wasn't generated before , isn't in markdown file. diff <table> <thead> <tr> + <th></th> <th> column 1 </th> <th> column 2 </th> </tr> </thead> <tbody> <tr> + <td></td> <td> value 1.1 </td> <td> value 1.2</td> </tr> <tr> + <td></td>...

github - phone gap download failing -

i tried downloading phonegap version 2.9.0 http://phonegap.com/install/ links https://github.com/phonegap/phonegap/archive/2.9.0.zip fail every single time. download few mb, , return network error. tried downloading using chrome , firefox fail. tried using download manager in firefox (orbit), still fail same message, network error. i can download files every other place in internet, files larger phonegap file. have tried download file past 3 days , failed. (about month ago) have no problem downloading phonegap library. can shed light me why happening?

r - Conditional selection of variables -

suppose i've following table: var iter_1 iter_2 iter_3 iter_4 var1 6 8 5 7 var2 5 1 7 8 var3 3 8 8 4 var4 8 7 2 5 var5 8 7 9 2 var6 8 7 3 6 var7 4 7 4 5 i want select combinations of columns each row such there combinations equal specific sum. e.g. in case, suppose want each var combination of iter 15. in case want select var1 , iter_2 & iter_4 . var2 , iter_3 & iter_4 . i wanted develop code such code can tell me column values select each var. can plz suggest method? 1 don't need write code, logic can use. thank you. this works if sum taken columns: data = data.frame(x = 1:3, y = 2:4, z = 5:7) sums = apply(data, 1, sum) target.val = 11 which(sums == target.val) otherwise looks exact cover problem. http://en.wikipedia.org/wiki/exact_cover or you use stoch...

c# - WPF Adding a custom property in a control -

ok have wpf application in have resource dictionary. in dictionary have new style button looks : <style x:key="menubuttonstyle" targettype="button"> <setter property="template"> <setter.value> <controltemplate targettype="{x:type button}"> <grid> <image x:name="imager" renderoptions.bitmapscalingmode="highquality" width="{templatebinding width}" height="{templatebinding height}" source="{binding relativesource={relativesource templatedparent}, path=tag}" verticalalignment="center" horizontalalignment="center" stretch="uniformtofill"/> </grid> <controltemplate.triggers> <trigger property="ismouseover" value="true"> <setter targetname="imag...

Reading c++ window in C# using handler -

i implementing plugin product called amibroker in c#. amibroker trading software has exposed few functions can used 3rd party vendors pass stock data solution. so, can create plugin in c# can recognized amibroker. in scenario getting handler of main window of amibroker [note : amibroker written in c++] in c# can retrieve handler of main window, using handle can read data of window e.g. child windows, panels showing stock lists or things visible user, , if so, how go doing this? you can, it's messy. literally worked on similar. pinvoke.net great stuff, i'll show examples of how i'd find controls. if amibroker has documentation control names or accessiblenames or allows find exact controls you're looking for, that'd killer. because if they're ambiguously named, you're gonna have helluva time finding ones you're looking for. basically, you'll want enumchildwindows on handle have, iterate through them , unique property allow find control...

c++ - What does this naming convention for headers refer to? -

i studying include guards in c++ , came across naming convention wikipedia : creatorsname_yyyymmdd_hhmmss i timestamp say #ifndef creatorsname_yyyymmdd_hhmmss #define creatorsname_yyyymmdd_hhmmss #endif then how compiler know headername.h ? it's convenient way store documentation person wrote module , when, guarantees uniquness of guard(through date), , provides additional information others referencing module. particularly if believe there problem it's corresponding implementation, have write to. otherwise, creator of module can forget add in documentation are. #ifndef chris_20140807_011555 #define chris_20140807_011555 struct foo { int member; }; #endif /* chris_20140807_011555 */ alternatively, this, doesn't provide additional information , adding documentation @ top easy forget.(though honest, should become habbit, , should not forgotten). but, still motivation such practices, despite option below being more used. /* * author: ch...

html - Jquery mobile button and textbox issue when focus on Android -

im running on android 4.2.2 , facing display issues when tap on button or typing in textbox. button move when tap ( see here ) text overflow when typing ( see here ) the content seems drop , leave transparent spaces. did not overwrite jquery mobile default css , not have other js running on them! pure html , css. for input <input type="text"> you can use css avoid overwrite input {-webkit-user-modify: read-write-plaintext-only;}

magento : show image before xml elements -

Image
i creating magento admin module. want show image(icon) before title of module. i want achieve i have tried following code no luck :( <title><![cdata[<img src="media/icon.png"/>]]>title</title> which outputs ----------edit ----- i tried rewrite adminhtml_block_page_menu no success public function getmenulevel($menu, $level = 0) { $html = '<ul ' . (!$level ? 'id="nav"' : '') . '>' . php_eol; foreach ($menu $index => $item) { $html .= '<li ' . (!empty($item['children']) ? 'onmouseover="element.addclassname(this,\'over\')" ' . 'onmouseout="element.removeclassname(this,\'over\')"' : '') . ' class="' . (!$level && !empty($item['active']) ? ' active' : '') . ' ' . (!empty($item[...

libtcod - C++: How To Use %i in Function? -

i have little question, possible use %i in function? here need do. have function callback: engine.gui->menu.additem(menu::agility,"agility (+1 defense)"); and want use in way: engine.gui->menu.additem(menu::agility,"agility (%i defense)",engine.level); how need implement that, or might not possible? tried best something, didn't managed it. :( reason want player avenges next level, engine.level counts gets ++, player level ups can more agility in different levels, , leveling can informed how many agility get. most boost::format ( http://www.boost.org/doc/libs/1_54_0/libs/format/ ) should want. won't exact syntax should close.

android - What am I doing wrong in this alarmClock method? -

when call method first time, sets alarm @ right time(current time +2 minutes). when call method second time, doesn't set alarm @ current time +2 minutes. sets alarm @ exact same time first time. doing wrong? code: private void setalarmnow() { vibrator v = (vibrator) getsystemservice(context.vibrator_service); // vibrate 500 milliseconds v.vibrate(1000); gregoriancalendar cal = new gregoriancalendar(); int minute = cal.get(calendar.minute)+2; int hour = cal.get(calendar.hour_of_day); if(minute>59){minute-=59; hour++;} if(hour>23){hour-=23;} intent intent = new intent(alarmclock.action_set_alarm); intent.putextra(alarmclock.extra_hour, hour); intent.putextra(alarmclock.extra_minutes, minute); intent.putextra(alarmclock.extra_skip_ui, true); pendingintent pendingintent = pendingintent.getactivity(this, 0, intent, 0); alarmmanager alarmmanager = (alarmmanager)getsystemservice(alarm_service); calen...