Posts

Showing posts from June, 2010

sql - MySQL join update: Updating join table row twice -

to explain problem have outlined example situation below. orderrows id|ordernumber|productnumber|quantity|done 1 |10 |100 |1 |no* 2 |10 |101 |1 |no 3 |10 |100 |4 |no* *have same product number stock productnumber|quantity 100 |5 101 |1 update orderrows inner join stock on stock.productnumber=orderrows.productnumber set done='yes' ,stock. quantity = stock. quantity -orderrows. quantity ordernumber='100' , done='no' the result table stock below. productnumber|quantity 100 |4 101 |0 the order rows updated correctly. order row 3 stock not adapted. because order row 3 has same product number order row one. question is, how can fix this? you need use group by here. can't use directly. can achieve using sub-query this: update orderrows o join stock s on s.productnumber = o.productnumber join ( select pr...

html - Google Sites checkbox value in Google Spreadsheet -

on google sites on edit mode, have prepared checkbox using insert - html box and within html box following code.. <style> div{ width:100px; height:30px; } </style> <script> function putresult(e) { var ss = spreadsheetapp.openbyid("0akkxdnrvyzqzde1yu21frgj6akj6mmzisvhtn0jmnnc"); var calc = ss.getsheetbyname("customer"); var chvalue = e.parameter.bike calc.getrange("c3").setvalue("chvalue"); } </script> <div> edc: <input type="checkbox" id="bike" onclick="putresult(e)"> </div> now requirements: i want true/false based on checkbox populated in ss.calc (c3) sheet. the page should automatically refreshed each time checkbox clicked. i novice , in learning stage. please shout if things unclear. ps: i copied code within gas, that's e.parameter.bike comes from, don't know if that's right way... i have inserted chart in goo...

javascript - Displaying popup when data processing is going on -

i have created html file demo . table can contain more 2000 rows. on clicking on each row, related data displayed in separate pane. $('table tr').on('click', function () { $('#showcontent').html($(this).find('.content').html()); }); i want add popup display processing message, displayed on clicking on row before displaying row related data in separate pane. once data ready display, popup should closed automatically. thoughts! you can use jquery blockui plugin: $('table tr').on('click', function () { $('#showcontent').html($(this).find('.content').html()); $.ajax({ url: url ... beforesend: function(){$.blockui();} complete: function(){$.unblockui();} }); });

core data - How to insert NSManagedObject in other NSManagedObjectContext? -

i getting data server , converts them array of nsmanagedobject objects. array used display table. how insert first element array peoples in persistent store? - (void)viewdidload { [self loaddata]; [self insertfirstpeople]; } - (nsmanagedobjectcontext *)managedobjectcontext { if(!_managedobjectcontext) _managedobjectcontext = [nsmanagedobjectcontext mr_context]; return _managedobjectcontext; } - (void)loaddata { ... network request ... peoples = [nsmutablearray array]; (nsdictionary *item in items) { people *people = [podcast mr_createincontext:self.managedobjectcontext]; people.name = [item valueforkeypath:@"im:name.label"]; [peoples addobject:people]; } } -(void)insertfirstpeople { people *people = peoples[0]; nsmanagedobjectcontext *moc = [nsmanagedobjectcontext mr_defaultcontext]; [moc insertobject:people] [moc mr_savetopersistentstoreandwait]; } error: an nsmanagedob...

sip - OpenSIP not sending cancel to UAS in case it received 200 from UAC. Verified in 1.7.2 and 1.8 -

sip call graph diagram when bug comes: a = uac b = opensips c = uas a ---------- invite ---------> b <-------- status 100 trying ------- b b ---------- invite ---------> c b <-------- status 100 trying --------- c b <-------- status 200 ok --------------- c <-------- status 200 ok ------------- b ---------- cancel ------------------> b <-------- 200 canceling ----------- b ---------- ack ---------------> b b ---------- ack ---------------> b b ---------- ack ---------------> b b ---------- ack ---------------> b b ---------- ack ---------------> b b ---------- ack ---------------> b b ---------- ack ---------------> b b ---------- ack ---------------> b b ---------- ack ---------------> b b ---------- ack ---------------> b b ---------- ack ---------------> b b ---------- ack ---------------> b b <-------- status 200 ok --------- c <-------- status 200 ok --------- b b <-------- status 200 ok --------- c ...

