Friday, December 9, 2011

Burning the midnight oil....

So, as I figured, the IRC channel came alive later in the night. I noticed no one had grabbed the test_syntheticMouseEvent test review and went underway. After making a series of changes, mostly stylistic and only a few that actually affected code, I configured it to work with the harness and it was ready for testing. rhung had been complaining that he was unable to get the tests to run correctly, so I pulled from his repo and attempted to run them, but it didn't work, not because it would fail, but because the tests would simply lockup and not proceed. Not sure as to why it is failing. Really I am writing this blog to pull myself away from issue for a minute while I try to think of what could be causing the problem...

My posts often lack anything particularly helpful to the reader, so I'm just gonna list some tips I've either found or been given. Just to make this worth your time reading.

1) Its always a good idea to keep your whitespace clean in your code, heres a few regex commands that can help keep your code nice and clean (mind you these are all for vim, but you should be able to translate most of them to other apps(ignore the %, thats vim only)):
-Remove whitespace at the end of a line: %s/\s$//
-Replace tabs with (2)spaces: %s/\t/ /g
-Replace (2)spaces with tabs: %s/ /\t/g
NOTE: These are obviously not made to be safe with string in your code, they will manipulate anything in the file

2) Build tips for linux:
-When using a make file use the -j# argument to specify how many jobs this make uses, generally you should use the number of core your computer has plus one. So on a quad core computer it should look like: make -j5
-For time consuming builds, screen can be a lifesaver. Screen is a linux utility you can use that will essentially make a virtual client, one that does not expire when you close your SSH connection. So you can start a build on a server, and leave it running, close your connection and come back to it later. I'll list the basic commands here, for more detail go here.
$ screen <-- open a new virtual client
(Once in a 'screen') Ctrl+a d <-- detach from the screen
$ screen -R <--Reconnect with the screen
NOTE: if you use screen twice instead of using -R, you will make a second client, and -R will no long work, you will need -r and specify the screen id

Thats all the tips I can think of right now. Hope this helps someone.

No comments:

Post a Comment