Sunday, May 15, 2005

Generic Programming in C++ part 3a: Palindromes

If you've been to an interview where you've been asked to write some C++ code, there's a fair chance that you'll have come across the "isPalidrome" problem.

It goes something like this: A palidrome is a group of letters that is the same written backwards or forwards. The challenge is to write a function that tests whether a given string is a palindrome.

A typical solution may look something like this:



bool isPalindrome(const std::string &str)
{

std::string::const_reverse_iterator itEnd = str.rbegin()++;
for
(std::string::const_iterator itStart = str.begin(); itStart < itEnd.base(); ++itStart, ++itEnd)
{

if (*itStart != *itEnd)
{

return
false;
}
}
return true;
}


(Actually, if you're in an interview you may have forgotten to start at before the one-past-end iterator and you may not have used a reverse iterator or perhaps forgot the call to base when comparing iterators and reverse iterators.  Those kind of things you can be forgiven!)

That solution works fine. Use two iterators, one pointing to the first and one to the last characters (which, as mentioned above is one before that returned by end).  Compare the characters and move the iterators toward the middle of the string.  If any comparison fails, the string is not a palindrome.  Finish when the start iterator is past the end (note that this takes into consideration both finishing conditions ie when there is an even or an odd number of characters in the string).

[There are other algorithms but we’ll stick with this one for now.]

We can do better. Why not write it generically?  It may not be obvious to you, but std::string is a container.  We can apply this same algorithm for any other container.  Consider writing reusable functions generically – especially after ‘getting them right’ non-generically.



template <typename RaIterator>
bool
isPalindrome(RaIterator begin, RaIterator end)
{

for
(--end; begin < end; ++begin, --end)
{

if
(*begin != *end)
{

return
false;
}
}

return
true;
}


Something has changed; we’re assuming that two random access iterators have been passed in.  We need random access iterators because of the less than operator, which is only provided on these kind of iterators.  And you’ll not that we’ve used a bidirectional operation – the decrement operator – instead of using a reverse iterator.  That’s to avoid weird syntax – asking the user to supply two different kinds of iterators is unusual (and prone to error!) and you won’t see that done in any standard algorithm.

Usage is slightly different, now we have to pass in stringname.begin() and stringname.end() instead of just stringname.  But again that’s consistent with the Way Of The Standard.  (It also has an advantage - we can operate on slices of a container.)

So how is this better?  Well, if we have a vector of characters we can use this function.  Or if we have a vector of longs.  Or a deque of longs.  Or an array of longs.  We could even have a vector of strings that form a sentence and use this function to determine if the sentence is a palindrome!

You get the picture.  Generic is better.

Unfortunately if we have a list or set of chacters we can’t use this function – you’ll get an ugly compilation error.  Why?  Because lists only provide bidirectional iterators.  And bidirectional iterators don’t give us that lovely less than operator.  So any container that provides anything less than random access iterators will not compile.  Bugger!  I wonder if we can get around that limitation…

Tune in to part b where I improve our isPalindrome function further, so we can use it with lists!

 

[I’ll admit that thinking at this level of abstraction is difficult in an interview situation but when you start thinking generically you’ll find that it won’t be too much of a stretch.  Disclaimer:  In the last interview I sat I wrote the first example…]

Thursday, May 12, 2005

Spicks & Specks

Last night a friend (Heya Age! When are you going to start your own blog?) and I went and watched the recording of two episodes of the ABC’s music trivia show Spicks and Specks.

Spicks and Specks

Gotta say, we both had a great time (though two episodes was bordering on too long) and I can recommend anyone go see it.  You’ll have to grab the phone number (I can’t remember it and they don’t have it on the website, sheesh!) at the end of the show to register interest for tickets, which are free.  Filming is at ABC studios in Elsternwick.

Adam Hills was a terrific host that earned a great deal of respect from us just because he was so honest, approachable, funny and real. 

Myf and Alan were also damn funny – I lost it when Alan broke his chair!  You’ll see what I mean in six weeks or so…  The guests were also great – I don’t want to name them and spoil the surprise but one half of Lano & Woodley was on and in fine form! 

Adam and the team really indulge the crowd, playing up on heaps of gags that will never make it to air.  Thanks everyone at the ABC for a terrific show.

Anyways, if you don’t watch the show it’s great fun and is on Wednesday nights at 8:30.  Enjoy!

 

Generic programming in C++ part 2b: A better example with CComSafeArray and standard containers

In the last post I asked the question "How do you normally copy containers". Let’s explore that.

A typical way would be to use the standard algorithm copy. (Note that there are many ways to copy containers, some are even more efficient, but this one suits the purposes of my explanation)


std::list<long> listOfLongs;

// Fill list here

std::vector<long> vectorOfLongs;
std::copy(listOfLongs.begin(), listOfLongs.end(), std::back_inserter(vectorOfLongs));

copy takes a range and an output iterator. The range is iterated over and each element is copied to the output iterator – after each copy the output iterator is incremented. It’s expected that the ‘thing’ that the ouptut iterator points to can hold all of the elements in the range.

For a vector (or, in fact, any automatically-sized container) this often isn’t what you want. Instead, you often want elements to be added to the container. But how should the algorithm add elements to a container? In fact how can an algorithm add elements to a container when, I’m sure you remember, algorithms don’t know anything about containers! Algorithms only know how to use iterators.

This may not be crystal clear yet so I’m going to make a point of it. Algorithms only know about iterators. They know nothing about containers. This is intentional and A Good Thing. Why? Because by enforcing that limitation algorithms can work for any container you provide – assuming you also provide iterators for that container (and that the iterators meet the requirements of the algorithm).

Now, we were trying to figure out how an algorithm can add elements to a container. The C++ way to do that is via an inserter which, in standardese, is a form of iterator adaptor. An inserter provides an iterator interface for a container. The algorithm ‘sees’ an iterator. But when the algorithm tries to assign to that iterator, the inserter kicks in and does something different. That ‘something different’ depends on what inserter you’re using but ultimately it (usually) adds an element to the container. It also does nothing when the iterator is incremented. If you think about that for a second that’s exactly what we were trying to do.

So how does the inserter know how to add elements to the container? Doesn’t that mean that it needs to know about the specific container type? No. Well, kind of. Inserters are templated on the container type. If we look at the example above, we’re using back_inserter. That particular inserter requires that the supplied container has a push_back method. Conveniently, vector does. Had the inserter been front_inserter, which requires push_front, compilation would have failed because vectors can’t insert elements at the front (efficiently).

So what does all this have to do with CComSafeArray? CComSafeArray is (almost) a container and we’re going to write an inserter to allow us to use them in algorithms when an output iterator is required. That means that we’ll be able to use the standard copy algorithm to copy elements from any container to a CComSafeArray.



template <typename Container>
class add_iterator : public std::iterator<std::output_iterator_tag, void, void, void, void>
{
protected:
Container& container;

public:
explicit add_iterator(Container & c) : container(c) {}

template <typename ValueType>
add_iterator<Container>&
operator=(const ValueType& value)
{

container.Add(value);
return *this;
}


add_iterator<Container>& operator*()
{

return *this;
}


add_iterator<Container>& operator++()
{

return *this;
}


add_iterator<Container>& operator++(int)
{

return *this;
}
};


template <typename Container>
inline add_iterator<Container> add_inserter(Container& c)
{

return add_iterator<Container>(c);
}



OK, so what’s going on here? An inserter has two parts. There is a class that is the iterator and does all the grunt work. There’s also a templated convenience function that creates and returns an instance of the iterator. That’s a fairly common idiom in the standard (see make_pair) and permits nicer syntax by taking advantage of the fact that templated functions can infer types. We mentioned back_inserter and front_inserter before, these are actually convenience functions that create an instance of the iterator classes back_insert_iterator and front_insert_iterator respectively. Without those convenience functions the syntax would be less appealing and more prone to error. For example, the code above would look like this:

std::copy(listOfLongs.begin(), listOfLongs.end(), std::back_insert_iterator<vector<long> >(vectorOfLongs));

So that explains the add_inserter function. Digging deeper, the add_iterator is actually pretty straightforward. It publically inherits from iterator which is a standard library class that defines a number of useful typedefs that all iterators are required to define. It’s just a convenience class saving you from defining a few things yourself. Assigning does what we described above, that is, it just calls Add (which must exist) on the container (you’ll notice that Add is the method that CComSafeArray provides to append elements). Incrementing (and dereferencing) are no-ops.

I glossed over the fact that assignment operator is a templated function. This usually isn’t necessary because containers are meant to expose the type that they contain. If you dig into any of the standard library provided iterators you’ll find that the type that the assignment operator takes is known. Normally we could have defined the assignment operator like so:



add_iterator<Container>&
operator=(const Container::value_type& value)
{

container.Add(value);
return *this;
}



Containers are meant to provide a definition for value_type.

Unfortunately, CComSafeArray doesn’t (hence the reason it’s almost a container) so we have to make the assignment operator a function template. No big problem, it just means that if you try to assign the wrong type via the inserter then your error message may be fairly cryptic – something like: “cannot convert type X to CComSafeArray<T>.Add() where T is Y”.

You may also have picked up that this inserter isn’t actually tied to CComSafeArrays. If you have any other containers that use an Add method to add elements then this inserter will work just as well for them.

And that’s it! We’ve harnessed one of the great strengths of the STL design – extensibility – and created an inserter, a form of iterator adaptor, to a container-like class so that we can make use of existing standard algorithms. Sweet!

Stay tuned for Part 3 where we give the age-old interview question “isPalindrome” a generic workover!

Friday, May 06, 2005

Generic programming in C++ part 2a: A better example with CComSafeArray and standard containers

Shortly after posting the original entry I thought of a better way to create a CComSafeArray with standard containers. Fifteen minutes later - much less time than it took to write the blog post! - I had working code.

Because I want to get some sleep now I'll have to post the code later. In the meantime I want you to think about it!

OK, you want a hint? How do you normally copy containers - say from a list to a vector?

In part 2b I'll show you how to write very similar code that works for CComSafeArrays.

Thursday, May 05, 2005

Happy Birthday Dave

Happy birthday Dave Winer! Thanks for keeping the simple things simple and for consistently demonstrating the importance of maintaining your credibility in the face of adversity.

Tuesday, May 03, 2005

Generic programming in C++: An example with CComSafeArray and standard containers

For those of you developing in C++ with COM you’ll be familiar with the all-too-common SAFEARRAY. You’re probably also familiar with CComSafeArray which is a useful class to wrap up the rather raw SAFEARRAY and aid in memory management.

This blog entry isn’t meant as a primer for SAFEARRAY and CComSafeArray usage, there are plenty of good sites for that.

What I would like to talk about is using generic programming for day-to-day tasks.

What is generic programming? Good question, tough to answer. In C++, generic programming is writing code that works for many types by coding solutions based on concepts. A concept defines what the supplied abstract datatype are required to provide in order to get the job done.

Confusing? Initially it may well be. How about we look at a real (albeit trivial) example:



template <typename T>
T
max (T a, T b)
{

return (b < a) ? a : b;
}


In the code above, max is a function that takes in two items (of the same type) and returns the largest of the two. The above code can be used for any T provided it supports the less-than operator. [In standard-library lingo T (the abstract datatype) must satisfy the concept of “Less Than Comparable”.]

This code is maximally reusable and, as such, is A Good Thing. It’s an example of generic programming because, in and of itself, max doesn’t know about T and thus works generically for any type (that supports the less-than operator). We can write max once and it’ll work for all types. Beautiful.

In my experience, occasions to create generic code like max occur more frequently than most developers realize. I believe it’s because it takes awhile to become accustomed to “seeing” generic solutions. For example, consider if our generic version of max didn’t exist but we needed a function to compare two integers. It would be all too easy to write:



int
max (int a, int b)
{

return (b < a) ? a : b;
}


Then, when we have longs to compare, or floats, we could copy and paste the code and change “int” to “long” or “float”. Avoid such code! Duplicating code is evil and should be avoided. If you notice yourself copy and pasting code regularly it may be an indicator that you could benefit from generic coding techniques.

Here’s a real world example I came across the other day at work.

We use SAFEARRAYS and CComSafeArrays often. We also need to manipulate them in various ways so we often covert them to standard containers as they have a wide variety of algorithms that we can employ. Usually we have to convert them back (to pass back over a COM API). Someone had noticed this and written a conversion function:



// Remember to delete the returned pointer
SAFEARRAY *
CreateSafeArrayFromVector(std::vector<long> vec)
{

CComSafeArray<long> sa;
for (std::vector<long>::iterator it = vec.begin(); it != vec.end(); ++it)
{

sa.Add(*it);
}

return
sa.Detach();
}


In fact there were a whole bevy of these conversion functions. CreateSafeArrayFromVector that worked for floats. For doubles. On unsigned longs. We also had to work with std::lists so CreateSafeArrayFromList was born, duplicating all the vector functionality. Remember that much of the code is practically identical, we’re just adding things to a safe array! What a mess.

A single generic function could (and has) replaced it all:



template <typename FwdIterator>
CComSafeArray<typename std::iterator_traits<FwdIterator>::value_type>
CreateCComSafeArray(FwdIterator first, FwdIterator last)
{

CComSafeArray<typename std::iterator_traits<FwdIterator>::value_type> sa;
while (first != last)
{

sa.Add(*first++);
}

return
sa;
}


Much cleaner! How is it used?



std::vector<T> handles;
//...
CComSafeArray saHandles = CreateCComSafeArray(handles.begin(), handles.end());


You’ll notice a few changes. I chose to use CComSafeArrays because there’s no obvious reason not to. It increases type safety and decreases the chance of memory leaks. You’ll see that we pass in iterators to the function now. That allows abstraction from the specific container type. If you’re familiar with using the standard library you’ll notice that this is a fundamental tenet in algorithms – all of them do the same thing. There’s an important point here, if you’re passing containers in your function declarations you’re not programming generically. Instead, create a templated function and expect iterators to be passed in. Tricky to grasp at first but so clean when you bend your brain around it (repeat after me, “algorithms operate on iterators!”).

You’ll also see something about iterator_traits. What the? Without going in to too much detail (again, it’ll have to be another article), iterator_traits is supplied by the standard library to provide compile-time information about the supplied iterator. std::iterator_traits<T>::value_type resolves to the type that T points to. [There’s a whole bunch of things that iterator_traits provides.]

I’ve called the type “FwdIterator” because I require the iterator to support the post increment operator – the concept of “Forward Iterator” defines this requirement.

But don’t get too wrapped up in the lingo. Read the code like this:

“Give me two iterators pointing to the start and end of a range”

“Create a CComSafeArray containing the same type of objects as the iterators point to”

“Add elements to the CComSafeArray from the iterators and return the CComSafeArray when done”

If you can grasp the high level ideas then the syntax comes relatively easy.

In the future I’ll talk about the pair function, FillFromCComSafeArray. See if you can write it yourself!

Relevant links:

SGI’s standard library documentation

Boost’s Generic Programming Techniques

David Muser on Generic Programming

Sunday, May 01, 2005

Gallery: FAQ Item C.22

I use the wonderful gallery to host my photos.

Every so often I upgrade it or perform some sort of maintenance on it. And everytime I have to search for a particular link that tells me how to configure the software so that I can view it from inside my LAN and from the Internet. I want to preserve the linkso I don't lose it again!

It's item C.22 of the FAQ.

I do recommend the software though ngallery and coppermine look quite good too.

What do you use to host your photos (and BTW I'm not interested in any online facility, flickr is great and all but I want to host them on my own PC thanks very much)? :)

Tuesday, April 26, 2005

Code Camp OZ - I want details dammit!

I was pretty pissed to find that I wouldn't be able to make Code Camp Oz. Alas, I had an engagement party and a wedding to attend (not for the same couple!).

Anyway, now I want to know how it went. First reports seem like it was great but I want details! Are slides going to be made available? What was your favourite presentations and why? And, especially for me, what details were there about C++/CLI? Is anyone else using it?

A big shout out to Thomas Williams for the offer of a lift up there. Sorry I had to bail Thomas, hopefully there'll be another Code Camp and I'll be able to take you up on your generous offer! :)

I just noticed that I was down as the "C++/CLI co-ordinator"...I didn't even realise! Sorry Mitch if I agreed to that and didn't let you know I wasn't able to attend early enough to find a replacement.

Friday, April 08, 2005

Podcasts

I was asked the other day which podcasts I listen to, so here are the major ones:

The Dawn and Drew Show [rss]
Engadget [rss]
Adam Curry's Daily Source Code [rss]
.NET Rocks! [rss]
Triple J's Hack [rss]
TPN: G'Day World [rss]
TPN: The MS Developer Show [rss]
TPN: The Tech Conference Show [rss]
TPN: Matt, Freak and the Fatboy [rss]
Reel Reviews Radio [rss]
Dave Winer's Morning Coffee Notes [rss]
Battlestar Galactica [rss]

I try to listen to more but just don't have the time. As it is I'm finding that I'm getting progressively further behind. Today I was listening to some podcasts from early March!

When I have another spare few minutes I'll also put links to the actual feeds.

Enjoy George! :)

