2008-12-26
Visual Studio 2008, take 2
So I downloaded Boost 1.37, the bjam executable for NT, read through the boost getting started manual, compiled the necessary libraries in 32-bit and 64-bit mode as well as a small test application. The process has been surprisingly painless -- it took me about one hour from downloading bjam to having a working test application that comes along with Boost.Thread.
Another reason for wanting to have a portable application is that it is painful to develop over a remote connection to unix server. A compromise solution, which I've been practicing lately, is setting up shared folders with Virtualbox, editing the code with XEmacs, and compiling/testing in the virtual machine. This kinda works, but does not make the code portable :)
2008-12-05
New CSPIM release
2008-11-29
CMake and assembly sources
set_property(SOURCE cputorture.s PROPERTY LANGUAGE C)
This works because the C compiler, at least on UNIX, recognizes
.s
as assembler source extension and invokes the proper assembler command.
2008-11-26
NetBSD 4 dissapointment
2008-11-12
Acrobat Reader 9 annoying accessibility feature
Solution: find "Accessibility.api" and "ReadOutLoud.api" files in Acrobat's installation directory (under plugins) and rename them to something else. I have created directory named "disabled" and moved the files there. Works like a charm.
2008-11-08
R
I have resisted learning R for a long time, because it also uses a rather arcane language with many complex and rather badly documented data structures. However, a week ago, I remembered my last experience with gnuplot, and I gave R a try. I'm glad I did even though it took me some time to get used to its data manipulation capabilities since the learning curve is rather steep. However, once you get used to it, it's so much easier and faster to manipulate data than with custom-made scripts, and much simpler to produce well-looking plots. Visit its homepage and take a look.
2008-10-06
Windows Vista and Visual Studio
You have probably heard that User Access Control (UAC) is PITA, and there are a bunch of cookbooks on the net instructing on how to disable it. Coming from UNIX background, I find it rather natural that you have to type in admin password before performing system-critical tasks. Suggesting to people that they turn off UAC is rather irresponsible, and I have not done it. I like being warned when some operation requires elevated privileges. Oh, and I have turned off the sidebar - gadgets there are mostly useless and they just increase the startup time (which is, I must say, rather decent).
I have found replacement for all of the tools that I used under linux, except one -- development tools. And now, my comparison standard is not linux, but Solaris, with Sun's native developmet tools, CMake and dbx. (BTW, Solaris dbx just rocks! gdb is a poor match for it.) I have installed Visual Studio 8 Professional (I have free license through MSDNAA), and it has several shortcomings in comparison with Solaris tools.
First, I've heard many windows developers say that VS debugger is one of the best, but I find it rather mediocre compared to dbx. VS debugger does not recognize C++ overloaded iterators (so you can't persuade it to show you
*it
where it
is some C++ iterator class) and it is a pain to display deeply nested data structure (just print -r
in dbx). VS has even its own embedded command-line interface, but nothing indicates that these features are available through it. Sure, VS debugger is nice for single-stepping through the code, but this is not the way I usually debug the code. (What usually happens in my debugging session is that some assertion/check triggers a crash, I inspect the core dump, put a breakpoint near the offending place, and quickly print
few variable values.) On the upside, the VS debugger understands STL containers and can display them in a nice form. But I'd go for dbx any day, only if it were available for Windows.Oh yes, changing command-line arguments through IDE for debugged programs is PITA :-) If I run the program from the shell and it crashes, it takes several seconds to drop into the debugger, which is kinda annoying.
Another complaint is that VS does not seem to come with a decent profiler such as gprof on Solaris. Most people recommend to use Intel VTune, which costs money. Sun has recently released (free!) SPOT tool which produces a nice report of hot-spots over several runs of your program, in the form of cross-linked HTML pages and graphs.
Then there's DTrace which is currently unique to Solaris and some BSD variants (OS X, FreeBSD?).
Lastly, project configuration management is easier with CMake. I have not yet figured out how I can persuade VS to inherit project properties from the master "solution" properties. Given that projects have parent projects, I should probably play with a deeper project hierarchy. (But why can't I set master settings in the "solution"?! Bleh.)
IntelliSense is nice, but.. it doesn't work all of the time (I see rather often a message in the status bar that IntelliSense couldn't find a completion.. ). Though, when it does work, it sometimes saves me a lookup of member name.
In conclusion - Vista is a rather nice environment for everyday work and it is very stable. However, Microsoft's C and C++ development tools are no match to Solaris's tools, at least when it comes to lower-level stuff. (Maybe not so surprising, UNIX is traditionally C and C++ oriented environment, while MS is moving towards .NET). I'm definitely somewhat less efficient in development with VS (though not drastically); I don't know (yet) whether this is because I haven't learned all the features, or because Solaris tools simply are superior and have no match in functionality in VS.
2008-09-21
New site
2008-08-17
New code release: ext2frag
A master student of mine has developed a FUSE filesystem as a part of his master thesis. He needed to compare several fragmentation metrics of his own FS with that of EXT2. However, no decent programs for calculating EXT2 fragmentation statistics are available, so I set out to code one since the student was really short on time. You can get the program here.
2008-07-19
Free society ; some tips
I've recently watched Lessig's presentation on free culture. It has been recommended to me as an example of interesting use of slides, but it is also an excellent lecture on how copyright stifles innovation and development. The following is the basis for the whole lecture:
- Creativity and innovation always builds on the past.
- The past always tries to control the creativity that builds on it.
- Free societies enable the future by limiting the past.
- Ours is less and less a free society.
There's another noteworthy quote (by JC Watts, a US congressman/senator?): "If you're explaining, you're losing."
Regarding tips: perl's CPAN shell is an excellent tool to install packages and their dependencies. However, it uses active FTP by default which is more and more dysfunctional because of firewalls. Exporting the environment variable FTP_PASSIVE=1 before running will make it use passive FTP.
2008-06-02
Few rants...
Second: ubuntu sucks! I have it installed on my desktop machine on work, because that's "what everyone else uses" and only ubuntu CD's are available for installation. Today I ran the latest upgrade of 8.04, rebooted the machine and I was greeted with half-functional GNOME. I.e. the gnome-panel was missing and had I not had some folders on desktop that allowed me to get access to the file manager and eventually run an xterm, it would be completely unusable (i.e. none of the keyboard short-cuts worked either). Solution? I have no idea -- I installed xfce4 to get a functional desktop. The good thing is that xfce4 does not display the annoying update notification every now and then :-D Anyway, ubuntu owes me compensation for 1.5 hours of lost work time. Talk about "no-cost" software :-P
2008-05-14
To hell with climate change, time to speak up for the fish!
[PS. I think that disappearance of any species is regrettable, but I certainly prioritize a food source over some exotic animal. It's regrettable that media don't have same opinion.]
2008-05-11
Sudoku solvers and cairo graphics
2008-04-13
Dent game: an example of nonexistant security
Before submitting my result, together with my data (email address and phone number), I fired up wireshark and found out the following:
- They first connect to stats.indexstats.com to report some basic statistics (a cookie with base-64 url, among other stuff, is sent and an empty GIF is returned).
- Then a simple POST request is sent with the score and entered data about the user. Everything through ordinary HTTP, and everything in cleartext! Some binary data is returned, but I haven't bothered to figure out what it is.
What could have been done differently? It's impossible to secure an application 100% when the user has full control over the computer, but I think that just AES-encrypting the sent data with a key preshared between the client and the server would have risen the hacking bar significantly. You'd have to download the raw flash file, try to find the encryption key inside it, guess the encryption algorithm, etc. If the encryption key is not stored contiguosly in the file, then you'd also have to reverse-engineer the flash code to see what's going on.
In any case, very badly done web application.
2008-04-02
Inkscape
2008-03-22
MIPS CPU simulator, CMake
I'm also using this opportunity to learn about the CMake build system.
2008-03-01
IT Underground 2008
2008-02-23
MIPS CPU
As for why I'm doing this - the answer will hopefully be clear soon :-)
2008-01-27
Java leaks memory
2008-01-10
Some regexps
/((?:(?n:.+):*:_nl:)+):*:_nl:(.+)/
Some peculiarities: the
:*:_nl:
is CRM114 literal for newline, and the ?n:
is a TRE flag to tell it that dot (.
) should not match the newline character (by default it does, and this makes TRE different from PCRE regexp). The headers will end up in the 1st matching group, and the article body in the 2nd.