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.
Tuesday, 8 May 2012
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.
Monday, 14 November 2011
More classic quotes reworked for the times
A rose by any other brand would sell more cheap.
Ask not what you can do with the country side, with the country side you can do - for a fee.
Ask not what you can do with the country side, with the country side you can do - for a fee.
Sunday, 13 November 2011
More classics updated: The Rubáiyát
The classic Rubáiyát of Omar Khayyám is beyond my reach, but I can speculate on what might have been written had the author possessed the fore-sight of Nostradamus.
Thus:
The press-ed finger spraying coloured scrit
moves in the night, with daubs of teenage wit
Though teacher calls to write a dozen lines
in tears of boredom motionless they sit
might have been rendered instead of the classic and more well known:
The Moving Finger writes; and, having writ,
Moves on: nor all thy Piety nor Wit,
Shall lure it back to cancel half a Line,
Nor all thy Tears wash out a Word of it.
It lacks the gravitas of the original but this is perhaps more than compensated for by the more comprehensive embodiment of the modern daily experience of many of us, which after all is what I feel the poet was striving for.
And which of us doesn't truly appreciate the lack of power that any amount of tears or frustration can exercise over the leaving bell?
Were I not able to express it so concisely I would go on with more verses as did the poet of old, but I feel that the reader will rightly be able to grasp my position.
I also feel it unnecessary to emphasis the difficulty in removing graffiti, a point which seemed to obsess the poet which caused him to labour the point.
Thus:
The press-ed finger spraying coloured scrit
moves in the night, with daubs of teenage wit
Though teacher calls to write a dozen lines
in tears of boredom motionless they sit
might have been rendered instead of the classic and more well known:
The Moving Finger writes; and, having writ,
Moves on: nor all thy Piety nor Wit,
Shall lure it back to cancel half a Line,
Nor all thy Tears wash out a Word of it.
It lacks the gravitas of the original but this is perhaps more than compensated for by the more comprehensive embodiment of the modern daily experience of many of us, which after all is what I feel the poet was striving for.
And which of us doesn't truly appreciate the lack of power that any amount of tears or frustration can exercise over the leaving bell?
Were I not able to express it so concisely I would go on with more verses as did the poet of old, but I feel that the reader will rightly be able to grasp my position.
I also feel it unnecessary to emphasis the difficulty in removing graffiti, a point which seemed to obsess the poet which caused him to labour the point.
Subscribe to:
Posts (Atom)

