2011-12-19

OK, G+, is *this* the killer app?

Since I'm demonstrating a visible lack of care about my online privacy or any of the social media implications, I clicked the "OK link to Google+" button on my Blog. Thus revealing my true name and any number of linked bits of information.

Mostly I'm interested to see what if anything happens: G+, after an initial flurry, seems to be settling down to the Google Wave lifecycle, rather than undergoing Facebook-like take off. I mostly only visit G+ after I've exhausted all other forms of update: Google Reader first, Twitter second, Facebook third, Reddit fourth and usually that's enough. If I'm still feeding for info and I've exhausted all those sources, maybe I'll click on Google+ but only to be disappointed by all the duplicate info posted way later there than elsewhere.


Honestly I don't know what Google's got to do to make G+ a success. I suppose I'm just sat around like everyone else here waiting for the next shoe to drop...

Merry Christmas to All Our Reader!

2011-11-01

iOS5: Apple's implementation of "Nudge" theory...

I've been very happy with the features that iOS5 has brought to my iPhone 3GS. When I bought it, over 2 years ago, I had a (nominally) single-tasking device that could read HTML5 web pages, run some cool apps, find it's location and orientation anywhere in the world, and Do Email.

In the 2 years since, I've gained multitasking (of a sort), full real-time sync of email, contacts and calendars (including shared calendars - but I have developments at Google to thank for that, not Apple), a good-enough Reminders / To Do list application, Real-time stalking location tracking of friends and family, and finally a Notifications system worthy of the name.