[Update: Well, I've updated the list! I listen to a few more these days...and I added the rss links. Enjoy Tom!]

Wednesday, March 16, 2005

GoogleX

Quick link to something I thought was cool: GoogleX. Now I'm heading off on holiday to Tasmania! Be back in after Easter - hope you and yours has a wonderful Easter break.

Monday, March 14, 2005

Cirque du Soleil: Quidam

After booking the tickets some eight months (!) ago, yesterday I finally saw Quidam. Most of the rest of the post can be summed up with the following word: awesome.

I've been sitting here trying to summarize what a Cirque du Soleil show is all about and it isn't easy. The show is a unique blend of artsy theatre, astounding athletical stunts, breathtaking live music, stunning costumes and pure comedic routines all rolled into one entertaining extravaganza. They've been touring for many years, beginning in their home country of Canada in 1984, and have gone from strength to strength to the point where they're now playing many shows simultaneously worldwide.

Thankfully, beginning this month, they started touring Melbourne.

I've been juggling (purely as a hobby!) for a few years now and was kicking myself that I missed Saltimbanco, Cirque du Soleil's first show here, in 1999. I was amazed when I saw the show on video (thanks Luke!) and vowed that I wouldn't miss another when they next toured. Unfortunately, a series of events prevented me from seeing Alegria in 2001 so you can imagine how keen I was when I heard that Quidam was touring.

Very keen! It didn't disappoint, it was fantastic!! I'm not going to review the whole show but here are some of my personal highlights:

The diablo girls. Holy crap. How they can spin those little tops with such precision and poise is beyond me. I've used a diablo a few times and it's taken me hours to figure out the simplest tricks. Watching the four girls deftly spin, toss and catch the diablos was amazing.

Skipping ropes. Simple concept right? Everyone's used a skipping rope! If you're around my age you probably did the "Jump rope for heart" program in primary school. In Quidam however, their motto must be "Jump rope gone crazy". People skip while they're skipping inside a 'double dutch'. Be blown away when the soloist (Norihisa Taguchi) skips on his bum.

Contortion in silk. The Cirque folk like dangling props from their specially-made roof. One of my favourites was where they dropped two gorgeous strips of red silk and had their acrobat (Isabelle Vaudelle) dance her way up and down them. Different in tone to the rest of the acts, this was quite emotional, serious and breathtakingly beautiful.

Banquine. Not sure how that exactly translates but here's a guess: "people throwing". See men and women fly through the air at dizzying heights as their colleague's throw them with ease! Check out the woman that is absolutely hurtled around. Hold your breath at the end where they attempt to make a vertical four-man tower.

Two of the funniest acts employed more tradition methods - improvised clowning around. Get some people out of the audience, have a vague plot; just add mischief. Haven't laughed so hard in ages!

Probably my favourite act was Vis Versa, or Statues. A man and a woman link their bodies in a slow-moving dance of incredible strength and balance. Unbelievable.

Although these are but a selection, the entire show was fantastic. Every second was enjoyable. The live music perfectly complemented each act, the lighting was sublime as were the dazzling costumes. Everything just reeked of professionalism and was just a delight to see. Highly, highly recommended.

For those out there that haven't yet purchased tickets, go do yourself a favour! The tickets are reasonably expensive (around the $100 mark) but what the show lacks in affordability it makes up for in kick-ass-ability.

Can't wait for the next show! (Or maybe I'll see it again...)

