Greed FTW

June 30, 2009

Ahh greed is a funny thing. The bigger the number, the more suckers wanting to win. I was one of the 1 million West Australians (ie. Suckers) participating in tonights epic $90 mill Oz Lotto MegaDraw.

I think I won, maybe $50. And to be honest Im pretty happy. Of course I would love more, but if I get enough to balance what I put in, there’s no loss.. and I had heaps of fun along the way.

I was watching the live results on TV tonight and there was a woman from the OzLotto offices speaking about the statistics of tonights MegaDraw. I believe she said that Aussies (in W.A. alone I think) had spent 23 million dollars in the basically 1 in 45,000,000 chance of hitting the jackpot.

And it hit me… 23 million bucks. Wow. Could you imagine if every aussie banded together and really wanted to get rid of poverty and hunger in Australia?? (not to mention the other places in the world, but I think we need to fix ourselves before trying to fix someone else)

Shit, if we just pretended there was a 90 mil megadraw every few weeks, we’d knock that shit off inside a year.

Ignorance and apathy are wonderful things…

Sorry if it sounds like Im getting up on my pedestal (the My Pedestal tag is a poke of fun at myself ūüėõ ), but maybe next time there’s a massive draw like this, stick some of that money into some random charity. God knows there are thousands of them out there… And Im not saying dont buy a ticket, that would be just silly! But one person today I saw spent $1000. Seriously, wtf?

Good luck everyone (who hasnt already checked their numbers ūüėõ )!

Advertisements

When It Rains, It Pours

June 29, 2009

Inspiration is a strange creature.

It will leap upon as at any given moment in time, constantly bombarding you with new thoughts and ideas. Ways to make existing things better, and the motivation to actually try new things, and times like these are quite hard to come by in the writing world, but by frick when it rains… it pours.

Such was my weekend, full of inspiration and dreams. To the point where my mind wouldnt rest until I had actually written them down! It was as if a fever had come upon me, seeing with my minds eye the potential that these ideas could reach if given the proper time and effort.

The first of such ideas was another blog. A concept I had been toying with for quite some time, as I felt my personal blog was feeling scattered with seemingly random thoughts and genres, but it wasnt until Friday night that things really got underway. By sunday I was having word-visions (for lack of a better term) of the words and analogies to introduce my new blog-child to the world. Needless to say Im as proud as punch of my new baby.

The second (and Im still questioning the wisdom of this) is a webcomic. As you can see, there is nothing there yet, as I am putting the finishing touches on the first release. I write these things purely with my sense of humour in mind… so if you do appreciate quirky, mildly amusing satyrical comics of things both in the general world and the technical world, then I look forward to seeing you there!

I find it quite strange, how I can go from posts being weeks (sometimes months) apart, to the 3 I have done over the past few days! I suppose most in the blogging world would find this normal, however I have been sadly lacking in inspiration over things to write… I refuse to be one of those people that just writes because they¬†feel like they must in order to ‘keep up appearances’. I dont know… I just dont feel right writing when I dont feel the urge to write… That constant need to keep typing about things relevant to me in this world, both whimsical and otherwise.

My advice to anyone out there: when inspiration bites you on the ass, dont flinch… you dont know how long it will be before it will bite again…

So enjoy it while it lasts!

 

Gnite all


A New Blog Is Born…

June 28, 2009

I paced back and forth nervously in the waiting room… The Murse (male nurse) came out and told me that my wife had requested to see me. Heart in my throat, I walked into the delivery room… And heard such foul abuse thrown my way, that I momentarily fought the urge to both run screaming from the room and throw up at the same time…

Gathering my courage, I walked forward, getting closer to the bed with my (usually beautiful, mild-mannered) wife, and sat down next to her.

As I grabbed my Blog’s hand, hearing her screaming with the effort of bearing our little blog-child, I winced, as the sound of her screaming set my ears ringing… Then I heard¬†a sound I think will stay with me until the day I die… the screaming of, not my wife (which is altogether uncomfortable and not a little bit painful), but my child.

Thus a new Blog is born.

After much discussion, we named him ‘Crazy Tech Head’, after the much loved technology the missus and I love to share with the world, and we hope he will grow up to be a big, strong blog, with many followers and a strong community.

We love you Crazy Tech Head, and welcome to the world of blogging.


iPhone, Where Art Thou?

June 26, 2009

The Prodigal Phone has arrived.

Finally.

I still dont understand why Australia had to wait an extra week for the promised iPhone… maybe its Steve Jobs way of passively taunting the ocker sounding cousins of the Southern Hemisphere. Who knows…

In any case, there was semi-hysteria surrounding the release of Apple’s wonderous telecommunications device, with those crazy people lining up in the early evening. It has been released on all of the major networks… bar those suckers on the 3 Network (sigh) as we have to wait til sometime in July before it graces our grimy fingers (although, according to most reviews the fingerprint issues have been partly resolved!).¬†

