Showing posts with label computers. Show all posts
Showing posts with label computers. Show all posts

Sunday, September 26, 2010

Do it on the device, or do it on the server?

This weekend, I thought I'd extend my little Android usage tracking application to work on more ISPs than the one (Internode) that it already does. As my phone is (sadly) on Optus, I thought I'd write one for that.

Internode was easy to add, as they have a documented API for accessing usage counters which are ideal for computer consumption. Optus on the other hand only provide a web application interface to check usage, necessitating the use of a web scraper. A web scraper is an application that pretends to be a user on a web page, makes all the appropriate calls (and fudges any javascript calls that are necessary) to get the results it needs. It then parses the (often non-compliant) HTML results that come back to get data. I have no problem doing this, and have done so on several occasions before, but it is not easy work and can be quite fiddly.  Parsing the HTML is often the most difficult part, as it is usually not well formed XML so you can't just use DOM to parse it.

In short order, I had a working prototype that used JTidy to clean up the HTML into something that I could use properly and then XPath to extract the elements of the document I needed.  It works great, except that the document clean up and parsing into DOM takes a really long time on a resource constrained device such as a phone.  It takes about 20 seconds to clean up and parse the document on my development emulator, which is too slow to produce a good mobile experience, especially if you have to parse multiple documents as I do.

So now I'm faced with a choice.  I could write a man in the middle service that the phone sends the user's login details to which then performs the parsing on behalf of the user and sends the results on to the phone, but there are a number of drawbacks to this:
  1. This means that the user is sending his login details to a 3rd party, which is a security no no.
  2. It introduces a single point of failure into the equation.  If my app gets popular the middle man service could get slammed.  If Optus decides that they don't like what I'm doing, they could easily block it.
  3. It means I need to host a service, which means additional expense.
I don't want to do this, so what I'm left with is more hacky solutions, using regular expressions to find what I want in the HTML documents retrieved from the provider.  This will take me longer to code, will be more prone to failure, and is just generally nasty.  I'm not happy.  Devices these days are very powerful, and there should not be the need for intermediary servers to help with processing.

Of course this would all be much easier if the providers published web services interfaces to their data, rather than just web applications.  This has been the mantra of SOA and internet connected businesses since the terms were coined.  It doesn't even cost them that much more to do it, and would lead to better designed web applications, but thats a subject for another rant.  Optus doesn't do this because there's no economic incentive for them to do so.  They gain nothing directly from publishing a usable web interface, so they can't be bothered... bah!

To be fair to Optus, they aren't the only ones that don't get it.  No ISPs and telcos provide any decent interfaces, other than Internode.

Sunday, September 12, 2010

I wrote an android application

I purchased an Android phone a few weeks ago. Part of the reason that I got it was that I wanted to see what the differences were between Android and iPhone.  This extends out to how to program them as well, so I had to write an application, just like I did for iPhone.

Last night, I released my little application.  Its a usage meter for my ISP, Internode. I deliberately chose something quite simple so that I could cut my teeth on the platform, and I must say that I'm very impressed. I found it very easy to write the application for Android, especially because it uses the same tools and libraries that I am used to using for my day job.  One other difference that I notice is that it is much more obvious what is going on inside an Android application.  The documentation describes things clearly and gives you full visibility.  Apple on the other hand like to keep their platform a little more mysterious.  There are plenty of good documents on how to do things, but you still get the impression that there's something going on under the hood that you don't quite understand.  Perhaps its just that I'm more familiar with the Java ecosystem.

If you'd like to have a look at it, check out its site at 8-bit cloud.  I've also been playing with the web site, and I will be improving it and hopefully making it more fun.


PS: I was tempted to call the application NodePony after a recent meme that Internode has got going with its cute little plush toys.  In the end, I decided that I shouldn't try to cash in on it.  It would spoil the meme...

Sunday, August 1, 2010

What do I do now?

I've been trying to work out what I want to do with my career recently.  When I've been speaking with mentors and colleagues, the first question that comes up is quite reasonably always "What is it you want to do?".  I have to admit that this question has had me stumped for some time.  For the last three years, I've been working as a principal consultant in the system integration space for medium to large size businesses, and I have not found it satisfying.  I do the work well enough (some say even exemplary), but I haven't been able to summon the passion that I can put into work which allows me to excel.  I find myself compelled to seek more responsibility and higher pay, but its just not working for me.

Yesterday, I went to see Stephen Fry speak.  It was a very entertaining journey through Stephen's life, and the things that make him tick.  He called it his personal WWW, the things that inspire and drive him that for the contrivance of his topic all start with the letter W.  One of the Ws that he spoke of was Writing.  He doesn't just like to write.  Its not that he is paid to write.  He is compelled to write.  His love of language and how it can move people is his passion, his reason for getting up in the morning.

