Wednesday, October 31, 2012

No Jelly Beans yet

Ok, so it does not really look like October, does it ...

After the earlier report  about October, I was really ...optimistic 

IT conservations: Jelly Bean on its way: From The Verge : The Taiwan-based manufacturer also revealed that a Jelly Bean update for the HTC  One X  and  One S  will arrive in Oct...

Saturday, October 27, 2012

Maps mash up: Underground vs post office

The other day, when I had to post an important letter, I was wondering if there is any post office close to an underground station on my commute, and I could not come up with one. So - me being me after all - I decided to do some in-depth analysis on this. And learn Python along the way.

1.  The Idea
Get all the underground stations and post offices as geo coordinates, and find those closest to each other.


2. Getting the underground data
Easy, the geo data of all the public transport stations (or ony the underground stations) can be found easily, since the are part of the open government data, shared by the municipality of Vienna.

3. Going postal
Getting the post office data is rather challenging, because they are seemingly not considered to be public enough.

Still, this can be done; so first get a list of all the post offices in Vienna from post.at. Best with a little python script (my first!!) to parse it.
Get all those with a ZIP code starting with '1' into a CSV file including their full street address.

Then - thanks for the hint, martin - use the Yahoo! PlaceFinder API to convert those postal addresses to geo coordinates. Get an Appid for Yahoo!, if you don't yet have one.

Important trick here: Don't place everything into the q=... query string, but separate it into postal, city, street, etc. Like this
u = yahooURL+"?appid="+yahooAppidy
u += "&postal="+po.zip
u += "&city="+po.city
u += "&street="+quote_plus(unicodedata.normalize('NFKD', po.addr).encode('ascii','ignore'))
u += "&country=Austria"
From Y! we get some fine XML back and use XPath to access the geo coordinates

doc = ElementTree(file=urlopen(u))
lat = doc.findall('.//Result/latitude')[0].text
lon = doc.findall('.//Result/longitude')[0].text
So now we have the geo coordinates of all the underground stations and all the post offices.

4. Visualize & Verify the data
Let's again use Python to create a simple KML file to load the date acquired so far into Google Maps (or Google Earth). There's a Simple KML python library to do just that. Here's are the maps (post offices, underground stations)

5. Do the Geo Math
This is the tricky part. I decided to put all the data into a (relational) database, and since I have DB2 installed on my system, it was of course DB2. I did not use any geo/spatial extension, but just put the latitude and longitude into proper types. Then I created a user defined function (UDF) to do the geo math. Actually, for this purpose this could have been simpler, since one can disregard all spherical aspects and assume the surface (of the Earth in Vienna) to be flat.
With my newly created haversine function the query then looks like this:

select haversine(p.lat,p.lon, u.lat,u.lon) as distance, p.plz,p.street,p.lat,p.lon,u.station,u.lat,u.lon
from ubahn.post p, ubahn.stationen u
where haversine(p.lat,p.lon, u.lat,u.lon) <1
order by 1 asc
fetch first 20 rows only

I'm only interested in post offices that are maximum 1km (distance<1) from an underground, and I only want the closest 20 of those (first 20 rows only)

6. Create a map
Export those data into a CSV file, and run a pyhton script that creates the KML file for this, with the post office being a point, the distance being a line, and the underground again a point. Map can be found here.

Turns out, there are more pairs than I actually thought.

Sunday, October 21, 2012

Geo-Distance vlg Haversine as a DB2 UDF

In a hack I'm currently working on (to be published soon) I needed to calculate the distance between two locations (on the surface of our planet). Admittedly, those are close addresses (all in Vienna), so I could have assumed them all to be on a plane (not an airplane, a flat surface...), but I felt like some real math.

This is a workaround for all of you who do not have spatial extender available or installed.

To calculate the distance of two points on (a perfectly spherical earth) you apply the haversine formula.
This is the representation of it as a DB2 user defined function (UDF)


CREATE FUNCTION HAVERSINE( lat1 decimal(10,8), lon1 decimal(10,8), lat2 decimal(10,8), lon2 decimal(10,8))
RETURNS DECIMAL(15,8)
F1: BEGIN ATOMIC
declare dlat, dlon, a, d double;
set dlat = radians(lat2-lat1);
set dlon = radians(lon2-lon1);
set a = sin(dlat/2) * sin(dlat/2) + cos(radians(lat1)) * cos(radians(lat2)) * sin(dlon/2) * sin(dlon/2);
set d = 2*6367*asin(sqrt(a));
return d;
END

