Friday, December 18, 2009

Black friday madness

November, sweet november... month of the most important of holidays on Earth - the Black Friday! When all geeks can join in a mad rat race for the best deals, from clothing to electronic gadgets. For about 3 days people get in lines throughout the night, take enough red bull and 5 hour energetic drinks to glow green in the dark just to save some dough for the holidays. This kind of sacrifice may sound stupid for those who never experienced it, but since I came here to the US I can say this is the funniest holidays ever. Which other holiday can we find 47' HDTVs for less than half the regular price? Or get into a Walmart of Target store and see people fighting over cheap doorbuster deals? And hordes of geeks fighting online and killing web servers with DOS attacks trying to purchase half-price electronics? It is not for the faint of hearth, that is for sure!

This has been my approach during the past Black Fridays:
1. Monitor "official" BF sites for leaked ads weeks before the Black Friday - the ones I usually look into are:

http://bfads.net/
http://www.blackfriday.info/
http://www.black-friday.net/

2. Based on the leaked ads, make a list of your targets - when the time comes there is no room for you to decide what to buy, if you hesitate you lose the deal!

2. Create a webmail account just for deals and other junk - apply for email lists on every store you can think of. Stores sometimes send good deals in its email lists and this is sometimes the fast way to score it! Just make sure you create a "junk" email account to use only for that purpose or set rules in your existing email client (webmails like hotmail and gmail are good at that too) to move all emails from these companies to a separate folder. Some stores I get deals via email:

• Newegg - http://www.newegg.com/
• Amazon - http://www.amazon.com/
• BestBuy - http://www.bestbuy.com/
• Target - http://www.target.com/
• CostCo - http://www.costco.com/
• TigerDirect - http://www.tigerdirect.com/
• CompUSA - http://www.compusa.com/

And so much more... some stores also give you discount coupons when you signup, so make sure you do not overlook it.

3. Monitor deal sites and forums for the best deals - the ones I use the most are:

• DealDump - http://www.dealdump.com/
• SlickDeals HotDeals forum - http://slickdeals.net/forums/forumdisplay.php?f=9
• FatWallet - http://www.fatwallet.com/

* - make sure you also follow the BF forum at SlickDeals - you need all the information as fast as possible!

4. And lastly, refrain from sleeping. This is key - if you sleep during the Black Friday week you WILL lose good deals. If you sleep during Thanks Giving / Black Friday / Saturday you will lose the BEST deals! In times like these you can't rely on a cup of coffer, you need something "military grade" - in times like these 5 Hours Extra is your best friend! :D

5. Some brick-and-mortar deals are inviting - but think wisely before stepping into the streets. Many times the online stores match or even top the deal. Also, shopping online you can easily cover dozens of stores - while other people are in line for one single store!

I hope you already figured I made a few jokes so far, I am not that crazy to spend 8 hours in line during a freezing night like some people to score a TV or laptop for peanuts. But for those who still think I am a materialistic person, I guess that may be true... but I have to say that most of the Black Friday fun is actually in digging and "fighting" (by fighting I mean trying to get your order thru, not actually fighting a dude over a TV!) for deals than actually spending tons of cash on stuff. And if you are picky with what you buy you do not need to spend a lot on stuff, spend good time with friends - I have had lots of good times with the wife and a friend on Black Fridays - and get out of it with good stuff you can use.

I just wish I had the idea to write this post BEFORE this years' BF... oh well, perhaps no one will notice if I copy / paste it for next year's BF hehehe :D

Sunday, December 13, 2009

Setup Oracle's SGA size

I always work with Oracle databases on my laptop. I prefer to install them myself so I can tune it to run without using all my memory. Also, instead of installing Oracle directly on my laptop I always do so on virtual machines because this way it is easier to share my environments with my colleagues and to setup individual sandboxes for each project I am working on.

When I have to work with databases installed by others I found I usually have to decrease how much memory is assigned to Oracle. The scripts below describe how to do just that.

• update Oracle's SGA size:

-- show current SGA size
select sum(value)/1024/1024 from v$sga;

-- set SGA target size to 256MB
alter system set sga_target = 256M scope=both;

-- list buffer size
select current_size from v$buffer_pool;

-- list all pools
select pool, sum(bytes)/1024/1024 Mbytes from v$sgastat group by pool;

