All posts in “Computers”

Syncing Google Calendar to your iPhone

I’ve just been reading up on something cool from Google.

Basically, I wanted to get my calendars on Google Calendar synchronised with my iPhone (because really, my google calendar is my main calendar) and seeing as iPhone OS 3.0 supports the CalDAV standard, it should be a piece of piss.

Anyway. Turns out, you can add the calendar quite easily by following these instructions

http://www.bagofspanners.com/2009/06/17/subscribing-to-google-calendars-via-caldav-in-iphone-os-3-0/

The problem with this approach though is that you only get one calendar. Fine if you only have one, but if you have several (like I do,) then it’s no bloody good.

So, lots of references to this page later…..

http://www.google.com/support/mobile/bin/answer.py?answer=138759&topic=14252

… and I finally twig what’s going on.

Turns out, Google have implemented an Exchange Server which lets you synchronise Calendar items and Contacts with your account.

Reading between the lines, you have to be careful regarding the contacts in your GMail account, as possibly they end up on your iPhone and any contacts on your iPhone end up on GMail. It sounds like you can turn that off, but actually it sounds quite useful too. The added plus of that is, if you change the contacts in GMail, they should synchronise back to Address Book on your Mac once you plug you iPhone back in. So, one address book to rule them all.

The added plus is, you get all of your calendars on you iPhone and you can add and remove items to your hearts content!

VBScript function IsNumeric

Brilliant.

Last night, we discovered that the VBScript function “IsNumeric” is a little more clever than you’d like, but there’s also no simpler version either.

Consider the following scenario.

We have the user input in a bit of text on screen. We need to process that (client-side), and part of that processing needs to find out if it is a number or not (i.e. if it’s a number, do this, otherwise, do that.)

Last night, we encountered a problem with the word “65d1″ – clearly, it’s not a number (the “d” gives that away,) however, IsNumeric says that it is. If you CInt(“65d1″) you get 650. WTF?

A little more testing reveals the following:

CInt("65d0")  => 65
CInt("65d1")  => 650
CInt("65d2")  => 6500
CInt("65d-1") => 6

So obviously that “d” refers to “*(10 ^ following number)” – however, I can’t find a reference for that.

A bit of googling turns up this page , which shows that adding a space at the front doesn’t stop it from being classed as numeric.

The only real clue to what is going on is to read, and interpret, the MSDN reference page which states:

Returns a Boolean value indicating whether an expression can be evaluated as a number.

And there-in lies the answer – that expression can be evaluated as a number, not that it is a number.

Fortunately, there is an implementation listed on the first page which shows you an alternative way to get the job done.

I’m now wondering if there are other things that you can enter that will affect an number in that way. I tried

CInt("6*5")

but that just errored. I’m wondering whether “e” has a similar effect.

Update: Yes, “e” (at first glance) appears to have an identical effect to “d”.

CInt("65D1") => 650
CInt("65D1") => 6500
CInt("65E1") => 650
CInt("65E1") => 6500

Why do Americans make up words?

Check out the comment on the Reddit.com post below:

vagif comments on Hypothetical situation: if someone were walking down the street one day just minding their own business and they stumbled upon a lost flash disk with the entire Windows7 source code on it … What do you think it would be worth?… To Microsoft… To Google … To Apple?.

Google and Apple officials will immediately distantiate themselves from you.

“Distantiate”??? LOL, the word is “distance”, you pillock.

Americans, you’re so funny.

WAP on the iPhone

I have just discovered that the iPhone doesn’t support WAP sites (I discovered this by trying to use National Rail‘s WAP site).

Now, I’m aware that this might sound a little redundant, but I really think the iPhone should work with WAP pages. Sure, you have a perfectly good web browser on the iPhone that renders ordinary web pages perfectly well. But….

You simply cannot escape from the fact that the screen is small, and it can be a real pain in the arse scrolling around the screen, zooming in and out, etc.

Which are similar problems that WAP pages were designed to solve!

And seeing as there are some sites out there that are much, much, quicker to use through a WAP site rather than their HTML-based equivalents, it kind of makes sense some times….

No? Just me then….

Debugging Client-Side VBScript

Having used client-side VBScript for years at work, I discovered the joys of the Microsoft Script Debugger several years ago. Unfortunately, until now, I’ve been unable to get the debugger to invoke when I desired (rather than having to wait for a crash!)

Several times, I ran across web pages saying that you just type “debugger” – however that only works with Javascript and not VBScript. I also found loads of references to Server-side debugger with ASP.Net – again that doesn’t work with client side.

But, finally, today I managed to find an article which actually explains the process, and marvellously, it’s not difficult and it’s (logically) a one liner.

