Keep [C]*(od|do)ing

March 7 th

0

SHED

Filed under: self-development — Liwen @ 11:06 pm

Organising is not enough anymore, you need to get rid of that stuff – this thought struck me while I was struggling to categorise all my games, books, clothes in a sunny Saturday afternoon. I hoped I could go out and take some pictures, but my room is really cluttered.

Games like Grand Theft Auto IV, Metal Gear Solid IV, Gears of War 2, I thought I could enjoy them a lot if I have some time, which I never had. The impressions on these games I got from teasers and trailers have waned. What are still vivid are the Silent Hill Homecoming covers on the shelves in Game and the big coming soon post of Resident Evil 5. SSomehow I feel obligated to own them since I played every instalment of the series; you see I am still thinking about Chris Redfield’s journey, Niko Bellic’s adventure and Snake’s fate.

Video Game Characters

George Orwell’s 1984 and Coming Up for Air were my favourite books back in high school, I felt that I need to add the paper book into my classic collection even I already have pdf/epub/html versions in my computer. I also have a brand new copy of the Learning the vi and Vim. For a Emacs nut, this is totally crazy! I don’t know why I bought it in the first place, probably because it was a real bargain on Amazon back then?

Emacs vs Vi Cartoon

Every time when I fell guilty of wasting money on games, I buy books to compensate – as investing in education is never being a waste, it will put me on sleep at night.

But at the end of the day, your know the story, neither games been finished nor books been read.

A friend recommended Julie Morgenstern’s book When organizing isn’t enough, shed your stuff, change your life to me. I haven’t read it but I think I got the gist of it in terms of solving my little problem.

Less Stuff, less commitment – More efficiency.

Imagine if I only got one book on my desk, I would pick it up straight away and start reading, no need to wonder in front of a pile of well organised books feeling guilty of not being reading each one of them.

SHED is an acronym used in the book; it stands for separate your life; heave your trash; embrace yourself, and drive for the future.

March 1 st

0

Early, Often, Thoroughly

Filed under: methodology — Tags: — Liwen @ 7:25 pm

Along with the growth of my consciousness and experiences in software development, I discovered that there are three words which can be used universally really count: early, often and thoroughly. Here are two examples of using the template:

Refactor early, refactor often, refactor thoroughly.
Test early, test often, test thoroughly.

For 9-5 programmers (The programmers who come to work at 9am, shut down their computers at 5pm and go home with coding-proof bubbles around them.), my points would seem to be over killing. The overwhelming effort needed to practice the principles is enormous, after all, not every coder would like to put these things as his/her epitaph.

For well versed desktop application developers, these three words, early, often and thorough, might not be innovative, as we all have read The Pragmatic programmer and Steve McConnell’s Code Complete. However, from a web developer’s point of view, they are quite interesting.

A typical web application development circle includes requirement, specification (optional), design, coding, testing and delivery. We apply different three word formulas to each stage.

Requirements and Specification

Gather early, gather often, gather thoroughly.

Clients, especially shareholders, usually are non tech savvy type of people, they come to you: ‘We want a website, we want it next month and we like Facebook pop-up bubbles!’. I am so glad you said ‘pop-up bubbles’!

Gathering requirements should be absolutely essential and it is the first deference of disappointment. Some small agencies, including the ones I worked with, tend to pitch their ‘free designs’ in the first meeting, do the hard sells, tell the client nothing could not be done – even if the client want the web to trap real fish.

Instead of trapping clients with free design and ocean deep low price and then rip them off when it comes to tiny changes and maintenance, a well composed contract that is based on enough requirements would be more appropriate. For web applications, personally I don’t think specifications are usually necessary and somehow they produce more disappointment than satisfactions. Reason? it’s not easy to get the specific level right. How specific is specific enough? ‘Membership management’ equals nothing when it comes to design and coding, but ‘The site needs three roles, respectively gusts, registered users and vip users’ will guarantee future changes to be incurred. For a requirements-change-everyday application, you might want to spend more time to gather the right requirements to ensure the solidity of design – both visual and coding.

Design and Coding

Refactor early, refactor often, refactor thoroughly

Not to repeat many great talks (PDF) and discussions on this topic, I will only say one point that I found very interesting yet paradoxical. DRY is the first thing I learned from my C++ class and I believed in it for many years. But for web applications, it becomes quite disadvantageous sometimes: If the page only needs to be alive for three days, code generator and wizard are your best bets. Duplication? don’t worry about that, you would not have a chance to modify them before they die out from Google.