Saturday, March 05, 2005

SQL Server 2005 CTP

Yukon was a highlight for many at the recent Security Summit - I'm sure Greg and Thomas will be wrapped to see that the new CTP has just been announced.

Me? I'm not really a mad-keen database guy. I will, however, be interested in playing with the new Whidbey CTP when it's released on March 38!

Sunday, February 27, 2005

Geek Dinner - Post MS Security Summit Shenanigans (with photos!)

OK, I'm a few days late on this post. Sorry!

Last Tuesday was the MS Security Summit in Melbourne. I covered the event in an earlier posting, but I'm now going to discuss the important part of the day - the post-summit geek dinner [1]. ;)

Many of us had been in Greg Low's terrific presentation on SQL Server 2005 (Introduction to Developers) which was probably the last to finish at a little after 5:30. After trundling down to the MSDN Connection lounge (gotta love elitism! ;) I met up with Will, organiser supremo, and some of the other gang. The dinner had been set at 7:30 at the Blue Train Cafe so we needed to kill some time till then so off to The Pub, at the Crown Casino we go.



Relaxing at The Pub (over some nice brews - thank you Microsoft!) was a good way to start the evening. Everyone was friendly and interesting, quite a relief when you consider the "geek" stereotype is meant to have the social graces of dead fish. I was wrapped to have some meaningful conversations while [I pissed everyone off by] getting down everyone's details and snapping a photo. Here's some shots while we were at The Pub:


