Does your hard disc drive (hdd) appear to be slower than before?

March 13th, 2007 by andreas

Mine did, anyway. I have a ThinkPad R52 which I have been running with the same installation of Windows XP from the day I got it, approximately 19 months ago. Recently I’ve noticed that disk operations were slow and required huge amounts of cpu cycles (mainly kernel mode) causing excessive delay in my interactive programs. This appeared a lot like DMA issues we experienced in the MS DOS-days.

The Windows Device manager reported that my hdd was in fact not in UDMA-5 mode but PIO. Several attempts at switching back to DMA proved worthless. Hacking Windows Registry or debugging possibly faulty hardware isn’t exactly my idea of fun, so I was very pleased when a random search on Google directed me to this thread at www.techimo.com. Long story short, a new version of a SATA Power management driver for Windows 2000/XP provided by Lenovo magically resolved the issue. The problem is listed in the driver’s changelog under version 1.2 “(Fix) Solves a hard drive being slow due to change the transfer mode from UDMA-5 to PIO. (This will resume to the UDMA-5 mode at installation time)'’

What caused the switch from UDMA-5 to PIO initially is nothing I care to find out about, but I guess it can be traced back to a particular Microsoft Windows Update. Since I haven’t done anything out of the ordinary in the configuration of my laptop, I suspect a lot of other ThinkPad owners share my experience.

Posted in Software, Hardware | No Comments »

Remind - a sophisticated calendar and alarm program

February 2nd, 2007 by andreas

I’ve been using Remind for several years now, with great success. For instance, I’ve put Remind in charge of reminding me of upcoming birthdays, whether it is relatives or friends, giving me a fair chance of greeting them or buying a present in advance. The scripting language is a bit overwhelming, but instructing Remind to remind you about simple repetetive events or one-time-events is quite simple. The fun, and perhaps frustration, begins when you need to deal with moving holidays and other exceptions.

Remind by itself is a console application, but several front/back-ends have been written for Remind, making it attractive for those of us who prefer graphical user interfaces.

I run Remind from my console every time I log in, using the following technique in /etc/profile

if [ -f ~/.reminders ]; then
/usr/bin/remind
fi

To give the reader an introduction to Remind syntax, I’ve prepared a couple of simple Remind rules.


# Remind me 14 days in advance that andreasblaafladt.com expires on 2008-01-02
rem 2 Jan 2008 +14 MSG andreasblaafladt.com expires %b


# I pay the rent the 1st of every month, but I like to be reminded a week in advance
rem 1 +7 MSG Rent is due %b


# I have a meeting at a particular day at a given time.
rem 13 feb 2007 +7 AT 18:30 MSG Meeting with John Doe %b

%b is replaced with a text indicating how many days there’s left to the given date. There’s a wealth of substitution sequences, read the manpage for details.

Now that we’re over the basics, I’ll try to demonstrate some of the power of Remind while still keeping it simple.


# I report and pay taxes the 10th of every second month, or the following monday if the 10th is a saturday or sunday.
# Example output: taxes on 12/02/2007 (in 10 days' time)
rem 10 Mon, Tue, Wed, Thu, Fri +15 SATISFY [monnum(trigdate()) % 2 == 0] MSG taxes %e (%b)


# Function which returns a string with the difference (in years) between yr and the day of the trigger
FSET _yr_num(yr) ORD(YEAR(TRIGDATE()) - yr)


# Here's a rule for reminding me about a birthday (30 days ahead)
# and using the above function to calculate age dynamically every year.
# Example output: John Doe 27th bursdag in 32 days' time
REM 6 Mar +30 MSG John Doe [_yr_num(1980)] birthday %b

Using the tools shipped with Remind you can easily generate a calendar in postscript format handy for printout.

The following command gives you a single-paged pdf document with the current month and all your defined events in a nice calendar layout, suitable for distribution or printing out and keeping on the refrigerator.

$ remind -p -m -c1|rem2ps -m A4 -l -e |ps2pdf - > calendar-`date '+%G-%b'`.pdf

All in all, remind is both powerful and extemely useful for describing repetetive events with or without exceptions.

Posted in Software | 1 Comment »

CRM114 - the Controllable Regex Mutilator

January 28th, 2007 by andreas

Last week I spent quite a lot of time on CRM114 which according to the website is “a system to examine incoming e-mail, system log streams, data files or other data streams, and to sort, filter, or alter the incoming files or data streams according to the user’s wildest desires. Criteria for categorization of data can be via a host of methods, including regexes, approximate regexes, a Hidden Markov Model, Orthogonal Sparse Bigrams, WINNOW, Correllation, KNN/Hyperspace, or Bit Entropy ( or by other means- it’s all programmable).”

CRM114’s programming language is not similar to anything I’ve seen before, with it’s declensional syntax instead of the more common ordinary positional syntax, strange keywords and lack of types (Everything is a String), but once you get ahold of it all, the author promises that you’ll be able to “write the filter of your dreams”.

A couple of example programs
First, a ROT13 implementation.

#!/usr/bin/crm
translate /a-zA-Z/ /n-za-mN-ZA-M/
accept

This code takes input from stdin and gives output to stdout.
Example

$ echo "CRM is so great."|./rot13.crm
PEZ vf fb terng.

A Reverse Polish Notation calculator

#!/usr/bin/crm
{
eval (:_dw:) / :@:R:*:_dw: : /
output /:*:_dw:\n/
}

Example usage

$ echo "2 5 2 * + 5 +"|./rpn.crm
17

But the real strengths of CRM114 lies in it’s ability to learn and classify text and other streams of data. At this point, CRM114 has seven different classifiers with different advantages. Some can do N-way choices while others do simple Yes/No-choices.

Posted in Software, MSc | No Comments »

How to get research done

January 16th, 2007 by andreas

Last week I attended a short presentation given by Mark Burgess entitled “How to get research done”. While I’ve heard most of the advices before, it still seems valuable to repeat them from time to time. So without further introduction, here’s some key elements:

Just do it!

  • It’s better to try and fail, at least you will learn something
  • Don’t wait until you think you are sure

Time management

  • Plan for the next day while your head is still focused on your work
  • Stop when you believe you know how to proceed the following day
  • Avoid interrupting progress by taking unnecessary breaks.

How to make progress

  • Dream of your long term ambitions but focus on immediate goals
  • Always have a TODO list
  • Set aside whole days for research and postpone trivia
  • Give priority to things that move you forward

Interruption management

  • Protect yourself from interruptions or you will exhaust yourself doing nothing
  • Consider shutting down applications and devices that provides email, sms, IM and music

Read, read, read

  • Read about anything, not just things you think are relevant
  • Your brain needs all kinds of food, not just specific nutrients — don’t be a vitamin freak
  • You don’t have to understand everything to get something out of it

Write, write, write

  • Always have a notebook in range
  • Write down thoughts and ideas, it’s never as clear as you think it is when it’s in your head only

Optimise work and rest

  • Make sure you sleep and eat properly
  • Exercise

Posted in MSc | No Comments »

First post on andreasblaafladt.com

January 4th, 2007 by andreas

This is my first post in this new publicly available blog.

Posted in Uncategorized | No Comments »