Posts

Showing posts from June, 2010

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...

Getting Array with MySQL -

Image
i have form fields name , email , , city . city autocomplete field calls 3 separate tables (cities, regions, countries). what i'd have these explode array city, region, , country defined values. query right autocomplete field: select c.city, concat(r.region, ', ', co.country) cities c, regions r, countries co c.regionid = r.regionid , c.countryid = co.countryid , c.city concat( incity, '%' ) order city; as can see, entered value ( incity ) compared city column in cities table. the reason need have city, region, , country defined because need enter ids in table called events . query insert cityid events table: insert events (events.cityid) values ((select cityid cities city = incity limit 1)); this doesn't work because there multiple cities same name. i able before php, i'm using mydbr reports , can use queries. things lot clearer when keep join conditions out of where clause: select concat(c.city, ', ...

c++ - Quicksort implementation error -

i trying implement quicksort. control seems never exiting quicksort function. appreciated. a few pointers: i using first element pivot. know better , efficient techniques exist choose pivot, not that. 2.the 'k' variable in partition function pivot element. as far know, problem partition function, since have tried debugging various times. also, not homework question. trying implement algorithm after having learnt myself. #include<iostream> using namespace std; void swap(int *a,int *b) { int temp; temp=*a; *a=*b; *b=temp; } void readarray( int a[],int n) { cout<<"enter elements array\n"; for(int i=0;i<n;i++) cin>>a[i]; } void printarray(int a[],int n) { cout<<"elements follows\n"; for(int i=0;i<n;i++) cout<<a[i]<<" "; cout<<endl; } int partition(int low,int high,int a[]) { int i,j,k; i=low; j=high; k=low; wh...

Vb.net 2005 - Input string was not in a correct format. - from Database -

so run query: select * shipments actionexec <> '' said query returns 2 results: result 1 has actionexec = "u" result 2 has actionexec = "c" when code runes below works fine first record. on second record error: input string not in correct format. the code below: orderno = rdrfps("order_no") order_type = rdrfps("order_type") shipmentnumber = rdrfps("trafficshipmentnumber") actionexec = rdrfps("actionexec") the error happens on actionexec = rdrfps("actionexec"), can't display output rdrfps in immediate window. again first record ran no errors, other fields in second record seem fine. any ideas?

php - Dynamic jQuery/MySQL dropdown menu -

i'm trying create php booking system, customers can go system, select date/time available slots in calendar-like interface. i need figure out way use jquery or other convention pull available time slots , put them drop-down menu user can select 1 , book it. time slot selected go mysql database being booked. clues information on doing this? ideas has done similar? i think need ajax request. ajax stands asynchronous javascript , xml, can convert response of page json well. there libraries in javascript ease use of technique, jquery. you pull data php page asynchronously (i.e., without blocking page) , display user. can find many exemples these among internet. the jquery documentation on ajax here: http://api.jquery.com/category/ajax/

cd - chdir() in C++ Getting Errors -

i trying run minimal terminal shell program through socket on unix machine. when use system("cd directory") doesn't work. did bit of research , came across chdir() , looked work. when tried it, though, gave me errors every single time. here code: if (chdir(argument) < 0) { send(sock, "[*] directory not exits!\n", strlen("[*] directory not exits!\n"), 0); } else { string argumentstring(argument); string entiremessage = "[*] new working directory: " + argumentstring; char entiremessagechar[64]; int i; (i = 0; entiremessage[i] != '\0'; i++) { entiremessagechar[i] = entiremessage[i]; } send(sock, &entiremessage, strlen(entiremessagechar), 0); } could please tell me why chdir() isn't changing directories? thanks. the value of errno after chdir() has exited needs checked determine why doesn't work. likely exit status values include: eaccess (no permission targ...

printing - IE8: Floats not working correctly in Print CSS -

does ie8 support floats in print css? can't seem mine work, have 2 column layout: #container { width: 95% !important; margin: 0 auto !important; } #main-view { width: 400px !important; float: left !important; } .confirmation-sidebar { width: 210px !important; margin: 1% 0 !important; float: left !important; } the container div 100% of window. there more enough room these elements float, widths shouldn't issue. can't wrap head around silly problem. they float fine in website, when print css applied not floating correctly. half of sidebar floats right, rest appears @ bottom of page. i have working fine in chrome (osx & win), ff (osx & win), safari, opera (osx)

ubuntu - Unable to launch an AVD Emulator: PANIC: Could not open: /home/baldur/.android/avd/AVD_for_Nexus_7_by_Google.ini -