Mayur talking smack about Windows


They're all business at Microsoft



Just chattin'


Seven thirty snuck up on us fast and soon after Coatsey announced "last drinks!" we were on our way. The Blue Train is an iconic Melbourne restaurant on Southbank that serves a pretty varied cuisine. It's always busy and tonight was no exception. We waited aaaages for a dinner before Kathleen took it into her own hands and started getting things moving (awesome work!). Time flew with s conversation. Check out some more photos:













In short: wicked night. As I said, everyone - without exception - was friendly and the night flew by. Most people were keen to get together again so hopefully we'll have a second geek dinner in the not-too-distant future!



[1] Really don't like the name "geek" dinner! It just sounds so nasty, can anyone come up with anything better??

Thursday, February 24, 2005

Photo Gallery

I've begun posting some of my photos up on my website. Check out:

http://trentini.myphotos.cc/gallery/albums.php

Be patient, it's running on my home PC over a 512/128 ADSL connection and that '128' ain't really cuttin' the mustard!

Wednesday, February 23, 2005

MS Security Summit review & feedback

The Security Summit was yesterday and I promised a few people that I'd provide some feedback. So here we go.

I should point out that I spent all my time in the MSDN Track as I was more interested in upcoming technologies rather than security per se.

For reference check out the agenda.



