This is a collection of miscellaneous stuff. Mostly related to projects that I plink on from time to time and research interests. This just makes it easier for me to google the stuff later on. Please note that I do retroactively edit posts.
Monday, December 28, 2009
How does your development language of choice rank?
You can see some more subjective ratings of various languages at the Hammer Principle.
--
The TIOBE Programming Community Index also ranks languages by counting hits on search engines. (April 2012)
Sunday, December 27, 2009
No more Qtopia
Apparently, Qtopia was killed off in late 2008, re-released as Qt Extended, then dropped by Nokia/Trolltech early 2009. Finally, source was “liberated” by a fork as Qt Extended Improved. I was considering it for the GUI layer of an embedded PowerPC project with an Embedded Linux (or maybe eCos) substrate.
Tuesday, December 22, 2009
Scratch Programming Language for Learning/Play
During some early morning googling to see if anyone had started a port of Java as Wii homebrew I came across Scratch. Described as: “Scratch is a new programming language that makes it easy to create your own interactive stories, animations, games, music, and art -- and share your creations on the web.”
Sunday, June 21, 2009
Porting fracplanet to Qt4 (actually Qt3Support)
First step ran qt3to4 on fracplanet.pro, then qmake VERSION_NUMBER=0.4 fracplanet.pro, and make. I’m missing dependencies like boost so I didn’t expect this to get very far. It didn’t.
First problem was the VERSION_NUMBER=0.4. At line 32 in control_about.cpp their isn’t a automatic conversion from QChar to double. So next I did qmake VERSION_NUMBER=1 fracplanet.pro, and make.
Got to line 55 of control_about.cpp and had to change it to:
license->setTextFormat(Qt::PlainText);
Did make again and now the boost problem. Since this was supposed to be a quick hack-and-slash I didn’t bother building boost. Found and installed Boost-1.34.1-mingw.exe into C:\Devel\Boost-1.34.1 and added the following directives to fracplanet.pro:
LIBS += -lboost_program_options-mt
INCLUDEPATH += C:\Devel\Boost-1.34.1\include
LIBPATH += C:\Devel\Boost-1.34.1\lib
LIBPATH += C:\Devel\MinGW\lib
Then redid qmake VERSION_NUMBER=1 fracplanet.pro, and make.
Next problem was a mission qhbuttongroup.h in control_render.h at line 27. Appears that the qhbuttongroup was rolled into qbuttongroup at some point. qt3to4 didn’t pick this one up so I mannually changed qhbuttongroup.h to q3buttongroup.h. Same in control_terrain.h.
Copied usage_text.h out of a previous build with cygwin to get around figuring out how to actually build the documentation.
Changed line 113 in fracplanet_main.cpp to
progress_dialog->setLabelText(QString(progress_info.c_str()));
Added the following before the use of glDrawRangeElements in triangle_mesh_viewer_display.cpp
PFNGLDRAWRANGEELEMENTSPROC glDrawRangeElements = NULL;
glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)wglGetProcAddress("glDrawRangeElements");
Then redid qmake VERSION_NUMBER=1 fracplanet.pro, and make. And the end result… A working copy of fracplanet built against Qt 4 compiled with MingW.
OK, technically it’s still Qt 3 since it uses Qt3Support. Also, has to be run from the command line at the moment. Might fix it up and package it later.
Building fracplanet with cygwin
Took a whack at building fracplanet with cygwin on a Windows box yesterday afternoon. It was too hot outside to mow the lawn.
Some things that I had to do to get it built:
- Edit the fracplanet.pro file so it could find the installed version of boost. I added the following:
LIBS += -lboost_program_options-gcc-mt
INCLUDEPATH += /usr/include/boost-1_33_1
- Edit the line 103 in /usr/include/boost-1_33_1/boost/random/mersenne_twister.hpp to
x[j]=gen;
instead of
x[j]=gen();
- Had to go back and install libglut for cygwin.
After that the program compiled and linked.
I ended up using Xming instead of the X server bundled with cygwin. Of course I had to make sure to start Xming before bash and set the display by hand (export DISPLAY=localhost:0.0).
Here is my first planet.
And here it is rendered by POV-Ray for Windows.
Monday, May 25, 2009
Homeworld source
and noticed that Homeworld is on the list. It's a classic that I used to play.
SDL oriented source is available with restrictions through HomeworldSDL and a Windows SDL version is available here.
Saturday, December 22, 2007
Standard ML New Jersey on OpenSUSE 10.3
First, I followed the install instructions. I downloaded the files from the SourceForge file list, and went through the install process but the build was convoluted by assembly source problems.
Next, I took a whack at building from the source RPM.
I searched for "smlnj" at the OpenSUSE Build Service .
Downloaded the source RPM and copy it to /usr/src/packages/SRPMS.
Installed the source RPM with rpm -Uvh smlnj-110.65-10.src.rpm. This will result in smlnj.spec in /usr/src/packages/SPECS and /usr/src/packages/SOURCES.
Build the RPM:
cd to the /usr/src/packages/SPECS and build the SRPM and RPM with rpmbuild -ba smlnj.spec.
On my system this results in:
- /usr/src/packages/SRPMS/smlnj-110.65-10.src.rpm
- /usr/src/packages/RPMS/i586/smlnj-100.65-10.i586.rpm
- /usr/src/packages/RPMS/i586/smlnj-debuginfo-100.65-10.i586.rpm
Install the RPM:
cd to /usr/src/packages/RPMS/i586 and install the binary RPMS with rpm -Uvh smlnj-100.65-10.i586.rpm.
The end result... AHRGGG! Not surprisingly, the install is still looking for library files in /usr/src/packages/BUILD/smlnj-110.65/sml.boot.x86-unix.
Finally, I extracted the source from the RPM (rpm2cpio smlnj-110.65-10.src.rpm | cpio -ivmud), applied the patches and built the whole thing in /usr/local/lib/smlnj then added /usr/local/smlnj/bin to the PATH. Now PADS builds.
Thursday, December 13, 2007
libpcap for cygwin
The port was conducted by CAIDA Metrics Working Group project to support the port of NeTraMet to MS Windows.
Source is in libpcap-0.7n.tar.gz at the NeTraMet downloads page.
The code is a bit dated (early 2002) and doesn't sync up with the current version of libpcap (v0.9.8). I don't really need it at the moment but it might be worth looking at later.
Wednesday, December 12, 2007
ANSI C way to check if a file is readable
int can_read_file(const char * filename) {
FILE *file=NULL;
if ((file = fopen(filename, "r"))) {
fclose(file);
return 1;
}
return 0;
}
You'll have to #include stdio.h
Bro v1.2.1 autotools tweaks
In configure.in added the line below so I could see if broccoli was on or off:
echo " - Building Broccoli: "${BLD_ON}$broccoli${BLD_OFF}
In src/Makefile.am changed AM_CFLAGS to:
#MED:2007-12-11: binpac.h is generated from binpac.h.in in src/binpac/lib AM_CFLAGS = -I. -I$(top_srcdir)/src/binpac/lib -I$(top_srcdir)/src -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/src/binpac/lib
In src/Makefile.am and aux/adtrace/Makefile.am changed the LDFLAGS back to AM_LDFLAGS.
In src/binpack/Makefile.am added the line:
#MED:2007-12-11: binpac.h is generated from binpac.h.in in src/binpac/lib libbinpac_a_CPPFLAGS = -I$(top_builddir)/src/binpac/lib -I$(top_srcdir)/src/binpac/lib
Haven't looked at the broccoli build problems yet. I just configure with --disable-broccoli.
Sunday, December 2, 2007
Installing parallel versions of GCC.
- Keeping multiple versions of gcc and installing them
- Installing Alternate GCC Compiler on Fedora
- How to install multiple versions of GCC
Next to test it out I downloaded mical-0.1.0.tar.gz to ~/tmp. I extracted the files and then did export PATH=/opt/gcc/3.3.6/bin:$PATH; configure;make. I didn't do a make install. I'm not comfortable installing something that will need the parallel version of GCC in /local or /opt yet. But I did plink with the algorithm tests and they seemed to work correctly.
For some reason the PATH approach above didn't seem to stick so now I'm building mical by specifying the version of gcc/g++ to as a parameter to the configure script:
configure CC=/opt/gcc/3.3.6/bin/gcc CXX=/opt/gcc/3.3.6/bin/g++.
Saturday, December 1, 2007
Adventures With NetDude.
Building NetDude
First I downloaded the netdude-0.4.8a.tar.gz file and the supporting libnetdude-0.10a.tar.gz and libpcapnav-0.8.tar.gz.
After extracting the arcived files I used configure; make; sudo make install | tee install.log in the following order: libpcapnav, libnetdude, netdude.
Next on to the plugins. I downloaded Essentials Pack, Appdemux, and TCP Filter plugins.
Libnetdude Plugins
AppDemux depends on several of the plugins in the Essentials
Pack and TCP Filter depends on Conntrack and Trace-Set from the Essentials Pack so the first order of business is to get the Essentials Pack built and installed.
I used configure; make; sudo make install | tee install.log in the following order: libnetdude-plugin-essentials, libnetdude-tcpfilter-plugin, libnetdude-appdemux-plugin
Netdude Plugins
The only NetDude plugin at the time of writing is the Traffic Analyzer. Unfortunately for me the version I downloaded did not build without errors. Since this was a quick hack I didn't spend time fixing the build so I was unable to try it out.
On to doing something useful with this...
I was able to demux TCP connections (transport level) with the demux plugin using lndtool (lndtool -r demux -0 wk3.01 -p we3.01_Mon.inside.tcpdump). I'm not sure that I like the way the traces are de-muxed. That is they don't directly translate into a format that I can input into a grammatical inference system. Also, I need to check on the parameters used to decide flow membership. It would probably help me out if I tweaked the demux plugin so it was parameterized.
Sadly the AppDemux plugin isn't working for me and that is the feature I really need at the moment. So my quest for a way to demux application level protocols continues. Going to re-evaluate tcpflow.
Does anyone have other flow reconstruction tools they can recommend?
Sunday, November 25, 2007
-mtune=native : GCC 4.2.x command line option
Using the GNU Compiler Collection Section 3.10
- To use it on an automake/autoconf project in KDevelop:
Qfsm configure.in hacks
The solution I used was to hack a large portion of the autoqt m4 macros into Qfsm's configure.in. A similar approach was used here.
A better solution would probably be to update autoqt so it works with a dual Qt3/Qt4 installation. There was also some useful info at Qtnode. Also, FreeMat's configure.in might be a good source for autoconf macros that are Qt4 related.
par2cmdline fix for gcc 4.x
Bro v1.2.1 and new ClamAV versions
To work around this I edited the configure.in file so it checks for the cl_scanbuff function and does not configure ClamAV support if it is not exported by ClamAV.
In the Bro configure.in I edited the ClamAV checks to read:
# Libclamav
have_libclamav=Yes
AC_CHECK_HEADERS([clamav.h],,have_libclamav=No)
AC_CHECK_LIB(clamav,cl_scanbuff,,have_libclamav=No)
#AC_CHECK_LIB(clamav,cl_retdbdir,,have_libclamav=No)
Then re-generated the configure file.
One possible "real fix" would be to re-write the FileAnalyzer functions to create temporary files and use cl_scanfile to scan the temporary file.

