Pulse-o-matic now on App Store

It took a month and a bit, but Pulse-o-matic is finally on the App Store. For my loyal followers (all 3 of you), email me for a promotion code :)



Thoughts on HTML, computer programs, and programming languages

I would like to start this post off by saying that emotionally I agree with the sentiment that HTML is not a programming language. Intellectually, however, my position is that HTML is a programming language.

My argument for HTML as a programming language is very abstract, and to put it simply: programming languages are used to express instructions to the computer on what to do. HTML instructs the computer on how to display content, therefore HTML is a programming language. Against this argument are the following, which can be encountered on any number of programming websites.

The most common argument against HTML being a programming language is that it describes itself as a markup language, as evident by the M in HTML. I find this argument wanting on 2 fronts: a) it implicitly assumes that a markup language can not be a programming language. TEX is a good example of a language which 99% of the time is used for markup, and the other 1% for programming; b) this argument is superficial. It implies if I was to simply rename HTML to HTPL, hypertext programming language, then *poof* now it is a programming language without having changed any of its characteristics. A rose by any other name...

A better argument is that HTML doesn't have control structures, whereas programming languages do. Suppose we accept this argument, which implicitly requires programming languages to support control structures. Consider a strict subset of LOGO, called miniLOGO that contains only the turtle graphics part of LOGO and nothing else - no loops, no conditionals, no control structures. By the definition we have assumed here, miniLOGO isn't a programming language. Now suppose you write a program in miniLOGO to draw "hello world"  on the screen, what have you written? I (and most people) say it is a program. This then presents a problem: you should not be able to write a program with a not-programming-language. At least it is a problem for me.

Suppose now you say no, the miniLOGO hello world isn't a program, and you give one of two reasons - that it doesn't contain control structures or that it wasn't written in a programming language. The first reason implicitly defines all programs as those containing control structures. I can not accept this reason because you can make a non-program a program by injecting a control structure with no side effect, and it is no less absurd and no more useful than the accepting HTML as a programming language. Not to mention the millions of introductory programming texts that will need to be rewritten so "hello world" contains an unecessary control structure. (There are those who will then say: there ARE control structures, they are just a few levels of abstractions down. Well there are similar control structures in a browser. We do not worry about the rest of the abstraction stack, only the top of it).

For the second reason, consider what happens if I write the same program in full is-a-programming-language LOGO. Now it is a program by the virtue of having been written in a programming language, which brings us to an uncomfortable place: now we two things which are absolutely identical, but one is a program and one isn't by virtue of their parentage. Accepting this position is no more absurd than accepting that HTML is a programming language.

The final argument I will discuss is that my definition is such a generic definition just about anything is a programming language, therefore that definition is next to useless. This I agree with. However as I have (hopefully) demonstrated, it isn't easy to come up with a definition of what is a programming language (or in fact what is a program) that isn't contradictory or would invalidate millions of simple programs around the world.

I am still giving this issue thought, but until I am a more learned person in CS and possibly philosophy, my choice is between a definition of programming languages with low discriminatory powers, or ones which are fickle and contradictory.

HTML-is-a-programming-language, I choose you!



Why Even Techies aren't Immune from the Filter

Of late I have seen statements from technologically inclined individuals along the lines of:
I am not worried about the filter. Even if they put it in it will just slow things down a bit but we all know how to get around it.
At first glance this seems reasonable, after all it is true. It however ignores the fact the filter is not just a mechanism for stopping "naughty" content. The government can easily abused the filter and use it monitor attempts to access blocked content. In other words the government will be able to construct a list of "naughty" people.

You might ask
What's the problem with that? Surely having a list of people who attempted to access child porn can only be a good thing
If you are asking this question, then you have been victim to Conroy's propaganda. The filter doesn't block just child pornography, it blocks all refused classification (RC) content. At least it is suppose to. The list of websites to be blocked will not be available for scrutiny. In other words, if the filter were to block content on such controversial topics such as abortion or euthanasia you won't know until you have attempted to access such content. By then it would be too late - the government now knows you tried.

The number of ways such a list of "naughty" people can be abused is beyond counting. Suppose the police needs a few child pornography arrests to look good. They just need to go through the list looking for a few poor souls who stumbled on their internet travels. Bang! A list of people whose privacy will be thoroughly violated as the police fishes through their background looking for dirt. God help them if they have actually broke some trivial law in our complex legal system.

But wait, you say,
Isn't attempting to access refused classification material wrong?
The answer is no, unless it is child pornography. The national classification code allows adult to read, hear, and see what they want:

Classification decisions are to give effect, as far as possible, to the following principles:
(a) adults should be able to read, hear and see what they want;