The keynote, delivered by Microsoft VP Bob McDowell was delivered with skill and style. Compelling and passionate, Bob obviously revels being on stage. It was fantastic watching him, even though I felt that he only lightly covered any topics of relevance to security. He seemed more determined to rebut Nick Carr's popular article of 2003 "IT doesn't matter". However, rarely have I seen such a wonderfully presented speech - no slides, no fancy displays, just a gifted and polished presenter. Inspiring.



Next up was Jason McConnell giving an overview of Visual Studio Team System. I've been reading Jason's blog for awhile now - hey he's a Melbourne boy! - and VSTS was one of the reasons I was there so I was looking forward to this presentation. But, sorry Jase, I was disappointed. Maybe it was because he was following up the energizing McDowell but I felt that he was lacking punch, that he was underprepared and that the slides were poorly organised. Jason seems like a terrific guy so I'm putting it down to a case of "holy crap, I've gotta head off to Redmond in a coupla weeks!" syndrome. All the best in your new job Jase!



Next was Darryl Chantry and Sean Salisbury with "Testing for Quality Code". Darryl is a kiwi and spoke for the first half of the presentation about various tools that Microsoft use and provides today - tools like the excellent FxCop and PREfast - as well as how they're going to bundle in unit testing and perf testing etc in future versions of Visual Studio. Nothing terribly new but interesting nonetheless. However, like Jason, Darryl was lacking energy. Guys, at an event like this we want to leave the room excited about your products - give us something to get excited about, deliver with energy!

