Tuesday, June 9, 2009

Notepad++ Macros - Video.

Most of us use text editors all the time. Store that phone number, view the log file, view configuration files and so on, are all done using a text editor. Many even write substantial amounts of code using text editors. On windows you can’t afford to get stuck with notepad under these circumstances. Enter Notepad++, a free editor that does the job and does it right. I am not trying to patronize the software. It just works brilliantly and needs to be shared. The feature that really attracts me to Notepad++ is macros. Many of you may already know what macros are and how to use them, but so many don’t. I’ll show you how. This is best explained with a video. So I made one. Here it is.

video

I hope you enjoyed that and learnt something new. This really increases productivity especially when you are dealing with extremely large files and need to perform the same action on multiple lines in these. Remember, repositioning the cursor needs to be done with a series of keystrokes and not by using the mouse in order for the macro to work multiple times as desired.

P.S. If you just got here, this week was double post week. Scroll down for one more.

Monday, June 8, 2009

Get a DotA setup going.

DotA is my favorite WarCraft III mod, and is probably the game I have spent most of my gaming time playing. If you want to get started with DotA or if you are already a player but without the proper environment, then here is a quick guide for setting up a fantastic environment for DotA. All the links and software are owned by the respective companies and I bear no responsibility should your computer explode, become self-aware and take over the world or any other problem resulting from the use of this guide.

Link your licenses to a battle.net account.
You need a copy of WarCraft III Reign of Chaos, and Frozen Throne for this. I am assuming that you already have it, or have just gone and bought one after reading this. Go to www.battle.net (if that does not work try us.battle.net) and create a new account. Once you have completed all on-screen instructions you have a brand new battle.net account. Use the ‘add game’ menu to add all your blizzard game licenses. This links your keys to the account, and you can now download your games anywhere and have access to all your keys from your battle.net account. Pretty sweet huh? Don’t throw the discs away though, they are always valuable. Now either download the game if you don’t have your discs handy or use the discs to install the game. Blizzard games no longer require CD authentication, so if you download the game from battle.net you will not need your CD to play. Once you have installed Reign of Chaos (RoC) and The Frozen Throne (tFT) you should fire up tFT and connect to battle.net to update. Now you have a functional WarCraft setup ready.

WinPCap and WC3Banlist.
Banlist is a program that helps you with joining, maintains banlists, custom phrases and much more. I simply cannot play DotA without banlist. It bundles WinPCap 3.1, which doesn’t work on Vista and is old, so you want to head over to www.winpcap.org and get the latest stable build which currently happens to be 4.0.2. Don’t get the beta, its not worth it. Once you install that, banlist can work. Now go to www.wc3banlist.de and get banlist 3.0 from the second mirror in the downloads section. When you install it, make sure you have unchecked the WinPCap install option since you have already done that. Also grab the banlist 3.1 beta zip file and simply extract it to your banlist directory to update banlist to the 3.1 beta which is actually pretty darn good, so you want that update. Once you fire up banlist it will take you through a wizard where you are mainly interested in selecting the right NIC. Unless you do this, banlist will not work. Use the NIC detector, and press detect if you are not sure which NIC you want to use. At this point you can use banlist successfully. If you feel confident, go mess around some more like custom phrases which I personally like to use.

Custom kick – absolute must for hosts.
Another tool you want, especially if you are interested in hosting games is visual custom kick from www.visualcustomkick.com. All you need to do is download and extract to any folder. Once you run the executable in its unconfigured state you can use it to kick unwanted players by simply giving a /vkick command while in WarCraft. I use the other features like autorefresh, host helper, latency reducer, automatic rules and others. They are great especially if you are a host. Tinker around in the tools and you will find some cool stuff.

Maps.
DotA is a mod for WarCraft III, so you need to get the map itself. You can get the latest release, latest stable and AI maps from www.getdota.com. Maps need to be in the /maps/download folder. The download folder is not present when you first install the game. It automatically gets created as you download maps from bnet. Most hosts will not allow you to download so you want to get the maps manually first.

