Archive for the ‘Web’ Category

Avoiding accumulated error while using GPolyLine (Google Maps API)

Saturday, January 13th, 2007

If you’re using the GPolyLine() API to Google Maps, and you’re using the string encoding to store a large number of points, you have to be very careful not to incur accumulated error as you encode the points.

The problem comes from the fact that the GPolyLine function fromEncoded uses a special encoding that only encodes 5 digits of precision beyond the decimal point. So, if you’re not careful, those left over bits after the 5th digit (if your source data has them) can add up to a nasty amount of error over time. A line with only a hundred or so points won’t show much error, but when you get to thousands, it ads up pretty quickly. You’ll see this problem manifest itself as a line whose starting position is perfect, but at the end of the line, it will be shifted several hundred feet in some direction.

This comes from the fact that the Polyline encoding uses 5 digit precision delta values to encode the difference between the previous point and the next. Full positions are only encoded at the beginning of each segment.

A naive algogithm, like the one below, will reproduce the error:


Encode( RoundToFiveDigits( point[0] ) );
for i = 1..points:
Encode( RoundToFiveDigits( point[i] - point[i-1] ) );

And, if you change the code as follows, you won’t get the accumulated error:


Encode( RoundToFiveDigits( point[0] );
for i = 1 .. points:
Encode( RoundToFiveDigits( point[i] ) - RoundToFiveDigits(point[i-1]) );

It’s subtle, but it makes a huge difference when you’re encoding several thousand points. When I first thought that this might be the problem, my thought was that if there was rounding error, that on average, it should work out that the errors should all add up to zero, with equal amounts of positive and negative error in each direction. The flaw in this logic is that 5 digits is probably just on the edge of what my GPS unit can distinguish, and thus, the 6th digit probably has a higher likelihood of being one value versus another, so the start to accumulate.

Why does everybody always do things the hard way?

Thursday, January 11th, 2007

Problem: You’ve got a 250G drive sitting around, and you want to use it. You’ve already got 1 USB drive attached and adding another seems like a pain in the butt.

Solution: You go to Fry’s and see an empty SAN shell made by Netgear. You think: “Netgear is a good company, and even though it doesn’t say that its Linux supported on the box, nothing ever does, and its got to just be a Windows Samba share, right?”

WRONG! The Netgear SC101 runs a proprietary filesystem (Zetera), and uses a proprietary networking interface. Custom drivers are needed for any platform that wants to access the data.

Result: You have to go back to Fry’s to return the piece of crap that you bought. Thankfully, you were smart enough to research the situation before opening it, so the return will be an easy one.

Cupertino Snake Oil

Tuesday, January 9th, 2007

Ok, I have something to say:

Yes, Apple announced an iPhone. No, its not for sale. In fact, if you look closely, there’s not a single photograph of the device. Steve wasn’t holding it and flaunting it on the show floor. Its all CGI renderings and screenshots. This thing is a long way away. My money is on a 2008 delivery. If there were even one single mock up or poduction prototype that Steve could have used, he would have been all over it. But, he wasn’t, and therefore, this thing is nearly vaporware. Apple has just essentially started to make the rumors come true and implement what people are drooling for. This isn’t a bad strategy, but I wish they would stick to shipping products, not concepts.

Secondly, the same basic comment applies to the Apple TV. No photos. Does the box run? Did it demo? Where is it? February? Really? Is this going to extend the DRM-crazed Walled Garden of iEverything from our pockets (iPods) to our livingrooms? Sounds sort of annoying. Why only 720p? Why not 1080p? (I know, hardware for 1080p is too expensive, thats why.)

Thirdly, all the iPhone really is is a Newton 2007. Don’t mistake it. Its more PDA than phone, and the whole touchscreen thing is very Newton-esque. (Does it have a stylus? How do you interact with it? Does it get all smudgy and disgusting if I call someone and eat fries at the same time?) I’m not saying that this is a bad thing, I’m just saying that you shouldn’t really call it a phone. Its a Widescreen iPod that can make calls and has WiFi. Thats probably a better way of putting it, but Apple is too afraid of calling it a PDA due to the failure of the Newton (which was an awesome device).

Oh, and by the way, post title comes from this

Streusel vs. Strudel

Tuesday, December 12th, 2006

Do you know the difference between Streusel and Strudel? Just to settle the argument, here’s what the internet thinks:

Wikipedia:

A strudel is a type of pastry that originated in Central Europe and is most often associated with Austrian and German cuisine. The best known kinds are Apfelstrudel (with apple) and Topfenstrudel (with Topfen, also called Quark)

Dufflet.com: (via Google searching for “define:streusel“)

STREUSEL: A crunchy topping used to cover pies, fruit crisps and coffeecakes. It has a high proportion of butter and sugar to flour and can contain any kind of chopped nut, oats and spices.

So there ya go.

Dicewars!

Saturday, August 5th, 2006

I bet this is old news, but its still totally awesome. Its DICEWARS! There are no instructions, but I bet you’ll pick up on it real fast.

I despise amazon.com

Thursday, August 3rd, 2006

Yes. Its true. I despise amazon.com. Or, better said, I despise what amazon.com has become. Why? One simple picure will illustrate my point completely. This is an actual screenshot from amazon, and has not been doctored other than cropping. Click to zoom

And now for the long rant… I despise amazon.com becase of their “Marketplace Sellers” feature, where multiple sellers have the same item for sale, at different prices, with seller ratings. This poses the following problems for the consumer:

  • amazon.com is undermining their own business. I think of amazon.com as the place I can go to buy any book. As this screenshot shows, not all books are sold directly by amazon, and the buying experience is so confusing and muddled as to be essentially impossible.
  • Having too many choices. A user faced with a choice between 11 different resellers for the same product. Why is it my job to choose? I want an easy, seamless and “guaranteed” buying experience!
  • Ratings, ratings, and more ratings. How is the consumer supposed to choose between the reseller with 97% positive out of 15,000 ratings at a slightly higher price, or the reseller with 95% positive out of 500 ratings at a lower price? Why are they faced with this choice at all? On what merit, other than these 2 numbers, are they choosing? Why can’t amazon guarantee a “100% satisfaction guaranteed” experience?
  • No “100%” solution. Even the highest rated reseller is only 97% positive. That means 3 out of 100 had a bad experience. What if someone said “give me your money, and there’s a 97% chance I’ll send you your book.”. Well, thats as good as it gets with this amazon reseller system. Reseller ratings for this item are as low as 85% — thats about a 1 in 6 chance of having a bad experience. Is this the level of quality that amazon supports?
  • Too many prices. For this item, prices range from a low of $42.96 to a high of $92.79. Thats a spread of 2.15x. Why such a large price variation? Is something wrong with the cheap version? Is the expensive seller gouging?
  • What is the “list price” of this item? All new books have a price printed right on them. I want to see that price, and I want to pay that price, or lower. Why isn’t it listed?
  • Is the product “New”, “Nearly New”, “In New Condition”, “Like New”, etc. I don’t know if this is a used product or not, from most of these sellers. Hardly a good buying experience
  • If I wanted eBay.com, I would have gone to eBay.com. Enough said.
  • Totally unrelated advertisements in the page. See the following screenshot:

    Sheet Music for Sailing? Give me a break! I mean, there are “Sheets” in Sailing, but they have absolutely nothing to do with music, thats for sure.

Again, I despise amazon, and I still want This book.

Slimdevices: Transporter

Monday, July 24th, 2006

Slimdevices announced their “Transporter” today.

They say:

Slim Devices’ Transporter™ was designed to appeal to the most discerning audiophiles and music lovers. It streams digital music with sound quality that surpasses even the most exotic compact disc players.

At the heart of Transporter is a “no compromise” attitude to component selection and electronic design.

My Thoughts:

  • This box is only interesting to people who’ve ripped as FLAC, since the mp3 encoding is going to kill any true audiophile.
  • Dual displays are cool
  • Its a little “bling” for me, even the black version. Less shiny, please (but I’ll never buy one anyway)
  • Why not put the cool knob on the remote too!
  • Built in wireless bridging! Genious!
  • You guys gotta improve the slimserver software! Its still pretty slow to respond to browsing ~5k artists/~25k tracks, and seems like it really needs a rearchitecture! Rescanning my music folder takes a really long time at 100% CPU usage. I know you can do better. Oh, and your memory usage is disgraceful! (Mine is running at 163M Virtual, 56M resident, all the time) Its using more RAM (Virtual) than any other “service” running on my box. (This doesn’t include mail & web apps that can be easily shut down).
  • Can the digital inputs be used for “ripping” from optical sources?
  • $2k?!? Ouch. Is Sonos really that big of a threat?
  • Make a Squeezebox that plays SD & HD video, PLEASE!

Upgraded to OpenWRT

Saturday, July 22nd, 2006

Today (its hot!) my wife was complaining that she can’t access our internal website(s) from her internal computer. The problem is that the external DNS resolution results in an external IP address, which routes back inside our net, which the Sveasoft router just couldn’t handle.

I had manually “fixed” this problem by editing my /etc/hosts, but doing that for every computer in the house is a real pain.

Solution? Upgrade to OpenWRT! Installation was straightforward, although the documentation is a little lacking on the web interface. Thankfully, everything is pretty straightforward.

After the install was complete, the OpenWRT firmware lets you put in “manual” hostnames that end up in /etc/hosts on the router. I did that for all my internal sites, and then changed all our computers to use the router for a DNS server, and everything is up and running great!

I’m a lot happier with OpenWRT than the silly Sveasoft firmware that I was running before. I briefly considered DD-WRT, but that guy looks like he’s going down the road of Sveasoft, and looking for funding. OpenWRT never will need that.

I’m Super Famous!

Friday, June 16th, 2006

Link to my Instructable on BoingBoing
Link to my Instructable on Gizmodo.
Link on makezine.com
From 3ayak.org. Can someone tell me what language this is?
http://digg.com/mods/$11_Super_Wide_Angle_Digital_Camera
http://www.mufopho.com/2006/06/15/the-11-fisheye-lens/
http://www.ismckenzie.com/06/15/some-photography-tips-and-tricks/
http://www.one26.com/blog/?p=7
http://www.camcorderinfo.com/content/The-$11-Wide-Angle-Lens.htm
http://loudopinions.com/blog/?p=318
http://www.gigabeat.co.uk/blog/06/15/2006/gadgets/wide-angle-lens-for-11
http://www.gizmojungle.com/2006/06/15/wide-angle-lens-for-11/
http://www.worldstuff.info/2006/06/15/intro-11-super-wide-angle-digital-camera/
http://photography.qj.net/Make-Your-Digicam-a-Super-Wide-Angle-Digicam-For-Just-11/pg/49/aid/55914
http://blogjunktrunk.com/blog/?p=5972
http://blog.ononesoftware.com/2006/06/11_super_wide_angle_digital_ca.html
http://loudopinions.com/blog/?p=318
http://tailrank.com/posts/562949953665387/$11_Super_Wide_Angle_Digital_Camera
http://spamnet.blogspot.com/2006/06/11-super-wide-angle-digital-camera.html
http://www.gizmowatch.com/entry/howto-make-a-wide-angle-peep-hole-digital-camera-for-11/
http://www.lifehacker.com/software/diy/wide-angle-camera-lens-on-the-cheap-180997.php
http://www.designboom.com/weblog/read.php?CATEGORY_PK=&TOPIC_PK=732
http://ecopyusers.tributemedia.com/?p=1217

You can always go straight to my wide angle gallery.

Oh, and congrats to our famous Kitty, Elsa!

And so on!

My first Instructable!

Sunday, June 11th, 2006

I wrote my first instructable today:
$11 Super Wide Angle Digital Camera

Its based on this:
http://aggregate.org/DIT/peepfish/

And you can see a couple more photos in my gallery.