RC material can not be shown, sold, and possession for the purpose of sale or display is illegal. But to consume it with in the privacy of your own home is no crime [1]. As an adult what you chose to read, hear and see is your own private business.

I am well aware this is a slippery slope argument, however I don't think it is outrageous or preposterous. Governments love to monitor what their citizens do [2], censor what they see, and control what they do. That is almost by definition. To imagine the government to pass up on abusing the filter mechanism is difficult to imagine. It would require integrity on their part, something that has been conspicuously absent thus far.

Hang on, I hear you say,
How does this affect me, who always uses an encrypted connection?
Because my dear Watson, the lack of clear text communication is in itself damning evidence to the government. It shows you are to hiding something. In next to no time they will bring out the old fallacy:
If you have done nothing wrong, what have you to hide?
Remember that Conroy is so incompetent he doesn't even know online banking is encrypted.

The bottom line is this: don't allow this invasion of our privacy the chance to snowball just because it doesn't inconvenience you (yet). Nib it in the bud.

At the next election, vote below the line and vote for the parties against the filter: the Greens [3], the Nationals [4], and if they make it in time, the Pirate Party Australia [5].


[1] They did try to make it a crime, but sanity prevailed. http://www.parliament.nsw.gov.au/Prod/parlment/hansart.nsf/V3Key/LA19970515003
[2] Just see how much the UK loves their surveillance, despite no evidence it actually lowers crime. 
[3] Greens might trade a rainforest or two for the filter though
[4] Nationals recently passed a motion to block any mandatory Internet filtering
[5] PPAU by definition has to block the filter.


Ben NanoNote First Impressions

Recently unboxed my Ben NanoNote, and I am impressed. The packaging was top-notch and classy as hell. I would not hesitate to put my name to it.

The NanoNote itself is tiny, and feels fairly solid despite the shiny-appearance which I have come to associate with cheapo devices. It's a nice little package, the only issue being the lack of cover of some sort for the micro-SD card slot, which is odd considering the USB port does.

For those wondering, the keyboard has good tactile feedback, though there is no way you are touch typing on this.

There is a microphone opening and a speaker grill, though I have no at this time exercised any of those functions.

If you are wondering what the Ben NanoNote is, here is a little background:

Ben NanoNote is a $99 device which runs OpenWRT. In and of itself this is nothing special. What is special is the copyleft hardware - you can download the schematics off qi-hardware. For hardware meddlers like myself, this is a boon: we can do many interesting things when we know exactly what is available to us and how.

The copyleft nature of the NanoNote hardware is that anyone else can build their own 100% compatible NanoNote variant. This allows immediately opens the platform to competition, and it also gives product developers peace-of-mind: you can always make your own Ben NanoNote, even if qi-hardware stops making them.

In many ways, the Ben NanoNote is like the arduino: here is some hardware and schematics along with a software platform/SDK with source. Now go wild.


Open Letter to Silicon Chip Australia

Dear Silicon Chip,

I recently cancelled my print subscription. You are no longer a magazine I wish to support.

Political commentary on topics like the insulation scheme and global warming has no place in an electronics magazine. The editor(s) are using the mailbag section to push their own agendas and opinions on the rest of us. I can no longer tolerate such non-sense, and have no interest in financially supporting a magazine that is so set on disinformation and irrational discourse.

Let me be clear: I am not cancelling my subscription because of the beliefs of the people at SC. I am cancelling because SC is being used as a platform to spread those beliefs. Whether or not SC believes in global warming, or that the government is at fault for the deaths from the insulation scheme, commentary of these issues are best left to newspapers. They have no place in a publication about electronics.

On other thing, the filler article reviewing consumer electronics (e.g. MacBook) is most annoying. It lowers the standard of the magazine. If you really have nothing to write about, go find some interesting arduino variants, like the jeeNode, and review one of those.

You have lost your way SC, and it is a sad thing to have to let you go. Maybe we can get back together again.



Script to make IPAs for ad-hoc distribution.

This script produces an IPA, then verifies to make sure the IPA is actually valid.

if [ -z "${PRODUCT_NAME}" ]; then
        echo "PRODUCT_NAME not set";
        exit 1;

rm -rf ipa
mkdir -p ipa/Payload &&
cp -R build/Debug-iphoneos/${APP} ipa/Payload/ &&
pushd ipa &&
zip -q --symlinks -r ${IPA} Payload/ &&
mkdir test/ &&
cp ${IPA} test &&
cd test &&
unzip -q ${IPA} &&
cd Payload/ &&
codesign --verify --verbose ${APP} &&
open ipa/
Designed to be ran from the command line, but it should be easily made into a build phase.