Optional but useful stuff.
DotA shortcuts are generally quite intuitive and easy to get your hands on, but if u don’t feel like remembering them for over 80 heroes, then you want warkeys from warkeys.sourceforge.net. It’s a nifty program that allows you to remap your keys how you want them. I use the force align to grid which basically maps the control set in WarCraft to the rectangle marked by Q-V. After that I remap attack to A, patrol to E and hold position to Q and some others for my convenience. The disadvantage of using this, is that they don’t update as often as DotA, so sometimes you may have to manually hack into shape your customkeys.txt file in WarCraft. Another interesting utility is the DotA patcher from www.dota-allstars.com. This program automatically downloads the latest version, allows you start up multiple programs, changes your desktop icon and some other fun stuff, however it doesn’t download the latest version to the downloads folder, but creates its own, and there is no way you can over-ride that. So I don’t use it because it screws up the replays as replays with the map in the custom folder will not work on computers with the map in the download folder.

Happy DotA-ing.

Tuesday, June 2, 2009

Double posting next week.

Sorry folks. This weekend was exhausting in NYC. There will be 2 posts next weekend to make up for it.

-Karim.

Tuesday, May 26, 2009

The Big 3 Mail providers.

Each of the Big 3 – Gmail, Yahoo! And Hotmail have gotten most of it right. The keyword being “most”. This week I am going to compare them. This is not a strict industry level comparison. Nor is this a review of the mail providers. And it is definitely not an advertisement or a promotion of any one of them. I use all three providers and this is what I think about them. Where they excel and where they are lacking in my opinion.

Gmail – I have been using Gmail since a very long time now. I had a beta invite when they were practically being sold. After an everlasting beta it finally came to a released status. Gmail used a fantastic strategy to become popular. Invite only entry. Each user would get 100 invites that could be sent to others. This made it something to be desired. Not easily available. It became a matter of social status to have a Gmail account. Soon practically everyone had a Gmail account, but the novelty still carried on and by the time it wore out, Gmail was a household name.
The Goods – Threaded conversation view that made it easy to read conversations, even with multiple parties in the conversation. The AJAX interface is amazing with practically no load times on good connections. It supports back and forward buttons on the browser which is quite a task considering the interface. Very early POP and IMAP support. Gmail can be used with great ease on any mail client because of this and therefore becomes a very popular choice amongst all mail client users, smartphone users and basically anyone that doesn’t want to use webmail. 20MB attachment sizing is great too.
The Bads – Until very recently Gmail had practically no anti-virus. Now they claim to have some, and I have seen alerts but it is still unclear to me which one it is. Gmail claims to be the in-thing with geeks, but not being able to attach executable files, is so grandma. Geeks use .exe, .ocx, .dll, .bat and all these extensions frequently, and blocking them from being sent or received is silly. One can’t even compress any of these and send them over. The glaring flaw is that you can change the extension and bypass this gimmick. I don’t really understand what Gmail has achieved other than making life miserable for people who don’t know how to change an extension. Most people consider Gmail mail analyzing feature to be amazing, however it bothers me to know that Gmail is reading all my mail, analyzing dates, addresses, packages I am receiving, appointments I am making and so on. I would prefer to be able to block Gmail from reading stuff I don’t want it to read.

Yahoo! – One of the oldest and most reliable email providers. Yahoo! was my first email account and I have experienced it better itself over the years.
The Goods – The new Yahoo! interface is fantastic. Using AJAX to create an Outlook like preview is very helpful. A tabbed interface for reducing clutter works very well. The new shortcuts are brilliant for all the keystroke efficiency maniacs.
The Bads – Trivial issues like no browser navigation support and no way can you open new messages in new browser windows short of manually opening a new window. This can be a little bit annoying at times when you are trying to compare multiple emails. My biggest gripe however is the lack of client support for US users. Yahoo! for whatever reason gives POP access to non-US users but denies it to the US. They have some funky implementation of IMAP that can be accessed via smartphone settings or Zimbra but not otherwise. This cripples mail client users limiting them to Zimbra, which frankly is a great client except for its extremely poor Hotmail support. Wake up Yahoo! Give US IMAP.

Hotmail – One of the oldest and most populous email providers out there, Hotmail has been criticized time and again for viruses, spam and other mail problems and yet it continues to be the top provider for email. Hotmail has come a long way and is very balanced in holding its own against the competition.
The Goods – Integration into the Live system makes it easy to access many different features in the Live world with the email login. The UI has been significantly improved with themes, clear text, pleasant color schemes and intuitive navigation. You can also link up multiple Live ids and switch between them with 2 clicks.
The Bads – Nothing spectacular in Microsoft’s offerings. In the end it’s the same old hotmail. Only POP access (still better than Yahoo!). A weird bug in the “mark” section of the email – when you open a new email, the mark menu on the top only lets you mark it as read instead of unread, which is pointless since you just read the email anyways, so it makes logical sense to mark it unread.