For many people, working in IT is just a job.  They have other things in their life that they call their passions, and they just come to the office to get a pay cheque.  I have many interests and hobbies, but my central passion is programming computers.  I view it as a creative pursuit.  Not art per se, but a craft that can produce elegant and useful things.  When I come home at night, more often than not I end up still camped in front of a computer.  So for me, computers are my passion, my raison d'ĂȘtre.  As with all passions, this gives me an edge.

It goes beyond being a code monkey however. Sometimes when I discuss the topic, people say "oh, you'd get bored just doing programming", because I've worked as a solution architect for so long, and I can operate at a business level as well as a technical one.  This is true, but not for the reason that people think.  I'm a bloody good programmer, an nothing gives me more pleasure than solving a technical challenge, but that's not enough to make something that works.  Creating modern software is a complex task, and to do it correctly there is a mix of communication, leadership and technical expertise required. I'd arrogantly like to think that I can perform all of these tasks.  I like the challenge of setting up simple, streamlined processes and teams that get jobs done.  It'd be nice if I got to do a bit of hands on work, because a true leader is a doer as well as a manager, but its more of an oversight, training and review function.

Which technology I work with is largely irrelevant.  There are some that are more interesting to work with than others, and some I have more experience with than others, but all are interesting to me.  Because technology is my passion, I pick new techniques and languages up very easily.  My company recently had a need to develop an iPhone application.  It just so happened I had been playing with iPhone programming in my spare time.  Where other engineers would have said "no, I haven't done that before" or asked to go on training, I relished the opportunity to pick up something new and got stuck in.  I trained a small team and let it to success.

So much of consulting consists of going into organisations that do not operate effectively.  They are rendered moribund by internal politics, people of limited talent in positions of power, and the sheer difficulty of organising a large workforce (usually too large) that is quite often afraid of change.  This is the reason that they bring in outside expert help.  These organisations get the job done, quite often a boring one, and they turn a profit.  But they do not produce exceptional results.

There are people that are very good at going into dysfunctional situations and turning them around.  I have immense admiration for these people because they do a very difficult and often thankless task.  They turn failure into a bare pass.  They can take pride in the fact that they put the hard yards in to get a result, but the end product is rarely anything to rave about.

I have performed project recovery work successfully before, but I am rarely given the opportunity to effect any real change.  I'm brought in as a technical specialist, often very late in the piece when many of the decisions have been made, to solve a particular problem, often within ludicrous constraints that don't make any sense in the context of producing something that works.  I've lost count of how many times I've been asked to work on a "platform project" to put in place tools and procedures for an organisation that does not have any function to put on that platform yet. How pointless.

So here's what I want from my job:  I want to create good software that does useful things. To do this, I want the freedom to be a good chief nerd (or lead engineer, or architect, or whatever else you want to call it).  I know what I'm doing.  Just get out of my way and let me do it.

My challenge now is to engineer the opportunity to do this.  To quote a review of yesterday's performance that appeared in The Age, "Fry proves that we can take power over, and joy in, the role that is ourselves.".  Time to prove all the outrageous claims that I've just made :)

Monday, May 31, 2010

I'm giving a lecture on Cloud Computing

This post is basically just to try out embedding a google wave post in a blog post :) There is some news however.

I am giving a lecture to a Masters of IT class at Monash. This wave is the place where I am gathering information about what I will present. I will also provide access to the students during the class, if they wish to participate or continue the discussion at a later date.

Date and Time: Friday 4th June 2010,
Location: Rooom H125, Monash University, Caulfield Campus

EDIT: Hmmm, it seems that Disqus, the service I use for managing comments on this site, includes the script that is used to view google wave. This means that there will be an unfortunate doubling of the content below.

Google Reader also strips off the google wave component, which makes sense considering the content is added by javascript. We wouldn't want nasty javascript content sneaking out there into reader land, would we?

Good to know.

Sunday, April 25, 2010

Easy Exchange Email Extraction

Okay, that should be forwarding, but I wanted some alliteration :)

Some time ago, I posted a very technical approach to forwarding email properly using Microsoft Exchange, which is useful if you work at an organisation that uses it. At the time, I was aware that the steps involved were to technical for some people, so I didn't really expect too many people to take it up.

Some colleagues at work expressed some interest in using themselves, but didn't want to go to the effort of setting up their own man-in-the-middle server to fix the emails. To combat this, and to make it easy enough for anyone to set up email forwarding for exchange, I updated my forwarder to work for any email address. I now present this work to the public, in the form of the Crimson Cactus Exchange Redirector. If you would like to perform exchange redirection easily, this might be of some use to you.

In fact, I set this up quite some time ago, but I've been too frightened to publicise it until now because I was concerned that it might become a source of spam or too much traffic on my web server. I've finally gotten up enough courage to try it out now, but please consider it a beta service. It may have to be turned of at short notice if it is abused.

Please give me your feedback if you find this service useful.

Bruce.

Monday, March 15, 2010

