ADAM'S WEB PRESENCE

10 February 2010

OMG, I’ve been hacked!

Filed under: General — adam @ 9:21 am

Apologies to anyone who has logged into this blog in the last few days only to find a link-farming spam page. Seems that someone has managed to pull off a script injection on this site. I’ve removed the offending code but I still have no idea how they managed it. I’m investigating…


7 November 2009

Halloween comes to Sydney

Filed under: General — adam @ 8:05 pm

Halloween usually isn’t very popular here in Australia but this year it sure was!
Residents of Matthews St, Davidson were inundated by hundreds of kids demanding sugar. My own kids were among the throng, I was surprised how many people were there.


15 October 2009

You can Hire me

Filed under: General — adam @ 3:11 pm

I’m looking for a little bit of freelance work at the moment, if you are interested in someone to help you out with digital circuit design, embedded systems design or programming, application development or even web sites or server back end work, drop me a line at adam@siliconsparrow.com. I’ve put my Resumé online for you to download if you are interested.


21 September 2009

Textapox is catching

Filed under: General — adam @ 9:53 am

Look out for this new disease sweeping the children of the world. Symptoms include coloured spots on exposed areas of skin and uncontrollable giggling.


16 September 2009

Python function is not callable

Filed under: Nerd Notes — adam @ 8:39 pm

Here’s a Python gotcha that got me. Here is my function to print out a range of sinusoidal values:

import math

def cycle(centre, range):
        theta = 4.71
        speed = 0.1
        for i in range(0,80):
                theta = theta + speed
                value = centre + (range * math.sin(theta))
                print value

I got the following error which confused the hell out of me:

Traceback (most recent call last):
  File "cycle2.py", line 11, in 
    cycle(0.0,10.0)
  File "cycle2.py", line 6, in cycle
    for i in range(0,80):
TypeError: 'float' object is not callable

Can you see it? It took me a while. I’d assigned a variable called range and then tried to call the range() function. I’d overloaded a built-in function. Duh!

I just had to rename my variable and it was good.


9 September 2009

Girls have more stuff

Filed under: Bizarre Stuff — adam @ 9:11 pm

I just want to say that women just have more stuff. Here is the state of our dressing table right now, you can just see my stuff in the corner there if you look closely but look at my wife’s stuff – handbags and hats and jewellery oh my!


3 September 2009

More Spreadsheet Tomfoolery

Filed under: General — adam @ 2:10 pm

I’m still messing around with my bookkeeping. Here is another nifty formula for OpenOffice Calc. I have a list of revenue and the dates that revenue was received like so:

Date Amount
10 Jul 2009 $1,080.00
18 Jul 2009 $144.45
30 Jul 2009 $2,248.40
2 Aug 2009 $1,000.00
5 Aug 2009 $522.30

I want to create a month-by-month summary of these figures. Here is the (rather complex) formula to make that happen:

=SUMPRODUCT(A1:A5>=DATEVALUE("01 Jul 2009");A1:A5<DATEVALUE("01 Aug 2009");B1:B5)

That formula will give the total of all amounts for July. By repeating this for each month, you can get monthly summaries for the whole year.


16 August 2009

Metamorphosis

Filed under: General — adam @ 10:18 pm

A picture of a butterfly
I realise I’ve been a bit dark lately with my blog with very minimal posting over the last few months. A lot of things have been changing around here. My wife and I have swapped roles. That’s right, I’m the housewife now and she has a full-time job.

I’m still doing some contract work here and there but am spending most of my time looking after the kids and doing housework. To be perfectly honest, I’m enjoying it. Its really nice to take a break from full-time work, the first time I have not been working flat-out in about twelve years.

So where to from here? While kids and housework keep me reasonably busy, I’m not the kind of guy who can just sit around. So I’m planning to create some products for sale. I’ve set up a new site called siliconsparrow.com where I will base my professional operations. I am excited about the possibilities.

Unfortunately it means this blog will become a bit neglected. I’ll only be posting personal and hobby stuff here, and perhaps more housewife-related stuff like recipies!


10 August 2009

Parallel port control in Python

Filed under: Nerd Notes — adam @ 11:11 am

Controlling the parallel port has always been a pain in Windows 2000, XP and later. In DOS or older versions of Windows you could just write a byte directly to port 0×378 and that was it.

Now you can get the same level of simplicity using inpout32.dll and Python. Go here to download the DLL and you can access it from Python just as easily as it used to be under DOS. The following example writes the number 5 to the parallel port:

import ctypes

ctypes.windll.inpout32.Out32(0x378, 5)


UPDATE: I have made a simple demo app using this technique. You can download it from my commercial website at http://siliconsparrow.com/parallel-port-tester-in-python/.


29 July 2009

Australian Income Tax Spreadsheet Formula

Filed under: Nerd Notes — adam @ 10:47 pm

Just a quick note for my future reference. I’m setting up my budget spreadsheet for the new financial year and I have converted the Australian 2010 income tax rates into a spreadsheet formula. I use OpenOffice, it should work fine in Excel too.

=if(A1<=6000;0;if(a1<=35000;.15*(a1-6000);if(a1<=80000;4350+(.3*(a1-35000));if(a1<=180000;17850+(.38*(a1-80000));55850+(.45*(a1-180000))))))

Next Page »

Powered by WordPress