I decided to install the GD image library for Perl on my working station, and as usual, using CPAN. However, after running install GD, I was faced with an error.
make: *** [GD.o] Error 1
LDS/GD-2.35.tar.gz
/usr/bin/make -- NOT OK
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
Failed during this command:
LDS/GD-2.35.tar.gz : make NO
Unable to find the cause, I turned to apt-get, which installed GD without any problems.
$ sudo apt-cache search libgd perl
libgd-gd2-perl - Perl module wrapper for libgd - gd2 variant
libgd-graph-perl - Graph Plotting Module for Perl 5
libgd-text-perl - Text utilities for use with GD
ruby1.8 - Interpreter of object-oriented scripting language Ruby 1.8
calamaris - log analyzer for Squid or Oops proxy log files
libgd-barcode-perl - Library to create barcode images (GD::Barcode)
libgd-gd1-noxpm-perl - Perl module wrapper for libgd (old version against GD 1.8.x)
libgd-gd1-perl - Perl module wrapper for libgd (old version against GD 1.8.x)
libgd-gd2-noxpm-perl - Perl module wrapper for libgd - gd2 variant without XPM support
libgd-graph3d-perl - Create 3D Graphs with GD and GD::Graph
libgd-perl - Perl module wrapper for libgd
libgd-securityimage-perl - Security image (captcha) generator.
libgdk-pixbuf-perl - Perl module for the gdkpixbuf library
$ sudo apt-get install libgd-perl
Done!
A few days ago, I set up a site where students can upload their essays for money (Uppsatslotto.se: Tjäna pengar på dina uppsatser), and wanted a nice way for analyzing texts. I found two in particular, FRES (Flesch Reading Ease Score) and SMOG (Simple Measure of Gobledygook). Slightly modified excerpts from the respective Wikipedia articles (licensed under the GNU Free Document License):
The Flesch/Flesch–Kincaid Readability Tests are readability tests designed to indicate how difficult a reading passage is to understand. There are two tests, the Flesch Reading Ease, and the Flesch–Kincaid Grade Level. Although they supposedly use the same measures, just placed into a different scale, the results of the two tests do not always correlate (a text with a better score on the Reading Ease test over another text may end up with a worse score on the Grade Level test). Both sytems were devised by Rudolf Flesch. In the Flesch Reading Ease test, higher scores indicate material that is easier to read; lower numbers mark harder-to-read passages. The formula for the Flesch Reading Ease Score (FRES) test is 206.835 - 1.015 * W/Se - 84.6 * Sy/W where W/Se is the average number of words per sentence and Sy/W is the average number of syllables per word.
SMOG (Simple Measure Of Gobbledygook) is a readability formula that estimates the years of education needed to understand a piece of writing. SMOG is widely used, particularly for checking health messages. The precise SMOG formula yields an outstandingly high 0.985 correlation with the grades of readers who had 100% comprehension of test materials. SMOG was published by G. Harry McLaughlin in 1969 as a more accurate and more easily calculated substitute for the Gunning-Fog Index. The SMOG of a text can be calculated by: 1.0430 * sqrt( 30 * Psy/Se ) + 3.1291.
The following code is a PHP implementation for calculating the required values (number of words, number of sentences, number of syllables, and number of polysyllabic words) and putting it all together using the above mentioned formulae.
1
2
3
4
5
6
7
8
9
10
11
12
| // Number of words: number of space series or linebreaks + 1
$wc = preg_match_all( '/[ \r]/', preg_replace( '/ +/', ' ', $text ), $tmp );
// Number of syllables: vowels not followed by another vowel. Quite accurate approximation.
$syc = preg_match_all( '/[aeiouy][^aeiouy]/', $text, $tmp );
// Number of polysyllabic words (>=3 syllables): Vowel, non-spaces, vowel, non-spaces, vowel (or more non-spaces-vowel)
$psyc = preg_match_all( '/[aeiouy]([^ ]*[aeiouy]){2,}/', $text, $tmp );
// Number of sentences: Number of periods, exclamation marks, question marks and linebreaks
$sec = preg_match_all( '/[.!?\r]/', $essayf, $tmp );
// Flesch Reading Ease Score
$fres = 206.835 - 1.015 * ( $wc / $sec ) - 84.6 * ( $syc / $wc );
// Simple Measure of Gobbledygook
$smog = 1.043 * sqrt( $psyc * ( 30 / $sec ) ) + 3.1291; |
A while ago, I posted about using FireStats for MediaWiki statistics. For some weeks now, I’ve been using FireStats for tracking statistics on this WordPress blog, too. This is by far the best statistics plugin that I have ever seen. You can find out most things about your visitors’ patterns through a nice AJAX interface. Also, it doesn’t use any JavaScript against visitors, which wins it a lot of points in my eyes.
Recently, the beta for FireStats 1.3.0 was released with a long-awaited feature: recording of search engine keywords. 1.3.0-beta contained a database upgrade which made me backup the FireStats tables before upgrading, although it failed due to a PHP memory limit. I took a deep breath and upgraded anyway, and it turned out perfectly after a couple of minutes database upgrading. To my delight, the keywords had been automatically extracted from the pre-1.3.0 hits.
The only feature that FireStats lacks before I’ll call it a full-fledged statistics system is graphs. I’m sure this is a high-priority trac ticket somewhere.
Thanks for FireStats, Omry Yadan.
Something is written here in the dust.
You read: "help i'm trapped in a nethack release".
------
|.....#################
#-....| # -------------
###|...{| ----------### |...........|
------------ # |....| ##...f.....| # #............|
|..........|### |....| # |........| ####|.....^.....|
|..........|# ----.- ### |....@...| ## |...........|
|..........|# # # |.........######............|
#-..........|# # ### ---------- |...........|
###|..........-# ## # -------------
# ------------ ---.--#
### |....|#
-----.- # |....|#
|......## |....-#
|.....| ------
|..<..|
|.....|
-------
Tim the Evoker St:14 Dx:11 Co:12 In:16 Wi:12 Ch:12 Chaotic
Dlvl:4 $:320 HP:17(17) Pw:12(12) AC:8 Xp:2/26
Current record: 20516. My Barbarian was frozen by a floating eye. Far, far from winning.
I decided to give my iPod a try under Linux (Fedora Core 4, x86_64). For a long time now, I’ve been using Amarok for playing music. Conveniently, it already has a function for transfering files to an iPod under the “Media Device” tab. However, there was a problem.
I added one song, after which the iTunes database file (iTunesDB) was corrupted, showing only a few songs. Note that only the database file was corrupted; the files were still there, but they were orphan in that they could not be accessed by the iPod software. Although I was unable to restore the iTunesDB, a lot of testing showed that, no matter how many or which songs I tried to transfer or delete, it was always only the 256 first songs that were visible.
This 256 songs limit was very confusing. After some research, I found that it was caused by the old Amarok version that I was using (Amarok 1.3.9). Upgrading to the latest stable release (Amarok 1.4.5) should fix the problem, although I’m currently too lazy and will have to settle with 256 files.
Even if you have given up your dreams of making it to the first pages of Digg and Slashdot, there’s lots of traffic out there orbiting the A-list sites, just waiting to be tapped into. I discovered the potential of Lifehacker by chance.