Presentation

I'm presenting a session at EJA tomorrow, entitled "Choose Your Cloud". I'll be comparing the different cloud vendors, with a particular focus on Google App Engine.

As an experiment, I've done my presentation in Prezi. I'm not sure if its cool or distracting. I'll check with my audience tomorrow to find out :)

Thursday, February 25, 2010

How predictable are you?

Ars Technica has posted about research that has been conducted about prediction your location, based upon data gathered from mobile phone towers.  The research shows that it is possible to predict where you will be at any given time with 93% accuracy, even before additional information such as calendars is taken into consideration.  That is spectacularly good, and just goes to show how good the information that is being gathered by our gadgets really is.  What this article makes me think about is how well adaptive user interfaces, once provided with the appropriate data, will be.  I want it... now.

Saturday, February 13, 2010

How I would design a forms workflow system for google wave

Yesterday, I posted a quick reply to a post on the google wave developer blog about creating a form based workflow system for google wave.  I was quite busy at the time and i think in my haste I may have been a bit brusque.    By way of making amends, here is how I would set up such a system.

A forms workflow engine needs a number of components in order to operate correctly.  In particular:

  1. A way of specifying relationships between people.  The Manager-Employee relationship is probably the most important here, but there are others too (like whom is in the HR department).
  2. A way of specifying what information is needed in the form.  What fields, how they are validated, that sort of thing.  Calculated fields would be important here.
  3. A way of specifying the workflow for the form, and working out which relationships to use and which form to use in that workflow.
  4. A way for a participant in a group to select which form he wants to fill in.  A particular person may be engaged in multiple organisations, so having a single form library to choose from isn't enough
All of this could be managed in Google Wave, but it would not be trivial.  If set up correctly, it could work quite smoothly however.  First, we need a bot that performs multiple functions, or multiple bots that co-operate to provide the functions listed above.  I think it would be more understandable for users to just have one bot, so lets use that model.  For the purposes of this discussion, I'll call it FormBot.

Next, we need a way of creating the models that are specified above.  An operator would create a wave, tag it with its function (so that the bot can tell what purpose the wave serves) and then adds FormBot to the wave.  FormBot adds a gadget to the wave which allows the operator to edit the data.

For the relationship diagram, the gadget/bot combo would be able to work out which users they were dealing with by looking at the participants of the wave.  This effectively becomes your personnel database, in lieu of having it hooked up to an LDAP server.  The gadget would then allow the operator to drop people into relationships.  The robot would detect any changes, and then suck up the information into its own database (this bit is quite important, as it is how the bot, when processing an instance of a form, will be able to find the information in needs).

The Form & Workflow models are linked together in a one-one relationship, so they can be added on another wave, this time tagged with workflowmodel.  There would be a couple of gadgets to allow the models to be edited, which are then sucked into the database again.

So finally, how does the bot process an instance of a workflow form?  A user would have an extension installed on his client which adds an entry to the "new wave" menu which would say "New Form".  This would create a new wave and add FormBot.  FormBot would check its database to see what Form Waves it has which are linked to relationship models with the user as a participant.  It would then present these as a list to the user to allow him to choose which form he wanted to fill in.  The Bot would then create the form and allow the user to edit it and progress through the workflow.  

In summary, what we've done here is create a couple of setting waves that the bot uses to configure the application, and to allow it to provide different form libraries to different groups of people.  I think its quite elegant and would work really well.  There'd be a lot of work to get it implemented though.  The gadgets to allow the editing of the models would be the key bit.  I'd love to do it but I doubt I'll find enough time to do it myself.  I did create a proof of technology some time ago, but it wasn't configurable, nor did it hook up to a proper user database.

Wednesday, February 3, 2010

Toshiba announces 'digital secretary' functionality

Last week, I ranted about how our cellphones will start adapting to what we are doing based upon the information they can gather on our behaviour.  Right on cue, Toshiba have now announced that they are building exactly this technology, and it will be available by the end of the year.  I'm impressed.  I wonder if they will introduce it only into the Japanese market, or more widely on Android or something similar.

Tuesday, January 26, 2010

My google wave post just broke :( but google fixed it :)

About 3 months ago, I wrote a google wave gadget, which allows users to collaboratively work on a google wave gadget within google wave.  I've gotten a bit of publicity out of it and its all been great.   Sadly, tonight, the wave that I created to document my gadget has crapped itself, collapsing under the publicity of its own popularity, with more than 200 blips and 500 participants.   The main blip in the wave now has no content whatsoever, and I can't view its history to repair its view.

This is a bad sign.  I like google wave, and I want to support it as a new way of communicating that is easy, effective and efficient.  The problem is that I can't trust it.  If its going to destroy information on me, how can I rely upon it?  Sure, its in beta at the moment, and I probably shouldn't complain, but I'm disappointed.  Its got a truckload of participants now, and I understand that that brings a lot of complexity, but I don't want to loose data.  If I could restore its state it would be fine... The really sad thing is that I'm due to deliver a presentation on my gadget tomorrow night, espousing how good google wave is and how it can be used.   What am I going to do now?

