A new version of Ecossaise is out. This fixes a few bugs introduced by Windows Vista and replaces dynamic links with static links in order to improve portability.
Category Archives: Programming
Master's Project… DONE!, final word on Google
I just finished my MS project… in a week. I had three months to do it.
In other news, Google did not offer me the job after all those months of interviewing. Pity; I could have done the same for them. If they behave like they did during the Summer of Code, I’ll find them using the ideas I presented at the interviews a few months from now despite this. Apparently one interview (of about 10 – the only one I didn’t solve the problem for, and even then I had the right idea) really is enough to screw up the entire process. A series of consensus interviews seems more a test of luck than actual ability.
The Matlab Elves
I received a visitation from the Matlab “elves” today. The following code worked perfectly yesterday:
“load data; imwrite(images{1}, ‘1.png’)”
Yet now returns an invalid image. No changes to data.mat have been made.
Edit: Scratch that; someone else on my team changed data.mat without notifying me.
B+-Trees
During a conversation with a friend, I said something worth writing:
“The B+-tree is the programming analogue of the Clementi sonatinas: not too difficult to implement, but very fun nevertheless.”
Matlab with CGI
If you call Matlab from, say, Perl, and it segfaults on startup with this message, please note that you must set the HOME environment variable, as Matlab requires a home directory. I used /tmp, but feel free to set it to whatever accessible directory you wish. It took me nearly 2 hours to figure this out, so I am posting this in the hope that it will save others from repeating this.
< M A T L A B >
Copyright 1984-2005 The MathWorks, Inc.
Version 7.0.4.352 (R14) Service Pack 2
January 29, 2005
————————————————————————
Segmentation violation detected at Wed Jul 25 13:37:45 2007
————————————————————————
Configuration:
MATLAB Version: 7.0.4.352 (R14) Service Pack 2
MATLAB License: 213660
Operating System: Linux 2.6.8-1.521smp #1 SMP Mon Aug 16 09:32:47 EDT 2004 x86_64
Window System: No active display
Current Visual: None
Virtual Machine: Java is not enabled
Default Charset: US-ASCII
Register State:
rax = 0000000000000000 rbx = 0000000000000001
rcx = 0000000000000000 rdx = 0000002a959cf9a0
rbp = 0000007fbfffbdf0 rsi = 0000000000000000
rdi = 0000000000000000 rsp = 0000007fbfffbdb8
r8 = fefefefefefefeff r9 = 0000002a96c8cb50
r10 = 0000000000000001 r11 = 0000002a9593ccb0
r12 = 0000000000000000 r13 = 0000007fbfffcf50
r14 = 0000002a95af70e0 r15 = 0000002a959cf9a0
rip = 0000002a96bfe790 flg = 0000000000010246
Stack Trace:
[0] libc.so.6:strlen~(0x7fbfffcfa0, 0x2a95c4ffa5, 0, 0) + 48 bytes
[1] libmwservices.so:svGetToolboxCacheFile(0, 0, 0, 0) + 31 bytes
[2] libmwbridge.so:mnRunLoginScript()(0x7fbfffd008, 0x00590420, 0x7fbfffd170, 0x2a95d7d61b) + 549 bytes
[3] libmwbridge.so:mnRunPathDependentInitialization()(0, 0x004015a0, 0, 0x7fbfffd1b9) + 28 bytes
[4] libmwmcr.so:mcr_init_handler(long)(0x7fbfffd430, 0x0058e360, 0x00592470, 0x2a96d99cf8) + 539 bytes
[5] libmwmcr.so:mcrInstance::mcrInstance(mcrOptions&, MfileReader*)(0x2a97559b79 “libc.so.6”, 0x2a97673dc3 “libc.so.6”, 0x7fbffff120, 0x2a97673dc3 “libc.so.6”) + 484 bytes
[6] MATLAB:mcrMain(int, char**)(0x00401730, 0, 0, 0x004015c0) + 226 bytes
[7] libc.so.6:__libc_start_main~(0x7fbffff7df “-nosplash”, 0x7fbffff7e9 “-r”, 0x7fbffff7ec “test”, 0x7fbffff7f1 “-logfile”) + 164 bytes
Please follow these steps in reporting this problem to The MathWorks so
that we have the best chance of correcting it:
1. Send this crash report to segv@mathworks.com for automated analysis.
For your convenience, this information has been recorded in:
test.out
2. Also, if the problem is reproducible, send the crash report to
support@mathworks.com along with:
– A specific list of steps that will reproduce the problem
– Any M, MEX, MDL or other files required to reproduce the problem
– Any error messages displayed to the command window
A technical support engineer will contact you with further information.
Thank you for your assistance. Please save your workspace and restart
MATLAB before continuing your work.
Classifying MBTI from a text sample
Using text mining techniques, I am going to attempt to build a naive Bayesian classifier capable of determining a person’s Myers-Briggs type from a sample of text that they write. This should be a fairly quick project once I finish with everything else. Whether it works or not is another story. Most likely it will, but no one will use it, so I’ll never accumulate a sufficient training set. No one uses anything I create these days, despite the constantly improving quality of my creations.
Anyway, if it does work, it’s publication-worthy, as this sort of thing hasn’t been done before, as far as I can tell. It could open up a whole new approach to automated psychological testing.
Update: It’s been done by uClassify. Pretty neat stuff.
Cross-compression: Compressing one file based on others
If taking many photos of the same scene, for example, it would be a good idea to compress these photos in terms of each other, using something like differential encoding (though probably more sophisticated; maybe building an LZW dictionary on one file then applying it to all files?). Domain-specific methods could be used as well. The files would necessarily be paired (don’t even think about changing one without altering the other as well), but it would offer significant savings over solely file-by-file compression.
Something like ZIP or TAR+GZIP may already do this. I’ll have to check the specifics of the algorithms employed. Regardless, I think I see a new coding opportunity coming my way.
Edit: Zip does not compress files together, but this approach is more or less exactly what tar+gzip does (including the idea of using a common LZW dictionary).
Master's Project Topic
My project topic will be “A Database Framework for Retrieval and Analysis of Tree-like Structures in Medical Images”, building upon my previous work at Temple.
The best part is that I get to both do research and code in Perl at the same time!
Results from running time
Some algorithms contain parameters in their running time that actually correspond to their solutions. For example, the vertex cover is fixed-parameter tractable for size k of the cover- the running time is expressed in terms of k rather than n.
If we implement awareness of its own running time into such an algorithm, we can use this to easily determine the solution.