Testing and Delivery

Test early, test often, test thoroughly.

User involve early, user involve often, user involve thoroughly.

Test is a big topic and will not be discussed here.

User involving might be a pleasant way to work with, it is definitely the most efficient way of avoiding disappointment and disagreement. Let the end users involve from the beginning to the end. Give them a prototype of interface to play with, ask for feedback after each stage/component. There is a thing called one-mind, but you and your client don’t usually have it. Sometimes user doesn’t know how much effect would be involved for a small change of his mind; sometimes a big change the client is afraid of telling you may only requires one line code change. Communicating with user can synchronize user’s expectation and developers’ decision, reducing the unhappiness caused by the parts which developers put a huge amount of effort in but lives out of user’s expectations and prevent client changing mind like a kid – which is far more efficient than specification and user would appreciate it.

February 23 rd

0

Be the Only Tech Guy Who Wears Suit?

Filed under: fetish, off-topic, peopleware — Liwen @ 10:29 pm

When talking about tech guys, geeks, nerds’ dress code, what images would pop up in your head?
Microsoft vs Apple
You think because the pictures are too old? How about these?
Microsoft Bad Dress in Conference
The above two were taken in 2008. Look at the red tie, ewwww!

I remember complaining to my fellow programmer friends that the worst thing about being a programmer is that you are not supposed to dress smart, if you turned up at work in suit and heels, people would think you are going somewhere else for a job interview.

Lots of programmers take dressing smart as a hard concept to grasp and think that’s totally irrelevant to what they do, which is very sad in my opinion. Are t-shirts and jeans tech guys’ iconic wardrobe possessions, or tech guys just don’t need wardrobes because they only throw their clothes on the floor?

We were asked to dress smart at work today. I went to office in a small-collar-thin-lapel suit with skinny tie combination, which has being popular for the last two years and recently it even caught more attention because of the popular TV series ‘Mad Men’. I was comfortable with my tastes on clothes, and fortunately people liked it. The problem is: as a programmer, I seemed somehow ‘over-dressed’. The popular acknowledgment turned to be that tech guys’ smartness of clothing should be lower than other people at least one level under the same dress code, why is that? Is it a stereotype or most tech guys are just being lazy?

After work, I did a search with keywords “trendy nerd” on Google, there are only 346 results. Which made me wondering is there anything wrong with tech guys’ dress sense or it’s just me that likes ties? Would that even unqualify me being a good programmer?

Personally I like work clothes very much, it’s not I am having a suit fetish. In my mind, this is not about how you want other people to see you, it’s more about how you see yourself, how you feel about yourself – it’s more of an attitude.

Geek clothes can not be trendy or stylish, but there is also a difference between casual and slobby.

If you really don’t like suit, at least you can think different. XD
Think Different

February 15 th

1

Configure svn+ssh on Windows

Filed under: Tools, software — Tags: , — Liwen @ 8:52 pm

As a proud command line junkie, I never went anywhere without my Emacs ssettings, which made my hands look like old branches from dead tree in some desert, but that’s fine for me, it’s been a decade since I ceased my hand moulding career.

Ok It’s a lie but seriously, I am not a big fan of mice and GUI, they usually slow me down and distract me from concentrating. Besides, some really bad designed HCI, such as Windows Vista UAC, can easily push my buttons in all circumstances. People from Microsoft said

“Disabling UAC risks your computer for allowing some worms to execute commands secretly without a prompt confirmation from end user.”

and I up voted this as the correct answer:

“Enabling UAC risks me throwing my computer out the window from frustration with a poorly designed and horribly executed security model.”

Forgive me being loquacious, the point here is I don’t want to use TortoiseSVN – I 100% agree with you that it’s a fantastic software, I do! I just need to get svn+ssh work with my Emacs shell mode.

Let’s get started.

1. Download Putty, if you are like me always afraid of installing untrusted software from the Internet because you believe that they are mostly badly written piece of crap that they would mess your already rubbished Windows OS completely then you can be greatly relieved here, I promise.

2. Start Puttygen.exe and generate a pair of keys, save the private key WITHOUT passcode,

3. Copy the public key, yes COPY not SAVE, paste/append it to $HOME/.ssh/authorized_keys, create the file if it doesn’t exist.

