Programming

New Look and WordPress Bug

Posted in Computers, Lillesvin Networks, Programming, Software on August 13th, 2009 by Anders K. Madsen – 3 Comments

I accidently stumbled across this nice WordPress theme by Rob Goodlatte, which automatically increases/decreases the font size depending on the size of the browser window in order to maintain a sensible and readable line length. I’m still not entirely through modifying it (the CSS is a bit of a mess and I’ve found several inconsistencies throughout the theme) and I’m not quite sure how well the dynamic font size works with regards to accessibility, but what the hell — it’s easy enough to switch back to the old theme again should this turn out to not work as expected, so let’s just give it a go.

Actually, I stumbled across this theme because I had to do an urgent upgrade of WordPress because of a nasty, nasty flaw recently discovered and described on Full Disclosure. Basically it allows anyone to reset the admin password effectively locking out the standard admin user, so if you’re running WordPress, make sure to update to the latest version at once — and upgrading is not that hard. I upgraded from an ancient version without a single problem (that I know of).

phpCF 0.5b — “Who would have thunk it?” edition!

Posted in Computers, PHP, Programming, Software, phpCF on May 5th, 2009 by Anders K. Madsen – Be the first to comment

phpCF version 0.5 beta is just done (after almost 4 years!) and commited to the repository. Among the changes are a completely new and more managable rules system, that allows for easy rules writing while still allowing for even more flexibility than previous versions. I’ll tag a release, upload tar-balls and update the phpCF page as soon as I get home from work tonight. See the ChangeLog for a more detailed list of changes.

Update (May 5 2009 @ 4:32 AM): The phpCF page is now updated and with links to tar-balls, docs and stuff.

Scale — “digits, yes please”

Posted in Programming on December 15th, 2007 by Steffen – 6 Comments

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

Posted in Computers, Life, Programming, The World on February 15th, 2006 by Anders K. Madsen – 2 Comments

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

Posted in Computers, Fun Stuff, Programming on November 23rd, 2005 by Anders K. Madsen – 8 Comments

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.)