Scraping HTML tables with Python 3.3 and HTMLParser
The HTMLParser class within Python’s Standard Library provides a reasonable interface for scraping the content from tables amongst a lot of extraneous HTML. In this specific example, I’ll show Here, I’ll show an example of using this to parse tables with country names from NationsOnline. A general solution to every variation of table on the website is difficult due to... read more
03 May 2013 | PythonRunning virtual X11 sessions.
This is a short guide documenting my experiences configuring a virtual X framebuffer on a headless CentOS 6.4. Specifically, I needed the functionality on a cluster to start graphical applications on the nodes. Previously, I forwarded X11 and was able to start graphical applications with the caveats: The forwarded X11 session has to be forwarded before starting graphical applications. The... read more
01 May 2013 | LinuxCUDA 5.0 separate compilation with C and C++ with nvcc and g++
For projects with many C or C++ files and few CUDA files, separate compilation with nvcc and g++ is optimal. NVIDIA posted a presentation here. Further, there are questions on Stack Overflow about this. A few I found are: G++ NVCC How to compile CUDA code then Link it to a G++ C++ project Building GPL C program with CUDA... read more
17 Apr 2013 | CUDACreating a pdf document from plaintext with vim and Bash
Vim’s print documentation allows printing to a postscript document. I’ve commonly done this within vim with the hardcopy command, but I now use a shell script to automate this and produce a pdf. This is available on GitHub. The implementation uses vim’s script/batch mode to call vim from the command line, ps2pdf to convert ps files to pdf files, and... read more
16 Apr 2013 | BashCatching an interrupt and adding a shutdown hook in Scala.
When using a JVM language, shutdown hooks) are called before the VM shuts down. They are also used to catch user interrupts, such as Ctrl-C. IBM also has well-written material on shutdown hooks and signal handling in Java. In Scala specifically, this process is similar to the references above. However, I’m writing this post because I struggled finding a specific... read more
15 Apr 2013 | Scala