Oh, and Darryl, is there going to be some sort of tool to perform GUI unit testing? The only reasonable solution I'm aware of is NUnitForms (WinRunner and other recording-based tools don't cut it in my experience) and since Microsoft seem to be replacing all the other third party tools... ;)

I inwardle groaned when I realised that Sean was there to present about his companies product - sounded like we had a sales pitch coming. But I was pleasently surprised. It was a plug, no doubt, but Compuware's products look first class. They would certainly complement the Rational toolset that we use. In particular, the new Fault Simulator and Security Checker looked great. FS allows you to simulate various system errors (low disk usage, out of memory etc) so that you can exercise your error handling routines. SC closely examines your ASP.NET code at both compile and run time to try and find security leaks and , if found, suggests ways to fix the hole. Nice. Their other tools helped tune and profile memory, review code, analyse performance, determine code coverage, detect thread deadlock and many other neat features. I do believe the tools are expensive though. Good job Sean, you got me interested in your products though I do have some concerns about the potential difficulties in creating automated scripts with Fault Simulator.



After lunch Darryl was at it again, this time with David (didn't catch his last name). By this stage I was getting tired - I had woken up at 6:30 that morning which, for me, is way early. So their presentation, entitled "Design for Operations with Visual Studio Team System" was struggling to hold my attention. Darryl again seemed flat - though I've got to mention that he seems a genuinely nice guy - but the demos were a highlight. On the technology front, a lot of it was about trying to help architect solutions by providing higher level tools to represent blocks of a system. I think the idea has promise but, even after the session, I've yet to see major benefits to using these tools. Mind you, they do look cool.

I skipped the next session as I needed some fresh air to stay awake, so I went for a walk along Southbank and picked up a free coffee at an iBurst promotional tent along the path. Was a reasonably decent coffee. And the iBurst service - wireless broadband - is gaining momentum and coverage. I read my blogs from their booth and found the speed of the connection, as promised, very fast. It's still expensive but not ridiculously so.



Anyways, the next session was "Deploying applications with ClickOnce" hosted by Andrew Coates. Another familiar blogger, Andrew's presentation was pretty kick-ass. he's obviously excited about the technology and loves giving presentations. ClickOnce is looking good - I've been playing with it in the November CTP but Andrew gave a simple yet powerful demo of many of it's features that I hadn't used, like the various ways to check for program updates. ClcikOnce is finally making the implementation of a conceptually simple process simple. Try saying that four times fast. Good work Andrew - especially in light of an IDE crash! But hey, where's my book?! ;)

