Posts

exception - Where does Java language define if a Throwable is checked or not? -

both exception , runtimeexception inherits throwable , not implement interface tell whether checkd or not. where specified exception checked , runtimeexception unchecked? hardwired in language or jvm? it's defined in java language specification section 11.1.1 . throwable , subclasses are, collectively, exception classes. exception superclass of exceptions ordinary programs may wish recover. error superclass of exceptions ordinary programs not ordinarily expected recover. error , subclasses are, collectively, error classes . [...] the class runtimeexception direct subclass of exception . runtimeexception superclass of exceptions may thrown many reasons during expression evaluation, recovery may still possible. runtimeexception , subclasses are, collectively, run-time exception classes . the unchecked exception classes run-time exception classes , error classes. the checked exception classes exception classes ...

ajax - onclick calling object working ONLY in Firefox -

as stated in title, can onclick calling object in firefox: not in chrome, not in ie, not in safari. i pretty new ajax , javascript in general, built code around answers guys gave here . i have html page number of 'products': each 1 of them, have form hidden fields contain information product. every form has 2 (submit) buttons: 1 'add' product shopping cart, other take 'off' of it. want identify button gets clicked in order identify product refers , add or cancel cart list. here html code page: <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> test </title> <meta charset="utf-8"> <script src="form_submit.js" type="text/javascript"> </script> </head> <body> <form id="ajax_1" name="ajax_form" method="post" action="test.php"> <fieldset> ...

c# - How can I specify an unordered Execution Block using the TPL Dataflow Library? -

i want set transformblock processes item in parallel. thus, i'm setting executiondataflowblockoptions.maxdegreeofparallelism > 1. don't care order of messages documentation says: when specify maximum degree of parallelism larger 1, multiple messages processed simultaneously, , therefore, messages might not processed in order in received. order in messages output block will, however, correctly ordered. does "correctly ordered" mean if there 1 message in queue needs long processing time, further messages not output until 1 message processed? and if so, how can specify execution block (for example transformblock ) not care ordering? or have specify @ consumption end don't care ordering? there no such block in library, can create 1 combining actionblock , bufferblock . like: public static ipropagatorblock<tinput, toutput> createunorderedtransformblock<tinput, toutput>( func<tinput, toutput> func, executiondataf...

How to rename all files and folder containing underscore to hyphen in Linux -

i want rename files , folder containing underscore in name , replace underscore hyphen. currently using following code, rename '_' '-' */*/* it working showing me "argument list long" you can try this: $ tree foo foo ├── dir_1 │   └── foo_file_2 └── file_1 1 directory, 2 files $ ft in d f; find foo -type $ft -execdir sh -c 'mv "$0" "${0//_/-}"' {} \; ; done 2>/dev/null $ tree foo foo ├── dir-1 │   └── foo-file-2 └── file-1 1 directory, 2 files this renames directories , files (the for loop on d f ) because haven't been able make renaming in 1 iteration.

algorithm - Computing the square root of 1000+ bit word in C -

imagine have e.g. 1000 bit word in our memory. i'm wondering if there way calcuate square root of (not accurate, lets without floating point part). or we've got memory location , later specified various size. i assume our large number 1 array (most significant bits @ beginning?). square root more or less half of original number. when trying use digit-by-digit algorithm there point when usnigned long long not enough remember partial result (subtraction 01 extended number). how solve it? getting single digit of large number? bitmask? while thinking pseudocode stucked @ questions. ideas? how hand? how divide 1000 digit number 500 digit hand? (just think method, quite time consuming). square root, method similar division "guess" first digit, second digit , on , subtract things. it's square root, subtract different things (but not that different, calculating square root can done in way similar division except each digit added, divisor changes). i w...

IE 11 Javascript Object doesnt support property or method 'match' -

its javascript countdown working on firefox & chrome not working on ie 11. here code return this.each(function() { // convert if(!(todate instanceof date)) { if(string(todate).match(/^[0-9]*$/)) { todate = new date(todate); } else if( todate.match(/([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{2,4})\s([0-9]{1,2})\:([0-9]{2})\:([0-9]{2})/) || todate.match(/([0-9]{2,4})\/([0-9]{1,2})\/([0-9]{1,2})\s([0-9]{1,2})\:([0-9]{2})\:([0-9]{2})/) ) { todate = new date(todate); } else if(todate.match(/([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{2,4})/) || todate.match(/([0-9]{2,4})\/([0-9]{1,2})\/([0-9]{1,2})/) ) { todate = new date(todate) } else { throw new error("doesn't seen valid date object or string") } }

audio - How to extract a Sound envelope from a .wav file using Python? -

Image
i have sound file comprise of instrumental sound. want examine each note of instrument extracting audio file. can use python doing or other open source software can recommend this. got waveform using audacity. have attached image of sound file , red mark indicate portion extracted. starting , ending of envelope. (only single instrument played in audio file). the thing want called envelope detector or envelope follower . maybe try out pyo project this. analysis module has few envelope followers available. edit: appear have misunderstood question title. want split notes? extract envelope, split based on threshold.