Thursday, 10 May 2012
Why we have a recession:
When you borrow money to spend, you are spending tomorrows money today and agreeing that you will therefore not be able to spend it tomorrow.
It's now tomorrow.
Today's money was spent by the labour government along with yesterdays money.
While cutting back spending won't "recover the economy" right now, there isn't actually much left to spend. Borrowing even more will just rob our children of even more of their future.
If you think spending is important to maintain the economy, then don't spend tomorrows money today - or you can expect a bleak tomorrow.
Did I mention that it is tomorrow?
Labour have been very generous to you and your friends by maxing out your credit card.
Tuesday, 8 May 2012
Dolphins and Discrimination
I wrote this allegory to capture observations on discrimination that would not be safe to utter plainly. There are at least three lessons here.
(C) Sam Liddicott 2012
There were some Dolphins on the windward side of an Island. Like most dolphins, they sometimes behaved aggressively toward each-other.
There were some Dolphins on the leeward side of the Island. Like most dolphins, they sometimes behaved aggressively toward each-other.
In time, some of the windward dolphins became particularly aggressive towards the leeward Dolphins, for no other reason than that they were leeward dolphins, and often hunted them out, or ganged up to attack lone dolphins. This became a particular concern for the leeward Dolphins who began to question their own aggressiveness between each-other.
In time, the attacks of the windward dolphins became so aggressive that the leeward dolphins would often be severely wounded or killed. Sometimes the leeward Dolphins would respond with violent attacks of their own but these did little to change the persistent behaviour of some of the windward dolphins.
When the continual violence of the windward dolphins became too much to bear, the great dolphin sent an Orca to deliver this message:
That although they were all brothers, the windward dolphins would in future be reborn as leeward dolphins, both to experience the effects of their behaviour and perhaps in time to temper the violence of the windward dolphins to their own reborn brothers.
The leeward dolphins were horrified when they heard this. They idea of living with and sharing life and love with those who had so badly treated them - and not be able to recognise them - was repugnant to them and made light of their injuries (they said).
Don't worry, said the orca, they will continue to behave violently towards those who do not appear the same as themselves, and so you will know who they are. Don't hate them, or you may become like them; love them because they will also protect you from the windward dolphins.
I count at least three morals in this tale.
Dolphins - an allegory on discrimination
(C) Sam Liddicott 2012
sam@liddicott.com
There were some Dolphins on the windward side of an Island. Like most dolphins, they sometimes behaved aggressively toward each-other.There were some Dolphins on the leeward side of the Island. Like most dolphins, they sometimes behaved aggressively toward each-other.
In time, some of the windward dolphins became particularly aggressive towards the leeward Dolphins, for no other reason than that they were leeward dolphins, and often hunted them out, or ganged up to attack lone dolphins. This became a particular concern for the leeward Dolphins who began to question their own aggressiveness between each-other.
In time, the attacks of the windward dolphins became so aggressive that the leeward dolphins would often be severely wounded or killed. Sometimes the leeward Dolphins would respond with violent attacks of their own but these did little to change the persistent behaviour of some of the windward dolphins.
When the continual violence of the windward dolphins became too much to bear, the great dolphin sent an Orca to deliver this message:
That although they were all brothers, the windward dolphins would in future be reborn as leeward dolphins, both to experience the effects of their behaviour and perhaps in time to temper the violence of the windward dolphins to their own reborn brothers.
The leeward dolphins were horrified when they heard this. They idea of living with and sharing life and love with those who had so badly treated them - and not be able to recognise them - was repugnant to them and made light of their injuries (they said).
Don't worry, said the orca, they will continue to behave violently towards those who do not appear the same as themselves, and so you will know who they are. Don't hate them, or you may become like them; love them because they will also protect you from the windward dolphins.
I count at least three morals in this tale.
Stop facebook intercepting your links
Are you are fed up with posting links to face book (guardian, yahoo, etc) and find that when your friends follow the link they are forced to accept intrusive facebook apps in order to read the link?
then you may want to prefix your link with this before pasting into facebook:
http://www.google.co.uk/url?sa=t&url=
to effectively paste a link like this:
http://www.google.co.uk/url?sa=t&url=http://uk.news.yahoo.com/rare-type-storm-sparks-tornado-210613161.html
When your facebook users click on the link, instead of being forced to accept the oppresive Yahoo facebook app, they will see this:
Which will allow them to follow on to the link in a civilised fashion.
NOTE: When adding your link on to the end of http://www.google.co.uk/url?sa=t&url= make sure you include the http:// part of the link you are copying.
then you may want to prefix your link with this before pasting into facebook:
http://www.google.co.uk/url?sa=t&url=
to effectively paste a link like this:
http://www.google.co.uk/url?sa=t&url=http://uk.news.yahoo.com/rare-type-storm-sparks-tornado-210613161.html
When your facebook users click on the link, instead of being forced to accept the oppresive Yahoo facebook app, they will see this:
Which will allow them to follow on to the link in a civilised fashion.
NOTE: When adding your link on to the end of http://www.google.co.uk/url?sa=t&url= make sure you include the http:// part of the link you are copying.
Sunday, 8 April 2012
Gather Ye Chocolates
Another in my series of classic poetry re-worked for modern times.
Old timers still a-trying :
For easter eggs that melt to-day
To-morrow will be frying
The baking heat of heaven, the sun
The hotter it is getting
The sooner chocolate starts to run
And spoil your dress, upsetting
That aged beast which at the first,
Would tend your clothes and laundry ;
But having over eat the, worst
stains leave you in a qaundry.
The bean of cocoa speed your time,
And while ye may go carry :
For having lost your chocolate time
You may be very sorry.
The original, below, makes valid points, but perhaps intersects less with the mind of modern woman than my revision.
Old time is still a-flying :
And this same flower that smiles to-day
To-morrow will be dying.
The glorious lamp of heaven, the sun,
The higher he's a-getting,
The sooner will his race be run,
And nearer he's to setting.
That age is best which is the first,
When youth and blood are warmer ;
But being spent, the worse, and worst
Times still succeed the former.
Then be not coy, but use your time,
And while ye may go marry :
For having lost but once your prime
You may for ever tarry.
To the Young Ladies, To Take Much Chocolate At The Easter Egg Hunt
by Sam Liddicott
Gather the choc'lates a'fore it's May.Old timers still a-trying :
For easter eggs that melt to-day
To-morrow will be frying
The baking heat of heaven, the sun
The hotter it is getting
The sooner chocolate starts to run
And spoil your dress, upsetting
That aged beast which at the first,
Would tend your clothes and laundry ;
But having over eat the, worst
stains leave you in a qaundry.
The bean of cocoa speed your time,
And while ye may go carry :
For having lost your chocolate time
You may be very sorry.
The original, below, makes valid points, but perhaps intersects less with the mind of modern woman than my revision.
TO THE VIRGINS, TO MAKE MUCH OF TIME.
by Robert Herrick
GATHER ye rosebuds while ye may,Old time is still a-flying :
And this same flower that smiles to-day
To-morrow will be dying.
The glorious lamp of heaven, the sun,
The higher he's a-getting,
The sooner will his race be run,
And nearer he's to setting.
That age is best which is the first,
When youth and blood are warmer ;
But being spent, the worse, and worst
Times still succeed the former.
Then be not coy, but use your time,
And while ye may go marry :
For having lost but once your prime
You may for ever tarry.
Tuesday, 20 March 2012
local variables are great
In the last few months I have really come to appreciate what perl and bash local variables really are. And it took a better understanding of list/scheme/tex/texmacs, and a couple of years to think about it.
And my bash scripts are more and more lisp-like using extreme parallelisations and local variables.
This bash function takes the name of a variable as a first argument and returns in this argument a free file descriptor number, rather like C's fopen(). The second argument can be the lowest file descriptor to choose from, but it defaults to the current value of the variable whose name is given in the first argument. The third argument is the highest value to work to, and defaults to 254.
The shell function closes stderr as it uses stderr for fdup to test if a destructor is in use. Ironically to close stderr, bash has to save it in another file descriptor - but internally bash can find one that is free, something that this function is written to do! But this means that this function will never allocate the descriptor in temporary use to save stderr even though that descriptor will be free when this function exits. Thus while this function can allocate a free descriptor it may miss some that were free. C'est la vie.
fd_allocate() {
set "$1" "${2:-${!1:-3}}" "${3:-254}"
printf -v "$1" ""
while test "$2" -le "$3"
do
if ! : 2>&"$2"
then printf -v "$1" "%s" "$2"
return
fi
set "$1" "$(( $2 + 1 ))" "$3"
done
return 1
do_something() {
The results (stdout) can then be reaped like this ($? cannot be obtained, if you want it, emit it to stdout):
}
Of course cat </dev/fd/$fd might do instead of read
However, all these uses of local are abusive and ideally I do want scoped variables in bash too. In fact fd_allocate was specially written to not use any local variables but to re-write it's parameters instead.
But the point is I can reap the parallised results in the right local environment without having to pass parameters. This becomes more useful as I factor my code which is written using literate programming techniques; and so I now longer write linear functions but instead compose fragments of code, and of course in this context, the environment of local or scoped variables becomes an implicit API, and so this is the situation in which I find myself understanding the power of local variables or the environment.
Local variables are visible to all subsequently called functions and so reduce the burden to pass a lot of parameters (something which C++ tries to ameliorate with default parameters) or objects of parameter sets.
Local variables are part of the environment exposed to called functions.
C could never really have local variables.
And my bash scripts are more and more lisp-like using extreme parallelisations and local variables.
This bash function takes the name of a variable as a first argument and returns in this argument a free file descriptor number, rather like C's fopen(). The second argument can be the lowest file descriptor to choose from, but it defaults to the current value of the variable whose name is given in the first argument. The third argument is the highest value to work to, and defaults to 254.
The shell function closes stderr as it uses stderr for fdup to test if a destructor is in use. Ironically to close stderr, bash has to save it in another file descriptor - but internally bash can find one that is free, something that this function is written to do! But this means that this function will never allocate the descriptor in temporary use to save stderr even though that descriptor will be free when this function exits. Thus while this function can allocate a free descriptor it may miss some that were free. C'est la vie.
fd_allocate() {
set "$1" "${2:-${!1:-3}}" "${3:-254}"
printf -v "$1" ""
while test "$2" -le "$3"
do
if ! : 2>&"$2"
then printf -v "$1" "%s" "$2"
return
fi
set "$1" "$(( $2 + 1 ))" "$3"
done
return 1
} 2>&-
This function is used for high parallelisation like this:do_something() {
local fd=4 things for thing in "$@" do if fd_allocate fd && exec 3< <( something "$thing" ) then eval "exec $fd<&3 3<&-" things[$fd]="$thing" else # spawn failed, do foreground instead echo "Output for $thing:" something "$thing" fi doneThe results (stdout) can then be reaped like this ($? cannot be obtained, if you want it, emit it to stdout):
local output for fd in ${!things[@]} do thing = ${!things[$fd]} read -d "" -u $fd output echo "Output for $thing: $output" done}
Of course cat </dev/fd/$fd might do instead of read
However, all these uses of local are abusive and ideally I do want scoped variables in bash too. In fact fd_allocate was specially written to not use any local variables but to re-write it's parameters instead.
But the point is I can reap the parallised results in the right local environment without having to pass parameters. This becomes more useful as I factor my code which is written using literate programming techniques; and so I now longer write linear functions but instead compose fragments of code, and of course in this context, the environment of local or scoped variables becomes an implicit API, and so this is the situation in which I find myself understanding the power of local variables or the environment.
Local variables are visible to all subsequently called functions and so reduce the burden to pass a lot of parameters (something which C++ tries to ameliorate with default parameters) or objects of parameter sets.
Local variables are part of the environment exposed to called functions.
C could never really have local variables.
Tuesday, 6 March 2012
Update Acer Aspire Bios
The readme file for the Acer Aspire BIOS update requires that FLASHIT.EXE and the BIOS file are copied to a dos-bootable disk.
Well... the Acer Aspire netbook does not have a floppy drive, and who these days can conveniently get a boot image working off USB? I can, but it's too much hassle (it involves loading a file system image as a ramdisk, blah blah boring boring).
But I find that there is a secret BIOS mode that let's the netbook flash it's own BIOS!
http://www.qrpcw.com/2009/01/acer-aspire-one-bios-recovery.html
I quote for posterity's sake:
Well... the Acer Aspire netbook does not have a floppy drive, and who these days can conveniently get a boot image working off USB? I can, but it's too much hassle (it involves loading a file system image as a ramdisk, blah blah boring boring).
But I find that there is a secret BIOS mode that let's the netbook flash it's own BIOS!
http://www.qrpcw.com/2009/01/acer-aspire-one-bios-recovery.html
I quote for posterity's sake:
First format an USB stick with FAT.Also, thanks to http://macles.blogspot.com/2008/08/acer-aspire-one-bios-recovery.html
Download the latest BIOS, and put both FLASHIT.EXE and the BIOS file in the root directory of the stick. Rename the BIOS file to ZG5IA32.FD, that's important. Do not remove the USB stick.
Turn the AA1 off, make sure both battery and AC adapter are connected. Press Fn+Esc, keep it pressed and press the power button to turn the AA1 on. Release Fn+Esc after a few seconds, the power button will be blinking. Press the power button once. The AA1 will now initiate the BIOS flash, do not interrupt it under any circumstances. After a while the power button will stop blinking, and the AA1 will reboot shortly after. Wait patiently.
The BIOS has been flashed and all settings reset to default.
If for some reason you made a mistake during the procedure and it doesn't reboot by itself wait 5 minutes before turning it off, just to be safe that it isn't still flashing the BIOS.
Thursday, 2 February 2012
HP Displayport Adaptor on Mint or Ubuntu
[Note: updated information here]
I post a correction on these notes: http://libdlo.freedesktop.org/wiki/DeviceQuirks which over-specify /sys (as well as hard-wiring it) as well as bConfigurationValue.
/usr/bin/dlconfig:
/etc/udev/rules.d/60-displaylink.rules
# DisplayLink devices always have the active configuration on configuration #1
SYSFS{idVendor}=="17e9", SYSFS{bConfigurationValue}=="2", RUN+="/usr/bin/dlconfig %S%p"
These cause the VGA adaptor to be intialized properly on each insert.
I post a correction on these notes: http://libdlo.freedesktop.org/wiki/DeviceQuirks which over-specify /sys (as well as hard-wiring it) as well as bConfigurationValue.
/usr/bin/dlconfig:
#! /bin/bash
if [ -e "$1"/device/bConfigurationValue ]; then echo 1 > "$1"/device/bConfigurationValuefi;
if [ -e "$1"/bConfigurationValue ]; then echo 1 > "$1"/bConfigurationValuefi;
/etc/udev/rules.d/60-displaylink.rules
# DisplayLink devices always have the active configuration on configuration #1
SYSFS{idVendor}=="17e9", SYSFS{bConfigurationValue}=="2", RUN+="/usr/bin/dlconfig %S%p"
These cause the VGA adaptor to be intialized properly on each insert.
Subscribe to:
Posts (Atom)

