Scale — “digits, yes please”

Just now and again one need a one-liner [0]. Just now and again it’s executed in bash [1]. Just now and again it involves some calculation. And just now and again it easy to do those things with bc [2] as it can read from standard input [3]. But at exactly those “now and again” times I normally find that bc truncates and returns only the integer part. Which at a subset of those “now and again” times are just not good enough. F.x.: one might be fuzzy about the resolution when counting how many keystrokes there are to go in order to have produced the scheduled amount of text for the day.

But fortunately I today got wiser; I met the scale variable in bc. It properly still truncates but now I can set a resolution that at least satisfy my fuzziness issue, which means I can now M-! my way to the following one-liner to get what i want.

C=`wc -c main.tex | cut -c 4-8`; P=`echo "scale=4; ${C}/2400" | bc`; echo ${C}c, ${P}p

Bliss. Back to work.

[0] http://en.wikipedia.org/wiki/One-liner_program
[1] http://www.gnu.org/software/bash/
[2] http://www.gnu.org/software/bc/
[3] http://en.wikipedia.org/wiki/Standard_input#Standard_input_.28stdin.29

A bid on my soul

This morning I found this in my inbox…

To: madsen@sjovedyr.dk
Date: Tue, 14 Feb 2006 02:21:23 -0500
Subject: php contract work
From: #####@########.org

I saw your ad posted on phpbuilder.com for php contract work.

I have a survey form / MySQL database project I am working on and am wondering
how much you would charge to complete it.

Here is a link to the form, and what I am looking for is explained there:

http://www.friendsofdenmark.us/.

If you want to call, my number in Washington, DC is ### ### ####

Thanks,

##### ######

From IP Address: ##.##.###.##
From Browser: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5)
Gecko/20060111 Netscape/8.1

Two words: Hell no!

Magnet poetry with Ajax

Based on DOM-Drag (which is really nice btw), I hacked up a little thingy for the Migato Estalo Co. website. (It’s in danish, but you know the concept.)

I’m growing more and more fond of Ajax (or rather XMLHttpRequest). It’s really nice, but unfortunately it’s not very Lynx-/Links-friendly, but I guess that’s the price to pay and I guess it’s all part of development. (I mean, you usually ditch something old in favour of something newer and smarter - though not necessarilly better in every respect.)

phpCF 0.3 released

This release of phpCF features:

  • Incorporation of the Lillesvin Networks blacklist (text/plain version) - possibly more blacklists will be supported in future releases.
  • Better testing for HTML
  • Configuration to allow specific HTML tags, thus excluding them when testing for HTML
  • Better debugging methods
  • Removal of disabled checks in the instance-log

Go get it at http://lillesvin.net/phpcf!

Lillesvin Networks serving online game

It’s true! It’s nothing fancy really (you’ll understand when you see it), but it’s a game non the less. And it has an online Top 10, so you can compete with others! It’s really simple, highly addictive, non-violent, non-sexual … pretty much non-anything - just the way some americans (e.g. from Michigan) like it. Who knows, I could start chargin a monthly fee for playing - I could make billions! Muahahaaa!

Ok, I’ve been taking to much of your precious time - here’s the game! Enjoy!

 Theme Brought to you by Directory Journal and Elegant Directory