-- additional Oracle memory settings:
-- make sure you don't setup SGA to the same or higher size than MEMORY
alter system set memory_max_target = 512M scope=spfile;
alter system set memory_target = 512M scope=spfile;
alter system set sga_max_size = 256M scope=spfile;
alter system set sga_target = 256M scope=spfile;
-- you will need to restart Oracle for the changes to take effect (e.g. dbshut and dbstart)

Friday, December 11, 2009

UML diagram editors

From time to time people ask me to write UML diagrams. Sometimes it makes sense, but oftentimes I could be better off using my time on something else, like writing code, prototyping etc. Please don't get me wrong, I am not against good documentation or UML per se, but many people like to focus too much time on pretty documents with beautiful colorful diagrams while others, more pragmatic ones, prefer instead to have a system built on time, with quality and running in production. I like to think of myself as part of the "pragmatic" group.

I KNOW documentation is important, it can make the difference of people using your software or not, or your development team implementing what your client actually needs instead of something completely outlandish. That is not my point. My point for this post is that we should generally try to stick with what we are good on, but sometimes we just dont have a choice and have to work on something we KNOW isn't one of our strong skills. I thought PMs were supposed to limit such times, making sure tasks are assigned to the best resources based on their talents, but from my experience this is not exactly how it generally works. Not necessarily because of the PMs, sometimes they just don't have better resources to tackle the job.

But regardless what I think, as much I try to avoid wasting a lot of time writing documents that no one will read, sometimes I have no choice and just have to do it. I guess that is why they call it work, we can't like all that we do for a living. But what I can do is to try to finish it as quickly as possible, while still developing good quality documents. Which bring us to graphical design talent... and this is one area of talent that, I must confess, I am not especially gifted. I've worked with people born with natural talent for graphical design, they could use pretty much any tool and come up in few minutes with amazing diagrams or images or web site layouts etc. Think like someone opening Microsoft Paint and drawing a Mona Lisa in few minutes - yeah, I know, that was a stretch, but the point is, this is one of the things in life that you are either born with or you are not. Sure you can learn techniques to improve, but your true potential is more or less apparent from the early start.

Now the question is, how someone who's not a superfast gifted designer can create decent looking diagrams fast? My answer is "with especialized tools that format most things for you and you just have to enter the data". Think something a bit more especialized than Microsoft Visio. I can spend hours on Visio, moving lines and boxes, changing colors etc, and no matter what I do on it it will always end up looking like a pig. Before people say I did not try enough I can say that I tried learning from articles and books about it, but after some time I just accepted that I'm better of spending my time designing server-side frameworks, integrating enterprise applications, working with web services etc than creating striking-looking diagrams and working with web design. Which is actually quite liberating, to accept that I should leave such things for other people more gifted than myself while focusing on what, I like to think, am good on and like a lot to do. We should not try to do everything, but to focus on what we LIKE to do, right?

So what can I do when I need to write diagrams so they at least look decent and describe the concepts and ideas I am trying to document? And are finished quick so I can move on to other tasks? Well... tools that automatically generate the diagrams for me is a good start, I would think.

For example, NetBeans can automatically generate a UML class diagram from your source code. The generated diagram will be complex and unless you do some additional editing to filter out some of the noise no developer would ever waste time reading it, they would obviously prefer following the source code instead (assuming your source code is decently written - it is, right??), but it does look decent to see on a document or presentation. For those who dont know, it would appear that you put a lot of time on it... yeah, right! :P

Ok, so NetBeans is fine... but most times when I need to write UML diagrams I still do not have the classes yet, I am still discussing the solution design with a team. So I need something more flexible than that. But not too flexible that I would have to spend ages moving lines and boxes here and there! That is when I found a ridiculously small application called Quick Sequence Diagram Editor (QSDE).

Different than most similar tools, in QSDE instead of moving graphical elements around with your mouse you actually PROGRAM the sequence diagrams! I initially thought it was stupid and it would take much longer to write diagrams this way than just using the mouse... man I was wrong, and I am glad I kept trying to use this little gem. Now I can draw sequence diagrams real fast using QSDE.



Another decent UML tool that I used for other UML diagrams than sequence is StarUML. It is free and pretty decent for class diagrams, check it out.



This is just a simple (and lame) diagram made with StarUML

# References:

• StarUML - http://staruml.sourceforge.net/

• Quick Sequence Diagram Editor - http://sourceforge.net/projects/sdedit/