Half person, half home automation, an under loved blog for all things Ruby, python and more in Adelaide
Wednesday, November 30, 2005
Get Your Firefox 1.5 On!
Do it, or the web standards zealots will eat you.
A few more reasons why, as well. CSS3 Cursors, anyone?
A few more reasons why, as well. CSS3 Cursors, anyone?
Ajaw: Javascript + Semantic Web
This is new snippet of RDF browsering magic - only works for documents at the w3c, at the moment though.
In other news, don't miss your next Gopher Con Roundup!
In other news, don't miss your next Gopher Con Roundup!
Friday, November 25, 2005
Tuesday, November 22, 2005
The System... Seems Broken
I got very very very very very drunk, as is usual on a Saturday.
I have no memory of the hours of 3am to 7am. What I do recollect is losing my jacket in a club which was located somewhere I just don't know about.
I spent the next few hours of my sunday, drunk as shit, riding around asking people if perhaps they'd seen a secret underground backalley club in these parts?
Result:
No debit card, no ID, no jacket. Initially, I was most upset about the jacket. It's worth $400 or so, and I got it when I was 16, I love that jacket.
Now, however, my mind has turned to other things. Every other time I have had to have my debit card reissued it was a matter of going to the bank and telling them my details. I lose my shit every few months so you'd think they'd know I'm a regular. The process consists of answering security questions about who I am, where the account was opened, my uber password, etc. Then they get the original bank to fax over my signature and I sign on a bit of paper to prove that I am infact who I say I am.
Usually; they just reissue my damned card and I'm able to eat again. This time, they said "Not Without Your Photo ID".
Right. Fucker. How, exactly, do you propose I do that? That is missing in action too. Oh, that's your grand idea? Get my birth certificate (I lose track of it all the time) and pop down to the Dept. Motor Vehicles and such, get them to bash out a new ID?
That's a fucking grand plan - you can acknowledge that I am who I say I am, *give me money from my account*, but you refuse to issue me a debit card so that every time I need money I have to waste 30 minutes of everyone's time.
I'm the one who's told you every damned detail in the record you have infront of you, right up to how much I spent on alcohol on the weekend and where I did that from, and you want to refuse to believe I'm who I say I am?
Rrr.
Alright, it's time to go to DMV and sort stuff out. I have a bit of paper from the tax dept, a signature, proof of my address, etc. I know that they store my photo on the system - it's a digital camera and it's stashed on records.
I know it's not going to be enough.
I ask anyway. I don't have a passport. No birth certificate. What about the temporary licence you issued me less than a month ago, which has my DOB, signature, name, address, licence number, etc on it - you guys issued it and it legally entitled me to drive around, etc etc.
No: We don't trust the paperwork we issued to you. No: we can't simply LOOK at the photo on record of YOU and compare YOUR FACE to OUR RECORDS.
So: that's it. I'm too disgruntled to fix it. I lose my ID + access to money every few months, and I'm sick of it. Work won't pay me except by cheque, which I don't have an account to deposit it into. I don't care about the privacy implications, I don't care about people doing malicious things with my private information: I would give anything to have them just keep my DNA on record, everywhere.
It would give me no end of satisfaction to be able to spit on people, banks, and red tape, every time they wanted to know who I am...
I have no memory of the hours of 3am to 7am. What I do recollect is losing my jacket in a club which was located somewhere I just don't know about.
I spent the next few hours of my sunday, drunk as shit, riding around asking people if perhaps they'd seen a secret underground backalley club in these parts?
Result:
No debit card, no ID, no jacket. Initially, I was most upset about the jacket. It's worth $400 or so, and I got it when I was 16, I love that jacket.
Now, however, my mind has turned to other things. Every other time I have had to have my debit card reissued it was a matter of going to the bank and telling them my details. I lose my shit every few months so you'd think they'd know I'm a regular. The process consists of answering security questions about who I am, where the account was opened, my uber password, etc. Then they get the original bank to fax over my signature and I sign on a bit of paper to prove that I am infact who I say I am.
Usually; they just reissue my damned card and I'm able to eat again. This time, they said "Not Without Your Photo ID".
Right. Fucker. How, exactly, do you propose I do that? That is missing in action too. Oh, that's your grand idea? Get my birth certificate (I lose track of it all the time) and pop down to the Dept. Motor Vehicles and such, get them to bash out a new ID?
That's a fucking grand plan - you can acknowledge that I am who I say I am, *give me money from my account*, but you refuse to issue me a debit card so that every time I need money I have to waste 30 minutes of everyone's time.
I'm the one who's told you every damned detail in the record you have infront of you, right up to how much I spent on alcohol on the weekend and where I did that from, and you want to refuse to believe I'm who I say I am?
Rrr.
Alright, it's time to go to DMV and sort stuff out. I have a bit of paper from the tax dept, a signature, proof of my address, etc. I know that they store my photo on the system - it's a digital camera and it's stashed on records.
I know it's not going to be enough.
I ask anyway. I don't have a passport. No birth certificate. What about the temporary licence you issued me less than a month ago, which has my DOB, signature, name, address, licence number, etc on it - you guys issued it and it legally entitled me to drive around, etc etc.
No: We don't trust the paperwork we issued to you. No: we can't simply LOOK at the photo on record of YOU and compare YOUR FACE to OUR RECORDS.
So: that's it. I'm too disgruntled to fix it. I lose my ID + access to money every few months, and I'm sick of it. Work won't pay me except by cheque, which I don't have an account to deposit it into. I don't care about the privacy implications, I don't care about people doing malicious things with my private information: I would give anything to have them just keep my DNA on record, everywhere.
It would give me no end of satisfaction to be able to spit on people, banks, and red tape, every time they wanted to know who I am...
Monday, November 21, 2005
Pyramids
<?php $max = 70; for ($i=0;$i<$max;$i++) { for ($j=0;$j<$i;$j++) { print "#"; } print "\n"; } for ($i=$max;$i>0;$i--) { for ($j=0;$j<$i;$j++) { print "#"; } print "\n"; } ?>You wonder why IRC flooders don't just use the above ....
reisio: #
reisio: ##
reisio: ###
reisio: ####
reisio: #####
MDCore: Don't you have work to do? !?
reisio: ####
reisio: ###
reisio: ##
reisio: #
Wisdoms for a Monday
- Never underestimate the tenacity of an end user who wants their button back.
- The more useless a button was to a user in their role, the louder they yell for it back.
- "New online report" and "New uploaded report" make perfect sense only within the bounds of the IT dept.
- Having different coding styles for every developer works wonders in a small development team. If your coders tend to refactor as they read to their style (and ours do), you can always see at a glance who touched code last. Then you can hit them for breaking it.
- The compliance department, which does the QA on the final product and is generally feared as "a terrifying component of a giant killing machine" likes smiley faces embedded in their error pages.
Thursday, November 17, 2005
Shanti's New Clothes
This website proudly supports Firefox.
Download Firefox - the Better Browser today at:
TheBetterBrowser.com/newer
Tell me this isn't aclickkick ass idea for a business model!
Download Firefox - the Better Browser today at:
TheBetterBrowser.com/newer
Tell me this isn't a
Wednesday, November 16, 2005
Why FreeBSD doesn't rule the world.
irc.dal.net:#freebsd
Am I alone in thinking that if you're bitter about providing support for a product, unhelpful, etc, you're going to give your beloved operating system a bad name?
Had this guy gone, Tell me what's up or actually read what I had written, which I'd think is pretty legitimate in the way of questions, I might be happier now, know a bit more about FreeBSD, and talk it up to whomever I ran across that looked remotely interested.
Now, I'm a bit vicious in ##php and #web sometimes, and I'll poke fun at poor n00bs a bit, but I don't usually make them want to hunt me down and stab me with a rusty spoon, which is how I'm feeling at the moment. Infact, they usually get code/help/links from me, after the initial ribbing.
Back to appeasing the management overlords, and crawling back under my Wednesday 5:30 pm hangover.
Me: The dox I am reading don't seem to mention a central place freebsd looks for fonts, is there such a thing, like on windows?
Ass: I have no idea what you're rambling about.
Me: Situation: There's a server which needs fonts to make graphs to appease our management overlords. I know precisely 0 about freebsd, but I'm the sucker who's got to fix the broken-ness. Is there a central place applications on freebsd look for fonts?
Me: To reiterate: Is there a central location in FreeBSD to schtick fonts?
Ass: I have no clue what you're talking about.
(I read this as "I have no clue")
Me: Look, you either answer "yes, anywhere in $PATH", "yes, /usr/local/share/path/to/freedom/from/assholes/", or no, or NFI.
Ass: Depends on what GUI you're running.
Me: No GUI. PHP wants to find things.
Ass: Depends on what GUI you're running.
Me: Fine, I'll take that as a "anywhere in the $PATH"
Ass: Take it anyway you like, I've helped you plenty.
Me: You've been most unhelpful, infact.
Ass: Do you have any further questions, or would you like to leave?
Me: No further questions, have a nice day.
* You were kicked from #freebsd by Ass (lame.)
Am I alone in thinking that if you're bitter about providing support for a product, unhelpful, etc, you're going to give your beloved operating system a bad name?
Had this guy gone, Tell me what's up or actually read what I had written, which I'd think is pretty legitimate in the way of questions, I might be happier now, know a bit more about FreeBSD, and talk it up to whomever I ran across that looked remotely interested.
Now, I'm a bit vicious in ##php and #web sometimes, and I'll poke fun at poor n00bs a bit, but I don't usually make them want to hunt me down and stab me with a rusty spoon, which is how I'm feeling at the moment. Infact, they usually get code/help/links from me, after the initial ribbing.
Back to appeasing the management overlords, and crawling back under my Wednesday 5:30 pm hangover.
Tuesday, November 15, 2005
Wanted: Embedded Gaim in Google Desktop Sidebar
I want to ditch google talk from my sidebar and go with integrating gaim-vv into it. Why would I, horror of horrors, want to stuff it into an activex component?
Mainly so that I can make it slide off screen when I don't need it!
Now, writing an activex wrapper for oodles and oodles of C is beyond poor old me, but this might be a worthwhile python project: render a buddy list in GDS from gaim.
Mainly so that I can make it slide off screen when I don't need it!
Now, writing an activex wrapper for oodles and oodles of C is beyond poor old me, but this might be a worthwhile python project: render a buddy list in GDS from gaim.
Sunday, November 13, 2005
Six One Seven Four
Kaprekar numbers are the numbers you get when you perform a bunch of operations on a four digit number.
For instance:
4064.
First, rearrange the digits to form the highest and lowest value possible [6440, 0446], subtract the smaller from the larger, and repeat the process.
Within 7 iterations; you'll get Six One Seven Four.
3 digit inputs get you 495.
5 digit numbers, however, get you a series that repeats.
In an effort to learn more python, here's a bunch of code to do 3 and 4 digit patterns. It doesn't cope with recognizing sets, which is a bit beyond me, and it's very hacky foo - there must be some way to use string manipulation functions on numbers without casting here there and everywhere.
Questions:
i. Can you improve the code to make it do the same thing in less code?
ii. Can you add a way to recognise repeating series
iii. Can you modify the code to deal with non-base ten numbers
iv. Can you make pretty graphs?
For instance:
4064.
First, rearrange the digits to form the highest and lowest value possible [6440, 0446], subtract the smaller from the larger, and repeat the process.
Within 7 iterations; you'll get Six One Seven Four.
3 digit inputs get you 495.
5 digit numbers, however, get you a series that repeats.
In an effort to learn more python, here's a bunch of code to do 3 and 4 digit patterns. It doesn't cope with recognizing sets, which is a bit beyond me, and it's very hacky foo - there must be some way to use string manipulation functions on numbers without casting here there and everywhere.
import operator
import copy
def kapreka(number, repeatValue="0"):
if int(number) == int(repeatValue):
return
a, b = "", ""
n = len(number)
stack = []
for i in range(n):
stack.append(int(number[i]))
stack.sort(cmp=lambda x,y: cmp(x, y))
sorted = copy.copy(stack)
stack.sort(cmp=lambda x,y: cmp(x, y), reverse=True)
reversed = copy.copy(stack)
for i in range(n):
a = operator.concat(a, str(sorted[i]))
b = operator.concat(b, str(reversed[i]))
result = str(int(b) - int(a))
print result
if int(result) == 0:
return
kapreka(result, number)
kapreka("6565")
Questions:
i. Can you improve the code to make it do the same thing in less code?
ii. Can you add a way to recognise repeating series
iii. Can you modify the code to deal with non-base ten numbers
iv. Can you make pretty graphs?
What I Actually Did This Weekend, Aside From Building A Plane
I saw Nik Fish, Sgt Slick/Andy J from Smash n Grab, and a shitload of lasers, glowsticks, attractive women, and hard house.