Based on my opinions above, it is really hard to say which mail provider really comes out on top because each of them have benefits and disadvantages. If Gmail dropped its restrictions on attachment filetypes, it would outshine the others by far with its POP and IMAP support. Likewise if Yahoo! enabled IMAP for everyone, it would win. Hotmail could work on some features like IMAP along with POP and probably mail previewing. However the competition is good for the end user, and I for one am expecting things to only get better.

P.S. This week has a poll. Please vote on your favorite mail provider.

Monday, May 18, 2009

Bits n nibbles.

I have often had people ask me why their hard drives don’t show the correct size, or that their internet is only giving them a fraction of the performance they are paying for.
Generally these queries, comments, concerns etc. are because most people are either ill-informed or have never found out the correct parameters that define data sizes and speeds. Not to mention different technologies use the jargon in different ways making it harder for a non-geek to keep up. Here’s some help.

The data scale.
Electronic data is stored in bytes. Each byte is 8 bits.
1 bit = binary state, 0 or 1.
1 nibble = 4 bits.
1 byte = 2 nibbles = 8 bits.
1 word = 2 bytes = 16 bits.
1 kilobyte (abbreviated KB) = 1024 bytes.
1 megabyte (abbreviated MB) = 1024 kilobytes.
1 gigabyte (abbreviated GB) = 1024 megabytes.
1 terabyte (abbreviated TB) = 1024 gigabytes.

Hard drive nomenclature.
Hard drive capacities are generally specified in GB or TB. However these aren’t the same as defined above. Giga and Tera in this context refer to the metric terms 10^9 and 10^12. This turns out to be slightly less than the data scale for GB or TB because 1000^3 < 1024^3. Let us see how this works out. We take a hard drive that is advertised at 500GB. This has a capacity to store 500 x 10^9 bytes. How much is this in data scale GB? It is 500 x 10^9 / 1024^3 =~ 465GB as per the data scale. Hence, on a “500GB” hard drive you can store about 465GB of actual data.

Bandwidth problems? Not really.
So you just got your 15Mbps connection and you are really stoked. You fire up your video download and watch excitedly as the speeds climb up. And then it stabilizes at 1.3MBps. Your jaw drops; you call the ISP and scream at the rep who doesn’t know what is going on either. Is the ISP failing? No. Notice how the connection is a 15Mbps with a lower case b. That is because it’s a bit. And your computer reports everything in bytes. So you need to divide your Mbps bandwidth by 8 to get the MBps bandwidth. Why do internet provides report speed in bits per second? To confuse you and steal your money? No. ISP’s provide you with a connection. Hence, they are to tell you the connection parameters, and since wires that provide you with this connectivity, don’t concern themselves with computer data jargon, then report how many state changes they can propagate every second. What is a state change? Why a bit of course. Which means that the internet connection is a bits per second rated connection. To get your byte per second speed, divide it by 8. The tricky thing to remember though, is that here kilo, mega, giga etc. scale in data terms and not metric, so you don’t have to divide by a power of 1024. Just divide by 8 and we should be ready to roll.

Show me the memory!
Almost everyone is confused by the available memory on 32 bit systems when they put in their shiny new 4GB ram sticks. Basically here is the simplest way I could think of for explaining memory. The CPU or the processor processes instructions. These instructions are stored in the memory. The hard drive is not fast enough to support the CPU’s need for instructions. Hence, the first step in the execution of a program is loading it into the ram. From there it goes into even faster memories like the cache, but let us not get into the nitty gritties. Just think of ram as the instruction list for the CPU. Now basically ram has locations, much like houses to store an instruction each (assuming each instruction is a byte for convenience). In order to know where to get the next instruction we need to label these houses with an address. Think of these as zip codes. If each zip code indicated a specific house, and you have 5 digit zip codes you can have at most 100000 houses (00000 is a house too). In a binary world if our system is 32 bit, then our zip code can store at most 32 bits which results in an addressing scheme that can address 4 x 1024^3 locations or 4 Giga locations in short. The operating system needs to reserve some locations for storing lookup tables, video memory and so on. This can range anywhere from 500 Mega locations to 1.5 Giga locations. Notice how I am using the word locations instead of bytes, since what you store at a location is not important here. Now since your addressing scheme can only address 4 Giga locations, and you have already used up some of your addresses for the aforementioned, you have less than 4 Giga locations to address your 4GB of physical ram. Which means you lost out on some of it. If you want to see all of it, use a 64 bit OS, on a 64 bit processor with a full 64 bit capable chipset.