Time to address reliability issues Google.

Update: I've asked google to look into the problem, and it looks like somebody accidentally deleted all of the content in the wave.  This could have been a simple PEBKAC, or a more complex interaction of network latency causing the google wave software to do something unexpected.  It is beta software after all, so these things are to be expected.  It wouldn't be a problem at all, except I can't get access to playback to retrieve an older copy.

Never fear however, the dynamic chaps at google have had a look at my wave, and apparently there are over 30000 revisions to it.  This was a bit much for the javascript engine's tiny little brain and it broke.  They've fixed it now, and all is back as it was.  Thanks Christian!

The time is now for inference engines in user interfaces

I've been thinking the last couple of days about the future of phone user interfaces, and I suppose the future of interfaces in general.  At the moment we have fairly static interfaces, with a scrolling list of applications with the occasional widget to tell us the weather forecast or what not.  We set it up how we like it and thats it.  Some user interfaces (in particular, I'm thinking of Android's pages) provide different screens to cater for different use cases, but it is still a manual affair.

What I'm looking forward to is the day when my phone can infer things about what I'm doing.  Our phones (and our extended computer networks)  know an incredible amount of information about us.  They know where we are, and if we are moving or not, and they can remember where we have been before and at what times.  They have our calendar, they know what time it is now.  That there is enough information to begin to infer things.

For example, I tend to finish work at roughly the same time every day.  When I finish, I walk to Flinders St train station and catch a train home.  During the day, I couldn't give a tinkers cuss what the train timetables look like, but when I walk out the door, all of a sudden I'm keen.  My phone, based upon my previous history of movement, detecting when I start moving from the building I've been in for the last few hours, could easily infer that I am leaving, and that my most likely destination is home.  Wouldn't it be cool if it could alter its home page to show timetable information because thats where it thinks I'm going.

We can get more sophisticated here by adding in additional information too.  If I throw my calendar into the equation, the destination guesser has more information available to it.  If I have an appointment at 5:30pm in a different part of town, it can logically infer that I'm not going home, but rather that I'm going to this location.  Instead of showing me the train timetables for my home line, it could show me a tram route to my meeting, or the location of the nearest taxi rank.  It could even choose which option to show me based upon the time until my meeting.  If I've left myself lots of time then I can take public transport, but if time is running short perhaps I should take a taxi.  My phone becomes a true digital assistant, rather than a window on to information that I have to instruct how to operate.

I want my phone to do this now, and there's no reason it couldn't be done.  I'm sorely tempted to get venture capital funding and go do this.  Its where the action is going to be in the near future, in my opinion.  I've got a whole bunch of ideas about what sorts of information could be fed into an inference engine.

We do need be careful to remember the lesson of Microsoft's clippy however.  In order for an inference engine to work, it needs to be accurate.  It needs to provide value to the user.  It should also be unobtrusive.  if the user simply wants to get to his email, or his web browser, it should be no more difficult to get to than it is on today's interfaces.  Clippy failed on both counts here, and was widely lampooned and hated for it.  The amount of information that the clippy inference engine had to work with was limited, so therefore the assistance it could provide was worthless.

No inference engine will be perfect.  If I walk out the door and start walking towards the train station, I might not actually be going home.  Instead, I might be going to a bar on the way to the train station to meet a friend that just phoned me up.  There's no way my phone is going to be able to guess that (unless it monitors my phone conversation, and understands what we are talking about.  We can't do that yet...).  The secret here is to be unobtrusive.  The phone should offer information on what it thinks I'm doing, but in such a way that if I want to do something completely different it doesn't get in the way.  Phone user interfaces are getting sophisticated now(e.g. SlideScreen) so I see no reason why inferred information can not be incorporated.

One final thought about this is privacy. In order for this to work properly, our computer/phone needs to collect, store (for pattern analysis) and cross-check a lot of really private information.  Where does this information get stored and analysed?  at Google/Yahoo/Facebook?  The inference engine will then construct a model of my behaviour to predict what I'm doing.  I'm not sure I want a big corporation like Google to be able to make these sorts of inferences for me...  but thats naive.  Big corporations like Google already construct models of our behaviour, and every time we sign up to a new service like Google calendar or gmail we give them more information to model us.  I'd prefer to run such a service on my own hardware, but that isn't the way that the industry is going.

But as I ranted recently, perhaps that isn't an issue any more.  Are we willing to give up fundamental privacy in order to get the advantages?  I'm not sure...

Sunday, January 24, 2010

I'm part of a presentation on developing Google Wave extensions, Wed 27th of Jan at RMIT

The local Melbourne chapter of GTUG is hosting a meeting around developing extensions for Google Wave this wednesday at RMIT.  The big presenter there will be Pamela Fox, Google's developer relations person, but I've been asked to give a quick run down at the end on my experiences developing a mind map gadget.  If I get time, I might also theorise about how wave could be used to provide ad-hoc communications focused tools inside business.

If you'd like to come along, please register here.  Its open to everyone.

Tuesday, January 12, 2010

On Privacy

Facebook's CEO, Mark Zuckerberg recently said that privacy is no longer a social norm, Google's Eric Schmidt has also said that if you want to do things online that you want to keep private, then you really shouldn't use online services such as Google, due to laws requiring identification and retention of data.

There are benefits to treating your privacy as a commodity.  The most obvious examples are the personalities that have achieved fame and riches through living their lives in a very public fashion, such as Paris Hilton or Kim Kardashian, but each and every one of us makes a decision to trade our privacy each time we go online, whether we do it knowingly or not.

I recently showed my Father in law how to use Picasa web-albums feature as a way that he could easily catalogue his photos from a trip, upload them to the web and then share them with people.  He was delighted and immediately started pestering his friends to view the web album, which of course involves creating a google account (if you want to restrict viewing to a group of people).  One of his friends refused, citing that he didn't want Google to know about his every move online.

This goes to show the difference between not caring about privacy online (my Father in law) and having enough knowledge to be scared but not enough to fully understand (his friend).  My Father in law knows in an abstract sense that google can track his activities, but he doesn't care.  He has made an implicit (and some would say uninformed) decision to trade some of his privacy for the additional features that Picasa gives him.   His friend doesn't want to share this information, and understands that an account is a tracking mechanism.  What he doesn't understand is that sites like google routinely issue web cookies which are almost as good at tracking people as an account when tied to server logs. Even if you don't sign up to google they will be storing information about you and your browsing habits.  It won't be as easy to pin the usage directly to you as in a person with a name, but it definitely can be, and is, done.  Google do this so that they can target adverts that are tailored to you to your screen, but that doesn't mean that the info can't be used for other means too.

In order to be completely private online, a user needs to go to extreme lengths, using cookie blocking software and IP anonymising routing.  If you do this however, many features that we have come to rely upon no longer work.  You can't browse online email.  You can't one-click share photos with friends, you can't use social networking sites.  Even if you could, there would no longer be any incentive for software giants to produce cool software for us to use, because they could no longer make money off us. The vast majority of us seem to be quite happy to make this trade.

If privacy becomes a commodity, then I would like to have control of that information.  I tend to agree with both Mark and Eric, and I am quite open on the internet, but I want to be able to control what information is used, and what isn't.  If my privacy is a commodity,  that means it has value, and I'd like to see whether I am getting value for privacy.  It is possible to envisage an architecture to the net whereby all personal information is stored locally, on a server that each of us controls, or encrypted on central servers in such a way that only people we allow can have access to that information.  In order for this to work, there would need to be legislation to enforce this separation, as there is cost associated with implementing things in this way.

And there's the problem.  There's no incentive for companies to give us privacy, or to give us control over our privacy, as it will loose them money.  There's no incentive for governments to give us control over privacy as they want to collect information on us too.  "The People" are unlikely to get thier shit together, as they are too easily distracted by the latest shiny product released by Google, or Yahoo or Facebook.   As a result I think we are doomed to a future where information is routinely collected on every aspect of our life.

This conversation has been going on for ages, and its good to see people were thinking about it decades ago.  Credit card companies have been constructing models of us consumers for years and years, based upon our purchasing history.  They then sell this information back to department stores and marketing companies.  A particularly good scenario surrounding how this could end up is played out as a side story in David Murasek's excellent novel Mind over Ship.  Its a sequel to Counting Heads, so you might like to read that first if you are interested.  Now that I think about it, there's also an interesting plot in there about the relative privacy of the rich/powerful vs the middle class.  In both novels the middle class is routinely scanned for information, and their personal AI's (called Mentars) are incapable of keeping the information gatherers out.  The rich have much better Mentars and as a result are able to navigate their way through life with relative anonymity (but of course the heroes undergo a lot more scrutiny because they are the focus of big events).  Perhaps that is our future...

Sunday, January 10, 2010

New Version of Google Wave MindMap Gadget available


I've just updated my Google Wave Mind Map gadget to a new version.  New features include:
  • It renders graphically now, so things are a little prettier
    • It won't work on Firefox versions earlier than 3.0.  If you are running an earlier version I strongly suggest that you upgrade
  • There is now the ability to edit properties, accessable via the properties menu button.
  • There is a context menu that can be used to access the menu, accessible via the Right Mouse button.
  • You can change the colour of nodes. There's also the ability to edit the background colour, but this is currently unused.
  • You can change the outline of nodes:
    • Underline
    • Circle
    • Cloud
  • You can change the direction of layout of the root node. Where is places nodes is a bit random, and I do plan on fixing this
  • You can specify whether nodes are collapsed upon intial view or not.
  • Upload/Download now supports non-ASCII characters, such as Cyrillic
Its not perfect, and there are a few things that need to be fixed, but it is an improvement on the old version so I thought I'd release it. If thre are any problems, please do not hesitate to let me know. I can easily revert it back to the old version if its really broken, or issue quick patches.


I'd be delighted to hear your feedback.

Tuesday, January 5, 2010

Why don't more engineers follow the KISS principle?

I was having a drink with some colleagues last night, and the subject of the over-use of high-availability environments came up.   At too many customer sites we see requirements that the system must have 5 9s uptime (approximately 15 minutes a year downtime) when there is patently no reason for such a requirement.  As a result, we end up spending far more time, more hardware, and more software licenses on the solution than is required.  This not only hurts the project during development, but also during maintenance as a more complex solution requires more maintenance.  This problem isn't limited only to HA, but extends to all areas of design.  In my opinion, this tendency to over-complicate projects is more responsible for project overruns and failures than any other cause.  To make things even worse, organisations who decide to do things "just because" tend to under-invest in them which means that the result is half-arsed and doesn't work properly anyway.

In a quick survey that I conducted of the people around the table at the pub, all of us subscribe to the KISS principle, and I suspect that most engineers would agree with us.  So why do so many projects end up bloated and lumbering?  The knee jerk reaction that everyone other than myself is an idiot just doesn't hold water.  Chances are the next enterprise architect that I meet will be almost as smart as me (even if my ego tells me otherwise), so what is it?  Here's a couple of theories.

Firstly, keeping things simple means that you will be done quickly, but you may need to come back later to make changes or to add functionality.  This is normal and expected within an Agile development methodology, but more problematic in big institutions that take ages to approve budgets and have difficulty dealing with change.  In many organisations it is easier to ask for $1M in one go, rather than ask for 10 $100K budgets. This sucks, but it is the way things go.

Secondly, companies contain many individuals, each of which has their own view on what is important. The reporting guy thinks that all his reports are the most important thing.  The IT guy thinks that good data architecture is the be all and end all.  If one constructs a plan by consulting everybody in the organisation you will end up with gold plating and and a very very long build cycle.

In order for KISS to reign a project needs ruthless leadership.  They need to make sure that their staff understand the principles by which the project is being run, and the intended goal. Knowing what you want to achieve is very important.

P.S. Happy new year!

Sunday, June 14, 2009

Online mind maps

I was going to write a blog post yesterday about where integration platforms were going, which seems to me to be online webapps without the need for an IDE at all. some products like Oracle's Aqualogic ESB are pretty much already there. I couldn't quite gather my thoughts properly though, so I thought I would do a mind map. I was going to use FreeMind, but considering I was talking about web-apps, I thought I'd do a search for whats out there. Turns out, there's heaps of online mind map editors, but most of them charge for anything but basic capabilities.

I did find mind42 though, which appears to be quite good. I think I'll be reccomending its use in the future. Below is the mind map that I'm working on. As you can see, I still haven't gathered my thoughts very well :-/ One of the nice things about this is that using an online service means that we can post links (just like the one below) in our Wiki documentation and have live updating when the mind map changes. Brilliant!

Tuesday, May 5, 2009

How to automatically forward email from Exchange without loosing headers

UPDATE: I've now created a service to make this much easier to forward email. If you are interested in this, please have a look at the service's site.

I've got a million email accounts. Every time I start work on a new client site, I get given yet another email account. Its a pain in the butt to manage all of these, so wherever possible I forward the mail onto my main gmail account where it can get filtered, stored and searched easily.

This works great for sites with unix based email, but more often than not my clients use Microsoft Exchange for their mail. You can set up a redirecting rule to forward the email (as long as the server has been set up to allow this), but when it does so it strips off the To: and CC: headers from the message when it sends it on. For example, if Bob Log had sent a message to Me@mycompany.com, SomebodyElse@mycompany.com, when it was forwarded on to my gmail account it would still appear to come from Bob Log but the To: would just be me@gmail.com, not the original recipients. This won't work!

I've toyed with a number of solutions to this problem, including writing a bot that uses EWS to poll the server, re-form the message and send it on, but that requires a bot to run on the client's lan and may not be able to forward on the message as getting access to Exchange to send the message can sometimes be difficult.

I now have a solution that works without requiring any additional software to be running on the client's network. The solution involves forwarding the message to an intermediate account as an attachment (which preserves the headers), filtering the message back out of the attachment at the intermediate account, then sending that message on to gmail in all its original glory. To do this, you require an intermediate email account that you can use purely for the purposes of filtering the mail, which is capable of piping incoming mail to a perl filter script. Generally, these aren't that hard to come by. I happen to have a getting started plan with Cove here in Melbourne which fits the bill nicely. Its free to run (although they do have a $2 setup fee) and its servers are in Australia which is a benefit for me. If you live elsewhere, there are probably other options that would do just as well.

