Sam Sargeant

Opinion, technology, Internet, dull life stuff

Comparing smartphone tech-specs

with 8 comments

The iPhone 4 came out today. I saw this article amongst the swarm on Twitter:

iPhone 4 vs. the smartphone elite: EVO 4G, N8, Pre Plus, and HD2

The guts of the article is a table that compares various technical details of the new iPhone with other leading smartphones. It reports on things like processor, storage, display type, SIM standards and weight.

It so happened that I was reading this on my phone, where I pass webpages through a ‘mobilizer’ – a service that trims images and layout, leaving only the text of the article to read. The table from Engadget was lost and all the text ran together to appear like this:

It occurs to me that normal people probably interpret the original article in the same way; an incomprehensible collection of buzzwords, acronyms and metrics. They don’t want this level of detail, as useful as it may be to those who do.

June 8th, 2010 at 8:44 pm

MySQL: It’s a bit shit.

with one comment

I’ve been using MySQL for over a decade now. When I have the choice, I’ll build projects with PostgreSQL. It happens that my current contract means I have a legacy MySQL database to work with. That’s fine, I’m a professional. Lets do this thing.

I wanted to add a new foreign key constraint to an existing table.

ALTER TABLE person
ADD CONSTRAINT person_type_id
FOREIGN KEY (person_type_id)
REFERENCES person_type (person_type_id);

Upon trying this SQL, I get the following error:

ERROR 1005 (HY000): Can't create table './customers/#sql-910_26.frm' (errno: 150)

Hrm, okay. That seems rather strange. I wonder that error number 150 is.

$ perror 150
MySQL error code 150: Foreign key constraint is incorrectly formed

Oh, I must have done something wrong with my new constraint. Weird that it doesn’t just come out and tell me that. Okay, lets check the manual and my SQL. Nope, I think my SQL is right. Now what?

Some searching suggested that more detail on the error could be found with another command:

msyql> show engine innodb status;
ERROR 1227 (42000): Access denied; you need the SUPER privilege for this operation

So it seems I need to be a superuser to get the error message for the command I just ran. That’s bizarre. Fortunately this isn’t a production box and I have superuser access. I run the command and search through pages and pages of text to find my error:

Cannot resolve table name close to: (person_type_id)

I’m not sure what that means, so I search some more. A few bug reports and forum posts finally leads me close to a solution. If your tables don’t use the same backend engine type, then foreign keys don’t work.

The solution, in my case, was to recreate the person_type table with the same engine as my person table. (In this case, InnoDB)

In summary: Initial error is unhelpful, secret error message is available if you have admin access, but it’s buried in a lot of text, and doesn’t really describe the problem. I had a very frustrating 30 mins chasing errors down a hole. I have now vented here, and will never mention it again. Maybe.

August 4th, 2009 at 4:18 pm

Tagged with ,

Radio New Zealand schedules on iPhone

without comments

A few weeks ago, Radio New Zealand kindly released their schedule data under a Creative Commons licence. This has allowed me to hack together a simple project that reformats their timetable into an iPhone friendly site.

To see it in action, visit http://radionz.resultpath.com/. It looks best in Mobile Safari, but should be understandable in other browsers. Currently it only works for Radio NZ National, and only for the current day. Next I aim to add support for RNZ Concert and the ability to browse other days.

It’s running on Google App Engine, which is fantastic for these sort of scratch-an-itch projects. I write a small Python script, and Google does the rest. I’ve also put the code on Github. Many thanks to Richard for help with bootstrapping the project with CSS/Javascript.

March 22nd, 2009 at 10:43 pm

Tagged with , ,

Amazon Kindle: Cause for rage

with one comment

Amazon have a product called the Kindle. It’s an electronic book reader. They have a huge collection of books on their site you can browse and purchase. I don’t own their hardware device, but I do own an iPhone. They recently announced the Kindle application for the iPhone which allows users to download eBooks purchased from Amazon and read them on their mobile device.

This is fantastic. I love reading and badly want a collection on my phone. I love being able to read something when I’m awake at night but don’t want to disturb the wife. I love reading on the plane when travelling. Carrying dead trees around strikes me as stupid. I’m perfectly happy with reading on a small screen and have a great desire to buy all my books in electronic form.

But my hopes were crushed.

When it came out yesterday, I gleefully downloaded the Kindle application from the iTunes store. I then spent a while browsing the excellent selection on Amazon’s Kindle Books store. Given the exchange rate is terrible right now, I searched for some good books at a reasonable price. I made a list of my favourites and hit purchase.

We could not process your order because of geographical restrictions on the product which you were attempting to purchase. Please refer to the terms of use for this product to determine the geographical restrictions.

Well damn. It turns out that since my credit card is for New Zealand, Amazon won’t sell me eBooks. There’s probably some licencing problem with the publishers, or some international tariff, or some treaty, or some mind-control device by space-aliens, or some other rancid excuse why I can’t give them money in exchange for their product. Who knows. I was really frustrated that I wasted nearly an hour looking through their store, while logged in as an NZ customer, only for them to deny me at the last hurdle.

So for now, I find other “online distribution sources” for the books I want, and load them into Stanza.

