20091217
Nice Work Australia Computer Society
You came to me during my first year in university, and sold yourself as the paragon of virtue and integrity - the kind organisation I would be foolish not to be associated with if I want to get anywhere in Australia doing software, or "Information Technology" as they call it now days.
I didn't join then, because I didn't have the money. I didn't join later because my career focus shifted away from software. I won't join now ever, because you have sold out.
I am referring to the honorary membership you awarded to none other than one Stephen Conroy, Internet Villain of the Year, 2009.
You had such nice things to say about him too:
“We are very pleased to honour Senator Conroy’s contribution and support of the significance of ICT to the economy and the key role of ICT professionals in Australia’s future,” said Mr Wells.
If I am so inclined as to read between the lines, I can't help but get the feeling you are thanking Mr. Conroy for pushing the Internet filter scheme, and in the process provided jobs for the programmers and technicians involved in the various trials and consultations.
“Senator Conroy has always encouraged the ACS in its role as the independent voice of the ICT profession, welcoming our input to various enquiries and working groups, and regularly attending key ACS events. We are grateful for his on-going support,” Mr Wells said.
I don't think Mr. Conroy is listening to your input, or learning from your events - he continues to believe filtering the Internet is doable, and not a waste of time and resources.
I reject you, Australia Computer Society, as "voice of the ICT profession". Your actions are deplorable and shows a lack of integrity. If I was a member, I would be ashamed.
Cheers,
Steve
Labels: australia, censorship, computer, internet, IRL, politics
20090604
microbric viper review
The microbric viper is neat. Good quality parts and unique idea. Makes a decent robotics platform if you get the wheel add-on. However, you gotta have small fingers to get some of the parts in place. Despite this, the hardware is solid, I like it. The one thing I would ask for however is more short-nuts and a printed manual, not a CDROM with a PDF. Take a leaf from LEGO and their construction manuals.
While the hardware is decent, the microbric viper is sadly let down by the software.
The microbric viper uses the basicAtom (by basicmicro), a PIC 16F87{6,7} with a custom bootloader. Now there is nothing wrong with this - arduino uses a custom bootloader too. However the custom bootloader uses a proprietary programming protocol. This is pretty fail, but what really fails is the programming software only runs under windows (or wine under ubuntu, but only for now).
IMHO the basic-esque language used by basicAtom is no better than what picaxe offers. I am completely at a lost as to why companies would use the basicmicro's products and lock themselves to a single supplier. Think about it: if basicmicro goes bust, your products using the basicAtom will not longer have a supported development environment.
Robotics companies need to seriously consider how their selection of controller will affect their customers - specifically those customers who aren't going to be running windows and staying with in the limits of whatever custom language designed by the controller vendors.
Arduino would be the best choice IMHO. Open hardware, open software. You don't have to pay premiums for the bootloader, and the number of people who will consider your product increases to include people like me.
I bought the microbric viper because it was on sale: reduced to $29 from $199. If I had known I could only program it under windows or that it used such a closed platform, I won't have bought it, even for that price.
Cheers,
Steve
Labels: arduino, computer, electronics, rant, software
20090429
Stripping trailing whitespace from XCode
Firstly, my usual approach of s/\s+$//g doesn't work since it eats up the newline too. s/\s+$/\n/g doesn't work either because the Replace: field in the find dialogue doesn't escape the \n.
Final solution is as shown: s/[ \t]+$//g
Cheers,
Steve
Labels: code, computer, howto, osx, software
20081015
Dear Steve Conroy,
You can’t be serious.
You wants to filter all Internet connections now, without the option of opting out?! You want every Australian to be on a list so you can see who is “naughty” and who isn’t?!
You can’t be serious.
You wants to filter all illegal material on the Internet?!
You can’t be serious.
How on earth do you propose to classify the contents of more than 181,000,000 websites (Sept. 2008, Netcraft)!? Assuming a government worker can classify a site as illegal or legal in 1 minute, that person will have to work non-stop every day for 344 years to classify 181,000,000 websites.
You can’t be serious.
How on earth do you propose to even filter that many sites without rendering the Internet useless?!
You can’t be serious.
How can we be sure the site blocked really is illegal, when we can’t access it!? How do you stop the system from abused? How do you correct the system’s mistakes? Why isn’t any of these described in detail?!
You can’t be serious.
How on earth are you planning on preventing people from circumventing your flitters using encryption?!
You can’t be serious.
Get a fucking clue Steve Conroy. The Internet doesn’t work like that. You have a background in the broadcast industry, and the Internet is nothing like it. You should leave technical decisions to people who know what they are talking about and stop pissing off every Internet literate Australian.
DIAF,
Steve
Labels: australia, censorship, computer, internet, IRL, politics, rant
20081009
Some people are going to hate me for this
But you can get the current function's name by using:
sys._getframe().f_code.co_name
Seems to work alright for debugging purposes. See the link embedded in the title for the origins and 3 other methods.
Cheers,
Steve
Labels: code, computer, python
20080920
A relatively pain free Linux/OS X VNC setup
Ever since I got my 2nd monitor, I been using VNC to work on my laptop. Leopard's inbuilt VNC server isn't really VNC compliant, and has many issues when used with a normal VNC client. I have found Vine server to be an excellent replacement. The client side is a little interesting. RealVNC didn't work too well for me, in that often the screen would stop responding, or it would not receive key events. The best setup I have found is to use tightvnc with the following Vine server settings:
- Devices
- Keyboard Layout: US
- Keyboard Events: User Session Events
The client and server will happily share the clipboard if you enable it. Settings are accessed via F8 in the client, and via Preferences in the server. The client is smart enough to synchronise clipboards only when it loses focus - which would be you switching away to say, paste a url into firefox. All in all it is a fairly painless experience.
Cheers,Steve
Labels: computer, howto, linux, oss, osx, software
20080731
iwconfig not setting essid?
If iwconfig wlan0 essid blah is seemingly not working when connecting to a open wireless network, then try
iwconfig wlan0 essid blahiwconfig wlan0 key openiwconfig wlan0 enc off
The above seems to work for me by turning off encryption. It would appear with encryption enabled, iwconfig won't work for a open network because of some magic or other. If it still doesn't work, then try stick the above in your /etc/network/interfaces and prefix the commands with "wireless-", like so:
allow-hotplug wlan0
iface wlan0 inet dhcp
wireless-essid blah
wireless-key open
wireless-enc off
Hope this help some people, it drove me nuts!
Cheers,Steve
Labels: computer, linux, software
20080724
grub, xfs, debian
Running grub-install with a XFS partition will likely fail - there is a reason lilo is used when XFS is root! The issue is grub-install creates the stage files in /boot/grub, which grub then expects to find when it accesses the disk directly using its own file system drivers. For most file systems sync is sufficient to force this to be true, but not with XFS - unless grubs's XFS drivers replays the journal, grub won't find the files. The detailed why of this is covered in this thread. To get around this, one needs to effectively replace sync with mount -r -o remount /; mount -w -o remount /. A quick a nasty way to get grub going with XFS partition is as follows:
- init 1 # need single user mode to be able to remount root
- cp /usr/sbin/grub-install /tmp # make a copy of grub-install to butcher
- vim /tmp/grub-install
- # now butcher grub-install as follows:
- # 1. find the line that says "Sync to prevent GRUB from not finding stage files
- # 2. deleted everything after sync
- # 3. add exit 0 after sync for good measures
- /tmp/grub-install # invoke our amputated grub-install to just produce the stage files
- mount -r -o remount / # flush everything by mount as read only
- mount -w -o remount / # remount since grub needs it to be rw
- grub # invoke the grub shell
- root (hdx,y) # manually specify the disk x partition y where /boot/grub/* is located
- setup (hdx) # install grub into the disk x's MBR. DO NOT specify a partition number, XFS's sector 0 is NOT reserved for boot loaders!!
- quit # exit grub
- reboot # should work now
Cheers,
Steve
Labels: computer, linux, oss, software
20080716
unoffical libfg repository
I have set up an unofficial git respository for libfg patches and new swig generated python interface, as Gavin Baker (the author) appears to be busy with other things. This is a maintance only repository as far as libfg goes - I don't plan on adding any more features (since all the ones I need are there already). I will however work to produce a more pythonic interface to libfg, as the swig generated interface is a straight port of C api into Python.
Currently the repository contains the following fixes and enhancements:
- RGB565 and RGB555 patch by Adalbert Prokop
- fg_new_compatible_frame patch by echoline
- mmap fix by me
- swig generated Python interface by me
If you have a patch against libfg, please post it at the libfg project's page first, and then to me if Gavin does not respond. I do not intend to take over development of libfg, and it is my hope Gavin will in the future make this obselete/redundant.
Cheers,
Steve
Labels: c, code, computer, linux, oss, python, software
20080618
Personification of Programming languages 2
An follow up on the last round of language personifications, this time contributed by brett.
PHP
The crazy party girl you meet at Uni; she's easy to get along with at the beginning; she reminds you of other girls you've known before and hey, its a bit of fun; you're only young once. But after knowing her a few months the cracks begin to show; she's pretty inconsistent and while she tries to do favours for you and help you out, she ends up making it more complicated than it needed to be. The whole time you're with her, you have this sneaking suspicion that maybe you'd be better off with Perl, even if she's harder to speak to.
Javascript
The late bloomer; in high school she was pretty dorky; she couldn't do very much and while she might have spent time in different social circles, she could never really fit in. But now the puppy fat has dropped away and she's revealed herself to be one hell of a girl. She can do things you never would have expected a few years ago and suddenly she's the life of the party, appearing in places you never would have expected and doing things that make your jaw drop.
bash
The fat chick you picked up at that party, only because you were drunk and horny. You'd never tell your friends about it, but it got the job done, so to speak.
QBasic
Your first girlfriend in highschool. You were so nervous you didn't even end up kissing.
Many thanks again to brett for sharing these with us :-D
Cheers, Steve
20080505
Death by *nix
20080428
{} I <3 thee
Firstly, I am the kind of guy who likes tabs over spaces, because I don't like forcing my particular preferences on to other people. To wax poetic, I like to give other people the freedom of choosing how they want their code indented. This of course brings me into the firing line of python programmers, for whom the 4-spaces-per-indentation-level is equivalent to the Ten Commandments handed down from Mount Sinai. Officially, python doesn't care, but thats like saying officially the Church accepts evolution.
I was editing a working python file written by some one else today, and wanted to convert it to tabs (yes yes, I know all about leaving files as I found them etc. Silence). So I ran unexpand -t 4 on the file. This simply replaces 4 spaces with one tab. This should have given me a working and correct python file though now indented with tabs. Naturally (Moore's law and all) this is not happened. The newly tab-indented file was riddled with errors because the original file was not indented properly so the simple conversion did not work. And as I go about fixing the errors python threw at me, I realised to my horror that information about the structure of the code was corrupted. Because python interprets code structure based on indentation, if your indentation is incorrect, your code is incorrect.
In comparison, a brace using language like C would have made the corrections trivial, because the braces explicitly specify the code structure. Python's argument that everyone indents anyway and thus braces are redundant is flawed - braces are not redundant because braces represent the separation of content from presentation, something that has been hammered into developers. In ignoring this, python has allowed a new class of errors - changing the appearance of code will now change the function of the code. I really can't see how this is a good thing.
If nothing else, python's integration of presentation and content, and thus presentation and program correctness makes it a far less robust language than brace using languages. Less robust in that a mangled python file is unrecoverable unless you actually read the code to figure out its structure, and that incorrectly transcribed python will likely run anyway with no syntactic or runtime errors.
Consider for example, the following code:
for n in names:
foo(n)
bar(n)
If you were transcribing the code and accidentally did not indent bar(n), the code now does something complete different yet no syntax or runtime error will be thrown. Now if the above code used braces, then it would have no effect. And if you forgot the brace, a syntax error will be thrown.
To be fair, python is a lovely language, and I do love it and use it extensively. Whitespace-as-syntax stance appeared at first to be a great idea, and one which now appears to be short sighted and naive. If nothing else, at least an interpreter which disallows incorrect space-indent files, that way tab->space and space->tab conversions would work correctly all the time.
Let me now put on my flame retardant undies, and you can flame away
Cheers,
Steve
Labels: code, computer, python, rant, software
20080328
eeepc, likes and dislikes
Likes:
- nice and small
- all the hardware works, including sleep/suspend
- runs debian based OS by default
- can run an external monitor at decent resolution
Dislikes:
- uses fastinit which only boots into single user mode, so user "user" is always logged in. Endless frustration playing with X11 startup in vain to get a multiuser login screen
- when kmixer shows a speaker with a cross on top, it means built in speakers will be used. When it is a speaker with no cross on top, it means headphone jack will be used. Talk about counter-intuitive.
- keyboard truly sucks
Cheers,
Steve
Labels: computer, linux, oss, rant, software
20060318
Fourier fitting with gnuplot
gnuplot can be used to fit a fourier series to a series of data points. In my case it was an observation log for the star BE Lyncis from the Bossom Observatory, curtsey of Geir Klingenberg.
Firstly one needs to define a time function t(x) such that as x progresses from its minimum value to its maximum value t(x) ranges from 0 to 2PI. In my case minimum value of x was 2453416.20172 and maximum value was 2453416.42447. So my t(x) was constructed as follows:
We now need to define a fourier series, f(x). It takes the generic form of:
Where #=0,1,2,3... infinity, and is the degree of the fourier series. Now we can use gnuplot's fit function to determine the values of all co-efficients and the constant c:
A quick explanation: we are trying to fit f(t) where t=t(x) using data from the file be_lyn-2005.txt with data from the first and second column. The order of 1:2 is significant as it is in the form of x:y. Thus 2:1 means the first column is y value, second column is x value. (This is from experience, if any one knows better, tell me!)
Co-efficient values and the constant will be computed and shown, along with various statistic data. An plot of the fourier series and the observed data is shown below.
The plain text file be_lyn-2005.txt has 3 columns: JD, instrumental magnitude, and error estimate, the later of which was not used.
Cheers,
Steve
Labels: astronomy, code, computer, oss, science, software