Start 5 pages in and go backwards, from The IBM protest right on through to the lasers and such.
Coding sucks, dancing rocks.

Start 5 pages in and go backwards, from The IBM protest right on through to the lasers and such.
Coding sucks, dancing rocks.
Saturday, November 12, 2005
Thursday, November 10, 2005
How well do you know your PHP?
class foo { public function __toString() { return "Whee"; } }
$f = new foo(); print (string)$f; print $f; print $f->__toString();
What did the little pig go all the way home?
Object id #59WheeWhee
Wednesday, November 09, 2005
Open Office & Firefox
Wow. OpenOffice 2.0 provides a Firefox plug-in - and it's damned fast even on my hunk-of-junk laptop.
I'm pretty impressed - at work we pump out PDFs through an open office machine and a python bridge; but this would make our document rendering much much faster :)
If you've already got OpenOffice 2.0 on your machine, look under the Tools -> Internet menu and start seeing how it performs on files in the wild.
Hell: OOo + ebooks, anyone?
I'm pretty impressed - at work we pump out PDFs through an open office machine and a python bridge; but this would make our document rendering much much faster :)
If you've already got OpenOffice 2.0 on your machine, look under the Tools -> Internet menu and start seeing how it performs on files in the wild.
Hell: OOo + ebooks, anyone?
Dear Australia: Sort out your council areas!
Australia has a mishmash of postcode, suburb and Local Government Area (LGA)s patched together in some kind of quilt, with threads of red tape.
I hereby issue a warrant for the tar and feathering of all of the local officials who decided to make certain suburbs half in one LGA, half in another.
Salisbury Heights is not something you are allowed to share. It's just NOT ON. Ok?
I hereby issue a warrant for the tar and feathering of all of the local officials who decided to make certain suburbs half in one LGA, half in another.
Salisbury Heights is not something you are allowed to share. It's just NOT ON. Ok?
Monday, November 07, 2005
PHP and Foreign Key Constraints
I hate having a Really Big Database that complains when you do a
Great, mysql, just $##%ing wonderful. There's 17 tables that reference
I think to myself: surely there's something that will show me all of the keys pointing to this table, yeah?
No. Not even a hint. I was stuck using DB_Visualiser and inspecting tables. Ugh!
Below is a solution I bothered to whip up at work today. $db is an instance of PEAR::DB, CLS_html::Form_Start() is merely a FORM tag with some extras. Ditto CLS_html::input(). By default, PEAR::DB fetchs row names (Fetch Mode Assoc?) rather than numbers.
DELETE FROM table_foo with something obscure like Cannot delete or update a parent row: a foreign key constraint fails.Great, mysql, just $##%ing wonderful. There's 17 tables that reference
table_foo, which one is broken?I think to myself: surely there's something that will show me all of the keys pointing to this table, yeah?
No. Not even a hint. I was stuck using DB_Visualiser and inspecting tables. Ugh!
Below is a solution I bothered to whip up at work today. $db is an instance of PEAR::DB, CLS_html::Form_Start() is merely a FORM tag with some extras. Ditto CLS_html::input(). By default, PEAR::DB fetchs row names (Fetch Mode Assoc?) rather than numbers.
<?php
/**
* What tables reference $target?
*/
function references($target, $keys) {
$matches = array();
foreach ($keys as $key => $tgt) {
if ($target == $tgt) {
$matches[] = $key;
}
}
return $matches;
}
function findKeys() {
global $db;
$pattern = "/CONSTRAINT `.*` FOREIGN KEY \(`(.*)`\) REFERENCES `(.*)` \(`(.*)`\)/i";
$sql = "SHOW TABLES";
$result = $db->query($sql);
$matches = array();
$keys = array();
while ($row = $result->fetchRow()) {
foreach ($row as $table) {
$syntax = $db->query(sprintf("SHOW CREATE TABLE %s", $table))->fetchRow();
preg_match_all($pattern, $syntax["Create Table"], $matches);
for ($i = 0; $i < count($matches[0]); $i++) {
$keys[$syntax["Table"] . "." . $matches[1][$i]] = $matches[2][$i] .
"." . $matches[3][$i];
}
}
}
return $keys;
}
if (!isset($_REQUEST["field"]) || !isset($_REQUEST["value"])) {
print CLS_html::Form_Start();
print '<p>';
print 'Field<br />';
print CLS_html::input("text","field");
print 'Value<br />';
print CLS_html::input("text","value");
print CLS_html::input("submit","","Describe");
print '</p>';
print CLS_html::Form_End();
} else {
$keys = findKeys();
$references = references($_REQUEST["field"],$keys);
$args = $_REQUEST["value"];
print '<pre>';
for ($i=0;$i<count($references); $i++) {
$parts = explode(".", $references[$i]);
$sql = sprintf("SELECT * FROM %s
WHERE %s = ? LIMIT 1",
$parts[0],
$references[$i]);
$result = $db->query($sql, $args);
if ($result->numRows() > 0) {
print str_replace("?",$_REQUEST["value"],$sql) . ";\n";
}
}
print '</pre>';
}
?>
Wednesday, November 02, 2005
Stunning Ideas
It would be great to lend small amounts of money to purchase and distribute Hipporollers in the third world.

Stunningly simple and effective, it's applied engineering like this that will save our world.
Stunningly simple and effective, it's applied engineering like this that will save our world.
Tuesday, November 01, 2005
Makybe Diva Crosses The Wiki Line
Tuesday, 1 November, 2005, Makybe Diva crosses the finish line of the Melbourne Cup for a record third time. I personally wasn't as impressed by that, as by the fact that within seconds, Wikipedia was up to date with details of the win.
Seconds. Within moments of it being broadcast via television it was eternally etched into history.
Seconds. Within moments of it being broadcast via television it was eternally etched into history.
Subscribe to:
Posts (Atom)
