Monday, December 17, 2007

My Chess Game

Reviewing my chess game:

Here is me running the game in vmware fusion

Yes, VS2005 runs nicely in unity, and when I use F5 to run... the program starts up in unity, very nice.

I need to get a few things completed on it before I go back to school

1) Networking & multiplayer over tcpip
2) prepare to have a new motion/kinetics system
3) prepare to have an ai (write eval function in script perhaps?)
4) add Xbox 360 controller Input (XInput) features.
5) change the skybox to a skydome.

Things I've accomplished on my first Weekend Home

1) Rather than reinstall osx I cleaned it
2) Reimaged my xp (Im going to be a osx/xp shop)
3) got bootcamp & vm fusion going on my xp partition (I didn't have that during school, only vmw)
4) Installed directx/vs2005/oblivion I now have only 2.5gig left on my xp partition (16 to start)
5) ran my chess game in vmware fusion (wohoo... its slow graphics refresh, but It is doable)

Saturday, December 15, 2007

Sweet Home Huron County

I made it back home.... ahhh homecooked meals and some sweet sweet 3 weeks of freedom

Friday, December 14, 2007

Adding Chrome to the firstXpcom lab

Following up from firstxpcom lab I am adding chrome to the lab

Follow the instructions and you should see this

Check out my zip of the extension

Thursday, December 6, 2007

Its Christmas soon

I want to do a few things during christmas

1) get more integration between xcode and firefox trunk
2) format/install my computers. mbp multiboot w/ gentoo/os x/windows vista
2b) get vmware fusion with ubuntu/xp on my os x partition
3) have a nice break
4) organize for my last semester at school (blogs for classes, wiki setup, gcal-update for new due dates, folder structure ready for classes/projects, svn)

Wednesday, December 5, 2007

Welcome back sports fans

For 0.3 I want to have a patch that can do italic/bold/oblique only if the found ATSUFontID is not already an ID for a italic/bold/oblique font.

I have a patch right now that allows me to piggy back on the size matrix to apply synthetic italic/bold. The trick is going to be finding a way to NOT apply if the font doesn't need it.


Friday, November 23, 2007

What can you do with a drunken sailor?

I went crosstown today to pickup a package from fedex. Wohhoo! a Blackberry device.

I went from having no cellphone, basic home phone to ultra-connected! Seriously, here is how my life is better for having a blackberry device.

1) gmail, send receive in a pushy way:)
2) sync to my gcal (via iCal)
3) sync my address book
4) sync memos/notes (to and from device via
5) sync tasks
6) receive/send telephone calls (though I am long distance in toronto)
7) receive/send SMS
8) Blackberry PIN
9) Windows Messenger Live
10) Surf the interwebs
11) GPS my position
12) Google talk
13) tell time, set an alarm
13) do quick calculations on the calculator

i was previously using my iPod 80gig as a
sync'd calendar
sync'd contact list
sync'd notes
music player
video player
portable data
now it looks like the ipod will be a media player/portable data device, and not an organizer (its not a very good organizer).

What does the slogan always on mean to me? It means that "unless I choose to switch off, i can always keep lines of communication open."

Today was a fun day... kinda like Christmas was when I was a kid:)

Friday, November 16, 2007

Workflow Artifacts

Here are some workflow artifacts


I would now like to describe to you my workflow.

Preperation Steps: (done only once... ever!)
1) download the trunk of mozilla
2) get a script that will update the code from cvs (./
3) get mozconfig for an optimized build
4) get a script that will set the mozconfig and build optimized
5) repeat steps 3-4 for debug build
6) build optimized (via script ./
7) build debug (via script ./

Start of coding session
1) ./
2) ./
3) patch -p0 < ../../patches/lastnightswork.txt
5) ./

Writing, Compiling, Running (testing)
1) edit via xCode
2) compile via commandline window (script specific to an incremental build... ./
3) use xCode GDB debugger to run/debug
4) run the program -P tester --no-remote

End of Coding Session (time for sleep)
1) cvs diff -u8p > ../../patches/thisnightswork.txt
2) patch -R -p0 < ../../patches/thisnightswork.txt

In the end I am left with two artifacts
Artifact A) a nightly patch (sometimes more than one if I want to "save my work" ie ive made some sort of progress worth preserving)
Artifact B) a clean sourcetree, free of any tampering

