Friday, November 30, 2007

Eclipse and keycode mapping

Okay, this is take 2 because my first post was unceremoniously 'disappeared'.

My BTS team is getting geared up for writing Unit Tests in JUnit. We're using Eclipse with subclipse for SVN. Two teammates are Windows, one Linux and me on the Mac. Mac's version of Java is Apple's not Sun's so my JRE profile is not compatible with theirs. This means I will be using my Linux VM for the project - getting to know Ubuntu a little better.

Today's the first day of significant coding and I am already frustrated that I have to reach back to use the ctrl key instead of my trusty apple key for shortcuts. Also the tilde key actually produces < and there's no delete functionality (what Mac calls delete is really backspace).

So I have found a solution and here it is:

First, create a file (mine is called wickedCoolKeycodeFinder - you know, so I can always find it again)
and in that file put this:
xev | grep -A2 --line-buffered '^KeyRelease' | sed -n '/keycode /s/^.*keycode \([0-9]*\).* (.*, \(.*\)).*$/\1 \2/p'

chmod +x this file and then run it to produce a neat little window that will tell you what keycode is returned for whatever key you press.

Then, once you know the keycodes of the keys you want to map, create a file called .xmodmaprc and in that file I put:

!this sorts out the apple key + backspace to do delete
keycode 113 = BackSpace Terminate_Server Delete
! map tilde and grave
keycode 49 = grave asciitilde
!map apple key to ctrl
remove Control = Control_L
keycode 115 = Control_L
keycode 116 = Control_L
add Control = Control_L


Now I just need to figure out how I can get my two-finger scrolling on the touchpad to work and I'll be a Linux user forever!

Wednesday, November 28, 2007

Circling, like a tiger ready to pounce

So for my 0.3 release of sourceServer, I am tasked with altering the code in symbolstore.py so that it will track the source files and then call pdbstr.exe on them.

To do this, I need to understand what PDBSTR.EXE does. This is what I have to go on:
Once the code has looked at all the source files in the PDB file, it's time to call PDBSTR.EXE to write the index stream, called SRCSRV, to the PDB file. When debugging, the debugger looks for this stream. If it is found, the debugger knows there's a source server involved and calls into SRCSRV.DLL to execute the version control system to ensure the right file is accessed.


I've been studying the pdb files pre and post indexing to gain insight into what happens when I use the Debugging for Windows srcsrv tools. Circling the symbolstore.py code getting ready to make changes to see what I can do.

Any minute now the big picture will come into focus...back to my pdb files.

Saturday, November 24, 2007

Thursday, November 22, 2007

XPcom Lab II

Well there was an initial kerfuffle trying to get the extension "firstxpcomchrome" working in my Minefield build. Turns out that when I was attempting to connect it up via a text file in the profiles/myprofile/extensions folder, I had put the path as a c:/.... path which, in Unix (ie Mac), is not correct. This was affecting my ability to install the extension through drag n drop because the file for firstxpcomchrome@senecac.on.ca was not being overwritten so even though the extension appeared to install correctly in the add-ons manager window, upon restarting it was nowhere to be seen. Deleting the erroneous flat file and doing a drag and drop installation cleared this up and I was able to continue with the lab.

Aside from crashing the browser every time I called on "Reload All Chrome" from the Extension Developer add-on, the lab went smoothly.

Results:
(please enjoy the File menu behaviour that is happening in the background)
Call
FirstXPComChrome1

Response
FirstXPComChrome2

Tuesday, November 20, 2007

Source Server 0.3 goals

Well, it turns out that my 0.2 release was a little buggy but Ted (luser) was able to hack his srcsrv.ini file to overwrite the URL I had indexed into the pdb files so that he was able to pull code from my server. Instead of hacking the 0.2 and fixing that though, I am moving forward with 0.3 which is to put into symbolstore.py the ability to do the cvs pulls.

This is the most complicated part yet, for me, because I am not too familiar with python and because I still see all this code as a nebulous cloud and finding the path from A to B is difficult.

So my steps toward my 0.3 goal so far have been:

  • Reading up on Python and how it works with some: Python Tutorials

  • Studying the logic of symbolstore.py



And coming soon, some hacks of symbolstore.py to see what kind of havoc I can wreak.

Monday, November 19, 2007

Xpcom success

Thanks to Armen's post and all the sub helpers that led to his post, I did successfully install the Extension Developer add-on and I managed to get my firstxpcom extension working in the JavaScript shell:
FirstxpcomSS1
FirstxpcomSS2

XPcom - not right now.

Well, I greatly enjoyed Benjamin Smedberg's talk - power outage and all - and much was learned about Xpcom. Not enough however, to enable me to complete the Xpcom lab that was assigned to us last week.

Last week I pounced on the lab, raring to go with my existing build of firefox and ran into a wall - something is just not making right. Some poking around, consulting with those who have done the lab generates no leads since the trouble I'm having is of course, unique, and so they do not know where I am going wrong.

Fine. I can handle this. I will do it all from scratch, checkout code, rebuild, start the lab and guess what? Still can't do it. Currently I am stopped by this:

make[1]: *** No rule to make target `install.rdf', needed by `libs'.

I don't understand Xpcom enough to really troubleshoot this so I think this lab is going in the "to-do later when you know more" pile for now.

Newsflash, I never created the install.rdf file - so now it's working to the point where I can see it in my Add-ons manager. However! Ted's Extension Developer add-on does not work with my build because it does not support secure updates...must be a new ff3 feature...so now I have to wait until tomorrow to ask luser if there's a work around.