Have fun. Happy computing.

Monday, May 11, 2009

Renting? Not as easy as it sounds.

Apparently this is the best time to buy a house. Unfortunately not everyone can afford one or is sure about their future in a certain city and therefore are renting. Not to mention unless you are rolling in cash, you will probably be living in a standard apartment the likes of which can be found all over the city. It is not as easy as paying a deposit and moving in. Because apartment renting is a serious business which means apartment companies are neither forgiving nor compassionate.

A few things you should be careful of when you rent:

Check what is included in the rent.
Many places advertise the lowest prices in the locality. These steal deals may not be as good as they appear. Sometimes the rent is low, but the overhead is high. Water may not be included. If you live in a place where it snows, you may have to pay for your heating, which might not be the most energy efficient kind. These utility bills generally make up for that spectacularly low rent. Often they might exceed the savings. Not to mention you will feel the conscience pinch every time you feel like turning the heat up; so it’s either that or the cold biting. Before you sign anything make it absolutely clear what is included and what is not. Then prepare an estimate of what is not included without the help of the apartment leasing agent of course.

Concessions? Really?
Every apartment office will offer you concessions on rent, on the deposit and on every other thing. Obviously they are in this for profit so the concession doesn’t mean much. Its only a catching phrase that lures in many ignorant and impulsive people. If they offer you a 10% concession, the apartment is only worth less. Most of the concessions come with very cleverly worded clauses in the lease which gives the management new and exciting ways to tell you how they will take back this concession.

Research where you want to live before you even see the office.
There are plenty of websites available to help your research and rate apartments. Try to get information from a friend or relative who already lives there about the place. Gather as much information as you can and the narrow down to only the places you want to live at so that you can be ready and not fall for the “It’s gone, but here is a better deal” trick. I’ll explain how that works. You go to a leasing office, and are shown an apartment. You tell them you are still looking and leave. You come back the next day to sign an application… and the apartment is gone. BUT wait, here’s a better deal with only $50 more and this huge patio (that isn’t huge and you don’t need it.) or this one which is actually $50 less which is just slightly smaller (actually its 400 sqft smaller and is worth $150 less.). The original apartment really gone? Of course not. The office just pulled in a sucker and now rents the original apartment for $50 more to some other eager renter. To avoid this, research where you want to live before you go to the office. This way you minimize the time between looking and renting, and give them less time to show you a “better deal”.

Acquaint yourself well with the lease termination clauses.
This is the golden cow that leasing companies have been milking over the years. Literary geniuses are probably hired to write the termination clause to suck dry the hapless renter in every way possible. Don’t expect these to be on one simple page or section in the lease. They will probably be all over the place. Make sure you calculate what you are going to pay if you terminate early. If necessary get it in writing from the property manager. Most times they will have you pay a massive termination fee, which is almost like 2 months of rent. More often that not, they will have you return any concessions you got. This is scarier than it sounds. If the lease is worded saying that you have to return concessions based on the then rate of the apartment, your bank account will be hit by a truck. Here is how that works. You got a rate of $1200 and you were given a 10% concession meaning you paid $1080. Now if you terminate you end up paying the termination fee plus the concession. But the concession is calculated on the then rate of the apartment, which could be… yeah $1350. Which means you will pay back $120 plus $150 for every month you stayed there. Rest in peace. If you are doubting your living there for the lease term, make sure you have an exit that doesn’t kill you in payments.

Lease term over? Of course not.
Almost every place requires you to give a written notice X(30, 60 or whatever they feel like) number of days before move out. This is on the lease they give you. Now unlike what may make logical sense, you have to give this notice even for your move out for lease end. If you don’t, it will be considered as lease termination and you will end up paying all those things we talked about earlier. Not to mention unless you extend your lease in advance (generally 3-4 months in advance) you will be put on a month to month lease which will cost much more. So make sure you know your notice date, and then make sure you extend on time, or turn in the notice.

Security and parking.
Understand the security features available at the property. Is there a guard on duty? Is there restricted access? Or is it a non fenced, non gated, non guarded property on which anyone can walk into anytime? Check on these things before you rent. It will save you a lot of heartburn later on. What about parking? Is there enough parking for everyone? What kind of parking is available? Is it restricted? Find out all this before you sign anything.