free hit counter

Friday, October 29, 2010

python helps qmake

The more python I write the more I like it. However, the whole join concept for printing lists seems a little odd untill you just accept its arbitraryness.

Still there's no arguing that this is a very concise, readable, little bit of code to generate a qmake .pri file from all the files in a dir.

#
# Generate a QMake include file for all the files in a dir
#

import os, re

theDir= "."
files= os.listdir(theDir)

rxHeaders= re.compile(".*\.h")
rxSources= re.compile(".*\.c(pp)?")

sources= filter(rxSources.search, files)
headers= filter(rxHeaders.search, files)


print "# autogenerated qMake include file for files in %s\n"%(os.path.realpath(theDir))
print "\n".join("HEADERS+= %s"%(i) for i in headers)
print "\n"
print "\n".join("SOURCES+= %s"%(i) for i in sources)

Labels:

Monday, October 18, 2010

perl one liner

This was a good one liner. I had three C header files with 4096 entries each of dummy data and it all needed to be plotted on a log scale.



perl -ne "$val= $_; $val= log($val)/log(10); $val*=10; print $val; print \"f,\n \"; " simMag.txt > simMagXResults.txt

Labels:

Thursday, October 07, 2010

doxygen plugin for confluence?

I'd love to see a way to marry the Doxygen comments in my source code into our Confluence wiki.

Labels: