Development on a Shoestring

Google’s moving in next door

image Google really is busy here in Australia.  First they announce Transit for Perth (and other states to come soon), and now I hear they’re building their new headquarters next door to my office.  They’re currently across Darling Harbour from us over in Darling Park here, but they’re moving here. It looks like a big block of concrete there, but it’s actually a construction site now.  Pyrmont is turning into a media hub, with Channel 7 next door too, and a whole bunch of other small media agencies near by.  Channel 10 is just up the road too.

The new Google building is been billed as a new ‘green’ style of building, apparentlyWorkplace6, a joint venture between site owners GPT and builder Citta Property Group, will generate one-quarter of its own power supply, take in harbour water to release heat and recycle sewage to flush toilets and irrigate nearby parks”.  Makes sense, sounds like Google is expanding its solar power scheme. Wonder if we’ll get a monitoring page like that for Sydney.

 This Lifehacker article has an image of what it’s going to look like.

Sydney’s Googlers will move into the new building in 2009. The press release was long on “dull but worthy” details such as “Workplace6 is NSW’s first 6 Star Green Star building, going above and beyond green office standards for Australia.”
We can only assume from the brevity of the press release that Google Australia has conceded that Google Zurich - which features a fireman’s pole or a slide to get you down to the  ground floor in a quick and  fun fashion - reigns supreme as the “cool” Google office. Aww.

Everything old is new again

What with all the, um, unpleasantness around FriendFeed this week, it reminded me about something that I’ve been thinking on for a while now. There have been a lot of new sites starting up in the last couple of years that are primarily focused on social communication over the web. Facebook, FriendFeed, Tumblr, Pownce, Twitter, Orkut, Jaiku, about a billion blogs, and so on. The social web it’s being called.

The idea is that the new web, ‘Web 2.0′, is introducing the concept of social networks to the internet as opposed to the ‘old’ web which was just corporate marketing.  Of course this is ridiculous.  If the internet has ever had a single defining feature, it is its social nature.  The internet was originally nothing but interpersonal communication. Anyone remember bulletin boards, Usenet?  Even with the advent of html and the font tag we had newsgroups and forums.  Myspace? It’s just Geocities with music. It was only in the very late 90s that the internet started turning into the corporate marketing platform that people seem to think it is.  The new social platforms are just newer, shiner versions of newsgroups.  Bulletin boards with animated emoticons and super poke.

image So why does everyone think that the internet is just one giant marketing tool? And if social isn’t new, what is it that the new “Web 2.0” brings that is actually, well, new?  The simplistic answer to both questions is this: volume

The sheer volume of people using the internet now on a daily basis is enormous.  The advent of broadband and its relative cheapness (unless you’re in Australia that is) means that pretty much anyone can load up a page within seconds.  I’m old enough to remember waiting minutes for things to load.  Minutes!  And I’m not really that old (don’t ask my kids).  Now, if your website takes more than 5 seconds to load, people from above start asking questions.  Your average office worker now has super high-speed access to the internet. And while offices often block non-work related sites, they can’t block them all, and there are always ways around the blocks if you know what you’re doing.  The fact is that a lot of people are spending a lot of time online, and they’re bored.  Why bother with solitaire when you can load up Kongregate?  Not only do you get more entertaining games, you get to broadcast your l33t skillz through the high score lists (and parade your achievements on your Facebook account with their app).

But it’s not so much the number of people online that led to the idea that corporations own the net.  It’s the rate of growth …

Read the rest of this entry »

Google Transit is coming to Australia

Google Transit will provide directions for travelling to and from locations using local public transport.

Its Australian launch, in Perth using data from the Western Australian transport authority’s online service Transperth, will be the first in the southern hemisphere.  Mr Noble said the company would seek to work with authorities in other states to launch Google Transit across Australian cities.

Google to launch transport tool in Australia: News.com.au

Nice, I wondered when they’d roll this out to us.  Google has a history of not abandoning us here in Aus like some other IT companies do.

image(via Simon Job) Google Maps now has maximum resolution images for Sydney.  Not just Sydney actually, here’s the Penrith Regatta Centre.  How about the Three Sisters at KatoombaNewcastle’s covered too, and it looks like everywhere in between is covered too!  This is a huge update.  Doesn’t goes so far south though, the high res layers seem to stop at Waterfall.

Cool things we can now see:

Oh and sorry, but Melbourne doesn’t have this yet.