To set it up, there are three steps,

step 1: create the filter script
Below is included a perl script which takes an email address as a parameter, and reads a MIME encoded email on STDIN. It will look for a part with a content-type of message/rfc822 which is an embedded message, and then it will stream that message out to sendmail with the supplied email address paramater as the final destination. This file should be uploaded onto your server somewhere where the mail filter can get hold of it.

I originally wrote a script that used the MIME::Parser perl module, but I've found that most hosting providers don't have that module installed, so it was easier to just do it from scratch. I'm not a perl programmer really, nor have I spent a lot of time on this script, so it definitely could be improved, but it works!
#!/usr/bin/perl

my $recipient = $ARGV[0];
my $boundary = '';
my $endMarker;
my $partType;
my $sendmail = "/usr/sbin/sendmail -oi $recipient";

# Reads a line from STDIN, and makes sure it isn't the EOF
sub fetchLine {
my $txt = <STDIN> or die "Reached end of file prematurely";
chomp $txt;
return $txt;
}

# reads a message part, looking for an rfc822 message.  If it finds one, it
# forwards it on to the recipient.  When it finds the part end, it returns 1
# if there are more parts, or 0 if it is the end of the message
sub parsePart {
my $isMessage = 0;
my $returnCode = -1;

# First, read the headers, looking for a content type
while ((my $text = &fetchLine()) ne '') {
if ($text eq 'Content-Type: message/rfc822') {
$isMessage = 1;
open(SENDMAIL, "|$sendmail") or die "Cannot open $sendmail: $!";
}
}
# Then read the body, streaming it out if it is a message
# End the loop when we find a boundary or the end marker
while ($returnCode == -1) {
$text = &fetchLine();
if ($text eq $boundary) {
$returnCode = 1; # Meaning we still have parts to parse
} elsif ($text eq $endMarker) {
$returnCode = 0; # Meaning we are finished parsing the message
} elsif ($isMessage) {
print SENDMAIL "$text\n";
}
}
if ($isMessage) {
close(SENDMAIL);
}
return $returnCode;
}

# First, Read Headers, looking for the multi-part content type and
# boundary separator
while ((my $text = &fetchLine()) ne '') {
if($text =~ m/^Content-Type: (.*)/i) {
$nextline = &fetchLine();
$nextline =~ m/\s+boundary="(.*)"/i or die "Could not get boundary after content type";
$boundary = "--$1";
$endMarker = "--$1--";
}
# We don't care about any other headers
}

# Check to see that we have the right mimetype and a boundary
die "No boundary found" if $boundary eq '';

# Skip until the first part separator
while ((my $text = &fetchLine()) ne $boundary) {
}

# Parse the message, looking for a part with a type of message/rfc822
while (&parsePart()) {
}

exit 0;

step 2: set up the filter in cpanel (or whatever else you use)
On your server, you now need to set up mail filtering so that any incoming mail from your work account that isn't a bounced message gets sent to your filter script. In cpanel, I did this by setting up an email filter for all mail, which looked something like this:



step 3: enable forwarding of mail in Exchange
Now that you've got your email forwarding filter set up, all that remains is to set up exchange to forward any incoming mail to your filter account. You do this by selecting Rules and Alerts



And then setting up a rule that looks like below:

Be careful with what you put in your rule definition, as some rules are "client only" which means they will only run when outlook is open. As an example, I tried to make it also mark the message as read when it forwards, but that is "client only" which means the rules won't run unless outlook is open :(

Once you've got that set up, you can test. Send a message to your work email and see if it makes it through. If anything goes wrong, it should bounce with a message telling you what went wrong. One thing I did notice though is that if I send the message from gmail itself, it tends to ignore the message when it gets forwarded through as it already has a copy (in sent), so I send test messages from an alternate account just to be safe.

Okay, so in summary, its possible to forward messages on from exchange, but it requires a man in the middle to extract the message contents, and its a bit fidlly. If you like this tip, let me know.

Sunday, May 3, 2009

Could I use my iPhone to work on?

I'm an IT consultant. As a result, I spend the vast majority of my time at work doing one of the following
  1. Reading or Composing Email
  2. Reading or writing Word Documents
  3. Editing our corporate Wiki
  4. Researching stuff (or skiving off) on the Web
  5. Looking at Microsoft Project plans
  6. Very occasionally coding... very occasionally
To perform these tasks, I lug around a quite heavy laptop. Its not a particularly special laptop, but it does the job. I would like to exchange it for something lighter and easier to work with in order to save my back, especially when I ride to work. I originally thought about getting a netbook. They seem to fit the bill nicely, except for a couple of annoying things:
  1. The screen is a tad small to be using all day long
  2. The keyboard could be considered small to be using all day long.
  3. They don't really have enough grunt to do coding
