Wednesday, December 9. 2009
Looks like a review of the tramTRACKER iPhone app was posted in the AFR today in amongst a review of a bunch of other iPhone apps.
"In metropolitan Melbourne the king of the localised apps is TramTracker, a way of hooking an iPhone into the real time transport information the system has been able to generate for years.
Recently ousted tram operator Yarra Trams must be cursing the timing of its failed contract renewal bid. If TramTracker for iPhone had run a couple of years before Judgement Day, they might have held onto the contract. The beauty of
TramTracker is not during the peak, when transport is regular - if unpleasantly overfull. It's that more people will be prepared to travel at off-peak times. When you can reliably arrive at a stop a couple of minutes before a tram instead of risking a cold and wet or warm and windy 20-minute wait going in and coming home, a tram seems a fine way of getting to the CBD late on a Saturday afternoon.
It feels rather luxurious to sip a sparkler in the bar after the show at the Victorian Arts Centre until the iPhone announces that one's personal transport is about to arrive, and step on the carriage a minute or two later."
Thursday, October 15. 2009
Whoa, it's been a while since posting!
Anyway, for a particular iPhone project I've been working on I've come across a requirement to be able to draw an underline underneath text on a UILabel. Google pointed me to a couple of tips, but lacked a complete solution.
Posted below is what I ended up with.
UnderLineLabel.h
Click on a comment to hide it. Click here to show all comments.
@interface UnderLineLabel : UILabel {
BOOL underline;
}
@property (nonatomic,getter=isUnderlined) BOOL underline;
@end
UnderLineLabel.m
Click on a comment to hide it. Click here to show all comments.
#import "UnderLineLabel.h"
@implementation UnderLineLabel
@synthesize underline;
- (void)drawTextInRect:(CGRect)rect
{
[super drawTextInRect:rect];
if ([self isUnderlined])
{
// Get the size of the label
CGSize dynamicSize = [self.text sizeWithFont:self.font constrainedToSize:CGSizeMake(99999, 99999) lineBreakMode:self.lineBreakMode];
// Get the current graphics context
CGContextRef context = UIGraphicsGetCurrentContext();
// Make it a while line 1.0 pixels wide
CGContextSetStrokeColorWithColor(context, [self.textColor CGColor]);
CGContextSetLineWidth(context, 1.5);
// find the origin point
CGPoint origin = CGPointMake(0, 0);
// horizontal alignment depends on the alignment of the text
if (self.textAlignment == UITextAlignmentCenter)
origin.x = (self.frame.size.width / 2) - (dynamicSize.width / 2);
else if (self.textAlignment == UITextAlignmentRight)
origin.x = self.frame.size.width - dynamicSize.width;
// vertical alignment is always middle/centre plus half the height of the text
origin.y = (self.frame.size.height / 2) + (dynamicSize.height / 2);
// Draw the line
CGContextMoveToPoint(context, origin.x, origin.y);
CGContextAddLineToPoint(context, origin.x + dynamicSize.width, origin.y);
CGContextStrokePath(context);
}
}
- (void)dealloc {
[super dealloc];
}
@end
All done!
-bok
Wednesday, January 28. 2009
Hi all!
I've decided to separate the iTransit blog from what is essentially my personal blog.
You can find the new iTransit blog over at http://www.itransit.com.au/blog/
Thanks for reading!
-bok
Friday, September 26. 2008
Hi all,
Thought I'd post an update on where we're up to and whats coming up, we've had a surge in users recently and have just crossed 2000 home screen additions.
tramTRACKER
We're now using the mobile tramTRACKER site for the real time data after discussions with Yarra Trams. This doesn't include the destination data so we're matching that against the schedule - it looks more consistent now with the scheduled data, but occasionally results in blank rows with route numbers only. If you see one of these let us know so we can repair it. They're also going to be incorporating some of the ideas in iTransit back into their own offerings.
Native Application
The Native app is continuing development with two versions planned - a free version and a paid for version.
Both versions will feature selective caching and will be able to sync timetable changes over the air - you can control if/when to check for updates. You can also choose which lines/routes you want to use regularly and so save space/bandwidth and get only the data that applies to you - the app will grab missing data from the website as needed, or you can grab everything for complete offline usage.
The free native application will support pretty much everything the current web app does with a few extra goodies. The paid for "pro" version will contain a lot of bonus features, which I'll keep to myself for now
Other things
I've redeveloped the backend recently to allow integration with other services out there, such as Melbourne Transport Updates and more, there is also an API in development that powers this if you have your own services you might like to build. The bus data has been redesigned and the remaining routes will be filled in in the next week or so, similarly the inter-city for Sydney.
Also: faux real time data for Trains
Remeber, vote in the poll!
-bok
Hi all,
Work is well underway for the Native iTransit application, but there are still a few things undecided.
We know that there will be two versions of the application released:
Free Version
There will be a free or "lite" version, which will contain pretty much all of the existing functionality of the web application. (Still undecided about the traffic conditions until I talk to VicRoads)
"Pro" Version
There will also be a "pro" version, for want of a better name. It will be the same as the free version but with additional bonus features. Several of which we know already, some more that we're still considering.
The "pro" version is also a way of supporting additional development - we do this because we love it and we use the software too, but covering development costs is always a plus 
So, what would people be willing to pay for a "pro" version? Vote in the poll to the right, leave a comment, or hit us up via twitter.
bok
Thursday, September 25. 2008
For those wanting to keep up with the latest updates for iTransit you can follow the twitter feed at htp://twitter.com/itransit_au or the RSS updates of said feed at http://twitter.com/statuses/user_timeline/16022820.rss.
bok
Tuesday, August 19. 2008
Time to press forward with additional data for iTransit.
Ultimately, I'd like it to be useful to everyone in Australia, to that end we're working on adding data for additional cities. Sydney is first up on the radar, and should be completed shortly.
And after that? Well I'll leave that to you.. check the poll on the right hand side of the screen and vote - I'll work down the list based on your votes.
bok
Hi all,
I've decided that it's somewhat painful trying to group fixes up into a version release for iTransit. Since it is a web app presently, its pretty straight forward to roll smaller revisions out with bug fixes and new features, so that's what I'll be doing.
There is a changelog inside iTransit (under More..) that will list the changes.
bok
Friday, August 15. 2008
Hi!
I've released a new version of iTransit with the following features:
- Melbourne Trains: Scheduled Times
- Melbourne Trams: Live Times (courtesy Yarra Trams)
- Melbourne Buses: Scheduled Times
- Melbourne Traffic: Live Travel Times (courtesy VicRoads)
Browsing/Searching
Browse lines and routes, or search for your station/stop name directly. No more remembering stop IDs! If you know the stop IDs though you can search on those too.
Filtering
View only the selected line/route, view all lines/routes through a stop, or select from a list which routes you'd like to see. You find your way, your way!
Smaller Stops
We have data for all stops, but for brevity (and so you don't have to scroll through a hundred stops!) we only show the major stops by default. They're still there though, hit the Minor Stops button to show or hide them.
Scheduled/Live Times
Where possible we try to show you the live data, but if thats not available we'll go off the timetables, keep and eye on the Live indicator in the toolbar.
Maps
Not sure where that station is? Click the map button to be taken to the Google Maps application, where you'll be shown where it is! You can then use Google to find you and give you directions.
The iTransit Application
The iTransit web application has undergone intensive development in order to deliver these features:
- Small Footprint: The app lives mostly inside Safari's database, so the initial loading of iTransit takes only 2.5KB of data
- Data Caching: Where possible, we use the internal database to cache stop names and lists, so you only ever need to load them once.
- Hardware Acceleration: We use the CSS transitions built into WebKit to do the animations, so its hardware accelerated and smoother.
That's the about blerb anyway.
A native version is in development, and more features are on the way. I'll post more about those sometime in the near future.
bok
Wednesday, July 23. 2008
Looking for iTransit? Check two posts down.
--
Been playing with touches in Safari, specifically trying to track certain gestures.
If you haven't read it, a good primer on touches/gestures in Mobile Safari can be found here. Its a great starting point.
So now that the its been established as to how to do Drag and Drop and rotating/scaling what about the other one finger gestures that apple employs?
Specifically, I'm trying to replicate the swipe left and right functionality of the photo browser (show previous/next photos), and I've been able to do so.
The trick here is to catch the initial touch event, and the ending touch event and work out where our finger has gone. A key thing to remember is that the touches are passed around and updated by reference, so your original copy of the touch will be updated with a new position.
What I've ended up with is a small class that watches the touchstart and touchend events on the document level, and when it detects a swipe it fires a gesture:swipe event.
How?
The following is the code that I used, you'll need Prototype to make this work.
Click on a comment to hide it. Click here to show all comments.
var GestureClass = Class.create
({
// Fired when a new instance of this object is made
initialize: function () {
// listen for start/stop events
document.observe('touchstart', this.start.bind(this));
document.observe('touchend', this.end.bind(this));
// touch storage
this.gestures = [];
},
start: function (e) {
// currently only support one finger on the viewport
if (e.touches.length == 1) {
var touch = e.touches[0];
// store the touch for later
this.gestures[touch.identifier] = Object.clone(touch);
this.gestures[touch.identifier].date = new Date();
}
},
end: function (e) {
// still only one finger
if (e.changedTouches.length == 1) {
// get the most recent touch
var end = e.changedTouches[0];
end.date = new Date();
// get the position that we started at
var start = this.gestures[end.identifier];
// and the duration of our swipe? number of milliseconds the gesture took
var duration = end.date.getTime() - start.date.getTime();
// calculate offsets
var horizontalMovement = start.clientX - end.clientX;
var verticalMovement = start.clientY - end.clientY;
// big enoug to count as a swipe? and quick enough
var viewport = document.viewport.getDimensions();
if (Math.abs(horizontalMovement) >= (viewport.width/2) && duration <= 800) {
// this object is passed to the new event under the 'memo' property
var gesture = {
start: start,
end: end,
gesture: 'swipe',
direction: (horizontalMovement >= 0 ? 'left' : 'right')
};
// Fire the gesture, listen with document.observe('gesture:swipe', <function>);
document.fire('gesture:swipe', gesture);
}
}
},
});
var Gestures = new GestureClass();
Is that documented enough to make sense? Drop me a line in the comments if not and I'll see what I can do to explain better 
You'll see this gesture used in the new version of iTransit, naturally - and there's more gestures to come!
Cheers,
-bok
Friday, July 18. 2008
I've posted a poll to try and add some sort of prioritisation to my upcoming feature/nice to have list for iTransit.
You'll see it to the right of your screen. Vote for the feature that you would most like to see added, but keep in mind its not an absolute list.
It does allow you guys to have a say in what you think is important though.
For more information about what iTransit it, please see the previous post.
bok
Thursday, July 17. 2008
Hi all,
While I'm quietly working on a new version of iTransit (iui is a bit bloated...) you're invited to continue to check out the current version @ http://iphone.itransit.com.au/.
Presently it is for Melbourne only, other cities are on my medium-range radar.
Here's whats coming:
- Smaller, sleeker, faster!
- Favourites
- Searching via station/stop name
- Bus data
- Traffic Information
- VLine Train/Bus data
- Swipe to view next/previous services
- Other cities...
- Investigate LocationService (GPS) integration

The current aim for iTransit is to be something that you can whip out on the go to find out info live - as such browsing timetables won't be a focus.
Comments, suggestions and other feedback is very valued. Feel free to leave a comment below or via the app.
Cheers, bok
Wednesday, July 9. 2008
I've added timetable information for trains based on scheduled data.
Also moved to a new URL to reflect further plans.
There is still a bit of cleaning up of duplicate data to do, but its otherwise functional
-bok
Friday, July 4. 2008
I wrote this a few weeks back as a proof-of-concept and first iPhone web app, but I was somewhat surprised today to find that someone else had the same idea!
Here then is my TramTracker webapp for the iPhone/iPod Touch.
http://transport.odynia.org/iphone
You should also check out this thread on MacTalk for info on the other TramTracker product for your iPhone.
I have a lot of plans for getting a site with decent info about Melbourne's public transport network - the metlink site is slow and bloated. Need to find the time to do it!
Saturday, June 3. 2006
With the purchase of my iMac that means I now actually own two macs. It and my 15" Powerbook G4. Given that I want to be able to read email, etc on both I decided to implement an IMAP server on my sever thats hosted in the US.
Courier-IMAP installed with ease thanks to ports, configured postfix to use Maildir, connected and all was go. Easy.
Then I ran into a problem.. it wouldn't allow me to create folders on the server. The solution to this is probably simple to someone who has used IMAP before, so I post it here purely for reference, in case someone else needs it.
The errors encountered indicated I was unable to create folders because of "Invalid Folder Name". Digging in it appears that most modern IMAP servers don't need a prefix, the version of Courier-IMAP I was using did. Its a FreeBSD 4.10 machine so thats expected.
The solution is to add "INBOX" to your "IMAP Path Prefix" in the account preferences.
Hope this helps someone,
-bok
|