Epic anti-kudos¬†on the lack of SPECIFIC details from 3. Note to 3: ‘Coming in July’ != specific details. I am patiently waiting for the release of what will liberate me¬†from several devices/things (plus a few new things)

  1. iPod: (my ageing 80gb keeps freezing at random times, plus the connection port on it is almost phubar)
  2. My current phone, a Samsung U900: To be fair, its quite a good little phone, but not quite powerful enough for my liking… I like my apps to load in an almost quantum timeframe (ie. on and off at the same time), and I think the psuedo-touchscreen is more a gimmick than anything.
  3. My 2005 aging Street Directory: Its served me so damn well, I will probably shed a tear when I cremate it the day I get my iPhone. With the inclusion of everyones friend, I shall further decrease my reliance on paper (no doubt pleasing some tree-hugging hippies out there ūüėõ )…
  4. GPS Functionality: Because¬†sometimes you need a bit more than an electronic street¬†directory…¬†And stuff buying a Tom Tom… Ill just download the TomTom app from Apple’s much lauded App Store.
  5. Gaming Device: Ah by far my biggest achilles heel, the hardware that runs the newest iPhone is just staggering in terms of its gameplay abilities. The meatier games on Apple’s App Store now run like a breeze… The wonderful thing about this is, that someone else will now make a game and push the envelope even further! Hardware improvements shall go forth and multiply!! I am truly a gamer at heart (some might say an addicted gamer) and the thought of being able to play 3d games while on the effing train just makes me so happy I want to dance around my house. Thats how much I love games. I heard rumours of the old-school ps1 title, Wip3Out being ported to the iPhone, using its motion sensing technology to steer… it will be the first thing I look for upon receiving my shiny new iPhone.

The thing I love about the iPhone (and this is without me even having owned one yet), despite some of its faults, is the sheer amount of integration you can achieve. People will remark ‘oh you only need it do calls, why spend so bloody much?’. But its not about it just being a phone, its about the combination and culmination of so many fantastic technologies that the mind just boggles. Now add in the elegance normally associated with Apple’s products and you have one glorious piece of hardware. Fast hardware.

Reports are emerging of how much Apple is making on a per-device basis, and already shouts of ‘foul’ litter the electronic air, accusing Apple of being evil, money hungry¬†bastards. My thoughts are: so what? If they are making massive amounts of profit, I say good luck to them! If any of us were in the same position as Mr Jobs, would we really sitting around the board room, saying ‘Well ladies and gentlemen, it seems we are making far too much on these iPhones of ours… we should cut prices!’. Ugh, idiots. That profit balances out the no doubt massive R&D costs that go into the development of such a device, not to mention licensing issues (TomTom comes to mind) of the higher-end apps, and the even bigger cost of the valuable IP of the iPhone itself. I think that justifies parting with our¬†hard-earned mulah to gain access to an elegant, powerful gadget that removes the need for at least 4 devices in our normal day-to-day lives (and dont even get me started on the Email capabilities).

For now, I shall sit patiently, waiting for the inevitable announcement that 3 has finally released the iPhone.¬†And in the meantime¬†trying¬†desperately to play a port of Galaga 3 on my samsung…

God help me (and my RSI).

 

Night all!


When Execution Plans Go Bad

June 24, 2009

I have decided to (finally) do a technical article… This was one of the ‘promised things’ from my very first entry, and now 6 months later, I am finally fulfilling that promise. Haha, come to think of it, the title of this blog is also very appropriate to my failed dedication in keeping this blog regular… but I am trying people.. and I will get there eventually!

Keep in mind that these articles aren’t the mammoth things that you see in other technical blogs, with advanced techniques on everything from customised and extended WinForm controls, to the new fandangled WCF with its advanced Web Service implementations (those are pretty damn cool though). Its more a guide to some of those ‘little things’ that I stumble across from time to time… the little things that you will spend hours on trying to figure out what the heck is going on, only to realise at the end just how¬†obscure some of these things can be.¬†

This first article is about SQL 2000/2005 execution plans, hence the title ‘When Execution Plans Go Bad’.

A little while back, my co-workers and I came across a very puzzling problem that was affecting our ‘main’ (for lack of a better term) application, in production no less. We were getting seemingly random locks in various parts of the application. So while we all frantically tried to figure out just exactly what the heck was going on, we eventually realised that one of the procs responsible for the basic client searches was locking up (and this search functionality is re-used in several places in the application). The strange thing was, when this proc was run from Sql Management Studio, the proc ran perfectly! We had recently come across a similar problem, but in Sql Reporting Services… the report was locking out, but the proc was being run from Sql Management Studio just fine! After a bit of research we discovered that the execution plan was to blame. Somehow, Sql had cached a terrible execution plan… We still arent 100%, but we think that it came from a job that runs every week on the DB, that re-builds all the indexes. And therein lay the problem… execution plans become inefficient (or even invalid) when certain changes to the database are made…

  • Schema Changes
  • Statistics Changes (this is also a possibility)
  • Dropped Indexes
  • Large numbers of changes to keys (bulk insert/delete statements to the table in question)