But with iOS5 there's a price to pay, and it's performance: my iPhone has gone from snappy, instant response to taking a couple of seconds to load a new App (longer for 3rd party ones). The increase in memory load of the OS is notable in Safari where it's now rare for switching tabs not to cause the page to reload (a sign it's been stolen from memory and now needs to be re-retrieved and rendered), and on occasion I've had 10-second freezes where launching an application has caused some sort of Grim Reaper to go around in the background and start killing off unused apps. All of this is taking it's toll on the User Experience (and also battery life, always the smart phone's Achilles heal).

But my phone is 2 years old, and despite it still being sold (as the entry-level iPhone aimed at emerging markets), I have a feeling Apple have very little interest in spending much time performing the performance tuning and optimization for it. Indeed, if I were a more cynical man than I undoubtedly am, I would suspect that here is an excellent opportunity to Nudge fans of the iPhone like myself towards a replacement purchase: Here are all these great features, they may say, and don't you think they'd work better on a newer phone? Available right now from an Apple Store near you!

Anyway, my iPhone 4S is waiting for me at home once I return from this trip. Damn you, Brain, for being so easily led...




2011-10-14

iOS 5: Everyone else has a snap judgement on it, here's mine

Things I like about iOS 5:
  • PhotoStream, 
  • WiFi sync, 
  • Stalker Mode (AKA "Find my Friends")
  • The excellent new Notifications system
  • Reminders
  • iCloud backup

Things I don't like
:
  • Sync'd playlists don't retain sort order (my podcasts aren't listed by publication date. Nyah!), 
  • My poor 3GS is now noticeably low on memory given how much applications are swapping, 
  • I've had at least one lockup of the phone changing tracks
  • A failed WiFi sync caused iTunes to view it as a new phone and trash the contents leading to a very late night rebuild.

But if I'd have wanted a quiet life I'd have waited for iOS 5.1, wouldn't I?

2011-08-10

Stargazing

I had what amounts to a religious experience last night.

Let me explain: For my *cough* significant *cough* birthday, my Dearly Beloved indulged me with a recent whim: a brand new Telescope. Nothing too fancy, I am a dilettante and a newcomer, not an expert or an obsessive. Nonetheless, the Celestron NexStar 102SLT is a fine piece of kit, a 4.5" refractor with a smashing computer-driven mount, making finding and locking on to interesting things a matter of calibrate, select from menu, press button and observe.

However, as always there has been a problem and in this case it's environmental. Apart from one try-out after it arrived (which mainly proved how well the calibration and tracking worked), either the weather's been overcast or I've not been around to try it out.

Thus it was that when I observed at about 21:00 last night that there was a bright moon and nearly clear skies, the glass of white wine inside me convinced me it was well past time to take up station in the back garden in shorts and sandals and see what I can see.

My preferred target would have been a planet - I'm dying to see Saturn's rings or as many of Jupiter's moons as possible - but the plane of the ecliptic is on the street side of our house, where the bright sodium lights & obscuring neighbour houses together with a minimal sense of decorum prevented me setting up. Besides, at this time of year Saturn's setting pretty much with the sun so I had no chance.

This left me with the mostly-Northern sky to observe, and thus deep-field objects rather than anything in the solar system. Stars are fine, but I'm not experienced enough to navigate the skies myself or to particularly tell the difference between them. So I used the "Tour" function on the 'scope to find me something a bit more than a point-light-source to look at.

I was rewarded with a l-o-n-g list of nebulae and galaxies above the horizon to choose from. I was pre-warned from my reading of the manuals etc that observing such far away objects by eye with such an amateur scope was unlikely to produce great results. However, I gamely selected the Andromeda Galaxy, waited as the 'scope slewed around, and put my eye to the objective.

I was rewarded with a smudge. A dim smudge, with a few pin-point stars around it. My natural conclusion was a spot on the lens, or perhaps a passing cloud. But slewing around, then back made the smudge re-appear, and keep the same position.

And here's the religious part of the experience: I saw a galaxy, but it requires faith on my part to believe that that dim smear between a bunch of stars is the light resulting from about a trillion stars 2.5 million light years away, rather than some sort of aberration of the 'scope or the heavens.

Intrigued and a little humbled by the experience - my own puny ageing weak eyes, gazing myopically on photons older than my species - I tried again. M2 was the same, the Dumbbell Nebula even weaker. Finally I tried the Ring Nebula which was far above the house.

If you google for it, you'll find pictures that look like this:
(Picture copyright NASA, taken from Wikipedia)

Whereas what I saw through my 7mm 72x magnification view looked more like this:

(Screenshot from Stellarium, post-processed to simulate actual view)

That smudge in the middle there is a ring about 1/2 a light year in diameter, 1,400 light years from here and the remnants of an exploded red giant star. Nerd that I am, I find the fact that I can see anything at all quite inspiring, as with Andromeda the implications of what I was able to see with my own eye are far, far more impressive and humbling than the image in any way suggests.

In many ways the experience - far from being a disappointment - gave me a new appreciation of the work of astronomers. Before the age of photography, this was all they ever saw and yet the star maps of even two centuries ago contain wonderfully detailed observations. The leap of intuition to go from "there's a smudge in the sky" to "That's another Galaxy, with more stars than our own, inconceivably far away" blows me away. 

I don't have the time, inclination nor (I strongly suspect) the intellect to get there myself, therefore I am in a position of having to have faith that what I was looking at was as described; I will never be in a position to prove this for myself.

But nonetheless it was a rewarding experience I look forward to repeating...


2011-07-19

Using a Vodafone K4511 3G USB Dongle on Linux

There's plenty out there for those with Vodafone's previous stick, the Huawei K4505, but they've recently switched to providing a new model, the K4511. Although the dongle comes with support for Windows and Mac, I haven't found any pre-configured support for Linux.

Rather annoyingly I'm now using a fairly odd choice of distro, based around RHEL 6.1. Which means most people who might chance across this post will inevitably have to do something different. But as a pointer anyway, here's what I needed to do to get it working:

  • On insertion, "lsusb" will present Vendor=0x12d1, Product=0x14b7. There are currently no provided usb_modeswitch configs for this, so no device class will manifest. 
  • Make sure you've installed the latest "usb_modeswitch" and (if separate) "usb_modeswitch-data" packages for your distro.
  • Create the file /etc/usb_modeswitch.d/12d1:14b7 (hint: the colon needs escaping. Try "vi /etc/usb_modeswitch.d/12d1\:14b7" to create it)
  • Make the contents of this file as follows:
# Huawei, newer modems

DefaultVendor= 0x12d1
DefaultProduct=0x14b7

TargetVendor= 0x12d1
TargetProduct= 0x14cc

CheckSuccess=20

MessageContent="55534243123456780000000000000011062000000100000000000000000000"

(Note: I copied the existing 12d1:1446 file and modified only the "DefaultProduct" and "TargetProduct" values to get this output. What I'd have done if a different "MessageContent" was required, I have no idea...)

  • Edit the existing /lib/udev/rules.d/40-usb_modeswitch.rules file. Add a (single) line:
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="14b7", RUN+="usb_modeswitch '%b/%k'"

(Note: Again, I copied & modified the existing line for device 12d1:1446)


  • For debugging purposes, you may want to set "EnableLogging=1" in /etc/usb_modeswitch.conf. If you do, files will be produced in /var/log/, in particular usb_modeswitch_3-4:1.0 will show the results of the switch, and you'll also get usb_modeswitch_ttyUSB[0-4] if it works.
  • Now insert the USB Dongle. After a short pause, it should be re-configured as a Modem *AND* a CD-ROM device - I get the file "10.2.102_RC1" appearing on the desktop as that's the firmware version loaded as a virtual CD device.
  • Configure NetworkManager as normal for a "Mobile Broadband" connection - I found the wizard supplied all the right defaults
  • Connect as normal - click the NetworkManager icon, select the Mobile Broadband connection you configured, and it should connect. After connection, click again and you'll see the service type (GPRS/EDGE/3G) and current network strength bars.
  • It's probably best to right-click the virtual CD device and "Eject" or "Safely Remove Drive" it before unplugging the stick, although I haven't had anything nasty happen to me yet when I've forgotten.
For Distros with no /etc/usb_modeswitch.d directory and/or files, you should get the same results by editing whatever's driving udev on your platform and adding something like:



usb_modeswitch -v 0x12d1 -p 0x14b7 -V 0x12d1 -P 0x14cc -M 55534243123456780000000000000011062000000100000000000000000000 -s 20

It's possible you might have to add some voodoo to ensure the option module is loaded to handle the /dev/ttyUSB[0-4] devices; I didn't have to bother as udev handled that for me automatically.

2011-06-27

First-world problems

Here I sit, a privileged member of the middle classes in one of the most privileged countries on the planet. 99% of the global population have serious life-affecting problems (you know: hunger, poverty, disease, shelter) which I fervently hope will never cross my effete brow.

OK, with all that out of the way:

ADSL. Copper Wiring, in particular, has been vexing me somewhat recently.

I've had, for the last 4 years, a very reliable connection that over time has increased in speed from 2MBit/S up to about 10MBit/S briefly. For most of that time I've been nicely and reliably connected at about 6Mbit/S, or in english numbers about 600KByte/Sec peak.

Now it's clear that there's only so far you can go with old copper wires originally put in to support a fairly basic-quality voice link. ADSL-Max (or whatever it's branded as; that which delivers ADSL2+ at least) is, from my experience, as fast as we're going on this infrastructure.

I'm about 3KM in cable distance from the exchange. I get about 40db attenuation, and have consistently gotten 1/2 to 2/3rds of what I've been promised (all those "up to XXX" ads - very disingenuous). Frankly, as long as it's stable and reliable speed has been a second priority.

My exchange got enabled for ADSL2+ last summer. I saw a re-sync and speed up - temporarily - from about 6Mbit to about 8Mbit down (and occasionally from 100Kbit to 500Kbit up). Then my ISP did their bit of the upgrade in April. Speed (which had dropped back to 6Mbit) went back up to 8Mbit (occasionally 9) and upload went up to 1Mbit then back to 500Kbit. All well and good.

Then the bad weather came at the end of May. Oh, and I got a new router - must declare my own actions in this I guess - in an effort to get faster speeds (a DG834GT apparently has a better chipset for higher-noise environments. Apparently). Worked great for exactly 1 day, then I went through 2 weeks of connection hell. Up, down, re-syncs, speed ups, slow downs and for considerable periods of time a line that went up and down on a 2-minute cycle. Ever tried web browsing when you've got a connection for 30 seconds in every 2 minutes?

I can't say what solved it - calling my ISP and having them "monitor the connection" certainly made a big difference, and it's been up for 8 days now. And what's worse is that I can't say what caused it either - notionally it would be plugging in a new router, but the problems persisted when I reverted to the old router. In fact they got worse.

The biggest correlation was a period of extremely heavy rain. Is it possible, therefore, that my internet connection depends on how damp the bits of copper connecting me to the world get?

Roll on the Fibre upgrade, that's all I can say...

2011-05-01

iBusted

Ok, Uncle Steve says I shouldn't worry, this is all cached geolocation data for my own good.

But those dots and locations in France are where I had all Data usage explicitly turned off. And it still gathered them: how? (if I am to believe no-data-usage-was-enabled)....

2011-01-14

Mac OS X Services are completely Awesome, Especially since you can make your own with Automator

The “Services” menu option (under the Application's menu for whatever's active) is not the best described thing about Macs. To be honest I've not had much to do with it so far. But this was a mistake: it's an incredibly powerful system-wide integration point allowing all sorts of cross-application functionality. And one of the reasons it's (relatively) hard to self-discover is because it's context-sensitive: Services only appear in the menu if they can be used. So just clicking randomly isn't going to let you know what you can get up to; try selecting some text first, and you'll find a bunch of stuff's become possible.
So I was a bit frustrated to find that an App I was using was happily let me type away, but couldn't tell me how many words or characters were in the document I was creating. Aha, I thought, I bet there's a way of writing some AppleScript to do that. AppleScript on it's own, though, requires some sort of mechanism to launch it; typically an App's got to have a scripting interface. It was this that got me pondering about using a system-wide Service instead.
Reading up on t'internet I found a myriad of ways of creating a new service, some of which looked quite complicated and some required 3rd party applications to make it all happen. However, each copy of OS X comes not only with AppleScript built in, but since 10.4 the rather nifty (if a little looked-down-upon by real developers…) Automator Drag-and-Drop automation creator. In addition to very handy stuff like making writing custom app launchers laughably easy (e.g. I've got an App that needs a particular CD loaded before it'll run, so I've got an App Launcher that checks for it being mounted before launching), and the much praised “Folder Actions” type (that lets very nifty stuff happen when files are created or moved into particular folders), Automator can be used to create Services.
So with that in mind, here's how I created a Word Counter service that will count the words and characters in any selected text, in any application, at any time:
Worked Example: Creating and testing a Word Counter Service with Automator
Acknowledgements: I don't know enough AppleScript to write my own unaided yet. So the actual code that does the work was adapted from examples at Use AppleScript to count words and characters in text 
  • Launch Automator (Applications → Automator)
  • Choose the “Service” Template for your new Workflow:


  • In the “Actions” Search box, type “Apple”, then drag “Run AppleScript” to the main Workflow window:

  • Make sure that the Service options are set appropriately, and add the code to the AppleScript window that actually performs the calculation & displays the Alert Box:

  • on run {input, parameters}
     set wc to count words of (input as string)
     set cc to count characters of (input as string)
     display alert "Selection contains " & wc & " Words and " & cc & " Characters" as informational
     return input
    end run
  • Now the "Gotcha". You can use “Run” to test the Workflow, but because it's a Service you'll receive this warning:

  • Rectify the error by inserting a “Get Specified Text” action before the AppleScript and supply some test text to word count:

  • Once you're happy with how the Workflow operates, remove the Get Specified Text action and then do File → Save As (calling the Service “Word Count”) to save the Workflow as a Service.
  • You can close Automator now, we're done with that.
  • Go to another application, select some text, then do (Application) → Services → Word Count:


On my iMac there's a short delay between selecting the Service and the alert box appearing. This indicates to me that we're probably not using the most efficient way of creating or calling a Service. But I'm fairly confident that's it's the quickest and simplest way of doing it, and my time is much more valuable than the computers.

Other Useful Services Ideas

ROT-13

I got some email with ROT-13 text in, which irritated me as Mail.App has no way of converting. A little Googling got me this thread: Re: Simple rot-13 encoding script …Which I turned into a Service using exactly the same steps as in the previous example, but with the following AppleScript action:
on run {input, parameters}
    set inString to input as string
    if length of inString is 0 then
        set inString to "(abguvat fryrpgrq)"
    end if
    set outString to ""
    set plainChars to "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
    set rotChars to "nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM"
    considering case
        repeat with x from 1 to count inString
            set offsetNum to offset of (character x of inString) in plainChars
            if offsetNum > 0 then
                set outString to outString & character offsetNum of rotChars
            else
                set outString to outString & character x of inString
            end if
        end repeat
    end considering
    display alert outString as informational
    return input
end run
…I'd be happier with some other way of displaying the text, because an Alert Box is going to run out of space and I don't think you'll get scroll bars. Ideally you'd replace-in-context with the ROT-13 text, but I think support for that is application-specific.
Also note that lame attempt at error handling (the if length of inString is 0 clause). I wanted to handle the case of no text being supplied to the Service by popping up a message to that effect (I ROT-13 encrypted ”(nothing selected)” for the script to decode instead). However, as noted above, the Services are context sensitive so you should never be able to select the ROT-13 (or Word Count) services unless their input condition (some text is selected) is met.
As a side note, I had some difficulty with this Action based on my not really knowing what I was doing. Using the input parameter directly was causing All Sorts Of Aggro, so I decided to explicitly cast it to string (calling it inString) in the process. Debugging AppleScripts within a Workflow is very limited; running the Workflow just gives you an error message which it's up to you to work out. You can run just the AppleScript itself by clicking the green arrow in the AppleScript action, but this doesn't do anything to get you up to the start point, so there's no input to the string (which was the genesis of my efforts to supply some default within the script)). However, this will at least highlight the offending statement in the code and gives you a much better chance of resolving the problem.
Text-to-Speech

Here's one that's even easier to create: Get your Mac to use the inbuilt TTS capabilities to speak whatever text is currently selected. No AppleScript is required for this, as there's a built-in action called “Speak Text”. Note in the screenshot below I've added a “Get Specified Text” action for testing purposes which I'll remove before doing File → Save As and calling it “Speak Selected Text”. It's well worth playing around with the different available Voices, some of which are quite bizarre…


2011-01-11

No more The Daily Show? More4, I Am Disappoint.

More4's only decent show, The Daily Show with Jon Stewart, is going from 4 nights a week to the once-per-week highlights show (Global Edition). Source.

TDS was the only reason for More4 to exist, as far as I'm concerned. Their justification for chopping it is particularly ironic:

More 4 have said that the reason for this is that it wants to concentrate on ‘high end’ American programming.To this end they have purchased and intend to show the US version of Shameless!

Or in other words, their commitment to "high end" US TV means they've dropped the high-end US programme in favour of a rehash of a broad UK drama. Marvellous.

If you don't like this decision, you can complain here (I have).

The Sound of Silence

Hey, nobody said I had a commitment to Blog, did they?

Still, I'm having fun playing with all these lovely new Mac toys...