March 5th, 2009 at 3:49 pm

Tagged with , , , ,

Atrocious copyright law about to come into effect

without comments

There is a ground swell of opposition to section 92 of the Copyright (New Technologies) Amendment Act 2008 which is about to come into effect. This part of the law states that Internet Service Providers (ISPs) are required to have a policy that provides for disconnection of users who repeatedly infringe copyright.

There is a lot of debate on this issue. I’m very frustrated when rights-holders try and paint the opposing side as those who want free-downloading for everyone. Lets be clear; I think it’s important for copyright to exist at this time, and we need to protect the rights of those who own copyright material.

I have two major problems with this law. Firstly, the act of terminating an Internet connection is a major step. I firmly believe that we have created an important tool for humanity. To deny our citizens the means to express themselves, to communicate with each other, to learn, to consume and interact with government is totally unacceptable. I don’t know what punitive measures should be taken against those who infringe copyright, but cutting off their access is a mistake.

The second is often overlooked and is rather subtle. The law requires that ISPs act as soon as they receive notice of infringement. In the case of a movie or TV show, this is fairly obvious. What would happen if you were told that the following snippet of text infringed copyright:

Section 92A requires that ISPs must develop a code of conduct to deal with copyright infringement.

That happens to be a quote from an NZ Herald article on the recent protests, so I think I’m safe. The Associated Press have recently taken steps to claim that even a five-word quotation from an article is copyrighted and you must pay a licence fee to use it. There is no fair-use legislation in New Zealand like there is in the United States. We have no case to argue against such insanity.

Small businesses that allow their staff to use the Internet may be considered providers under the law, and thus need to comply like regular ISPs. How are they going to be able to track and disconnect their staff? What would they do when rights-holders complain about emails with quotes from the Associated Press?

Copyright is not a clear-cut issue of stolen movies or music. It’s incredibly complex. I am very concerned that forcing ISPs, businesses, and schools to judge such issues is going to lead to major problems. The future already has enough uncertainty. Idiocy like this will just make things worse.

I urge you to contact our government and ask them to repeal section 92A. Do it soon, we don’t have much time.

For more information, check out the great work by Matthew and Bronwyn of the Creative Freedom Foundation.

February 17th, 2009 at 2:54 pm

Tagged with

Twitter bot: NZ police updates

with 3 comments

I’ve subscribed to the email updates from our police for a while now. Given these updates were usually about things happening live, I thought it’d be useful to write something to post them into Twitter.

After about an hour of hacking, I had a quick and dirty script that did the job. There are three users you can follow if you are so inclined:

The script uses BeautifulSoup, a particularly excellent python library that ZachTwo reminded me about. I’d prefer it if the police released their updates in a better format, but screen-scraping will do for now.

Read on for the script. Consider it under a GPL licence.

Read the rest of this entry »

January 23rd, 2009 at 3:33 pm

Tagged with , ,

Using Google Talk with your own domain

with 2 comments

When I got my parents setup with a new computer I took the chance to setup a new domain-name with some Google services. I’ve got my family running with their own email address and iChat using Google Talk accounts. We don’t really use the chat feature of gtalk, but it’s a great way to setup a screen sharing session, or a video call. Colin asked me for some more info, so I’m doing a quick brain-dump of the process here.

You will need the following:

  • A domain name registered. Google do support registration of a domain through eNom, however I haven’t tried this myself.
  • The ability to create records in your domain. Your registrar can help with this.
  • A Jabber client such as iChat, Adium, or Pidgin.
  • About an hour plus a coffee or two

With a domain name ready to go, you first need to signup to Google Apps. This entry-level service is free and allows you to setup email, chat, calendars, documents and websites for a workgroup. This does a good job of servicing a small company too and is much cheaper than Exchange or Zimbra.

Example dashboard for Google Apps

Example dashboard for Google Apps

On the Google signup page, select “Administrator” and enter your domain. Moving to the next step they ask you about your organisation and expected number of users. Nothing too complex yet. Finish this and step #3.

You now should be looking at the main control panel for your domain. I’ve used “crazy.geek.nz” in my example image.  Notice the part that says “To activate Google Apps services you must verify that you own your domain“. Click the “Verify domain ownership” link to do so.

I normally go about this by selecting “Change your CNAME record“. Google verifies you have control of your domain by asking you to add a fake record they can check. Something like google748fe89ab72097f.yourdomain. This won’t hurt anything else you are doing with your domain name and can be removed after this process is complete.

Your domain name registrar should offer a control-panel where you can add this record. Some registrars (like simplename) may help this process with a form tailored to the Google Apps setup. If you’re a DNS geek, here’s an example record for a BIND zone file:

google748fe89ab72097f     IN     CNAME     google.com.

Verification screen for a domain

Verification screen for a domain

Once you have this recorded added to your domain name, click the “Verify” button. The response says “We are checking domain ownership. This may take 48 hours to complete.”, however it has always been finished within minutes for me.

Now the domain should be verified by Google you can setup the chat service. Click “Activate chat” on the dashboard. While you’re waiting for this (up to 30 minutes!) go setup more users for your domain.