Comparing two arrays (or IEnumerables) in C#

Much to my surprise I found that .NET 3.5 doesn’t seem to have a native method for comparing two arrays or collections of any type.  The LINQ extension methods offer a whole lot of added functionality for IEnumerable<T> collections, but not native comparison.  The Equals method is still the base object.Equals method that does a reference equality (i.e. Are these two the same object?) not a value equality (do they contain the same values?)

So, finding myself needing an equality comparison between two arrays, I’ve written the following extension method:

   1: /// <summary>
   2: /// Checks whether a collection is the same as another collection
   3: /// </summary>
   4: /// <param name="value">The current instance object</param>
   5: /// <param name="compareList">The collection to compare with</param>
   6: /// <param name="comparer">The comparer object to use to compare each item in the collection.  If null uses EqualityComparer(T).Default</param>
   7: /// <returns>True if the two collections contain all the same items in the same order</returns>
   8: public static bool IsEqualTo<TSource>(this IEnumerable<TSource> value, IEnumerable<TSource> compareList, IEqualityComparer<TSource> comparer)
   9: {
  10:     if (value == compareList)
  11:     {
  12:         return true;
  13:     }
  14:     else if (value == null || compareList == null)
  15:     {
  16:         return false;
  17:     }
  18:     else
  19:     {
  20:         if (comparer == null)
  21:         {
  22:             comparer = EqualityComparer<TSource>.Default;
  23:         }
  24:  
  25:         IEnumerator<TSource> enumerator1 = value.GetEnumerator();
  26:         IEnumerator<TSource> enumerator2 = compareList.GetEnumerator();
  27:  
  28:         bool enum1HasValue = enumerator1.MoveNext();
  29:         bool enum2HasValue = enumerator2.MoveNext();
  30:  
  31:         try
  32:         {
  33:             while (enum1HasValue && enum2HasValue)
  34:             {
  35:                 if (!comparer.Equals(enumerator1.Current, enumerator2.Current))
  36:                 {
  37:                     return false;
  38:                 }
  39:  
  40:                 enum1HasValue = enumerator1.MoveNext();
  41:                 enum2HasValue = enumerator2.MoveNext();
  42:             }
  43:  
  44:             return !(enum1HasValue || enum2HasValue);
  45:         }
  46:         finally
  47:         {
  48:             if (enumerator1 != null) enumerator1.Dispose();
  49:             if (enumerator2 != null) enumerator2.Dispose();
  50:         }
  51:     }
  52: }
  53:  
  54: public static bool IsEqualTo<TSource>(this IEnumerable<TSource> value, IEnumerable<TSource> compareList)
  55: {
  56:     return IsEqualTo(value, compareList, null);
  57: }
  58:  
  59: public static bool IsEqualTo(this IEnumerable value, IEnumerable compareList)
  60: {
  61:     return IsEqualTo<object>(value.OfType<object>(), compareList.OfType<object>());
  62: }

Updated: Jugen (see comment below) made some quality suggestions that I’ve used to improve the code here.  To see the state of the code when the comment was made, see here.

It gives you an extension methods on any collection that implements IEnumerable<T>.  There is an optional parameter of type IEqualityComparer<TSource> which if not null will be used to compare each item in the collections.  Otherwise it will use the default comparer for TSource. It will also work for untyped IEnumerable collections, the overloaded method passes the collections through to the IsEqualTo<TSource> method with object as the TSource.  This is really just there for backwards compatibility.

As far as speed goes, I ran a test with 2 collections of 10,000,000 (I stopped there because I started getting out of memory exceptions when I was populating the test collections after that!) items & it took 0.89 seconds, so I think that’d do for most scenarios.  If you want to use this code you can grab a copy of it here.

Sweet.  I didn’t see this before, but Firebug has a new beta version too, which means that it works in Firefox 3 beta 4.  Grab it from the releases page under the Firebug 1.1 Betas heading.  Possibly the single most useful Firefox plugin for me, the fact that it wasn’t working in the beta releases of FF3 was what was stopping me from switching to the beta. No more excuses now, the Adblock Plus plugin even works.

Subscribe by email

Enter your email address:

Delivered by FeedBurner


Elsewhere

Verse of the Day

And now, O Lord GOD, you are God, and your words are true, and you have promised this good thing to your servant. (2 Samuel 7:28, ESV)

Networks & References