The two points are given in latitude and longitude (in degrees) as lat1/lon1 and lat2/lon2. It returns the distance in kilometers. If you want to change this, replace 6367 (which happens to be the Earth's radius im km in Vienna, for which I needed this) with your radius and units,e.g. 3956 if you want miles in London.
Check it simply at Wolfram Alpha with "earth radius in london".

I guess it is not perfect, but it does work well. I should probably make it DETERMINISTIC (because it is) to improve performance.
Go ahead, play around.

Monday, October 15, 2012

Something's odd here

In tablets we currently observe two business models:

The Apple model -  make money on the hardware, therefore lock users in,  and make sure that there's enough content available for iOS to do so

The Amazon model - get consumers to buy content and stuff from Amazon,  and make sure they have a device for this.

What is odd here,  is that the Apple model,  which depends on globally availability and distribution of a physical goods (the iPad) is more scalable than the distribution of purely electric or virtual goods (content) in the Amazon model, because Amazon is (still) limited by availability of said content in each country and has to negotiate it...

Sick.

Wednesday, October 10, 2012

Firefox 16 is out

... and fighting with he F1 addon (an addon to share pages via Facebook, Twitter, gmail)

Problem was that the tab-key stopped working... both in web-pages as well as in the awesome bar (to jump to the search inbox).
Google revealed bug 788050  with the following exchange:

Luckily, F1 has been replaced by the Firefox Share addon, which solves the tab-key problem, but does not have a share button/icon on the address bar... 

The worrisome part of it, is that the addon is from Mozilla Labs, and not some thirdparty script kiddie.

Tuesday, October 02, 2012

Jelly Bean on its way

From The Verge:
The Taiwan-based manufacturer also revealed that a Jelly Bean update for the HTC One X and One S will arrive in October
hell yeah...

Saturday, September 29, 2012

A New Baby - Raspberry Pi

Finally - thanks to Max, I got my new baby:

a Raspberry Pi.

What for, you ask?

Don't know yet... I'm thinking along the lines of

  • a thermostat - with some fancy features
  • a power meter - for some "private" smart metering
Any other ideas welcome.

Today I finally found the time to get the beast running: only needed an SD card (believe it or not, I could not find any SD card at home... probably because my Nikon uses CF). 

I also got myself a new Logitech wireless keyboard and mouse; the first time I'm using a wireless... but only because the Pi is next to the TV (via HDMI cable), and I don't want any more cables lying around.


Apache is running, the dhcp lease is permanent... cool times ahead.



Monday, September 24, 2012

Oh boy!

Last Friday, late  afternoon, just when we arrived at our b&b for our 2 days vacation in Styria, my beloved HTC One S went into a reboot loop. Meaning, it would power off, restart and right after the HTC logo reboot again, and again, and again, ... forever.
Didn't change when connected to power.
Didn't change when I let the battery run out (which was fairly fast and easy with this behaviour).
Nothing.
After about 2 hours I was not only really annoyed, but also quite allergic to the Quietly brilliant logo and sound.

So I finally managed to get into the bootloader or diagnostics menu (or whatever it is called). The one you get when you press volume-down while powering up. There I - after some playing around - decided to go for a factory reset.
This helped.

Bad thing is, I only had a 2 months old Backup I took with My Backup Pro. Not only that, I didn't actually have it, because it was on the memory of the phone I just wiped...
At this time, I really wished, the HTC One still had physical SD cards...

And this in the middle of nowhere. I only had an Edge connection from time to time.
Luckily the b&b had at least free Wifi, so I could re-install all my apps from Google Play.

From there it was easy: all contacts were synched with Google. Nothing to do there.
My emails, tasks, appointments are of course all "in the cloud" and/or on our corporate server(s), so once I logged into the respective app, it was done.
My photos/videos got periodically backed up to Dropbox with the automatic camera upload. Nothing lost there.
Most podcasts I had in Google Reader, and BeyondPod does sync with Google reader. Good.

The only real pain (apart from losing all my achievements in Temple Run) was to get the application settings back again. Still working on some of those.

Lesson learned: always do a backup and do it to an external medium or the cloud. Will set this up tomorrow.
Really.
I swear.

Tuesday, August 28, 2012

ToS;DR

We all know, that no-one ever - ever!! - reads the terms-of-service of a web service. So in a very laudable effort, the guys around ToS;DR did this for us.

ToS;DR is of course a play on the ever popular tl;dr, which is not a broken HTML tag, but stands for too-long, didn't read:

Said whenever a nerd makes a post that is too long to bother reading.
(source: Urban Dictionary)


ToS;DR - short for Terms of Service; Didn't Read - takes care of that:

They created a dash board of the most important web services out there, and flagged them from class A (green) to class E (sooo red, you don't really want to touch it) with the most important aspects and consequences of using said service, like e.g. that twitpic by the terms of service you agree to (!) takes credit for your content.

This catalog of services and their ToS is just great. Imagine, this were to be represented as XML (or in any other machine readable format); then a browser extension could actually flag web pages you visit according to their service, i.e. really warn you about your "loss of copyright" (exaggerating) if you upload to twitpic...

I want this!

Thursday, August 23, 2012

Look, What I just did to my HTC One S!

No, the Jelly Bean upgrade is still not here for HTC One S, but at least here in Europe we got the 4.0.4 upgrade on ICS.

Upgrade was totally smooth and flawless. And now, back to waiting for JB...

Friday, August 17, 2012

Listen, listen, gone.

So, finally, Google Listen is gone from my mobile.

I'll stick with BeyondPod.

Google Play Store Gift Cards

According to several reports, the Google Play Store is finally getting gift cards.
Google Play Store Gift Cards - Great Idea!:

This essentially places the Google Play Store on par with the Apple iTunes ecosystem.

It means that anyone can purchase apps and content from the Play Store, without the need for a credit card.
For example, my kids!

And thus it gives more revenue opportunities to app developers in the Android ecosystem.

Well, let's see when it will become available outside the US...

Monday, August 13, 2012

Cisco AnyConnect VPN Client for Android

Finally, with my move to an ICS device I do have a VPN client compatible with our corporate VPN, Cisco AnyConnect. For earlier versions, this was only sort-of available for rooted devices, and I did not really want to root my old HTC just for this.

But now for Android 4 and above (ICS+) there is AnyConnect ICS+ available in the Google Play Store.

 Setup and installation is straightforward. Of course you need to know the connection details of your VPN (hostname, mainly; assuming you do know your userid and password anyway).

It comes with a nice widget for fast and easy access; remembers your userid after the first connect, and also shows the VPN status with a key (connected) in the notification area.

Works great.

Still don't know what I should do in the corporate network with my mobile, though.

Sunday, August 12, 2012

Replacing Google Listen

The other day Google announced they would discontinue Google Listen (my favorite podcast fetcher and player for Android until now):

We launched Google Listen through Google Labs in August 2009, to give people a way to discover and listen to podcasts. However, with Google Play, people now have access to a wider variety of podcast apps, so we’ve discontinued Listen. People who have already installed the app can still use it, but after November 1, podcast search won’t function. You can access your podcast subscriptions in Google Reader in the “Listen Subscriptions” folder and download them from the Import/Export tab.
So I finally did some research for a good podcast player for Android; my criteria were:
  • use or at least import my current podcast feeds from Google Reader
  • an option to restrict episode download on Wifi only
  • an option to restrict episode download only when charging (not too critical, though)
  • easily accessible controls for play/pause and skip
  • good control over the order the episodes play (playlist)
  • good UI
I found all this in ... drumroll ... BeyondPod.

What I really like is the smart play list, where you can configure BeyondPod to e.g. take all episodes from category x from oldest to newest first, and the all other episodes from category y. I use this to start with all the short 2-5 minutes episodes from e.g. FM4 or OE1 (both from Austrian public radio), followed by the longer ones, e.g. Tech News Today, or In Beta.[1].

The concept of categories makes it easier to configure update frequency, order in which to play episodes, etc etc. Really nice set of settings there.

BeyondPod comes as a free trial version, with all features enabled for the first 7 days. After that, you either continue using the free version - what they call "Lite" - with a limited feature set:
When using the Lite version, you can still add feeds, update, download and play your podcasts. The main limitation is that in order to get the latest episodes, you have to manualy refresh each of your feeds using the circular "Refresh" button located in the top right corner the Feed Content View.
This is too "Lite" for me, so I purchased the BeyondPod Unlock Key from the Google Play store for €5.51/$6.99 so I can continue to use the full version. Still worth the money.

I moved to BeyondPod about a week ago and I'm glad I did.

btw: you can find a review of BeyondPod All About Android episode #5 (minute 38:20)

--
[1] other weekly podcasts like TWiT, or TWiG, or AAA I still listen to on my iPod nano

Thursday, August 09, 2012

Data Usage Monitor in Android ICS

Found this while playing around with my HTC One S running Ice Cream Sandwich (aka ICS, aka Android 4.0) while on vacation and roaming (!).

If you pull down the Settings menu or open it via the apps screen under *** more you will find a Usage menu.

Opening this will reveal some very useful and detailed statistics about the data usage of your phone.

You can see the wireless data as it accumulates over the data usage cycle as you define it. Since I am on a corporate plan where the billing cycle starts with the first of the months, I set the usage cycle to the month. If your billing cycle starts on the - say - 21st, you should change this to 21st to 21st of the following month. Set the Reset data count value for this.

You can also set two different thresholds.

  1. A simple warning when a certain data volume is reached within the usage cycle - see the 1.0GB bar in the graphic
  2. A real limit, where - once reached - the phone will no longer allow a data connection. As you can see I have not activated the hard limit.
If you scroll down further, you can see in detail how the data is been use per application. This lets you easily identify data hogs, giving you some good data points when you want to tweak your data consumption.

In my cases here (just for demo) a good idea would be turn of one of the podcast players (I have both, BeyondPod and Google Listen active right now... more on this later), and also restrict them to Wifi only... Or maybe do less Facebook while commuting :)

Very useful indeed. If you are running ICS already, take a look at it.


BTW: You can turn this on for Wifi, too. This will give a separate tab on this page.

Thursday, August 02, 2012

Wonderfull errror message

Thank you, Facebook... that really helps.
btw: I only clicked on a Instagram link on Facebook. The error itself is from http://graph.facebook.com/l.php?u=http....

Wednesday, August 01, 2012

Android ICS for Raspberry Pi

Wow, ICS is coming to the Raspberry Pi... you know that little cheap alsmost DYI computer.

This sounds like serious fun!
I just might...
I just might...

Monday, July 09, 2012

CalDAV for Android

I've been looking for this since my first Android last year, but at that time there was no CalDAV support for Android. So I had to use the Notify Active Sync solution my company provided. This basically allowed to sync the calendar (and email, ...) as ActiveSync (from the handset's point of view) to our corporate calendar/email/...