How to get the MAC-address from MSSQL server 2000 -

i'm working on project (among other things) need find mac address remote computer. problem i'm restriced accessing computer throught sql queries. (so can't use wmi) the remote computer running windows server 2000, , ms sql server 2000. i know ip of remote computer , able log in admin account. how can mac address(preferably of them) remote computer? thankful answers. according this , doesn't seem can. if using sql server 2005+, i'd think code in sqlclr without effort.

c - How can I wait until specified "xterm" finished? -

in c-shell file, did like: xterm -e "source xxxx0" & xterm -e "source xxxx1" & wait code.... it works fine code after "wait" executed after 2 xterm finished. but gives problem. if have ps open, txt file opened geditn, or have eclipse open, hung there since "wait" waiting jobs finished. so how can let "wait" wait 2 xterm jobs. or in word, want 2 "xterm" run concurrently. , after both done, code can continued. how shall that? thank much tell wait process ids should wait for: xterm ... & pid1=$! xterm ... & pid2=$! wait $pid1 $pid2 that's assuming use shell wait supports multiple arguments (bash,zsh, ...). if use sh portability, have 2 waits: wait $pid1 wait $pid2 this wait untill both finished. if second finishes before first, wait return.

Dandelion Datatable + Thymeleaf + Pagination Issue -

i trying use dandelion datatable paging thymeleaf. following link article. using 0.2.14 version. when try use dt:paginationtype="four_button" throws following exception. it gives me following error 2013-08-07 16:26:59,655 error [org.thymeleaf.templateengine] - <[thymeleaf][http-bio-8080-exec-9] exception processing template "department/departmentlist": not parse expression: "four_button" please try wrapping "four_button" single quotes follows: dt:paginationtype="'four_button'" note in upcoming v0.9.0, single quotes won't necessary longer.

python - Naoqi eventhandling 10 Secounds delay -

i working nao-robot on windows-xp machine , python 2.7. i want detect markers in speech. whole thing worked, unfortunately have face 10 secounds delay , events aren't detected (the callback function isnt invoked). first, main-function: from naoqi import alproxy, albroker speecheventmodule import speecheventmodule mystring = "put \\mrk=1\\ there." nao_ip = "192.168.0.105" nao_port = 9559 memory = alproxy("almemory", nao_ip, nao_port) tts = alproxy("altexttospeech", nao_ip, nao_port) tts.enablenotifications() mybroker = albroker("mybroker", "0.0.0.0", # listen 0, # find free port , use nao_ip, # parent broker ip nao_port) # parent broker port global speecheventlistener speecheventlistener = speecheventmodule("speecheventlistener", memory) memory.subscribetoevent("altexttospeech/currentbookmark", "speecheventlistener", "onbookmarkdetected...

asp.net mvc - Adding New Items With jQuery And No Ajax -

i wanting enable user add items view model jquery , no ajax. the reason not want use ajax because without ajax user must click save, , creates less chance of them accidentally changing something. i have working, seems bit of hack. '<tr>'+ '<td class="detail-priority">' + '<input id="complianceseveritylevel_4__complianceseveritylevelid" type="hidden" value="-1" name="complianceseveritylevel[4].complianceseveritylevelid" data-val-required="the complianceseveritylevelid field required." data-val-number="the field complianceseveritylevelid must number." data-val="true">' + '<input id="complianceseveritylevel_4__priority" class="valid" type="text" value="0" name="complianceseveritylevel[4].priority" data-val-required="the priority field required." data-val-number="the field priority must nu...

Rails helper_method with argument -

when allowing controller methods helper in views, how pass argument? in example_controller.rb have class examplecontroller < applicationcontroller helper_method :group_exists? private def group_exists?(gid): .. code check if group exists end end in view (i use slim), want pass argument - if group_exists?(group.gid) | exists - else | not exist however throws error saying wrong number of arguments (2 0..1) buddy if want helper method, there place defined it. write same method in examplehelper class created you. the reason if want debug helper, know easily. don't create helpers in controller until use case specially call it.

php - How to change the number in TCPDF for arabic & persian numbers -

how change number in tcpdf arabic & persian numbers, need change encoding or char codes? i need replace 1 ۱ , arabic code in unicode. i find code,but not know how use it function formatpagenumber($num) { $strnum = strval($num); $strnum = preg_replace_callback("/[0-9]/", create_function('$matches', ' $numarr = array("۰", "۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", "۹"); return $numarr[intval($matches[0])];'), $strnum); return $strnum; } try this: require_once('tcpdf/config/lang/eng.php'); require_once('tcpdf/tcpdf.php'); function formatpagenumber($num) { $strnum = strval($num); $strnum = preg_replace_callback("/[0-9]/", create_function('$matches', ' $numarr = array("۰", "۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", ...

ruby - Rails - data displayed only after controller is re-saved -

i experiencing weird behavior of rails application. i have downloaded repo github, , initiated development database. when create event (thats purpose of app), @ right after press 'create' , browser goes to, 'events/1'. however if navigate main page, of events supposed listed, event not displayed, until re-save controller file (i don't have make changes in it). page reloads not help. i should mention on previous machine worked fine. here part of controller: class eventscontroller < applicationcontroller def index @events_future = event.future_events end the scope scope :future_events, order('start_date asc').where('start_date >= ?', date.today) again, on same mac before had reformatted code worked perfect, don't think coding (well, hope). be? thanks. thank lawitschka above defining scope won't work in production mode, since model cached, scope evaluated on load time , date.today cached, well, unti...

Generate xsd from xml, validate xml, generate class/objects from xml/xsd -

please assume know nothing anything. i new windows phone development. i have xml follows - not file - xdocument generated string came server <user> <number>00000</number> <id>1234</id> <textkey>a1a1a1a1a1a1a1a1a</textkey> <agent>windowsphone</agent> </user> first of all, need generate xsd xml need validate xml against xsd on windows phone platform if xml valid, need generate objects/class it(???) i've read xsd.exe xml schema definition tool how go on using it?? other way above in visual studio 2012???

MySQL numbering dates per id -

my question simple answer (sorry that) cannot find solution. i have table this: id / date 1 / 2013-5-5 13:44:12 1 / 2013-5-5 15:34:19 1 / 2013-6-5 05:14:07 2 / 2012-3-4 06:33:33 2 / 2013-5-5 12:23:10 3 / 2012-5-7 11:43:17 what want this: id / date / position 1 / 2013-5-5 13:44:12 / 1 1 / 2013-5-5 15:34:19 / 2 1 / 2013-6-5 05:14:07 / 3 2 / 2012-3-4 06:33:33 / 1 2 / 2013-5-5 12:23:10 / 2 3 / 2012-5-7 11:43:17 / 1 so earliest date per id should position 1, second earliest 2 , on. how can create position column in mysql? thank much! unfortunately, mysql doesn't have windowing functions assign row number data. there few ways can result, return position number using subquery similar following: select t.id, t.date, (select count(*) yourtable r r.id = t.id , r.date <= t.date) position yourtable t order t.id, t.date; see sql fiddle demo . you implement user defined variables: select id, date, position ( ...

javascript - Page views and Visits using conversion variable in Sitecatalyst -

with reference question page views , visits using traffic variables in sitecatalyst have changed userid traffic variable conversion variable (evar). i have navigated custom conversion->custom conversion 1-10-> selected userid , showed me user's , visits. userid visits user1 3 user2 4 user3 20 i dragged "page views" "add metrics" button , can see below report userid visits page views user1 3 20 user2 4 40 user3 2 10 if click on break down icon of user1 , have following report,i have noticed visit value changes each page,my understanding should same pages ie 3 int case.please let me know reason. visits page views user1: 3 20 home 3 4 login 3 4 2 4 details 1 4 registration 1 4 thanks in advance in breakdown report, seeing pages contri...

paypal - Setting a Return URL for returning after success payment -

i set paypal button wizard, , set return url www.mydomain.com/payment.php , enabeled return url . <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top" class="paypalbtn"> <input type="hidden" name="cmd" value="_s-xclick"> <input type="hidden" name="hosted_button_id" value="m4vfseteytreq4"> <img alt="" border="0" src="https://www.paypalobjects.com/en_us/i/scr/pixel.gif" width="1" height="1"> </form> now buy item, pay credit card...card pass in end paypal page invoice link site. how can make sure after success payment user redirected return url? when buyer pays credit card, there not way automatically redirect buyer site. have click return link. modify text of link like, must click link complete order on site. the variable text " cbt ". sets text ...

python - cancatenate two strings in a dict -

views.py def method(request): member in list: personname = {'id':member.id, 'name':member.firstname + member.lastname } return render(request,'some.html',{'name':personname}) in above views.py,i used concatenation operator concatenate firstname , lastname.concatenation happening,i need make space between firstname , lastname.i used " " giving syntax error. you can use + concatenating firstname, space , lastname strings: personname = {'id':member.id, 'name': member.firstname + " " + member.lastname} or use string formatting: personname = {'id':member.id, 'name': '%s %s' % (member.firstname, member.lastname)} or format : personname = {'id':member.id, 'name': '{0} {1}'.format(member.firstname, member.lastname)}

ruby - How to get my Facebook friends with OmniAuth in Rails? -

i have simple rails app can log in using facebook through omniauth. is there way obtain facebook friends using omniauth facebook gem? need use other gems that? (if so, ones best ones - updated/etc). you can use koala gem works facebook graph api. @graph = koala::facebook::api.new(oauth_access_token) friends = @graph.get_connections("me", "friends")

java - Parsing the XML file has got error -

does find problem why no xml file not parsing following code.... xml format can seen here . i tried test line line using log.i("your string goes here", xml); function unable see execution of code when loop starts.... i have used splash activity in asynctask() function executed in background , listactivity used display domparser activity output.... me out problem @ all.... thank in advance package com.wfwf.everestnewsapp.parser; import java.net.malformedurlexception; import java.net.url; import javax.xml.parsers.documentbuilder; import javax.xml.parsers.documentbuilderfactory; import org.jsoup.jsoup; import org.jsoup.select.elements; import org.w3c.dom.document; import org.w3c.dom.node; import org.w3c.dom.nodelist; import org.xml.sax.inputsource; import android.widget.toast; public class domparser { private rssfeed _feed = new rssfeed(); public rssfeed parsexml(string xml) { url url = null; try { url = new url(xml); ...

Understanding a boolean expression -

i trying set rule using boolean expression when x within range (6.0 -8.0) yellow, below green , above red. appreciated you mean this? if(x<6) { color=green; } else { if(x<=8){ color=yellow; }else{ color=red; } }

csv - Python reading unicode folder and file names -

i new python. trying input 1 path , use os.walk() search files, , return files' names. want use os.path.getsize() file size, , finally, write them csv file. however, if file name not in english, in chinese, german, french, etc, python cannot recognize , not return size of file. i'd use os.path.getsize(path) (referring example below), not recognize file's name. how can let python recognize file's name , return size of these kind of files? for example: file's name is: "Показатели естественного и миграционного прироста до 2030г.doc" . path="c:\xxxx\xxx\xxxx\Показатели естественного и миграционного прироста до 2030г.doc" if pass unicode input os.walk() file-names unicode well. the following should work you your_base_path = u"c:\\directory" # note unicode root, dirs, files in os.walk(your_base_path): f in files: print os.stat(os.path.join(root, f)).st_size

modulo of a number - python vs c# -

lets take basic arithmetic operation - modulo i different outputs depending on different languages. python >>> -1 % 12 11 c# var res = -1 % 12; output: res = -1 why seeing such behaviour? ideally i'd output 11 in both cases. also know if can achieve in c#? the premise of question incorrect. % operator in c# not modulus operator, remainder operator, while in python is modulus operator. as eric lippert describes , modulus , remainder same positive numbers, handle negative numbers differently. despite both c# , python having % operator, doesn't mean both represent modulus. it's worth noting other languages, such c++ , java use remainder % operator, not modulus, contributed why c# choose use remainder well. since there isn't lot of consistency in meant % operator, suggest looking in language docs whenever working new language.

version control - Continuous Integration: Centralize Software Assets -

in order achieve continuous integration, in book continuous integration: improving software quality , reducing risks, 1 can read 1 of principles behind centralizing software assets on version control system, may these compiled artifacts, libraries, third party components , on. i can understand such statement in case 1 using scm , nothing else. if 1 using tool such nexus? nexus or alike makes such statement obsolete when referring built artifacts? the short answer is: "yes" the longer answer using nexus centralize software assets legitimate, versioned store. more appropriate technologies need compile binaries, scripted technologies favour creating tarballs or better still rpm packages. deployment process incorporates scm system marries software.... more worryingly every person needs install software must have access (credentials) tool.

Signalr: getting hubcontext with unity di -

i started using unity inject stuff 1 of hubs. works, but, when resolve hubcontext somewhere outside hub seems i'm getting wrong one. because when try send messages it, connected clients don't them. dependencyresolver: public class signalrunitydependencyresolver : defaultdependencyresolver, idependencyresolver { private iunitycontainer _container; public signalrunitydependencyresolver(iunitycontainer container) { _container = container; } public override object getservice(type servicetype) { if (_container.isregistered(servicetype)) return _container.resolve(servicetype); else return base.getservice(servicetype); } public override ienumerable<object> getservices(type servicetype) { if (_container.isregistered(servicetype)) return _container.resolveall(servicetype); else return base.getservices(servicetype); } } what r...

android - multiple records in one NDEF message on one NFC tag -

how many records can ndef message encapsulate? (for different nfc tag types - 1,2,3,4?) and in general ...do understand right? : i can have 1 nfc message, array(of capacity?) of nfc records. each nfc record has own mime-type, facilitates application recognition <data android:mimetype="specific application mime-type goes here"/> so can launch different applications if use 1 tag. the number of records in ndef message limited memory of tag . there no difference in various tag types . when tap tag phone, whole ndef message delivered 1 app. else need program after received message.

html - jQuery submit() not working in IE when an <input type="file"> is in the form -

i want use submit input trigger click in file input , submit form itself. clicking in submit button open file picker window, , after closes form submitted. i'm using code: <?php var_dump($_files); echo "<br>".time(); ?> <!doctype html> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script> $(document).ready(function() { $("#uploadform").submit(function() { $("#file", this).click(); return false; }); $("#uploadform #file").change(function() { $(this).closest("#uploadform").unbind('submit').submit(); }); }); </script> </head> <body> <form id="uploadform" name="uploadform" method="post" enctype="multipart/form-data"> <input type="file" name="file" id=...

dependency injection - Best practices for Eclipse 4 DI -

i'd know best practices eclipse 4 dependency injection. after reading subject on internet, came following strategy. requirements share data model of application (e.g. company, employee, customer, ...) framework objects (view parts, handlers, listeners, ...) can access little coupling possible. proposed strategy i've used lifecycleuri plugin property register handler triggered @ application startup. such handler creates "empty" top-level data model container object , place eclipsecontext. discarded when application stops. all eclipse framework classes (view parts, handlers) use classic di such data model object injected. button listeners created class constructor can't have data model object injected in them. thought created contextinjectionfactory.make() have injection performed. couple class creates listener cif, great advantage injection works out of box. this best solution i've found yet leverage e4 di little coupling possible. weak spot i...

jenkins - cloudbees folder plugin jobs in copied folders must be saved before they can be run -

i'm having @ cloudbees jenkins folder plugin. looks serve purposes in allowing me copy groups of jobs but... when copy folder containing jobs have click through configure / save each job in new folder before build option available. expected behavior? thanks glenn yes, when job copied marked temporarily unbuildable until save configuration. essential in case origin job configured build trigger (like building on schedule): not want copied job start running until had chance check configuration , perhaps make changes.

Does workflow status change gets triggered when creating new objects in Plone? -

i have content rule, sends emails whenever object published (any of states internally_published, visible, externally_published, ...). upon request of client, have changed local workflow policy 1 initial state 1 published; creating new object not send desired email. when manually change status, emails sent. does plone triggers "status change" event when new object created? bug? should thinking differently? details: i'm using plone 4.0.5. you must use different rule this: try sending email when object added folder. for more information, take @ using content rules tutorial.

css - How can I add an "onclick" in an input tag? -

i trying insert onclick="countcheckboxes()" within input tag. there way in css? tried following, didn't work: input[type=checkbox]:after { content: "onclick="countcheckboxes()"";} so output this <input type="checkbox" onclick="countcheckboxes()"> this wordpress form. maybe add in functions.php template enable me this? you cannot generate javascript in css. please refer more information: using javascript in css i guessing want keep markup clean of js? if so, best thing abstract js markup in separate js file. there can navigate dom , append functions whichever way require. can either vanilla javascript or js framework(like jquery) simplifes process lot. i'm happy set demo if wish learn how.

video - Converting Real Media with ffmpeg -

i have number of old crusty real media files need convert , hoping write script batch process them. i'm able real media -> avi conversion ffmpegx, when try replicate conversion ffmpeg, errors out like: [avi @ 0x10084fa00] large number of skipped frames 117425 > 60000 it may have funky format of these real media files: duration: 01:28:23.42, start: 0.000000, bitrate: 448 kb/s stream #0:0: data: none, 32 kb/s stream #0:1: data: none, 192 kb/s stream #0:2: audio: sipr (sipr / 0x72706973), 8000 hz, mono, flt, 6 kb/s stream #0:3: video: rv20 (rv20 / 0x30325652), yuv420p, 320x240, 13 kb/s, 15 fps, 15 tbr, 1k tbn, 1k tbc stream #0:4: video: rv20 (rv20 / 0x30325652), yuv420p, 320x240, 8 kb/s, 15 fps, 15 tbr, 1k tbn, 1k tbc stream #0:5: video: rv20 (rv20 / 0x30325652), yuv420p, 320x240, 5 kb/s, 15 fps, 15 tbr, 1k tbn, 1k tbc stream #0:6: video: rv20 (rv20 / 0x30325652), yuv420p, 320x240, 27 kb/s, 15 fps, 15 tbr, 1k tbn, 1k tbc stream #0:7: aud...

html5 - html footer tag in wordpress showing a tag href separately in [ ] & sidebar is not coming -

here http://smallbusinessauthority.com.au/blog/ , href shown in "[ ]" author meta next post date. code using footer html tag , if removed footer tag,, working fine. <footer class="entry-meta"> <span class="by-author">by <span class="author vcard"><a class="url fn n" href="http://smallbusinessauthority.com.au/author/admin/" title="view posts admin" rel="author">admin</a></span></span> on <a href="http://smallbusinessauthority.com.au/objectives-management-the-key-to-success-for-the-largest-to-the-smallest-businesses-and-what-the-solution-providers-dont-tell-you/" title="8:59 am" rel="bookmark"><time class="entry-date" datetime="2013-07-29t08:59:20+00:00">july 29, 2013</time></a>. </footer> even sidebar not shown on blog page. every setting...

reducing an Array of Float using scala.math.max -

i confused following behavior - why reducing array of int work using math.max, array of float requires wrapped function? have memories not issue in 2.9, i'm not that. $ scala -version scala code runner version 2.10.2 -- copyright 2002-2013, lamp/epfl $ scala scala> import scala.math._ scala> array(1, 2, 4).reduce(max) res47: int = 4 scala> array(1f, 3f, 4f).reduce(max) <console>:12: error: type mismatch; found : (int, int) => int required: (anyval, anyval) => anyval array(1f, 3f, 4f).reduce(max) ^ scala> def fmax(a: float, b: float) = max(a, b) fmax: (a: float, b: float)float scala> array(1f, 3f, 4f).reduce(fmax) res45: float = 4.0 update : work scala> array(1f, 2f, 3f).reduce{(x,y) => math.max(x,y)} res2: float = 3.0 so reduce(math.max) cannot shorthanded? the first thing note math.max overloaded, , if compiler has no hint expected argument types, picks 1 of overloads (i...

HTTP Content length less than File byte-size, did it fully download? -

trying determine if user downloaded executable file website. examined pcap , see content-length field = 784,536 server->user 430,380 bytes. tells me user did not download file. downloaded file myself , see 766 kb. possible content-length value based on http header not equal file size of exe file if downloaded (the local file size)? correct? packet capture data (i can't post screenshots) get /chromaslite211setup.exe http/1.1 host: www.technelysium.com.au user-agent: mozilla/5.0 (windows nt 5.1; rv:17.0) firefox/17.0 accept: text/html, application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 accept-language: en-us accept-enconding: gzip, deflate connection: keep-alive referrer: http://technelysium.com.au/ http/1.1 200 ok date: thu, 01 aug 2013 17:28:17 gmt server: apache last-modified: mon, 15 apr 2013 08:29:57 gmt accept-ranges: bytes content-length: 784536 keep-alive: timeout=5, max=100 connection: keep-alive content-type: application/x-msdownload mzp..................

android - best way of setting up a phonegap multiplatform project repository -

what best way of setting multi-platform (ios/android) phonegap repository (git or svn). how handle mutually exclusive file/folders inside the www folder javascript plugin files. you should read link here: http://docs.phonegap.com/en/edge/guide_cli_index.md.html#the%20command-line%20interface it has information on installing command line tool , doing talking about. you'll need node.js installed(actually you'll need npm comes node), if don't have can find installation instructions on node.js site , it's cool project well. after can create project command line, add platforms, plugins, , creates merges folder can use add in platform specific javascript or css.

javascript - how to make a vertical accordion menu convert from hover to click when resizing at a certain window? -

i want make menu when @ window size, such detecting touch screen devices, menu convert hover click open vertical drop down accordion menu. familiar media queries , responsive/adaptive designs. want browser , touch screen devices convert hover click when detects screen size, , when so, want go hover without having refresh website when resizing bigger window in order go hover. when click option going on detected screen size resize window, stays on click. thanks of these guys got me started converting vertical accordion menu when detecting window size: how convert horizontal menu vertical submenus vertical accordion menu submenus? here fiddle html: <!--menu under header begins--> <table id="menubar" width="0" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td> <div id="navmenu"> <!--#navmenu div menu contents start here--> <ul...

loops - C# Count Vowels -

i learning program c# , trying count vowels. getting program loop through sentence, instead of returning vowel count, returning length of string. appreciated. static void main() { int total = 0; console.writeline("enter sentence"); string sentence = console.readline().tolower(); (int = 0; < sentence.length; i++) { if (sentence.contains("a") || sentence.contains("e") || sentence.contains("i") || sentence.contains("o") || sentence.contains("u")) { total++; } } console.writeline("your total number of vowels is: {0}", total); console.readline(); } right now, you're checking whether sentence whole contains vowels, once each character. need instead check individual characters. (int = 0; < sentence.length; i++) { if (sentence[i] == 'a' || sent...

c++ - Making a string of 0's and 1's into an int, into a character from that ascii val -

here's procedure: static void undo_bitstring(std::string& str) { (unsigned = 0; < str.length(); += charbits) { int ascii_val = 0; (unsigned j = 0; j < charbits; j++) { if (str[i+j] == '1') ascii_val += (int)exp2(charbits-j-1); } str[i/charbits] = (char)ascii_val; } str.erase(str.begin()+str.size()/charbits,str.end()); } where, know, charbits was defined static const size_t charbits = 8 * sizeof(char); what supposed happen is, example, std::string str = "01010111"; undo_bitsring(str); should change str "w" since 0x2^7 + 1x2^6 + 0x2^5 + 1x2^4 + 0x2^3 + 1x2^2 + 1x2^1 + 1x2^0 = 64 + 16 + 4 + 2 + 1 = 87 and (int)'w' = 87 and of course procedure supposed work string of 0's , 1's length multiple of charbits. instance, std::string str = "010101110101011101010111"; undo_bitsring(str); should change str "www" on tests ...

css3 - bootstrap-responsive - how to redefine / overwrite a css class -

background info i'm trying hand @ first responsive app using bootstrap. far, good. i'm trying target google nexus 7 , default, seems classified "phone" based on following css see in bootstrap-responsive.css: @media (max-width: 767px) { .hidden-desktop { display: inherit !important; } .visible-desktop { display: none !important; } .visible-phone { display: inherit !important; } .hidden-phone { display: none !important; } } in 1 of pages, have following logic: <div class="row-fluid visible-desktop"> html here desktop version display big buttons </div> <div class="row-fluid visible-tablet"> html here ipads display medium buttons </div> <div class="row-fluid visible-phone"> display divs, not buttons. </div> problem currently, nexus 7 in portrait ...

java - How can I flick an object so it moves indefinitely with velocity depending on force of flick? -

i have circle on graph, , want able flick , have move indefinitely , wrap around screen goes. circle, or ball how coded it, view. right have circle can touch , drage, via code: //creates view ball framelayout flview = (framelayout) v; flview.setpaddingrelative(0, padding, 0, 0); //creates new ball ball = new ball(findviewbyid(r.id.main_view).getcontext(), x, y, 10,padding); switch(event.getaction()){ case motionevent.action_move: flview.removeallviews(); flview.addview(ball); break; case motionevent.action_down: flview.removeallviews(); flview.addview(ball); break; } here's i'd do. i'd measure startposition (x,y) of ball, , time user first taps screen, ball, whatever. user moves finger across screen i...

bash - shell: select unique row of flat file -

i have flat file looks cat file id1, value1_1 id1, value1_2 id1, value1_3 id2, value2_1 id2, value2_1 id3, value3_1 id3... as can see data sample, each id, there several values id , whatever value - same or not. me, don't care value picking up. value works me. so want 1 value each id. don't care one, if have choose, row has longest length. id1, value1_2 id2, value2_1 id3, value3_1 it might done in python there easy way in shell itself, open use sed or awk please don't write whole paragraph of awk code, please.. it might like: # pseudo code # sort -k 1 file | uniq (max(length) id) thanks lot !! this find first line each id: awk -f, '!seen[$1]++' file explained: awk associative arrays not have pre-declared, first time id encountered, seen[$1] have value 0 (for numeric context). seen[$1]++ post-increments associative array element, expression evaluates 0 first time id seen, , evaluates positive integer other time. awk treats ...

ruby on rails - How do I take a string of SCSS and have it output CSS? -

i have templates in application have own style sheets. i'd let users (and myself) take advantage of scss features. however, haven't been able find out how send sass gem string of scss, , have return regular css. (i haven't been able find on google, nor easy find in documentation.) so how do it? just do: # scss string str = %q{ $text-color: #555555; $unfocused-background-color: #f1f0ec; body { background: $unfocused-background-color; color: $text-color; } } se = sass::engine.new(str, :syntax => :scss) se.render # => "body {\n background: #f1f0ec;\n color: #555555; }\n" see sass reference docs here: http://sass-lang.com/docs/yardoc/file.sass_reference.html .

selenium isVisible method not working as expected -

Image
i opening page http://www.ebay.com/itm/apple-iphone-5-16gb-white-silver-factory-unlocked-/151097083750?pt=cell_phones&hash=item232e168766 and checking see if blue ribbon visible mentioned in image here test <tr> <td>open</td> <td>/itm/apple-iphone-5-16gb-white-silver-factory-unlocked-/151097083750?pt=cell_phones&amp;hash=item232e168766</td> <td></td> </tr> <tr> <td>isvisible</td> <td>//div[@class='vi-notify-msg']</td> <td></td> </tr> and expecting fail surprisingly passes every time...what missing here? edit: i expecting test fail because ribbon takes time appear after page loaded , command isvisible executed before ribbon visible..so should fail right? if @ html, element there page loads. it's styled fade in after page finishes loading, html perspective, it's "visible" entire time page loading: as page lo...

Android Image Dialog/Popup same size as image and no border -

Image
at moment working on file browser. works fine 1 exception: if user clicks on image (jpg, png, bmp, ..), want image displayed in dialog or in popup has same size image - there no borders @ all. image files located on sdcard. here have far: bitmapdrawable bitmap = new bitmapdrawable(context.getresources(), target_path); alertdialog.builder imagedialog = new alertdialog.builder(context); layoutinflater inflater = (layoutinflater) context.getsystemservice(context.layout_inflater_service); view layout = inflater.inflate(r.layout.thumbnail, null); imageview image = (imageview) layout.findviewbyid(r.id.thumbnail_imageview); image.setimagedrawable(bitmap); imagedialog.setview(layout); imagedialog.create(); imagedialog.show(); the xml file: <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_par...