Lifehacker is not too keen on advertising your personal URL — instead, people have to follow a link to your profile, and can get further through there. This discourages many from being helpful and giving comments, since they feel that they are not given enough back. However, there is one underestimated part of commenting: linking to external sites. Which, coincidentally, happen to belong to you.
In the beginning of this year, I tried biphasic sleep. I resigned, though, since it was incompatible with my social life. Very timely, a post showed up on Lifehacker a month later about Power napping. Sharing my experiences, I’ve got 300 hits from that page in less than a month, and my comment was not even among the first five.
The point is that 10 hits a day is a lot for any small blog. I recommend subscribing to Lifehacker, if not for its excellent content, then for this reason. You don’t really need experience, either: just read up quickly on the subject, post a post, post a comment, and watch the traffic rolling in.
I was going to expand my guide archive for Hellbound Hackers, but when I went to HellboundHackers.org I saw the following:
This Account Has Been Suspended
If you are the owner of this web site, please contact the billing/support department as soon as possible.
Telephone: +44 (0870) 922 0465
Contact Us: http://support.ukhost4u.com/
Web Site: http://www.ukhost4u.com/
This must have happened recently — Google currently has a working cache from 11 Apr 2007 23:21:02 GMT. Is this going to be like the GoDaddy/Nmap incident? Hopefully the site will get back up soon. It had a lot of interesting missions.
Update 19:30 GMT: The site now returns a 403 Forbidden error.
I figured that I lose way too much time watching movies, even though I do all I can in order to multitask it efficiently. Following Devin Reams’s example, I’m going to start reviewing what I watch. Although the wp-review plugin is excellent (I use it on my Swedish blog), I decided to keep to posting in categories because it seems more scalable.
Expect a couple of consecutive reviews coming, since I’ve got to review everything I’ve watched so far this month in order to feel effective.
A post from a LiveJournal blog showed up in my RSS reader along with its full content. I couldn’t remember that blog, and so I followed the accompanying link to the post.
Error. You must be logged in to view this protected entry.
Unfortunate for you, MySpace (and blog-owner), your feed is not protecting very well.
I just got this error when I tried to read an email from my inbox in Gmail:
Oops… the system was unable to perform your operation (error code 766).
Please try again in a few seconds.
The text was in a Javascript alert-box, and it appeared twice when I refreshed the page. It worked when I tried again after a few seconds, just like the error message said.
Earlier Posts »