And has ClickOnce been standardized so cross platform development is - at least in theory - possible?



The final session for the day was an "Introduction to Programming with SQL Server 2005" by Greg Low. I'm not a passionate database user but Greg's presentation was terrific. His quiet demeanour couldn't hide the fact that he loves his work. Especially Yukon. He's got reason to enjoy it, Yukon is looking pretty awesome. The idea of having an accesible CLR in the lower layers warms my cockels. And, although Greg emphasised that the idea isn't to have a database act as an object store, that idea really appeals... He also showed us that T-SQL isn't dead, with a host of changes in store on that front. Covered a lot in a short amount of time - and Greg probably could have filled a whole day on half of the topics. We were the last session to finish...

Thus the summit ended. A pretty good day and, despite some "flat spots", I'm glad I attended. Thanks to Microsoft for putting on such a large event, it was really appreciated by me and everyone I talked to. Apart from the minor delays in registration everything ran very smoothly, even the obvious unpredictability of McDowell's keynote! The MSDN connection benefits were nice (speedy rego line & the lounge area) and I encourage you guys to continue to push that service. Can't wait to see the PDC come to town. ;)

Now, where were the G'Day World lads? Cam, you only live fifteen minutes away, where the hell were you? ;) Some of these sessions would have been really good podcasts...

And it's a pity that Frank Arrigo couldn't be there, many people were keen to meet him. Hopefully next time.

The post-summit festivities were fantastic, but that's for another posting, for now I've gotta get some sleep!

[Update: Photos are inline!]

Mugshots

As promised, here are the people who came to the "geek" dinner on the 22nd Feb after the Microsoft Security Summit. Where available I've also linked to their blogs.

I'll be posting more about the summit over the next couple of days (including more photos!) so stay tuned!


Damian Edwards


Matt Cosier


Mayur Patel