4. After modified the authorized_keys file, remember to:

chmod 700 authorized_keys
chmod 600 .ssh

This is important as you may get connection errors if the file is group writable.

5. Next, test the connection with putty.exe or plink.exe, (side note:TortoiseSVN has a plink.exe windows implementation which would not pop up messages.)
plink.exe -i theprivatekey.ppk username@hostname

6. Modify your subversion configuration file. It’s in
c:\Users\yourname\AppData\Roaming\Subversion in Windows Vista
add the following line to your [tunnels] section:
ssh=x:/path/plink.exe -i x:/path/privatekey.ppk

Now you should be able to access your svn+ssh repository without typing password, in Microsoft Windows! Vista!

Some extra info for folks who love GUI – for TortoiseSVN users, you need to generate the OpenSSH private key from server, then load it with puttygen.exe and get the public key – it’s due to the fact that there are differences between private key implementations in putty and OpenSSH, otherwise you will get the lovely “server refused our key” message!

February 14 th

2

Install Subversion 1.5.5 on Bluehost 64bit Box

Filed under: Tools, software — Tags: , , — Liwen @ 11:55 pm

The first thing I do before start typing code at home is to put it under version control system; the first thing I tried to do when had a SSH enabled reliable hosting, of course, was to set up Subversion server on it.

There are already several tutorials in the Internet, why I am writing this again? Well, I just wanted to prove that I too, can write blog! Among all those tutorials, none of them worked for me, I guess either I was trying to install the newest version of SVN or the BlueHost hosting environment has changed, or they just hate me. So I am constructing this and hope to contribute something I learned along the frustrating process of setting up SVN on 64bit shared hosting so you don’t need to smash your keyboard.

Once you enabled SSH on BlueHost control panel with a photo ID, it’s time to set up Subversion.

1. Open a terminal, type in:
ssh username@yourdomain.com
and hit enter, then input your hosting password.

2. It’s better to create a separate folder for all the operations, in case our home directories got messed up by any mistakes.

mkdir src
cd src

3. Download Subversion and dependencies:

wget http://subversion.tigris.org/downloads/subversion-1.5.5.tar.gz
wget http://subversion.tigris.org/downloads/subversion-deps-1.5.5.tar.gz
tar -xzvf subversion-1.5.5.tar.gz
tar -xzvf subversion-deps-1.5.5.tar.gz
cd subversion-1.5.5

4. Install apr and apr-util, notice the var LDFLAGS , it’s 64 bit, it’s m-A-g-I-c.

cd apr
./configure --enable-shared --prefix=$HOME LDFLAGS="-L/lib64"
make && make install

cd ../apr-util
./configure --enable-shared --prefix=$HOME
--with-apr=$HOME --without-berkeley-db LDFLAGS="-L/lib64"
make && make install

5. Install neon, I had been stuck here for an hour because of the 64 bit mode problem, remember to explicitly enable compilation of shared libraries and prefix the files into home directory.

cd ../neon
EXTRA_CFLAGS="-L/lib64 -fPIC"
CFLAGS="-L/lib64 -fPIC"
./configure --prefix=$HOME --enable-shared LDFLAGS="-L/lib64" --with-libs=$HOME
make && make install

6. Install Subversion, pass --without-apxs and --without-apache to prevent svn installing Apach modules, also you need to explicitly specify the dependencies.

cd ../
./configure --prefix=$HOME --without-berkeley-db --with-apr=$HOME --with-apr-util=$HOME --with-neon=$HOME
-without-apxs --without-apache
make && make install

7. Modify .bash_profile and .bashrc file

nano -w .bash_profile (pico is always my favourite.)
add $HOME/system/bin to PATH variable, it should look like this:
PATH=$PATH:$HOME/bin:$HOME/system/bin
Also add this line to your .bashrc file, after the ‘fi
PATH=$PATH:$HOME/bin

8. Logout the current session and log on again, let’s try:
mkdir ~/repos
cd repos
svnadmin create topsecrets007plus

now you can access your repository like this:
svn+ssh://username@host/home/username/repos/topsecrets007plus/
just replace username with your 8-character user name given by BlueHost.

Powered by Wordpress | All rights reserved, all wrongs observed. @ 2009 Liwen Zhang (11 queries. 0.297 seconds.)