Discouraging File Sharers at LANs

A friend of mine likes to go to LANs and like to run LANs. He has been complaining for sometime that social gaming no longer occur at LANs and in its place is leeching. Lest you think LANs have somehow turned into 19th century medical clinics, we are talking about leeching of files, which given the kind of people who go to LANs, consists of porn, porn, porn, movie, and porn.

My friend laments that he hasn't found a nice way to deal with file sharers such gamers aren't impacted, since some file sharing is required for games installers, updaters, drivers, etc. Any kind of port blocking, packet inspection, real-life-what-are-you-doing inspection are right out for the reasons of impotency, latency, and privacy.

After some discussion, we came up on the following idea to discourage, not ban, file sharers: limit upload rate of all ports. This won't affect 99.99% of gamers since games use very little bandwidth, and it still lets you download at full speed. This however impacts significantly on file sharers: the theoretical maximum downstream a file sharer can achieve is n-1 * upload_rate, which assumes everyone else is giving him their upstream bandwidth. Make this theoretical maximum low enough, and file sharers are better off using sneaker net.

There is an elegance to this that appeals to me - it exploits the fact gaming prioritise latency over bandwidth, and file sharing bandwidth over latency. It is also resistant to circumvention -  because this can be implemented on the data link layer, it isn't something file sharers can get around by changing ports or using encryption.

If you know of any LANs that implement this policy, or run a LAN implementing this policy, I would love to know how well this idea performs in the real world.



Notes on PHD Guiding

  • Maximum RA guide pulse is 1000ms (1s). If PHD is not locking on to the star and it says "dur=1000" in the status bar, a better polar alignment is required.
  • RA hysteresis is used in a 2-term weighted moving average:
RA_dist = (1.0 - RA_hysteresis) * RA_dist + RA_hysteresis * last_guide



Auto-generating CoreData Classes

If you have a xcdatamodel file, open it, and using the menu: File > New File > Cocoa Class, you will see an extra item: Managed Object Class. This will autogenerate the required header and implementation files for your CoreData entities so you can use the convenience accessors instead of [setValue:forKey:]. Doing this will also update your data model so your entities won’t have NSManagedObject as their class. Instead their class is the corresponding generated class.

The thing is, you won’t see “Managed Object Class” item unless you have opened the xcdatamodel file and it is the front most window.

Naturally I discovered this by accident just as I was about to hand write the last CoreData model class.



My First Galaxies (Kinda)

I finally managed to find some galaxies last night. This has been something that has eluded me due to my location, inexperience, and frankly inadequate equipment. (You in the back! Stop snickering!)

Last night, with my Canon 1000D I caught the barest glimpses of M83 and NGC 5128, aka the Hamburger galaxy, aka Centaurus A. The pictures are below, all taken at ISO1600 and 30s exposure time.

This however doesn’t really count - I didn’t see it with my own eyes. This is not conceptually different to seeing (much better) pictures taken by Hubble and other telescopes.

Time to start saving up for a bigger telescope.



Shorty Awards Audit Part 2: Exception or The Rule?

After discovering previously that @mercola had 64% valid votes (IMHO) where as @DrRachie had 88% valid votes, I wonder if this is an phenomenon is the same in other categories. In other words: is @mercola's valid vote percentage the exception or the rule?

To answer this question, I ran the audit script for 1st and 2nd placers in the #music category. Here is the breakdown for the current leader, @yelyahwilliams:

  • deleted accounts: 449 (13.98%)
  • accounts with 1 tweet: 21 (0.65%)
  • accounts with 2 tweets: 32 (1.00%)
  • other accounts: 2706 (84.27%)
  • total: 3211

There is a discrepancy of 3, from users BenFreemann, ovan10, and YannickBraun. 

Now for @ivetesangalo:

  • deleted accounts: 431 (9.07%)
  • accounts with 1 tweet: 30 (0.63%)
  • accounts with 2 tweet: 92 (1.94%)
  • other accounts: 4190 (88.21%)
  • total: 4750

There is a discrepancy of 7 from andreiaAMO, Brubruna, buguinhaBrito, Erica_nasciment, julianestephany, KEKELZITA, and pedro_PERWAH.

It would seem that @mercola's 64% is an exception not the rule. Granted, I only sampled 4 leaders. I suspect however that when I run the statistics for the leaders in #celebrity, I would see the same results: that the rule is for percentage of valid votes are 80% or higher.

I will update when the #celebrity audit is done. Note that I am auditing those categories where the leaders have vote counts in the thousands. This should reduce anomalies. 



Shorty Awards Audit