Vinit Pandya


William Luu


Nirav Patel


Thomas Williams


Jeff Alexander


Michael Kleef


Bill Chestnut


Tejas Patel


Adrian Bezzina


Jarrod Plunkett


Peter Stanski


Barmaid


Henry Craven


Greg Low


Athena Powlowski


Kathleen Khoo


Andrew Coates

Saturday, February 19, 2005

My new baby; the Nikon D100

I've always loved capturing photos. It blends technical knowledge and art in such a satisfying way. You need to know how to correctly expose an image (technical) and try to make it look pleasing (art).

I've been persistently using an old Nikon F801 35mm film camera for years now. It's a great camera and, when released, must have been a sensation. And the feedback it gives is magnificent. Press the shutter release and ch-chick! A wonderful sound to accompany the delight in creating a photograph.

I've been hungrily eyeing digital cameras for many years now. The ability to really be creative - and learn from your results instantly - has been an incredible attraction to me. I enjoy experimenting with the camera - playing with long exposures and shifting the camera or adjusting the zoom mid-shot, etc. However, with film this kind of creativity is difficult to explore because there is such a delay in seeing what you've done. What aperture was I using? How long did I expose for? Just how much did I shift the camera? Who can remember by the time they've gotten their prints back? How do you try and repeat a shot, with slightly different settings? How do you learn?

Digital SLR's overcome these deficits so I've wanted one for many years. But they've been prohibitively expensive. The Canon 300D and, more recently, the Nikon D70 have begun to change that. While still expensive you no longer need to sell your soul for the purchase. Thankfully, the price of older DSLRs have come down in price - to the point where I finally committed and bought a second hand Nikon D100 with a 24-85 f/3.5-4.5 AFS lens.

Woohoo! :)

I've had it for three weeks now and couldn't be happier with it.

Expect pictures to be posted soon. [update have a look at my online gallery here]

And expect pictures from tonight's Melbourne geek dinner to be posted in the next couple of days!

Monday, January 31, 2005

No Inkernet!

For anyone out there who's reading this blog you'll have noticed that I've written not a damn thang for a couple of weeks now. There's a very good reason.

I'm housesitting.

Which is cool! You see, normally I live with my folks. No real problem - I get on with them really well. But, at 27, I'm starting to need to spread my wings. Back in 2001 I moved out of home for the better part of a year and, when the lease came up, I decided to move back home in an attempt to save enough money to buy my own house. Unfortunately the huge housing boom has extended my plans somewhat as the size of the required deposit practically doubled in the past two years. Anyways. The house is closer to the city (where I spend a bit of time) and my girlfriends (where I spend a lot of time). It's good, I'm enjoying it here.

Except for one little problem.

No broadband! It's amazing how quick you take for granted that fast Internet connection. I'm really missing reading and responding to blogs in the evenings. And downloading files without even bothering to check their file size. I'm damn-near tempted to get a broadband connection installed here just for the duration of my stay...but I haven't been able to figure out a way to truly justify the cost - even to myself! I have just connected up a dial-up account generously provided by my company but dang it's slow. I now really feel Adam Curry's pain! Once you've tasted that pure, glorious fat Inkernet pipe there's no going back!

So I'm here for five months. Please excuse the lack of posts, I'm still reading everything (after work hours mostly) and I have lots to talk about (hiking at Wilsons Prom, figuring out how to integrate Winforms and Win32-based GUI libraries in C++/CLI, my new digital SLR) but I just don't have much spare Internet time. I'll try and post as much as I can. In the meantime bear with me and consider a thought for little ol' Inkernet-deprived Matt.


Thursday, January 06, 2005

Australia pledges 1 billion

I'm not a huge fan of the Howard government but pledging one billion dollars over five years seems totally appropriate.

Glad our little country can help out.


Monday, January 03, 2005

Please donate if you can

By now, everyone has heard and seen the news about the Tsunami disaster. Here's a plea for help; please, if you are able, donate some money to one of the many organisations collecting funds.

If you are in Australia here's a few such organisations:
There are many others.

If you're unsure which to choose I've been a supporter of Oxfam for some time now and have been more than happy with their work.

If you're located in another country please just look up a local organisation, you shouldn't have to search very far.

Thanks,
Matt