However, there is a problem with Start of coding session #4. What if there is a conflict between my last night patch, and the current state of the source tree?
I have to edit by hand :( This has once added 2hours!

Please! Someone rescue me. Teach me how I can write some sort of script or some sort of GUI merging program for full source vs diffs which saves my clean tree and nightly patch!


On a side note, I would really love it if I were to write some little program that could follow my code progress as a living organism sorta thing... like allow me to view the code files I am editing in time-lapsed photography style video.

Bold and Italics

So I have bold and italics on fonts that should have them while rendering ATSUI text layouts. People have commented that italics is the wrong way. People will further comment that bold can hardly be seen. Layout is all bogus etc.

All I can say is... yeah... however, I am now ready to ask for help with this stuff. This was a big step for me, and the cause of much stress. So anyway, if you are a Mozilla Text Guru, I need you to take a look at this patch and tell me what you think.

Go to the bug

Free Software Presentation by John Selyms

Today we had a guest speaker for BTS. John Selyms came and talked about "why software sucks." The man has a lot of good things to say. I recommend you read his slides here

EDIT: now that I have time, I can write more
Important Slide (31)

What Should You Do?
1 Never underestimate the problem
2 Understand and plan
3 Know the tools you use
4 Act professional - leave ego at home
5 Write free software and share it

My favourite Slide (11)
Comments from the Field(about state of software development)

"It's like pre-Sumerian civilization - we're in the hunter-gatherer stage." - Brad Cox, George Mason University

"Cave art, it's primitive, no science here." - John Munson, University of Idaho

I really like the first quote. It conjures an image of 5 near-ape techno-neandertals, each dragging one knuckle in the ground while his other hairy arm grasps a laptop, or knapsack, or bike helmet; what-have-you.

I asked a question to John relating to this quote, "Could google be the emergence of an agrarian culture of software?" (left as an exercise to the reader)

Thursday, November 15, 2007

State of the font

Its about time that I post about the DPS project I am doing.

What I want to do with the project is try out ATSUI for font display, rather than the current use of CGglyphs. Using ATSUI is different from the current method of rendering fonts because ATSUI renders a whole line of text, while CG renders an array of glyphs.

I want to use ATSUI because ATSUI gives you the ability to "set" italics/bold etc on a line of text, thus when you render the ATSUTextLayout object, it will be nicely italisized/bolded.

So I had been having tonnes of difficulty until earlier this week, when I made a breakthrough and finally printed "something" using ATSUI. Since then I have continued to improve my work, and I can now print some of the actual html text that firefox is receiving from web pages.

Look here for a screeny
What I wanted to have complete for Friday (today), is have the italics/bold happening when it should be. I unfortunately haven't gotten that far yet.

I'll work tomorrow evening on getting things bold/italics.

You can find the patch that does rendering in ATSUI here

A tricky situation

Ben Smedberg, Mozilla code guru, came and talked to the class today... I can sum the talk up in 1 phrase "oh my"

I was feeling very bad during the talk because Ben had to be paused while one technical disaster after another occurred. During the down time students would engage Ben in some tangent questions, but Ben was forced away when technical questions were resolve, and threads of conversation were left hanging.

The talk was describing the nitty gritty details of XPCOM, and while I was simply stunned by the complexity of it all during the seminar, things are starting to come better into my head now that i have a chance to think on things. I hope the camera got the talk however, because I will want to review it later, when i have a better understanding of mozilla on the whole.

Tuesday, November 6, 2007

Poppy Problem

Lest we forget:

I've been passively looking for a poppy box for the past week, without any luck; so today I needed to actively search for somewhere with a poppy box. I live in the Dufferin Steeles area, and I do not have a car, so I am only able to search this area

Places that do not have Poppies.
- Shoppers Drugmart
- Superstore Groceries
- Petro Canada
- Esso
- Royal Bank
- Century 21
- Value Village
- Tim Hortons
- Wendy's
- Starbucks
- dollar store
- Sci Fi Store
- 3 local convience stores

I am still poppyless, tomorrow I search York Lanes.

Monday, November 5, 2007

Bugfixing Lab

Found the place where mailto links are created... made an if statement to look for double periods.

Sunday, November 4, 2007

Resources Test Result Graph

Scenario 4: Ram 512 CPUs: 2

real 4m37.692s
user 1m9.088s
sys 1m21.957s

Scenario 3: Ram 1024 CPUs: 1

real 4m29.431s
user 0m35.174s
sys 1m14.805s

Scenario 2: Ram 512 CPUs: 1

real 4m49.397s
user 0m40.879s
sys 1m2.612s

Scenario 1: Ram 1024 CPUs: 2

real 3m59.998s
user 1m3.328s
sys 1m36.654s

VMware fusion Resource Results

So, fooling around with my virtual ubuntu machine... I 'walk the tree' in two resource allocation scenarios.

Scenario 1:
Ram: 1024
CPUs: 2

Scenario 2:
Ram: 512
CPUs: 1

Scenario 3:
Ram: 1024
CPUs: 1

Scenario 4:
Ram: 512
CPUs: 2

Pats vs Colts... spectacular 1st half... Joey Addai TD amazing, it shall be known on highlight reels as "The Cutback"

Saturday, November 3, 2007

Bug 402395

Submitted another cookie-build bug based on disable-logging. After getting my windows guest machine building firefox in vmware fusion, I ran into 402395 and supplied some patches

Virtually Mayhem!

I have installed VMware Fusion 1.1 beta, so see what its like. I have created a virtual machine based on my boot camp partition, and I have installed ubuntu 7.10 via fusion (its just like installing it on a computer, except your 'computer' is a window on your desktop).

I am now compiling firefox trunk on ubuntu, and am installing the pre-reqs still on windows. I am doing these things at the same time, all the while using my base OS X to run my browser and other normal tools.

Yes, thats right, Ubuntu, Windows, and OS X all running on one laptop. all nicely running inside their own 'spaces' window wow.

Friday, November 2, 2007

Bug 402148 update

I have a potential patch for 402148, the disable-logging bug I discovered yesterday.

UPDATE: This patch has gone into the tree... huzaaah, drinks all around.

Thursday, November 1, 2007

Tuesday, October 30, 2007

Camino Build (part 3)

Got a Camino Build now. Needed to look here and talk to a couple of guys on the #camino IRC channel.

Camino Build (part 2)

Nuff Said

/Users/coren/mozilla/OBJ_DIRS/debug/cam/camino/IBPalette/src/CaminoViewsPalette_Prefix.pch:7:50: error: InterfaceBuilder/InterfaceBuilder.h: No such file or directory
make[5]: *** [libs] Error 1
make[4]: *** [libs] Error 2
make[3]: *** [libs_tier_app] Error 2
make[2]: *** [tier_app] Error 2
make[1]: *** [default] Error 2
make: *** [build] Error 2

real 31m28.681s
user 23m43.170s
sys 4m26.792s

Camino Build (part 1)

I followed devmo to build camino to see what its like...

NOTE: ac_add_options --enable-default-toolkit=cairo-cocoa

Because I am masochistic I decided to build and optimized version and a debug version at the same time.

See part 2 for results.

Saturday, October 27, 2007

Friday, October 26, 2007

Grrr, Im a Leopard (A Review) : I met Ed

This is the first thing I do with Leopard... Be good kitty.

After the Free and Open Source Symposium, I headed over to Data Integrity and reserved a copy of Mac OS X.5. I walked back to the school, talked with a fellow Ed.

Ed had made a claim during one of the talks, that certain Canadian Schoolboards have decided never to install any non-ms software on the computers. Im no longer a linux junkie... after all I put down my $130 for my happy new kitten ... but I felt truly scared that SCHOOLS ban a hugely useful teaching tool.

Thats one of my views on Linux... its a terrific teaching tool. Linux is also great for running as a server, but I digress.

Ed and I talked for 30 minutes or so, he made me aware of certain tactics of politicians to carve deals with Microsoft. Thanks Ed, you made me more aware today.

After our chat, I run over and wait in the huge lineup of 7 ppl for X.5. I ran home (or rather took the bus)... and cleaned up my external drives, 1 Media Drive, 1 portable drive containing my old schoolwork and music for tradesies. Ok lets being

remembers as if it ware 3 hours ago, warning stream of consciousness (SOC)

Pop in the disk, click the "Install Mac OSX" reboot.....
Ok, lets go... ok boot up, great. Ok a screen asking me if I speak english, yes I do... next... ok eula, I read a bit I grep for "soul" "all worldly possessions" and "Agreeing to this document ensures that you and the Lord of Darkness have entered into an unholy pact"... None of those show up... so I guess the eula is safe ... ok accept ... Choose your drive to install ... wait, my drives aren't listed.... WTF... oh no my os X is defective.... lets reboot and try again... ok boot, language, drivers, NONE.... oh no oh no... wait whats this... stuff in the upper lefthand corner .. ok disk utility, hey look, there is my old macintosh HD... lets verify it, ok verified, hey look, now it says "mounted" ... I used to be a linux nerd, it means that now I can use the drive. ok back to the install window, right on my drive is there... ok click continue.... omg its gonna take 3.5h... oh well.... do do do do de de de de lalalalala, ok 2 hours later its done... OH GOODIE. oh, fancy new background... maybe I want to keep this... no there is my claude lorrain background...

Ok enough SOC.

End result to here, everything is kinda the same, the top bar is now transparent, and UI for applications is a wee bit darker, but its mostly the same. All my settings have remained, has the same fonts, and transparency, even remembered all my open web pages.

All my settings have remained: 1
I can ssh into my server : 1
I can run Minefield: 1
I can update my mozilla source code: 1
I can build the mozilla source code: _0_

configure: error: installation or configuration problem: C compiler cannot create executables.
oh *$#@

I should install Xcode now...

... a little while later

Ok lets try to compile again... running... running ... success pffew

Nicer things
Finder looks like iTunes now... its actually impressive, the new view option.
I can sort in the normal details view for finder... much more usable. Finder is much improved
Spaces is very much a needed improvement.
I love that iCal shows the right date instead of July 17 now.
the limited time I played with safari let me know its really fast and has some sort of 'cut' feature, where I can add things to my dashboard.... it did my gcal!
vertical external monitor now works (tiger would system halt)

had trouble connecting to my samba share.

Gonna try time machine soon.

FSOSS is over

FSOSS is done for another year. Talks today focused more on the social aspects of open source. There was a fun but ultimately pointless BOF discussion on what peoples views of open source are as they relate to democracy... along with a very good talk about how history relates to open source.

Now its time to install Leopard.

Thursday, October 25, 2007

What Mozilla Does to me Mommy!

Its poetry time

What Mozilla Does to me, a Haiku

I cannot sleep now
paths through code I must tread deep
too much fun for me

And for my Macbook Pro

Be bloody, bold, and resolute;
laugh,to scorn The power of Win.
for none of woman born shall harm Macbook.

Be lion-mettled, proud; and take no care
Who alts, who shifts, or where conspirers delete:
Macbook shall never vanquish'd be
until Great Linux Usability to high quality hill
Shall come against he.

More Texty Thoughts: Soused at FSOSS

Today was FSOSS, and yes, I got a little soused at the end (thanks Zad). Dave introduced me to Stuart in the flesh, and he had some ideas for me towards my bug. I wanna get them down before I go to sleep.

1. he confirmed my visualization of mozilla text being something like a 16th century printing press. Mozilla arranges all the little blocks so its just right (I think of this as the layout stage)... and then slathers ink all over it and "presses" onto the screen.

2. he told me that mozilla/cairo for mac is already using atsui for all the layout stages, and that drawing ATSUI might not take that much of a performance hit.

3. he guessed that ATSUI just does synthesizing anyway, so synthesizing isn't as dirty a method as I think.

4. cairo was chosen and used as the gecko rendering backend because it supplies the opportunity to do cool things like full image scaling, rotation. AND it abstracts most of the multi-platform features (eg mac does one thing, bug windows doesn't do that thing... cairo allows both windows and mac to do a thing).

5. CoreText would be nice, but not necessarily worth the effort right now.

It was good to meet him. I got to get some good insight on the italics/bold bug, and I got to meet a Sharks fan (I didn't know they actually existed, aren't there only 3 teams in the NHL anyone likes... habs, leafs, sens).

What else happened at FSOSS you ask?

1. A talk by a Xen virtualization guy... made me understand why businesses would want to run vms.
2. Ben Smedberg from Mozilla who talked about reading code, why and how.
3. Fluid Project guy who talked about how his group was working with Blackboard like portal sites to make user interfaces more accessable/standard.
4. Bob Young from Lulu who talked about the eternal battle between good and evil.

More from the scene tomorrow.

Tuesday, October 23, 2007

Options for Text Processing

Prerequisite Knowledge:
ATSUI - Apple Type Services for Unicode Imaging.

Gecko 1.8 (used in ff2) uses Quickdraw for all it's text rendering needs.

Quickdraw is now deprecated.

Gecko 1.9 uses Cairo for it's text rendering needs... Cairo uses Quartz to draw, and has ATSUI to run/store all the measurements. Gecko itself uses ATSUI to store font information.

I hear rumours that CoreText will replace ATSUI in leopard, thus making ATSUI deprecated (or soon to be deprecated).


So the question is, what road should I take towards fixing the problem that:
"when a css style demands italic/bold etc. and no predefined font exists (thus we need to take an existing 'normal' font and make it italic/bold) the browser doesn't render the style properly"

Option 1: Fake it, synthesize the style.
Option 2: See if Quickdraw can be used for mac os <>= 10.5
Fix up cairo to do this (gulp! thats a lot of work)
Option 3: Work with Cairo so that it draws with ATSUI rather than quartz. From documentation I have read, ATSUI can play with quartz (performance issues?). Cairo already keeps the font information in ATSUI... so i expect that the difficulty will be < option 2.

Here is a comment inside the cairo of gecko 1.8 (gecko didn't use cairo... but I guess it included it for some reason)
// TODO - bold and italic text
// We could draw the text using ATSUI and get bold, italics
// etc. for free, but ATSUI does a lot of text layout work
// that we don't really need...

Wednesday, October 17, 2007

A Dirty Italics Hack

This patch will make fonts already acting properly for italics go to "SUPER ITALICS"

So if you have been following along, you'll know that italics aren't working for certain fonts. I have created a really dirty (like roll around in the mud dirty) hack... a little description as given on IRC

xrayon: just give me the dirtiest part
mullin: the dirty part is reading whether a font should be italic or not
mullin: so I do some casting where I shouldn't
mullin: so during init time I read whether the font should be italic, and I set a variable that is kept around until draw time
mullin: at draw time I retrieve that variable, if the variable is true
mullin: I shear all text glyphs a little bit
mullin: making them look italics

The Patch

Project Page

Wait. Oh My ! What have you done. I'm backwards you filthy furball

Hahaha... a patch which writes the fonts as if the top left corner is the bottom right, and vice versa. Run it, you'll find it funny too.

Learn about here

Its not All Italic

More evidence gathering. New patch to check out

Learn Here

Tuesday, October 16, 2007

The Akbar Attack!

Alright, so I've created a patch to mess with your browsers fonts... ALL of em.

This is part of the debugging process to see how fonts are made & displayed.

Left is a screeny

Apply Me Here

Holy *bleep* this is deeper than I thought

In my debugging I thought to myself. "mike, lets print the font names as they are rendered"... I print them off and I see "Times-Italic" and all the other fonts I am using. So I says to myself, why is the _Name_ of Times-Italic ? Shouldn't Italic just be a style applied to Times?

I open up Font, and I start looking through the fonts... Times-Italic is an actual font name... so I play around with my test cases and change Times to Lucida Grand and Helvetica, which do not have an entire font associated with italics...

Lo and behold, they do not render as italic in Minefield.... hmmm deeper... why are the fonts not applying style to a font rather than just picking up a premade style.

Notepad Entry

Just to be used by me as a notepad entry. I am testing out how I like using a blog instead of a pad of paper beside my computer.... (aka I dont expect you to read this, its not for your benefit its for me to noodle)

CompressedGlyph: gfxFont.h
* This class records the information associated with a character in the
* input string. It's optimized for the case where there is one glyph
* representing that character alone.

a gfxTextRun has an array of these things... hmmm maybe important

textRun->AddGlyphRun(font, 0); in gfxTextRunWordCache looks impressive.

wtf is this ?
static inline PRUint32
HashMix(PRUint32 aHash, PRUnichar aCh)
return (aHash >> 28) ^ (aHash << 4) ^ aCh;

To draw a string, (or rather a nsThebesFontMetrics) Make a gfxTextRun which has a GlyphRun. The gfxTextRun does other fun things with glyphs like SetCharacterGlyph which fills up the glyph array with a 'CompressedGlyph'

Ok like, So where am I?

Ok so what is the state of my project:

My task is to understand why certain fonts do not apply bold/italics properly to their glyphs on Mac OSX. My previous work has been about trying to understand what happens in rendering process and thus the initialization of gfxFonts. I've walked down to the cairo level of the initialization process attempting to follow how the style value of italics.

I am unsure on what ForEachFont(FindATSUFont, this); does, and is a Fallback something used when the precisely intended font is not available for some reason (donno why that would be though??)

"there may be situations in which ATSUI cannot draw a glyph with the assigned font because the font does not have the glyph in its repertoire." -

// Create the fallback structure
OSStatus status = ::ATSUCreateFontFallbacks(aFallbacks);

Tonights marathon task is to go through the glyph drawing process... I have a fishy feeling I am going to have to take notes on ATSUIFontID values that are going on during init and seeing how this value applys to drawing.

Monday, October 15, 2007

My first Extension

So I went in for surgery this morning, and got an extension to my ..... ohhh you want to know about my FIREFOX extension. Ok then

Click here

Saturday, October 13, 2007

Bugzilla Watching

I officially dislike the watching feature of bugzilla. Here is why

What I did is started watching two people on bugzilla; My friend from school Andrew, and the GFX guy Pavlov (Stuart). I setup a gmail filter so that all bugzilla email would go into it's own area. And then I let bugzilla do its thing.

A week and a half later I have 81 conversations in my inbox. Although I can see the subject of the email, I don't know who wrote the comments that spawned the bugzilla-daemon email, and when I open up the email, there is rarely any useful information.

I'd like the bugzilla subject line to show who caused the email to be sent to me (andrew, pavlov, or my selected bug). And I would like to have the option of setting rules that would state that only actual comments are to send emails (rather than status changes, or reports of bug duplicates).

Thursday, October 11, 2007

Patch Match Dash

The challenge of the first patch was on.  Here is my complete hack.

lsblakk describeds the task best here

Wednesday, October 10, 2007

More Fontyness

I've been looking through the cairo-atsui-font.c code. When I next pick up I need to find out what the ATSUFontID values for the different fonts are.

Thursday, October 4, 2007

A whirlwind font tour

So I started trying to understand how fonts work in firefox 3, I used MXR and xcode/breakpoints to determine that I may want to compare the code paths starting from nsThebesFontMetrics::DrawString.  Its a starting point.

Tuesday, October 2, 2007

Windows Debugging

I followed the instructions here

A few hickups but I finally got things going, and hit the breakpoint every time I scrolled the wheel.

Linked to:

Reproduction (no, not that you dirty!)

Ok, so its time to reproduce 365713. Just a test on Windows vs OS X. My Linux box is down for maintenance.

Step 0: Get an optimized build on both windows and OSX

Step 1: On windows box open up in IE7... starts the japanese font process.

Step 2: Reopen in IE7. Open in the windows trunk build. Open in the OSX trunk build.



Safari Mac


1. Get Linux build going
2. Learn debuging on Windows
3. Learn debugging on Linux
4. Compare the step-through traces of the three operating system builds.

Sunday, September 30, 2007

View->Text Size->Increase (cmd+)

On my mbp, I increase the size of my font via the shortcut key (cmd+... applekey with plus key). How is this feature implemented?

1. search mxr for "Text Size"


* line 30 -- <!--ENTITY textSizePlus.label "Text Size +"-->
* line 31 -- <!--ENTITY textSizeMinus.label "Text Size -"-->
2. search for textSizePlus.label


* line 329 -- label="&textSizePlus.label;"
3. open up the minimo.xul to see if I can find a function
Side Question: What is minimo? it looks important, like it defines the main menu for firefox browser.
Minimo is the windows mobile browser... DOH, Im sure Dave told us about that in class too

Ok Restart

1. search mxr for "Text Size"

* line 292 -- <!--ENTITY textSize.label "Text Size"-->
2. search for textSize.label

* line 174 -- <menu id="viewTextZoomMenu" label="&textSize.label;" accesskey="&textSize.accesskey;" observes="isImage">
3. open the source and look for a function
174                 <menu id="viewTextZoomMenu" label="&textSize.label;" accesskey="&textSize.accesskey;" observes="isImage">
175 <menupopup>
176 <menuitem key="key_textZoomEnlarge" label="&textZoomEnlargeCmd.label;" accesskey="&textZoomEnlargeCmd.accesskey;" 177="" command="cmd_textZoomEnlarge">
178 <menuitem key="key_textZoomReduce" label="&textZoomReduceCmd.label;" accesskey="&textZoomReduceCmd.accesskey;" 179="" command="cmd_textZoomReduce">
180 <menuseparator>
181 <menuitem key="key_textZoomReset" label="&textZoomResetCmd.label;" accesskey="&textZoomResetCmd.accesskey;" 182="" command="cmd_textZoomReset">
183 </menuitem>
4. command="cmd_textZoomEnlarge" ??? look for that

* line 105 -- <command id="cmd_textZoomEnlarge" oncommand="TextZoom.enlarge()">
5. TextZoom looks like a class, lets do an Identifier Search
 73   __zoomManager: null,
74 get _zoomManager() {
75 if (!this.__zoomManager)
76 this.__zoomManager = ZoomManager.prototype.getInstance();
77 return this.__zoomManager;
78 },

236 enlarge: function TextZoom_enlarge() {
237 this._zoomManager.enlarge();
238 this._applySettingToPref();
239 },
So basically when a textZoomEnlargeCmd.label or a textZoomEnlargeCmd.accesskey occurs the TextZoom.enlarge function is ran... this in turn asks the ZoomManager to run things for it. What is the ZoomManager (obviously a singleton), What does it do?

6. Search for ZoomManager
  49 function ZoomManager() {
50 this.bundle = document.getElementById("bundle_viewZoom");
52 // factorAnchor starts on factorOther
53 this.factorOther = parseInt(this.bundle.getString("valueOther"));
54 this.factorAnchor = this.factorOther;
55 }
enlarge method
 102   enlarge : function() {
103 this.jump(1);
104 },
jump method
 153   jump : function(aDirection) {
154 if (aDirection != -1 && aDirection != 1)
155 throw Components.results.NS_ERROR_INVALID_ARG;
157 this.ensureZoomFactors();
159 var currentZoom = this.textZoom;
160 var insertIndex = -1;
161 var stepFactor = parseFloat(this.bundle.getString("stepFactor"));
163 // temporarily add factorOther to list
164 if (this.isZoomInRange(this.factorOther)) {
165 insertIndex = 0;
166 while (this.zoomFactors[insertIndex] < this.factorOther)
167 ++insertIndex;
169 if (this.zoomFactors[insertIndex] != this.factorOther)
170 this.zoomFactors.splice(insertIndex, 0, this.factorOther);
171 }
173 var factor;
174 var done = false;
176 if (this.isZoomInRange(currentZoom)) {
177 var index = this.indexOf(currentZoom);
178 if (aDirection == -1 && index == 0 ||
179 aDirection == 1 && index == this.zoomFactors.length - 1) {
180 this.steps = 0;
181 this.factorAnchor = this.zoomFactors[index];
182 } else {
183 factor = this.zoomFactors[index + aDirection];
184 done = true;
185 }
186 }
188 if (!done) {
189 this.steps += aDirection;
190 factor = this.factorAnchor * Math.pow(stepFactor, this.steps);
191 if (factor < this.MIN || factor > this.MAX) {
192 this.steps -= aDirection;
193 factor = this.factorAnchor * Math.pow(stepFactor, this.steps);
194 }
195 factor = Math.round(factor);
196 if (this.isZoomInRange(factor))
197 factor = this.snap(factor);
198 else
199 this.factorOther = factor;
200 }
202 if (insertIndex != -1)
203 this.zoomFactors.splice(insertIndex, 1);
205 this.textZoom = factor;
206 },
Well this is where the code is... ZoomManager.jump. The browser is defined in the, which is an include file for the browser.xul . Browser.xul is the user interface definition for the firefox browser.

Bug 364713 - Project

I have accepted the Mozilla bug relating to Non-styled fonts not displaying bold and italic, (364713). I want to have my first patch ready for Oct 19 2007.

Friday, September 21, 2007

Setting up Debugging with xCode

I followed this manual and everything worked as it should.

Some notes:
I ran with a debug build, I was able to set a breakpoint in a cfile in the GFX library and the execution stopped at the set-breakpoint just as it should.

I've set up some scripts to make it easy to run optimized builds and debug builds.

Tuesday, September 18, 2007

My experiences with "Shark"

Stuart suggested I learn a bit about "Shark" an optimizing tool for OSX.  Here are my experiences.  I followed along with this tutorial: Optimizing Noble Ape with Shark


Needed to reinstall (with my osx disk 1) Xcode.  Clicked the option to install CHUD

Compile - Pre Analysis

Need to compile the NobleApe Application... load up the project file and "build & Run"
Neat little program I guess, I left it running.


I opened shark, and clicked "Start" and let it do its thing

You do this "Run Program, run Shark Analysis" a few times with the tutorial explaining how the code of a certain function would change.


Shark helps you determine what parts of your code take the longest to run

Backend GFX debugging for Mozilla

So I have signed up to the Backend GFX debugging project for Mozilla as a team lead.  I think this project will really introduce me to the Mozilla source code.  I will do my best to help get this GFX system "out the door" by shipdate.

Monday, September 17, 2007

nled Makefile : PLEASE COPY MY WORK

Hi All... I tried to be REALLY REALLY generic.  Im looking for others to help me out with Windows and/or Linux/AIX porting

To run type
make -f

Here are my Makefiles
ALLOBJ=qkdisp.o nledshwr.o nledmisc.o nledit.o nledisp.o nledio.o nledata.o nled.o

# 1) in nled.h remove the lines which define the target system
# 2) in qkdisp.c remove the lines which define the target system
# 3) around the function beep(int n) in nledio.c wrap the entire function in a
# #if MACOSX == 0 ... #endif

all: nled cleanobj

compile: nled


$(DEL) nled

clean: cleanobj cleanexe

nled: $(ALLOBJ)
$(CC) $(ALLOBJ) $(LIBS) $(LDFLAGS) $(TOOBJ) nled

qkdisp.$(OBJ): qkdisp.c nledkeys.h
$(CC) $(CFLAGS) $(DEFINES) $(NOLINK) qkdisp.c $(TOOBJ) qkdisp.$(OBJ)

nledshwr.$(OBJ): nledshwr.c nled.h nledvdef.h nledfdef.h
$(CC) $(CFLAGS) $(DEFINES) $(NOLINK) nledshwr.c $(TOOBJ) nledshwr.$(OBJ)

nledmisc.$(OBJ): nledmisc.c nled.h nledkeys.h nledvdef.h nledfdef.h
$(CC) $(CFLAGS) $(DEFINES) $(NOLINK) nledmisc.c $(TOOBJ) nledmisc.$(OBJ)

nledit.$(OBJ): nledit.c nled.h nledkeys.h nledvdef.h nledfdef.h
$(CC) $(CFLAGS) $(DEFINES) $(NOLINK) nledit.c $(TOOBJ) nledit.$(OBJ)

nledisp.$(OBJ): nledisp.c nled.h nledkeys.h nledvdef.h nledfdef.h
$(CC) $(CFLAGS) $(DEFINES) $(NOLINK) nledisp.c $(TOOBJ) nledisp.$(OBJ)

nledio.$(OBJ): nledio.c nled.h nledkeys.h nledvdef.h nledfdef.h
$(CC) $(CFLAGS) $(DEFINES) $(NOLINK) nledio.c $(TOOBJ) nledio.$(OBJ)

nledata.$(OBJ): nledata.c nled.h nledkeys.h nledfdef.h
$(CC) $(CFLAGS) $(DEFINES) $(NOLINK) nledata.c $(TOOBJ) nledata.$(OBJ)

nled.$(OBJ): nled.c nled.h nledkeys.h nledfdef.h
$(CC) $(CFLAGS) $(DEFINES) $(NOLINK) nled.c $(TOOBJ) nled.$(OBJ)

Mozilla Trunk from CVS : firefox : Mac OS X

Here are my experiences building firefox from the mozilla trunk from CVS for Mac OS X.

From start to finish. I posted my findings in our wiki

Friday, September 14, 2007

RIM has offered me a JOB!!!!!

YEAH, I will be employed (so long as I sign the paper and graduate!)

Im very glad I got a job at RIM.  The financial compensation is far more than I expect (can't take it back now RIM!), I love the city of Ottawa, I enjoy being around my old co-workers, and working on those devices is KICK-ASS.  Not only these things, but we play lunchtime road hockey in the springtime!  So long as everything goes well this year at school, I'll be starting my employment on May 5, 2008 (2008-05-05).

Oh man, I can't wait for the winter of '08 when I can skate the Rideau again.

Serious Linux Based Employment

Key job responsibility
- Port Windows based games to Linux Platform

Valve makes the HalfLife games, and has some deep pockets.  It looks like they want to start getting into Linux.

Wednesday, September 12, 2007

Moz Compiling

I want to compile the firefox browser.  here are my experiences doing so

1) downloaded the source... easy enough to download
2) configured my mozilla/browser/config/mozconfig file... easy enough
3) export mozilla/browser/config/mozconfig... easy enough
4) make -f build... doh error, I need libIDL
  a) install Fink  ... easy enough (reload, re export)
  b) use apt-get to install libIDL ... easy enough