The tricky part of all this comes next. You need to setup some special DNS records for chat to work. In short, these records tell iChat which servers to connect to when you try and sign-in as sam@crazy.geek.nz to the Google Talk service. The records you need to add are:

_xmpp-server._tcp     IN     SRV 5 0 5269 xmpp-server.l.google.com.
_xmpp-server._tcp     IN     SRV 20 0 5269 xmpp-server1.l.google.com.
_xmpp-server._tcp     IN     SRV 20 0 5269 xmpp-server2.l.google.com.
_xmpp-server._tcp     IN     SRV 20 0 5269 xmpp-server3.l.google.com.
_xmpp-server._tcp     IN     SRV 20 0 5269 xmpp-server4.l.google.com.
_jabber._tcp     IN     SRV 5 0 5269 xmpp-server.l.google.com.
_jabber._tcp     IN     SRV 20 0 5269 xmpp-server1.l.google.com.
_jabber._tcp     IN     SRV 20 0 5269 xmpp-server2.l.google.com.
_jabber._tcp     IN     SRV 20 0 5269 xmpp-server3.l.google.com.
_jabber._tcp     IN     SRV 20 0 5269 xmpp-server4.l.google.com.

Using Google Apps with simplename

Using Google Apps with simplename

If you’re using simplename, or some other registrar who has customised their process for Google Apps, you can ignore this step. Just login to simplename and enter your key (the google748fe89ab72097f bit from earlier) and they’ll setup all the right records.

Assuming all the records are working, you should now be able to fire up iChat (or some other Jabber client) and get things working.

Unfortunately there’s one big caveat lurking. I’ve seen some consumer routers that run a stub-resolver. These devices have no idea how to deal with SRV records in the DNS and will drop them without warning. What you’ll see is a failure to connect from your chat client. If this happens, you’ll need to find the advanced options in your Jabber client and supply ‘xmpp-server.l.google.com’ as an explicit server to connect to.

Good luck! Tell me how it goes.

December 1st, 2008 at 1:09 pm

Tagged with , , ,

Broadband uses: Video conferencing

without comments

Video conferencing is often mentioned when justifying broadband goals. It’s a technology you can use right now if you go buy a $40 webcam or have a computer with a built-in camera. It’s great for business use as well as in the home.

Modern families are spread across the country or even the globe. Being able to see and hear your loved ones when you’re unable to be there in person can be very valuable. Recently I got my parents a new computer and spent a little time getting everyone setup for video conferencing. They live in Christchurch and while it’s only 300 km south of me I don’t make it down to see them as much as I’d like. Video calls are ideal for us.

Video call for the Sargeant family

Video call for the Sargeant family

The family home has TelstraClear cable Internet, as do I. The quality of calls to my family is okay, but has frequent problems and dropouts during peak times. If we wanted to add a 3rd person to the call I expect bandwidth would dry up very quickly. I also expect that if I call someone who uses an ISP that TelstraClear isn’t peering with then all bets are off.

A strong national network with capacity for this is the first step, however business and families can stretch internationally too.

When I travelled to Taiwan early this year I used Skype to call my fiancé back in Wellington. I had oodles of bandwidth to my hotel room, however video quality back to New Zealand was so pathetic we had to give up and use audio only. In theory our home has speeds of 10 megabit for download and 2 megabit for upload. In reality even our 64 kbit voice stream was struggling.

Recently TelstraClear used their “Next IP” network to demonstrate the next step after video: Holograms. I notice that their media-release only considers this technology useful for business. Another example of how short-sighted they are. I look forward to shimmering 3D images of my kids beamed into the lounge.

September 24th, 2008 at 10:41 am

Tagged with ,

Should we care about broadband?

without comments

Telco hits out at National’s fibre plan

This month the CEO of our second largest telecommunications company said faster broadband to the home will mostly result in more downloads of pornography and movies rather than improvements to productivity. Shortly afterwards the MD another network infrastructure company piped up with a “me too” statement saying the vast majority of New Zealand’s wealth is created in businesses and not the home.

He was probably correct in saying that business generates most of the wealth. But that’s not the reason I find his statements frustrating. I’m a firm believer that high-speed telecommunications for citizens is going to be critical for New Zealand in the future.

I’m not alone in disagreeing with TelstraClear. InternetNZ followed up the initial news with a release of their own that said “high-speed broadband already allows effective work-from-home and telepresence arrangements, greater social interaction through video contact between family members”

I do find myself defending ubiquitous high-speed Internet on occasion. Sometimes it’s hard to get across why I feel it’s so important. It’s very easy for people to assume, like the aforementioned business leaders, that faster Internet is just going to be used for more time-wasting or simple entertainment.

So I’m planning some blog posts to describe what I use broadband for, and why I think the more homes we connect the better things will be.

September 11th, 2008 at 10:05 pm

Tagged with

Movies times for Wellington

with one comment

A friend of mine hacked up a sweet iPhone styled page that shows movie times for Wellington cinemas. On your phone, check out http://www.phirate.com/movies/

It also has a nice icon so you can add a bookmark to the home screen.

September 8th, 2008 at 10:22 am

Tagged with , ,