So I can reveal that to invoke the debugger in client-side VBScript, all you type is…..

stop

Huzzah!

A Quick Cough-Cough-Splutter-Splutter Moment

I had a bit of a shock the other day, whilst eating breakfast, as to what counts as “diminutive”.

Apparently, according to the BBC Click TV programme, the application “360° Desktop

only sips a diminutive 33MB of RAM

Cough-cough-splutter-splutter. 33MB is diminutive? Jesus, I would have said that that is more like “a fuck load”, especially for a desktop utility!

RESTful Webservices

Aha!

Someone’s finally done the decent thing, read the book and then consolidated it online!

REST – a quick summary

How to re-partition a USB Drive in Windows

I recently played with the Moblin Linux Distribution by installing it on a USB stick.

The only problem was, the USB stick was 8GB and the image was only 700MB – stupidly, I was expecting the remaining ~7.2GB to be available. It wasn’t (because it was a .img file)

So… this morning I went on a hunt to find a way to restore my USB stick back to normal.

I found it here: Re: How to partition usb thumb stick??

under XP, just go Start > Run and type diskmgmt.msc

Works a treat!

Time to Delete

Argh! I’ve just read an article that I can’t help but think is the most useful sounding useless idea ever.

Called “Time to Delete“, it’s an idea for an extension to Windows, and subsequent boiler plate code for an implementation, that lets you indicate the date and time that a file or folder should be deleted.

Now, while this sounds like a good idea, it’s actually not that useful. Think about it. How often do you know precisely when you’ll be able to delete a file in the future? You don’t, most of the time. It’s mostly around events happening, not dates and times, for example take the event of “Delete this when this project is completed.” What happens if the project overruns? You’ve got to remember to go back and remove that clause, otherwise, you’re hard work will disappear two weeks before the project actually ends.

And besides, a lot of the time, you don’t want to delete something, merely archive it to DVD/Flash Drive/Central Server/etc. I know that for my projects at work, deleting data is one of the worst things I can do – at least for a year afterwards, so moving it to the central server works immensely well!

What also really annoys me about this article is that it implements the code as a “Send To” extension in Windows. That’s the “Send To” option when you right click on a file or folder. Let’s just review the Grammar of that sentence: “Send To Time to Delete”. ARGH! Surely, you implement it is a shell extension so that it appears in the properties menu as it’s own item!

Reducing My Bandwidth

I’m facing a rather practical problem at work, and it’s kind of highlighted to me one potential downside of AJAX based websites and Web 2.0.

I was recently shown a chart of bandwidth usage and number of web hits for people in my department at work. This made me immediately think that I should start to reduce my non-work web traffic to avoid showing up as a major blip on the radar.

One simple way I realised that I could do this was to reduce the amount of RSS feeds that I unnecessarily subscribed to, and to reduce the number of times I refreshed the feeds.

Then I realised, that every time I displayed a feed, I would cause my hits to go up. If looked at a feed in my RSS reader (the “Sage” plugin for Firefox,) I would cause an HTTP request for the page, and a request for every image. If I went away from the feed and then back to it, then I’d refresh everything again. If there are 100 RSS items in the feed, each with (say) 3 pictures in, that’s a lot of web requests. Couple to that, the “Read” status was based off of your browsing history, I have my suspicions that every time I marked a post read (even though I didn’t read it,) it caused a web request as well.

Since upgrading to Firefox 3.5, Sage has unfortunately stopped working, so instead I switched to Google Reader, which I was hoping should off load some of my hits to the Google servers and instead I would just see the changes.

Then I realised that all of these wonderful AJAX websites that I use are going to be doing the same damn thing. Every time an AJAX request is sent, that’s another hit. Thinking of GMail, that sends an awful lot of requests. Google Reader seems to be even worse – every time I scroll past a post I don’t want, it gets marked as read – that’s an AJAX request. It refreshes the posts list a lot too, that’s more requests. I’m now wondering too, whether the RSS feeds aren’t just parsed locally on your PC, and you’re still doing the same number of requests.

Unfortunately, I can’t find any technical reference for Google Reader to explain how many requests are made, and from which location (my PC or Google Server.) I guess Google aren’t really ready to give out the information to some of their architecture.

Even now, typing this blog entry, WordPress is continually using AJAX to save a draft version and to provide a word count.

It seems that the one downside to the Web 2.0 world is that if you’re being monitored in terms of bandwidth usage or number of web requests, AJAX (and the like) are most definitely not your friends.

For now, if anyone can point me in the direction of an RSS reader that definitely does cache images (and other embedded items,) and does not make web requests to mark something as read (and is also “trustworthy” in terms of security and preferably on some Free license) that would be helpful