5) make again
6) watch compiling
7) 25-30 min later run the ... voila :)

The Eternal Question

How do I get paid?

As we dive into our last year at school, Its on my mind: how do I get paid?  Can Open Source/Free Software pay the bills?  Can I live as nicely as the Jones'? Do I deserve to live as nicely as the Jones'?

Its nice for academics and long haired hippies to expose how wonderful open source is towards society, but they shop at the A&P whether people pay developers for the software or not... they train people afterall, they do not feed their kids on emails saying "hey man, thanks for the cool browser."

I suppose I could live on welfare and charity, surf off my neighbours insecure 802.11, and code all day long, but I am greedy for more.

Open Source: What's in it for me?  I want things; and by things I do mean things. I want big TVs, a nice house, a dog, a super powerful washing machine, a kick ass computer, video games, and I want not to steal wifi (gadgets fill the void of being a fat nerd sitting on a computer in the basement and unable to score with girls, lol).  How can Open Source pay for those things?

Does anyone want to give me a job to do some code in Mozilla?  (like seriously, some cash would be nice right now)

Thoughts on Revolution OS

I thought this was going to be a poorly produced documentary, and I wasn't looking forward to watching this at all.  However after watching for the first 5 minutes I was engrossed.

I don't really have many thoughts on the movie other than I thought it was a nice history lesson.  I myself am a linux user (I used to be rabid and used it as my desktop and server, but now that I've found mac OSX...).  The movie could have used some controversy (perhaps talk about Hans Reiser) and Michael Moore would have done well to produce this flick.

Tuesday, September 11, 2007

Thoughts on Eric S. Raymonds piece "The Cathedral and the Bazaar"

I was about to simply read "The Cathedral and the Bazaar" and post my thoughts afterwards when I came to this quote, "Plan to throw one away; you will, anyhow." I think its a great line and had to immediately say that I totally agree.

I agree with points 2-6 in "The Mail Must Get Through" section, but I am somewhat iffy on point 1.  I think quite a few pieces of software started off to get someone rich (perhaps wealth is a personal itch?)

In section "The Importance of Having Users" I disagree with the idea of having users being the guinea pigs for debugging.  This seems to put the idea that 'the software organism' is what is important, and that perfecting it should be our pinnacle of success; I believe that user satisfaction should be the pinnacle of success.  Now having perfect software will make people happy, but if our non-hacker-but-still-users have had to put up with several iterations of buggy software , they will not be happy.  There is a place for beta-testing, however in house testing should be done thoroughly before software is released for serious products.

I only half believe the statement "release early. release often."  I think it should be "release carefully. then release often."  Release the software after through testing, but after this initial release phase the maintenance patches should be rapidly implemented and deployed.

I agree with his section about throwing away features.

I think the idea of "harnessing" communities more than solitary brains is cute, but not necessarily true.  Sometimes great ideas come from only one head.

The rest of the article is interesting and informative, but simply based on the authors desire to defend the Bazaar style.  The author then demonstrates the successful stories of the bazaar and seems to ignore the unsuccessful stories, or the bad sides to bazaar style development.

Friday, September 7, 2007

Start of Class - First Ideas

Yesterday (2007-09-06), we had our first DPS909 class.

We discussed what the purpose of the class was (introduce us to Open Source development methodologies).  I've got a few ideas about what project I want to do during this class.  Unfortunately my ideas seem a little bit big to me... comment if you think so (or not).

1) Mozilla Scriptability
- The ability to use the Mozilla browser statefully in a scripting language (such as perl). eg. Scripting language looks something like this (forgive me for using java... its easiest to psudocode in for me... the final product probably wont be a java thing, but a commandline thing for scripting langs like PERL PHP etc)

MozBrowser m = new MozBrowser();
m.setTextBox( "masmullin", 0 ); // put my username in box 1
m.setTextBox( "hahanicetry", 1 ); // put my pword in box 2
m.clickSubmit( 0 ); // click the submit button
String s = m.getHtmlAsString();

Now Gmail is actually an incredibly bad example now that I look at the page... because its AJAXy (view the source for gmail once you log in... you'll notice a lack of HTML code).  But the example is just to give you an idea.

2) Firefox logging
- An extension to log what a person does in firefox to give the ability to easily "record" steps taken during a browsing section.  
This idea is the "opposite" of my first idea, and is complementary to the scriptability idea.  They logging + scripting would allow a non-power user to automate tasks they regularly perform in firefox. eg.

A user regularly logs into their bank site to see their balance.  The user can switch on "logging" and perform the necessary tasks to get to the page which contains their balance.  The output can then be used the scripting idea (idea 1) to gather the text displayed on the balance page... pipe to a regular expression and bam, they can easily automate a little task to grab their bank balance.