With the re-installation on my new HTC One S I found that there is a ("native") CalDAV sync for Android, and luckily our corporate calendar supports CalDAV.


With CalDav-Sync beta from the Google play store you create - as expected - an additional calendar and set up a new profile in "Accounts & sync".

You can change the sync interval, the range of events to sync (past and future) ...
There are also some kludges and fixes for weird calendar or phone behaviour, e.g.  that some Android phones seem to create events only as tentative.

The default mode is a one-way sync from server to phone only, but all you need to do is disable this option, and - voilà - you have a two way sync from server to phone and vice versa.
I have had this running for about a week now and it works like a charme... Although I have to admit that I did not try any synchronization conflicts yet.

Sunday, July 08, 2012

HTC One S

For almost exactly one and a half years my son was the owner of a Sony Ericsson Xperia X10 mini pro. To be precise, he had two of them, probably three - since we had the first replaced immediately. With all three of them, the Sony showed huge problems with charging the battery after a while. We already went through an external charger, which worked fine. So it was never a problem of the battery, or the USB cable.

So about a week ago, I decided to get myself a new phone and pass the HTC Desire Z on to my son.

At first I could not really make up my mind between
  • HTC One S
  • HTC One X
  • Samsung Galaxy S III
So I want to a A1 store, where they had all three of them on display.  The S3 and the One X are of almost exactly the same size (in all three dimensions; or four if you include weight :) ). Although the display of the One S is significantly smaller, the whole body of it is only marginally smaller than those two.

Since I still don't like the Samsung skin, and I - quite frankly - love HTC Sense, the choice was only between the two HTCs.
Or in other words:
  • Do I need 1280 HD on my phone? - No
  • Do I need NFC? - No... not yet, not sure if ever.
  • Do I need a 4.7 display instead of 4.3? - No
  • Is the One S display sufficient ?  - Yes
  • Do the One X features justify 100 EUR more? - No
There. I ended up with a HTC One S and I'm totally happy with it.
Android 4.0.x (Ice Cream Sandwich)  and dual core are just ... wow.

I'll continue to report on my love for this gadget in the weeks to come.