After reading the sordid tale of ballot stuffing via twitter over at Bad Astronomy, I wonder if @mercola has the same "problem". Further, I wanted to know if it was also affecting @DrRachie.

To that end I wrote a python script to "audit" shorty award votes. Given a username, the script will scrape shortyawards.com for voters, and hit their twitter.com profile to generate a file containing 2 columns: username and number of updates. Users with deleted accounts will have -1 updates.

I have ran the script for @mercola, and at the time of data collection (UTC 1100) this is the breakdown of where the votes came from:
  • deleted accounts: 348 (12.07%)
  • accounts with 1 tweet: 407 (14.11%)
  • accounts with 2 tweets: 288 (9.98%)
  • other accounts: 1838 (63.71%)
  • total: 2885

The discrepancy of 4 comes from users who somehow managed to have no tweets: I suspect the account was deleted, then recreated. These 4 users were: bugoff48, budsgirl54, tracyaustin, janesperr.

You might wonder why I took an exception to users with 2 tweets. The following screen shots should suffice as an explanation:

I checked at random 10 users with only 2 tweets, and they were all people who created a twitter account for the express purpose of voting in the shorty awards, which is against the rules.

Personally, I would say that only 64% of votes for @mercola are valid. This puts him in the lead still, but only ~300 votes in front.

Feel free to do your own analysis of the data.

I am still running the script for DrRachie, so I will update when that script is done. In case you are wondering why it takes so long, that's because I am been nice and rate limiting my queries :)

Update 1: realised some users were showing up twice. Removed them, recalculated, re-linked data.

Update 2: @DrRachie's data is available! See the following.

OK, here is a break down of where @DrRachie's votes came from:

  • deleted accounts: 113 (6.50%)
  • accounts with 1 tweet: 41 (2.35%)
  • accounts with 2 tweets: 47 (2.70%)
  • other accounts: 1542 (88.42%)
  • total: 1744

Again there is a discrepancy, this time of a single user, Superpositional.

Just as I did for @mercola, I checked random accounts with 2 tweets. They all broke the rule. These accounts contained only tweets voting in the shorty awards.

My personal opinion is that 88% of votes for @DrRachie are valid, a percentage much higher than @mercola's.

Again, the data is available for your own analysis.

What should be done about this, I hear you ask. Personally I am happy if @mercola and @DrRachie both have their vote count adjusted accordingly.

Update 3: I am running the same analysis for 1st and 2nd place for #music, to see if the same pattern holds. Those results will be in a new post.

Update 4: I should point out that I am aware both @mercola and @DrRachie received votes in multiple categories. But seeing as how majority of votes are in #health, I feel it would be Too Much Effort to separate the vote out. Though if enough people complain, I will fix it.

Update 5Part 2 has been posted. It explores the question whether 64% valid votes is the exception or the rule.



An Idea for Personal Domains

Given that we can have purely numeric domains, i.e. 131500.info, why not have domains that map to our mobile phone numbers for personal use?

What's the point? For one, you can give out your public mobile number instead of your website, since it is much easier to communicate numbers than domain names. This can be used to communicate other information that is difficult to convey by voice, e.g. emails, skype names, etc. A simple website at $your_mobile.mob would overcome all these.

This obviously has privacy implications, and as such should be entirely opt-in.

Any such system would need to be regulated, ideally controlled by carriers. A custom TLD like .mob would probably be a good idea too. One must also keep in mind however that such easily predictable domain names will be targeted by spammers.



Introducing GeoNote AR (2.0)

Some of you might know I have been working on a little iPhone app called GeoNote (iTunes link). Its basic goal is to allow you to annotate the real world by allowing you to leave little messages (notes) which are "pinned" to real world locations. These little messages are visible to anyone running GeoNote.

Initially GeoNote had a rather unflattering interface: just a List View of notes. However as the iPhone SDK and the iPhone itself evolved, GeoNote also evolved. First it gained Map view, which was much more intuitive and useful, then with the iPhone 3GS and a bit of time on my hands, GeoNote gained Augmented Reality view:

Cool isn't it :D It is available in GeoNote 2.0, but only for people with iPhone 3GS. GeoNote will run on iPod touch and iPhone 3G, but AR will not be available.

The Augmented Reality View is activated by holding the phone up like you would to take a landscape picture, with the home button on the right. The colour scheme is customisable, since I haven't found a nice set of colours. It looks rather retro'ish with the default green colour scheme:

There are a lot of things that cane be done better, like a nice way to select notes, and more customisation for things like limiting distance, etc. But as they say, release early, release often :-)

For more on the app, visit: http://gtd.pictorii.com. It is rather nasty right now, I will work on that :)