It seemed that one of the tables had their index dropped along the way, and re-created (or possibly the statistics of the table changed) and made the current cached execution plan inefficient and/or invalid. Applications, when accessing Sql Server, will usually automatically use these cached execution plans (queries run directly from Sql Management Studio do not suffer from this problem as they seem to bypass the cached execution plan).

There are several ways to fix this, the easiest (in my opinion) method being a call to one of the system procs, called sp_recompile, which (in case you didnt realise :P) re-compiles the object in question. Passing the name of the object into the proc as a varchar (or equally string related type) will cause the proc to be recompiled, caching a new execution plan next time any proc/function/query related to the object (ideally a table, but a proc will work ok) is called, whether it be from Sql Management Studio or from an external application.

Example:
/*
An sp_recompile call for the uspLogError Stored Procedure
in the AdventureWorks Database.
*/

¬†EXEC sp_recompile ¬†‘dbo.uspLogError’

An alternate way (though one to be wary of, due to possible performance issues) is by placing a WITH RECOMPILE clause in the definition of the proc, before the AS keyword. The problem with this method, is that if you do implement it, Sql Server will discard the execution plan every single time the proc is called and re-create the execution plan from scratch (but it might be good for when you are still developing an application and the database and its structure could change constantly).

Example:

 

/*
A WITH RECOMPILE clause example, which causes a stored procedure
to be recomplied each time it is called.
*/
CREATE PROCEDURE [dbo].[uspLogError]
(
@ErrorLogID [int] = 0 OUTPUT
)

 

WITH RECOMPILE
AS
BEGIN

END

 

The final way, is by calling a proc using another form of WITH RECOMPILE. This is a once-off call, similar to the sp_recompile proc, however this will only work with procs, as you (obviously) cant use this sort of method on a table.

Example:
/*
         Executing a stored procedure using the WITH RECOMPILE clause, to force
         Sql to recompile the proc, and refresh the execution plan.
*/

EXEC dbo.uspLogError WITH RECOMPILE

 

 

 

Once we forced the proc to recompile, the new execution plan was cached… and the locks vanished!! Huzzah! The application started functioning normally and we all breathed a huge sigh of relief… at least until the next time it happened! ūüėõ Thankfully we were all prepared and instantly recognised the issue when it arose.

Well, there you have it. My first ‘technical’ article. I hope it was an enjoyable and interesting read. And please, if you can offer any feedback or point out any mistakes, dont hesitate to do so… how else does anyone learn ūüôā

Night all!

 

Resources:
http://msdn.microsoft.com/en-us/library/aa238892(SQL.80).aspx
http://msdn.microsoft.com/en-us/library/ms181055(SQL.90).aspx
http://msdn.microsoft.com/en-us/library/ms190439(SQL.90).aspx
http://downloads.red-gate.com/ebooks/HighPerformanceSQL_ebook.zip (HIGHLY recommended!)


Social Interactions

June 3, 2009

*Sigh*…

Well, I finally did it. I signed up for facebook. I remember about¬†2 years ago, when everyone was raving about the MySpace/Facebook craze… It was nuts. As a result of this, I swore both of them off, vowing never to be pulled into the void of eletronic social interactions. Until last Saturday that is…

And I gotta say, I am having a blast!

Of course, I signed up for the lesser of two evils, this¬†being Facebook. Ive seen my sister’s MySpace page (sorry nic) and it made me shudder… that being another reason Ive stayed away from the social networking scene. For all the times people have said to me, ‘Oh you should totally sign up to MySpace’, I truly, from the bottom of my heart, have wished I could be able to do this. MySpace truly isnt my thing…

Facebook… well thats marginally better. The only slightly annoying thing being the 5 billion quizzes (which, I must admit, I have partaken in quite a few)… and these quizzes are like a nice smelling coffee in the morning, but you’ve already had 3. You know you dont want to, you know its not a good idea and your body is screaming at you to just leave it alone… but you pick the coffee up drink it anyway. And then you’ve got the shakes for the next 2 hours.

I quite like the overal simplicity of Facebook’s design (I vaguely remember¬†remember people kicking up a fuss about the change, and I think those people are crazy). I wouldnt go so far as to say its targeted at my demographic, but I sure as hell havent seen any crazy whacked out themes or background pages…

And the ability to share photos is great! Ive uploaded photos of me and the missus, my pimped out Ride (everyone that actually knows me just lol’d then), my food (cue the drooling), and later today I will be adding my coffee!

Im also talking to people I havent spoken to in years! Mostly good people too, although one or two are still the same dickheads/assholes I remember. Considering blocking them too, if thats possible with FB (0h yes, Im abbreviating! Look how facebookey I am! ūüėõ ). Not only that, but Ive had more contact with my friends in the past 5 days than I have in the past 3 months (note to everyone: the mobile phone is a horrible way to stay in touch… its too prone to laziness). So its pretty good to be (kinda) in the loop!

Well, thats it for now!

Enjoy your week everyone! ūüôā