The first two problems can easily be solved by using an external keyboard, mouse, and screen. I always work in offices, so it generally isn't hard to find something that I can appropriate for the purposes of working while there. The third problem is a little more tricky. One way I've thought about solving this problem is using remote desktop to a server. Given that I generally need a server to code on anyway (I do enterprise SOA work), this seems to make sense. I simply log into the server (either via ssh or VNC/RDP) and I can do anything I would have originally wanted to do on my laptop, albeit with a little more lag. A RDP server would also allow me to get to those windows only tasks that I occasionally need to do without needing to bloat my netbook with software

This sounds great, and I might just do it, but why should I carry a wee little laptop around if I'm never going to use it as a laptop. I'll use my iPhone when I'm on the road, and plug the netbook into a KVM when I'm in an office. Why not just use the iPhone? I love my iPhone, and I carry it with me everywhere. It can do most of what I need to do just as well as a netbook, but it suffers from the smallness problems even worse than a netbook does. Why couldn't Apple make a docking station for the iPhone which allows it to work with an external keyboard, mouse and screen? That way, I can carry my phone around with me, get to work, plug it into the docking station, and work directly on my phone.

I think the docking station would need the following features to be successful:
  1. Be relatively small, so that it can be transported if necessary
  2. Provide charge to the iPhone while operating
  3. Have the following connectors:
    1. 1x Power - I would prefer an integrated transformer, but a wall wart would work too
    2. 3x USB - one for keyboard, one for mouse, one spare for something else...
    3. 1x DisplayPort, or DVI, or whatever to connect up a monitor
    4. 1x Ethernet port
    5. 2x Speakers
    6. Audio jacks for external speakers and mic
    7. RCA/Composite video out, so that it can do everything a current iPod dock does
    8. IR receiver for those cute little remotes.
    9. Possibly a phone handset to allow it to be used as a phone while docked. Perhaps just a jack to allow a handset (or hands free kit) to be plugged in
  4. Provide at least 1920x1200 resolution screen - this would probably involve improving the graphics card of the iPhone
  5. Be capable of receiving calls while in the dock. If the user removes the phone from the dock to receive a call, the user's session should be saved so that he can pick up where he left off when it is re-docked. Likewise, if I pull it out of the dock in the evening, take it home, and dock it again, my session should pop straight back up
  6. Be capable of running faster (at a higher clock speed) when plugged into power. iPhones are deliberately left running at a low clock speed to conserve battery power, but when plugged in they could easily ramp up.
I realise that iPhone apps, as they currently stand, would not be suitable for use on a large screen, but they could be adapted. Alternatively, the phone side and the desktop side could be kept largely separate, and there could be dedicated desktop applications (just a port of the normal os x version) along side the mobile versions. They would still need to synchronise app data (bookmarks for example), but that wouldn't be difficult to achieve.

I don't think this is an especially original idea. I know that other people have thought about doing it for ages. I just wish we could convince Apple to produce it as a product. Here's how I think we do it: tie ins to .mac. .mac is a good service, but most people don't want to fork out for what they can get for free elsewhere. If the iPhone plus had better integration with .mac it would make it a much more compelling offering. iDisk is a perfect example. Devices with limited storage need online storage. voilla!

Ahh apple, I doubt you will ever read this, but if you do, please make this device! I'll buy two. Lots of people I know will buy them. It'll be awesome.

Sunday, September 4, 2005

My first HTPC

I've been trying to put together a HTPC for quite a long time now, up until now with little success.

Recently, some of my workmates have started working on HTPCs of their own, which has spurred me on to try again. For a change, I succeeded, mostly through the really good MythTV distribution KnoppMyth. It takes out all of the hard work in configuring linux to work properly as a set top box, especially for obscure hardware like the VIA EPIA-M mother boards

So, I now have a working set up to record Digital TV programs.... Yay!

Here are some pictures











The hardware list:
  • An old DVD-Player case (Thanks Peter!)
  • Via EPIA-Me6000 Motherboard
  • 60W DC-DC power supply
  • 256 Mb DDR400 RAM (Thanks Mike!)
  • 300Gb Segate Barracuda 7200.8 Hard Drive
  • ATI RF Remote
  • Logitech Di-Novo bluetooth keyboard/mouse
  • Netgear WG311 802.11g PCI Card
  • Hauppage Nova-T DVB tuner card
Things that are still wrong, or I need to fix:
  • The Hard Drive runs too hot, and you can hear it click when it seeks. I think I will replace it with a notebook drive
  • The Tuner card is too slow.
  • I think the power supply is a little too weak, as sometimes it struggles to boot up. I think changing the hard drive will help a lot
  • The EPIA-M boards, even with their hardware decoder, can not decode HD (1080i) signals properly. I am considering building another machine using a Pentium-M solution
  • No DVD Drive, but that is just a matter of buying one and sticking it in