Image
i have been looking around online tutorials on how started development of qt & opencv applications android devices, in particular nexus 7 running android 4.2.2. fooling around, able create emulator , run on android virtual device (under ubuntu linux 12.10). i trying take on more systematic , meticulous approach , better understand doing. uninstalled qt/necessitas sdk , reinstalled. having following problems: when trying launch android emulator using nexus 7 target device definitions’ (i.e., known device configuration), receive following type of error: starting emulator avd ‘avd_for_nexus_7_by_google; panic: not open: /home/baldur/.android/avd/avd_for_nexus_7_by_google.ini when trying launch android emulator using own custom definition of android virtual device, receive following error: emulator: error: avd’s configuration missing kernel file!! with device 'avd_for_nexus_7_by_google' created, create on ‘start’ in avd manager. nothing happens, qt creator ...

How to get Arduino UNO and WS2811 LEDs with FastSPI -

arduino uno , ws2811 fastspi does have code initialize leds? i literally started learning these last night. got adafruit working fine. don't know how set fastspi. i'm trying. have looked everywhere. if has code can them going, helpful!!! thanks!! nick

oracle - Sql*plus always returns exit code 0? -

whenever run sql script using sql*plus , check $?, 0 when script wasn't succesful. example #$ sqlplus user/password@instance @script.sql sql*plus: release 10.2.0.1.0 - production on wed aug 7 14:20:44 2013 copyright (c) 1982, 2005, oracle. rights reserved. connected to: oracle9i enterprise edition release 9.2.0.8.0 - 64bit production partitioning, olap , oracle data mining options jserver release 9.2.0.8.0 - production v$dataf-ile d, * error @ line 6: ora-00933: sql command not ended disconnected oracle9i enterprise edition release 9.2.0.8.0 - 64bit production partitioning, olap , oracle data mining options jserver release 9.2.0.8.0 - production $ echo $? 0 $ i return non-zero value when error occurs. how can achieve ? you have explicitly tell sqlplus that, in script. basically, there 2 statements can use: whenever sqlerror exit sql.sqlcode whenever oserror exit for example: whenever sqlerror exit sql.sqlcode begin select c...

parsing - Breaking a big file down into smaller files on special char in bash script -

i have huge file 800,000 words in separated | character. write bash script reads file, on every 1000 | dump content file , continues until have your post appears cut off, gather script should started. awk 'begin{ fs="|" y=1 outputfile="/tmp/outfile" }{ (i=1; i<=nf; i++) { tmpoutput=tmpoutput" "$i if (y == 1000) { y=1 print tmpoutput > outputfile tmpoutput="" } else { y++ } } }end{ print tmpoutput > outputfile }' inputfile

ajax - Apply jQuery functions to appended Infinite Scroll elements -

