Performance of subprocess.check_output vs subprocess.call

Reading the docs, both subprocess.call and subprocess.check_output are use-cases of subprocess.Popen. One minor difference is that check_output will raise a Python error if the subprocess returns a non-zero exit status. The greater difference is emphasized in the bit about check_output (my emphasis): The full function signature is largely the same as that of the Popen … Read more

Using Component Object Model (COM) on non-Microsoft platforms

Answering myself but I managed to find the perfect library for OLE/COM calling in non-Microsoft compilers : disphelper. (it’s available from sourceforge.net under a permissive BSD license). It works both in C and C++ (and thus any other language with C bindings as well). It uses a printf/scanf-like format string syntax. (You pass whatever you … Read more

Capturing sound from Wine with TargetDataLine

Make use of AudioSystem.write() method. It is much easier targetDataLine.open(format); targetDataLine.start(); AudioInputStream ais=new AudioInputStream(targetDataLine); AudioFileFormat.Type fileformat=AudioFileFormat.Type.WAVE; /* Other Audio file formats supported: AudioFileFormat.Type.AU AudioFileFormat.Type.AIFF AudioFileFormat.Type.AIFC AudioFileFormat.Type.SND */ File audoutputfile=new File(‘myfile’); //adjust extension according to AudioFileFormat AudioSystem.write(ais,fileformat, audoutputfile);

How to increment version number in a shell script?

$ echo 1.2.3.4 | awk -F. -v OFS=. ‘NF==1{print ++$NF}; NF>1{if(length($NF+1)>length($NF))$(NF-1)++; $NF=sprintf(“%0*d”, length($NF), ($NF+1)%(10^length($NF))); print}’ 1.2.3.5 1.2.3.9 => 1.2.4.0 1.2.3.44 => 1.2.3.45 1.2.3.99 => 1.2.4.00 1.2.3.999=> 1.2.4.000 1.2.9 => 1.3.0 999 => 1000 UPDATE: #!/usr/bin/gawk -f BEGIN{ v[1] = “1.2.3.4” v[2] = “1.2.3.44” v[3] = “1.2.3.99” v[4] = “1.2.3” v[5] = “9” v[6] = “9.9.9.9” … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)