Archive for June, 2007

Importance of knowing and talking Design patterns

June 16, 2007

As part of a push from a mate at work (and hopefully myself), I have started reading the book Head first design patterns by O’Reilly publishers (intro pdf avaliable on the site). By first looks, It’s a very childish book but once you get past the logic for it being so (well explained in the first few pages of the book/ pdf), it’s actually a really informative and invaluable book.

<ShamelessPromotionOfBook>

I have always thought that for me to pick up a good understanding of design patterns, I really have to be reading about them and implementing them as I go through the examples (prob the typical approach to learning). The way this book is written seems to remove this need by (according to the author) making use of different learning styles and ultimately making itself standout by use of images, with text and arrows inside the image rather then captions, images to stimulate emotion and attachment, lots of activities to practice and quiz yourself on your understanding, the use of stories which is a lot easier to remember then just raw information and facts and a lot more. End result is a much more interesting book that helps your brain persist, recall and hopefully apply the use of patterns in real life situations (the book gives heaps of good situations which relate somewhat to real world). So far the book is looking real good and I’ll highly recommend it to anyone who thinks they just wont be able to read a thick book on design patterns.

</ShamelessPromotionOfBook>

Anyway, back to my post, At the end of the first chapter, it talks about the huge importance and benefits of using a shared vocabulary when talking about software architecture, the vocabulary being mainly expressing  things in design patterns.
So fully supporting this comment, the key points and benefits of doing so (slightly grouped together and in 1 (longish) paragraph).

Saying more with less / Turbo charging the team / Stay in the design longer:
By using patterns to describe architecture, you are really describing and grouping together a whole pile of ideas which another developer should be able to understand without having to expand on the little details such as ‘this has a collection of animals which….”. By not getting into the details of how things are going to be implemented, you can easily form a stronger overview of the system and deal with the high level issues such as potential architecture floors. This also changes efficiency of the team (the whole turbo charge thing) by spending less time on actually explaining the individual components of a pattern (outside of the context of the pattern) and by minimising mistakes caused by misunderstanding and interpretation.

<ShamelessPromotionOfBook>
Once again, highly recommended book, easy to digest, Buy or Borrow this book!
</ShamelessPromotionOfBook>

Advertisements

Bad caps on a compaq Machine (motherboard)

June 2, 2007

Afew days ago I had a call from some friends of mine, it appears that their fathers old compaq (amd athlon 1100mhz) had given up on them and they had alot of good stuff on it, including alot of the photos from their recent wedding. To say the least, it was vital to recover what i could from the machine. I was told that the sympton was that it would nolonger turn on and that for payment, my partner and I would be shouted to their delecious home cooked mussles, who would be the fool to give up an offer like that?!

Anyway, after having dinner at their place and a good catchup, I had a chance to test out the machine for myself. There was definitely power and it would turn on but only showed a black screen, it wouldnt post, no beep codes or anything 😦

Bad CapsAfter opening up the machine, I quickly spotted a good handful of bad Capactors lingering around the cpu (tell tale signs are when theres brown oze appearing from the top and when the top looks like its under alot of presure / not flat). Theses were common faults awhile back, affecting alot of motherboards of verious brands and there is a whole conspericy theory around why this happened (checkout www.BadCaps.net for more info), but these are realitively easy and dirt cheap to fix if you have the time, the tools (tools being a 25W to 40W soldering iron) and a steady hand.

When looking for replacement caps, theres heaps of places online these days that will sell you a cap kit for specific motherboards but as living in new zealand, postage would cost more then its worth, however, www.Jaycar.co.nz sells low esr caps thet may fit into some of the older motehrboards, else you can always find a cheap doner/faulty motherboard (this being the case with me) from your junk pile, a friend, ebay, trademe etc. The one thing to be aware of is that when replacing caps, usually only the higher value caps need replacing (look for anything 1000uf or higher as potentially being faulty), this doesnt mean lower value caps go bad but its alot less likely. The otherthing is although value isnt entirely all that important (I have replaced afew 1500uf and 22oouf  caps with 1200uf before and will in this case), Voltage is everything, When a cap says its 6.3V, do not use anything less, you could do more damage and potentually damage other parts such as the precious CPU and less precious Power supply!.

It is also very important that you use low ESR capactors as when passing power through the caps, they generate a resistance which is dependent on the frequency being passed through it (and dont say you are passing DC, cos you wont be, well not clean DC as its a switching power supply and also, the motherboard is using switching to get the different voltages it needs). The greater the resistance, the hotter the cap gets and the shorter they last (very short lifespan). The Low ESR caps cope better with the high frequency going through them.

bad caps on motherboardIn my case, the original caps were Nkcon 2200UF (6.3v). Luckly I had a old motherboard around which although wasnt useful, it had some good caps onbaord, so off they went. The best way I have found for removing caps of the board is by heating up one of the legs from the bottom of the board while applying presure from the top side of the cap (same side as the led you are ehating up). As it lifes out abit, repeat on the other leg and keep repeating the process untill out. This method also works well when removing the bad caps from the board you are trying to fix (however you really do need to be careful on this as the pcbs have heaps of layers and can be damaged very easily).

When applying the good caps to the board, fistly, make sure the legs are clean, straight and spaced such taht they should slide into teh board easely. Apply some solder to the upper side and lower side of the board wher the cap is going to sit. Position the cap into its final position (ensuring that the positive and negitive pins are in their correct orentation).

Apply heat on the bottom of the board (board should be rested verticually if possible) while applying presure on one side of the cap. repeat process for the 2nd leg and keep repeating to wiggle the cap onto the board. The cap should soon be sitting on the baord (doesnt need to be a tight fit as that may over time and the heat cycles, damage the cap).

Repeat process for all the caps (11 in this case).

As a final step, make sure you clean up after yourself, remove any splatters of solder that may have jumped as you heated it, resolder any of your work that looks unclean etc.

Finally, test your board and pray for success (I would recommend you test your board using old parts if you have them just incase, else use only 1 memory stick, no hard drives, no unnessery addon cards etc). once you are happy with a job well done, connect everything else up.

In this case, the hard drive was still good and the motherboard was the only fatal fault. What was better was that when they came to pick the machine back up, they droped off some dim sims that Serahs father had made!, yum!!!!

If you plan on trying this fix then afew words of advice:

  •  When replacing the caps, Make sure the voltage of the new caps is atleast the same
  •  The new caps should be the Low ESR type and rated for 105 degrees
  •  Be extremely careful when removing the damaged caps, if you are not, you can easily damage the board.
  •  Tint the leads of the new caps first before putting them onto the motherboard
  •  Make sure you have the caps positioned correctly (the ‘-‘ should be marked on the cap and the ‘+’ should be marked on most boards)
  •  Make sure you do a good job on cleaning up before putting the baord back into teh case, old solder bits could get traped and short circuit things (really bad, best to tidy up well)
  •  Before turning the board on for the first time, make sure you install only the minimum parts to get the machine started (pick the smallest ram chip, dont install hard drive, if you have onboard graphics, use that instead of the standalone one, dont install any unneeded addon cards such as modems, unplug usb ports and even the monitor if its an lcd etc), that way, you will cause the lest damage if somethign went wrong (you should know if somethings not right within seconds of turning it on).
  •  Finally, have some faith in yourself, it isnt a hard job to do.

 Good luck!