i'm having incredibly hard time finding answer this. there must answer buried somewhere, haven't found yet. in short, have elements being appended wordpress loop using infinite scroll. i'm not using isotope or masonry plugins loop, i'm being buried in wrong answers. outside of header script call infinite scroll, have slew of other functions being loaded (window).load(function(){... , understand, appended elements should fall scope. unfortunately they're not. my question is, shouldn't (window).load execute on every applicable element after new ajax elements have been appended? code available on request, i'm hoping simple syntax answer... the answer question is: no, $(window).load() doesn't fire when elements appended, when window object's onload event fires, i.e., @ completion of initial page load. the suggestion of event delegation founded, , of passing callback when instantiating infinite scroller, more so. assuming you...

vlc - DVB-S streaming from source to media server -

i streaming fta channels http://www.tbsdtv.com/products/tbs6985-dvb-s2-quad-tuner-pcie-card.html using mediaportal http://www.team-mediaportal.com/ and rtsp url mediaportal of channel timeshift and vlc can send stream mediaserver fms hls, hds, rtmp, rtsp i have 3 servers running erlyvideo (flussonic) take care of delivery. i want alternate solution beside have done methods work our including vlc iptvl dvbdream but quality better when stream thing file, fmle works live stream, can use directshow enabled devices http://www.viewcast.com/products/osprey-cards i doing on windows. if 1 have more methods or want share version please so

smtpclient - Send email from @my-domain.com using SendGrid in Azure -

i have web app working in azure. able send emails xxx@mydomain.com. possible using sendgrid? example, if use gmail's smtp, emails sent email address specified in networkcredentials user name, if in mailmessage use different email address. if use sendgrid instead, emails come user name created azure or able achieve this? you able send email whatever address want, specify correct address (e.g. xxx@mydomain.com ) when sending email.

android - Accessing Context -

i have broadcast receiver used receive broadcast pending intent using api requestlocationupdates . context receive in onreceive(..) method has ui elements , objects of calling activity in (which see using watch window). there way/method access these ui elements or objects contained within context? here's snippet: mainactivity { //initialize pending intent locationmanagerobject.requestlocationupdates(provider,0,0,pendingintent); //registering broadcast reciver } broadcastreciverclass { onreceive(context context, intent intent) { /*i want gain access objects of main activity. can see them in context if use watch window monitor context object. want find way able access them , use them*/ } } why want gain access objects on main activity? i'm asking because i'm wondering if there's better architectural decision made. activities intentionally modular. if you're looking update ui components in m...

php - CakePHP Threaded "Find" with Associated Models -

i using $this->find('threaded') in cakephp application , trying pull in associated model within find (habtm). have tried several methods, such 'joins', 'recursive' , 'contains' no luck. using cakephp 2.3.6 here (working) code. class eventscontroller extends appcontroller { public function promoters($id = null) { $options = array('conditions' => array('event.id' => $id)); $event = $this->event->find('first', $options); $this->set('event', $event); $this->loadmodel('eventspromoter'); $treelistconditions = array( 'conditions' => array( 'event_id' => $id ), ); $promotertree = $this->eventspromoter->find('threaded', $treelistconditions); $this->set('promoters', $promotertree); } } this results in following array output array ( [0]...

performance - How do SYSCALL/SYSRET instructions perform across x86 CPUs? -

syscall , sysret (and 32-bit-only intel counterparts sysenter , sysexit ) described “generally faster” way enter , exit supervisor mode in x86 processors call gates or software interrupts, exact figures underlying claim remain largely undocumented. in particular, of intel or amd optimization guides able find contain no mention of these instructions @ all. so: how many cycles (estimated) syscall , sysret take across recent intel 64 microarchitectures? measurable direct experimentation, there quite few of different cpus test. depending on order of magnitude of number, more detailed questions may relevant: do incur complete pipeline stall, or other kind of stall? how, if @ all, interact branch prediction (e.g. return stack buffer) , fetch logic? what latencies, data dependencies, serialization? &tc. assume 64-bit code on userspace side, no additional address-space switches (writes cr3) , matching syscall , sysret pairs if matters.

How to disable 'vi compatible' mode for Vim in Cygwin on Windows 8? -

i using cygwin 1.7.22 (32-bit) on windows 8 (64-bit). within cygwin, using vim 7.3.1152, default version. behavior seem bugs: when press i enter insert mode, not -- insert -- in bottom left. in fact, doesn't anything. behave correctly, though. when delete letters using backspace in insert mode, letters not disappear cursor move left. when use arrow keys in insert mode, enters letters a, b, c, , d, rather moving cursor. arrow keys work outside of insert mode. how make vim behave expect? create ~/.vimrc file following contents put vim in nocompatible mode (actually mere presence of file sufficient.) set nocompatible the behavior seeing how vi used behave. these not bugs. take @ :h nocompatible in vim compatible mode tries emulate vi closely possible. --insert-- not part of vi not shown in compatible mode. i believe vi did lazy redraw of screen , didn't update until exited normal mode. backspace usable works on stuff entered in current in...

xcode4.3 - No Mac Installer Certificate Found in Xcode 4.6 -

Image
i renewed provisioning profiles , mac device profile keep getting error when refreshing xcode organizer: any suggestions on how fix this? this error appears when os x developer certificate or os x distribution certificate has been submitted certificates, identifiers, , profiles tool approval, has yet approved team admin or team agent. if either of these roles on os x developer program account, login certificates, identifiers, , profiles tool > mac apps > certificates > pending , approve pending os x developer certificate. otherwise, contact team admin rights or team agent, , request certificate approved. once happens, click refresh button , should able continue through rest of update process. in interim, if need updated certificates or profiles ios account, login certificates, identifiers, , profiles tool , manually download files need.

asp.net - Elmah error logging, can I just log a message? -

i installed elmah ( https://code.google.com/p/elmah/ ) asp.net application. possible log message without creating exception first? catch(exception e) { exception ex = new exception("id = 1", e); errorsignal.fromcurrentcontext().raise(ex); } so possible do: errorsignal.fromcurrentcontext().log("hello testing elmah"); yes, can use errorsignal without throwing exception. errorsignal.fromcurrentcontext().raise(new notsupportedexception()); for custom message, can create custom exception. var customex = new exception("hello testing elmah", new notsupportedexception()); errorsignal.fromcurrentcontext().raise(customex);

jquery - Fetching values from url and displaying them -

hi have following url trying extract values. http://xxxxxx.com/confirm.aspx?vcode=123xyzd33eed&emailaddress=xxx@hotmail.com& i trying extract values of vcode , emailaddress display in appropriate fields. <input type="text" id="text1" name="validationcode" value="<? echo htmlspecialchars($_get["validationcode"]); ?>" placeholder="validationcode"/> <input type="text" id="emailaddress" name="emailaddress" value="<? echo htmlspecialchars($_get["emailaddress"]); ?>" placeholder="email address" /> the above code doesnt display values of vcode , emailaddress. ideas how fix it? thanks http://jsfiddle.net/vgewt/ function getparameterbyname(uel, name) { name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); var regex = new regexp("[\\?&]" + name + "=([^&#]*)...