Musings, work notes, web links and general trivia related to computer programming in a variety of areas. Random things I happen to find interesting or important
Sunday, 31 January 2010
Starting Over
The site quirksmode.org has a great overview of JavaScript best practices. Makes dealing with cookies pretty painless and easy.
Thursday, 31 December 2009
A Cry from the Crypt
Breaking into a running python program using pdb and Unix signals.
2d vectors in Python.
Learning Swedish. More learning Swedish, with online mp3 files. Mercurial hosting on bitbucket.
Cool tutorial on 2D games.
Cool tutorial on 2D games.
OpenGL Red book online. Basic introduction to vectors.
Computer generated imagery.
Friday, 9 October 2009
Next in Line
The stdbuf program is now in GNU coreutils. Trying to handle buffered stdout in programs controlled via pipes is awkward.
Friday, 21 August 2009
Forget to Remember
The Django framework in Python is quite nice, but needs, like all dynamic languages, a good way to debug for typos. The scratch module looks to be the simplest possible way to write a non DB backed web service, albeit with absolutely no support for safe concurrent data access as designed.
Wednesday, 12 August 2009
The Unforgiving Blade
Cell Linux development is oft discussed on the cbe-oss-dev list.
Jeremy Kerr writes Cell Linux code for IBM.
IBM hosts the developerworks Cell Broadband Engine resource centre.
The Cell Performance forum has interesting articles.
The CorePy system can program SPUs.
A blog on Cell Programming.
Sunday, 2 August 2009
Timelessness
Shoes - ruby in a box, with a simple to use UI library. Nice enough, but bundling its own version of ruby makes it awkward to integrate 3rd party libraries wanting a different minor version of Ruby. It has an excellent, and amusing, set of documentation.
Compilers for one language targeting another are nothing new, but translating ANSI C into higher level programming languages is interestingly nutty to perform. Clue targets Lua, Java, Perl, and Javascript.
The clojure language discussion of state discusses some of the problems of using an Actor and message passing approach to concurrency.
Games need artwork. Free artwork is a good thing. Good free game artwork is a very good thing. General program art is also good, especially for icons.
Applescript is evil. Langauge bindings for AppleScript are nifty. Enter appscript. Don't forget the tools needed to understand the AppleScript API being bound to, e.g. iTunes.
Ambulance driving and paramedic work - how to be under appreciated, overworked, and covered in bodily fluids all in one day's work - and in a free ebook, Blood, Sweat and Tea.
VirtualBox is a free VM, ala VMWare or VirtualPC. Also, free for 'personal' use, which does in fact permit commercial usage. User manual.
Flipcards, in python. Pyglet, OpenGL and sprites and animation and sound and stuff for games, in a nice package. Unlike pygame, easy to install. Pymunk, a pythonic wrapper around the chipmink 2D physics library. 1.1.3 needs a fix for crashes related to timers, caused by sound playing. Centering windows tip.
Google's protocol buffers make python data persistence easy, and should provide support for evolving data schema.
Friday, 27 March 2009
The Ides of March
A brief return to document layout and typesetting; Squeezing whitespace and wrong figure numbers, the use of bibtex, again,the caption package, measuring performance improvement, the listings package, a WikiBook on LaTeX and a collection of LaTeX conference tips.
A paper from 1987 describing SphereFlakes.
A paper from 1987 describing SphereFlakes.
Tuesday, 24 March 2009
Crash Test
Automated testcase reduction is way cool. Lithium is a very nice python tool for that, easy enough to modify (to for example, attempt to not reduce only in chunks that are powers of two in size)
Hand in hand with automated testcase reduction is automated testcase generation. There is a little GNU tool (named spu) hiding away in the GDB sources to do just that.
EA have a custom STL replacement. (EASTL). WxCocoaDialog, and CocoaDialog.
High precision timers for Cell Linux.
Hand in hand with automated testcase reduction is automated testcase generation. There is a little GNU tool (named spu) hiding away in the GDB sources to do just that.
EA have a custom STL replacement. (EASTL). WxCocoaDialog, and CocoaDialog.
High precision timers for Cell Linux.
Monday, 16 March 2009
Look for the Truth
Terry Pratchett defines why I read SF & Fantasy.
Just when C++ seems understandable, some new examples of what can be done show up, and present interesting bafflement.
How to program securely in C/C++, avoiding integer overflow via templated operator overloads and allowing testing of objects in boolean contexts without unintended integral promotions.
Test case reduction - using Delta and a book on Why Programs Fail.
Delta debugging.
Just when C++ seems understandable, some new examples of what can be done show up, and present interesting bafflement.
How to program securely in C/C++, avoiding integer overflow via templated operator overloads and allowing testing of objects in boolean contexts without unintended integral promotions.
Test case reduction - using Delta and a book on Why Programs Fail.
Delta debugging.
Monday, 2 March 2009
Welcome Home (Sanitarium)
The shape of code. Interesting. A book giving a cultural commentary on the C language. The C language is relatively small - the commentary comes to 1600 pages - if he wrote it for C++, then would it ever end?
Microsoft have, as expected, a proprietary name mangling scheme for symbols output from their C++ compiler. It is irritating that they cannot find it in themselves to fully and publically document the naming scheme, resulting in a series of more or less incomplete or obsolete 3rd party attempts scattered across the internet. Even if they promise to, and do, completely revise the scheme each version of the MS tools, it would still be preferable to the current unknown, unknowable, and murkily mutable world of trying to interoperate.
Not that purveyors of open source are much better off - you can point fingers at the quality of the code, you can cry at the state of the documentation - or rather, the lack of (good) documentation about the internals - not just the user manual. Fear of infringing on license terms leads to a reverse engineering process, just like proprietary software, even with open source. Still, some other people do occasionally write docs - leading to the question, are those correct for any or all versions in the range from obsolete, current and bleeding edge.
The impact of economics on compiler optimisation.
Computer chess. Fast, and pretty. The grep command takes a -v argument to invert the meaning of the match - e.g. to drop matching limes, rather than non matching. Random numbers in batch files via %random%
Microsoft have, as expected, a proprietary name mangling scheme for symbols output from their C++ compiler. It is irritating that they cannot find it in themselves to fully and publically document the naming scheme, resulting in a series of more or less incomplete or obsolete 3rd party attempts scattered across the internet. Even if they promise to, and do, completely revise the scheme each version of the MS tools, it would still be preferable to the current unknown, unknowable, and murkily mutable world of trying to interoperate.
Not that purveyors of open source are much better off - you can point fingers at the quality of the code, you can cry at the state of the documentation - or rather, the lack of (good) documentation about the internals - not just the user manual. Fear of infringing on license terms leads to a reverse engineering process, just like proprietary software, even with open source. Still, some other people do occasionally write docs - leading to the question, are those correct for any or all versions in the range from obsolete, current and bleeding edge.
The impact of economics on compiler optimisation.
Computer chess. Fast, and pretty. The grep command takes a -v argument to invert the meaning of the match - e.g. to drop matching limes, rather than non matching. Random numbers in batch files via %random%
Labels:
batch files,
c,
c++,
grep,
name mangling,
online book,
random
Friday, 20 February 2009
The Line Begins to Blur
The 7zip tool has a command line program to go along with the GUI integrated into Windows explorer. This is well documented here.
High performance fractal viewer written in Java - beautiful images, and good performance. Seems scalar loops in Java get good performance, and you can write a portable GUI on top and have arbitrary precision maths support from the libraries. The symmetry in chaos book describes interesting fractals. Its a sign of changing times that the example programs were written in QBasic.
Some C++ objects are non-copyable. Some patterns recur. Heh.
High performance fractal viewer written in Java - beautiful images, and good performance. Seems scalar loops in Java get good performance, and you can write a portable GUI on top and have arbitrary precision maths support from the libraries. The symmetry in chaos book describes interesting fractals. Its a sign of changing times that the example programs were written in QBasic.
Some C++ objects are non-copyable. Some patterns recur. Heh.
Tuesday, 17 February 2009
Out Of The Shadows
The sphereflake - nice procedural model generation and raytracer in ~100L of C++. Sorting algorithms have a .com web site.
Tuesday, 10 February 2009
Wake Up
Someone, somewhere, is complaining about the offensive content of the internet. And sending cease and desist letters, to chilling effect.
Someone, somewhere, is wishing a file format they need to process was documented. People write books about things lacking documentation. Like Windows 2000, and its assorted development tools. Someone (who?) may be programming Windows applications in assembler.
John Levine's Linkers and Loaders book is available online in draft form.
Finally, online hex to binary/decimal converters are useful.
Someone, somewhere, is wishing a file format they need to process was documented. People write books about things lacking documentation. Like Windows 2000, and its assorted development tools. Someone (who?) may be programming Windows applications in assembler.
John Levine's Linkers and Loaders book is available online in draft form.
Finally, online hex to binary/decimal converters are useful.
Friday, 6 February 2009
The Thin Line Between Love and Hatred
Visual Studio 2005 has a nice debugger; I spend quite a lot of time there. It is certainly an improvement over gdb. Some of its nicer features are the visualisations of the programs data structures - STL containers, arrays of characters as strings. The visualisation of data structures can be customised, and this is good; Sadly, it is not a documented feature. The autoexp.dat file contains the relevant specifications.
It can be used to provide custom views of data structures specific to programs and libraries. One example is the Chromium browser from google. (and links 1,2,3,4,5). It can also be used to auto expand watched data.
The parser and evaluator for these leave much to be desired. Syntax errors are silently ignored (the preview, or child view, the visualiser for a given type is unchanged) leaving the display unchanged. If not ignored, they are reported in a single modal dialog. If an error is not syntactic, the debugger will crash. Possibly immediately, possibly subsequently in the middle of a debugging session on inspecting certain values.
Beyond the implementation quality issues, the lack of documentation is the main problem. The syntax, while not good, would be improved by a smattering of documentation on the MSDN.
Its a shame, because it is obviously a (potentially) useful feature. It certainly was useful for substituting names for numeric codes in data views (when it didn't crash...)
The Visual Studio command line options are documented on MSDN - some obscure but useful ones. Possibly the most useful is /debugexe - to invoke the debugger on a program from the command line.
Wednesday, 4 February 2009
Try, Try, Try
People try to explain maths on the internet; periodically, I try to understand it once more. Teleworking, but from Edinburgh...
Wednesday, 28 January 2009
Monday, 19 January 2009
The Frayed Ends of Sanity
Some blog titles make you jealous; JavaScript used for sorting DOM list elements and FireBug's console for printf style debugging sanity.
Integration of bugzilla and Thunderbird to ease dealing with bugzilla generated report mails. Nice if it worked with an authenticating bugzilla.
Integration of bugzilla and Thunderbird to ease dealing with bugzilla generated report mails. Nice if it worked with an authenticating bugzilla.
Wednesday, 14 January 2009
Links 234
Version control books online. For CVS, SVN, and Hg. (FAQ). Using a version control system as a 'super client' to another is an interesting idea.
Graphviz for debugging data structures, especially DAGs
Graphviz for debugging data structures, especially DAGs
Sunday, 11 January 2009
Before I Forget
It is hard to find good online resources about compiler writing. Two interesting approaches to teaching compiler implementation are nano-passes and An Incremental Approach to Compiler Construction.
Wednesday, 7 January 2009
Piece by Piece
Some pretty folder icons on a pretty website. A guide to actually using them on OSX...
Encoding email addresses in JavaScript for web display to humans rather than bots - although, how long will it be before bots run JS?
Markdown. Text to html. Showdown, Markdown in JS. Syntax highlighting for code snippets. Browser side code is becoming useful for more than annoying input validation.
The programming language Oberon, dead in all but name, lives on. As normal for niche languages, especially dead ones, documentation is scarce. Fortunately, Oberon is simple and the report short. Some more books on Oberon are around too, for the moment. Since Oberon is so simple, no-one uses Oberon 1, 2, or 2007 - but extended versions with features (re)added from Pascal, Modula and other Pascal derived languages.
Labels:
icons,
javascript,
markdown,
oberon,
online book,
showdown
Friday, 2 January 2009
Escape Confusion
How to position a fixed sidebar using CSS. Fiddling with lists. Using colours.
Tuesday, 30 December 2008
Left Unfinished
A long time ago, in a land far, far, away, I wrote a data binding system for Java and XML. Sadly now, the demo programs fail on recent JVMs and Java Webstart, but that would seem an inherent risk of (ab)using the ability to access the javac compiler via private APIs to compile java source code. Incidentally, compiling java and then using the reflection API in java on the output classes, generating more java code, to compile, load and use, seemed like a nice demonstration of the power of programs that write (efficient) programs or (boring / error prone) parts of programs.
This program is apparently valued highly; The methodology behind this generated figure of $226,531 and 4 man years of effort for code alone is dubious in the extreme, since it was written by me, and not for that long nor that much.
This also leads to the question of how long will the project be hosted? Given its inactive status and lack of activity over 5 years, I guess it is not costing more than a few cents? per year to host, so it may well survive indefinitely.
While I am linking to old, abandoned, and semi-abandoned stuff I have written, here is another little toy N-body visualiser.
Its the age old story - if I had used the hosting services for my MacOS X screensavers, I would still have the source code for them after someone stole my computers...
On a side note, the JQuery JS library is quite interesting.
This program is apparently valued highly; The methodology behind this generated figure of $226,531 and 4 man years of effort for code alone is dubious in the extreme, since it was written by me, and not for that long nor that much.
This also leads to the question of how long will the project be hosted? Given its inactive status and lack of activity over 5 years, I guess it is not costing more than a few cents? per year to host, so it may well survive indefinitely.
While I am linking to old, abandoned, and semi-abandoned stuff I have written, here is another little toy N-body visualiser.
Its the age old story - if I had used the hosting services for my MacOS X screensavers, I would still have the source code for them after someone stole my computers...
On a side note, the JQuery JS library is quite interesting.
Sunday, 28 December 2008
Creeping Death
The cyberduck program seems to transfer files faster via scp than sftp... This can be selected in the preferences.
The Disc Inventory X program can be used to report on the space usage of types of file, down to the level of individual files.
O'Reilly have a guide for writing books for them.
Monday, 8 December 2008
Securitron (Police State 2000)
Who knew that some sort of inscrutable blacklist of forbidden websites is maintained, and used, to restrict internet access in the UK? And that it'd be used to ban the image of a heavy metal album cover?
And that there is a news spin off of Wikipedia?
And that there is a news spin off of Wikipedia?
Friday, 5 December 2008
Dirty Magic
Move .c files into .cpp files, with the same name prefix
for i in *.c; do mv $i ${i%".c"}".cpp"; done
Who would have known bash can manipulate strings?
Double buffering; A nice article.
for i in *.c; do mv $i ${i%".c"}".cpp"; done
Who would have known bash can manipulate strings?
Double buffering; A nice article.
Monday, 1 December 2008
Zero Signal
The wireless network is now working on Fedora 10 on Cell Linux. Lets start with the PS3 Wireless howto - now out of date, but sufficient to configure wpa_supplicant. Once connected, fire up dhclient, and we are online. This is glossing over the faff to get the connection brought up on boot, see the forums and random other pages for that.
I also had to remove the -u option in the /etc/sysconfig/wpa_supplicant file in order to get the service to start on boot. Hmm.
I should write a decent guide on setup, but its late, I'm tired, and quite sure it would be obsolete in a little time anyway.
The elinks browser is sufficient to read the BBC, albeit in a horrendous default colour scheme.
Thursday, 27 November 2008
Be Quick or Be Dead
Cell Linux - now I remember why I haven't bothered to administer or install Linux for years. Some documentation on the (many) steps needed for the particular version I have to install is here. Got to love any system this decade that fails to support WiFi. Once the obsolete and buggy packages get dumped on disk, apply ~1.0GB of patches and updates as detailed in the yum FAQ on updating and upgrading. The admin docs are a work in progress.
Its fun to try and seperate generic Linux config tweaks from distribution and architecture specific ones. Its like going back to Slackware vs Redhat in 1996....
On an aside, the IP address of this particular router is 192.168.1.254 for now.
The by now familiar refrain for Linux is that it all works better in a more recent version. This may be true. Got to love a website that is simply the directory layout of the FTP server over HTTP.
Its fun to try and seperate generic Linux config tweaks from distribution and architecture specific ones. Its like going back to Slackware vs Redhat in 1996....
On an aside, the IP address of this particular router is 192.168.1.254 for now.
The by now familiar refrain for Linux is that it all works better in a more recent version. This may be true. Got to love a website that is simply the directory layout of the FTP server over HTTP.
Friday, 14 November 2008
Here to Stay
The annoyance of the automated windows updater can be dealt with, via equally obscure command line or GUI means; this was detailed on the coding horror blog. To make it go away until the next reboot, use
net stop "automatic updates"
A random link of interest is We Tell Stories. Pretty computations can be found here on the GPU for rendering 3d Julia fractals and here on Cell for real time ray tracing. A book on Cell programming, with example source code.
Monday, 10 November 2008
Next in Line
So, next in the line of things found while researching how to drive bits of software. First up, network theory have online (and printed) manuals for free software, most relevantly GCC with its monstrous collection of options. Redhat have some more docs on options and warnings.
On the realms of useful tools there is paint.net and 7zip for mucking around with test images, screen shots, and (un)archiving on Windows.
On the realms of useful tools there is paint.net and 7zip for mucking around with test images, screen shots, and (un)archiving on Windows.
Sunday, 26 October 2008
Stranger in a Strange Land
This blog will accumulate links to things I find to be of interest, and wish to find again. Entry titles will be chosen on whim from a music collection dominated by heavy metal; people reading this blog (who?) should know this follows on from a web page detailing random experiences of linux usage, now available from archive.org here and here. This title is brought to you by Iron Maiden and emigration to Sweden...
It is intended to replace the traditional collection of physical books of programming knowledge - but freely accessible online books seem likely to be a more focussed, comprehensive source for certain programming topics - the GNU project links to 3rd party online books with liberal licenses, including some of the O'Reilly open book online books.
While its early days yet, I note there is far more content, somewhat better organised, in the book on GNU make than in the corresponding collection of questions tagged 'make' on Stack Overflow.
Subscribe to:
Posts (Atom)