Showing posts with label open source. Show all posts
Showing posts with label open source. Show all posts

Sunday, April 25, 2010

Release 0.3 - latest patch for Bespin's SmartMove implementation (revised)

I have been working on this bug over the past few days, throughout my flight to Saskatchewan and during time when I wasn't obligated to give my full attention to the family who I am visiting, and I have uploaded the newest patch for the SmartMove implementation. I had to change a couple of files so I found out how to make a diff for multiple files (which is actually just searching through the directory and it throws all the changes together in one big diff file) and uploaded it. Although the releases for class are done, I am definitely not going to stop working on Bespin. It has become somewhat of a hobby, and I like the community around it. I find it interesting in the way it is put together and would enjoy working on it and helping out in its production as a hobby and a pass-time. I can see myself working on it for a long time to come...I'd rather work on it as a hobby rather than for marks because then less pressure is applied and you don't have anything that could be perceived as negativity looming over your head; it's just you and your code and it feels a lot more leisurely and comfortable because the end result won't affect you long-term in any negative way whatsoever since everything you do in the real world is experience, whereas if you do something less than perfect for school, it is your one and only 'iteration' and it could mean a few strikes off the old gpa, which can lead to stress when trying to work on it and it is quite hard to concentrate fully when feeling stressed about what the result could mean to your future.

Anywho, my latest bug patch is below.

The bug page and comment can be found here

The actual patch can be found here

Wednesday, April 21, 2010

Should I really get the latest tip before I start work?

This is like the third+ time this has happened, but it was working fine before but then I ran hg pull -u and it stopped working. I thought maybe my changes didn't merge well together with the latest tip or something so I deleted it and redownloaded it, but sure enough, the same problem. It says something is missing and is having a 401 error. I asked a question in the bespin channel of irc but no one is answering, so I will try again tomorrow. Last time this happened, it fixed itself after no time at all; let's hope this time it's even shorter than last.


Monday, April 19, 2010

Issues with Bug 558783 over the weekend

I had some issues with bug 558783 over the weekend. First, when I began to work on it, I started up bespin but everytime I moved left or right it would stall. It appears that since I was working on it last week, they had updated a few things and 'column' was now referred to as 'col'. When I changed this in the moveLeft and moveRight function, it began to work again. I was worried at first because I was afraid I had uploaded the wrong patch or something and had lost my work. Luckily, this was not the case.

So far on the patch, I have implemented the reference for the smartmove option that Bespin produces when 'smartmove' is typed on the command line. It explains what the command does and how to use it. Right now, the bug is at a point where when the cursor is in the middle of tab spaces, it will jump from the middle of a tab to the end of the tab in the direction pressed, but not when shift is pressed. I have to figure out how to determine whether shift is being pressed and implement it in that situation as well. It also jumps over the entire space if there are two tabs rather than only one tab space. I am having trouble figuring out the logic for that one... I also have to add the actual command to turn the smartmove feature off and code it accordingly. Unfortunately, I have to give it a rest for a bit because my DSA exam and EJB exam are tomorrow. It will be in the back of my mind, however...

Thursday, April 15, 2010

Review of bug for release 0.2

I posted my bug that I fixed for release 0.2 earlier this week and it was reviewed by Jviereck a few days later. He said that there was a few things that were not quite right with the bug fix. These are:
  • When the cursor is within a tab, pressing right or left should bring the person to the end of the tab (if the tab is 4 spaces and the user is column 2 of that tab, pressing right should move the cursor 2 spaces to the right) (mine always moves *set amount of tab spaces*, even if the cursor is inside of a tab).
  • If the user is within a tab space, and say this tab space is on column 1-4 and the cursor is on column 2, if the user holds shift and presses right, the cursor goes to column 4 and highlights column 2, 3 and 4.
  • Add a setting to turn this feature on/off.
I will add these additional features to my smartmove implementation and post it, hopefully by the end of the week, but by Monday at the latest and it shall be my 0.3 and final release (for the course).

Monday, April 12, 2010

Fixing Bespin Bug 558783 - Release 0.2

Yesterday I decided to put the Java-EE and the accompanying tribulations to rest for the night and
work on OSD. I had previously spoken to jviereck about a bug involving implementing TM's SmartMove. I was able to accomplish this last night. Much to my advantage, Harjinder had just worked on bug 557135 involving implementing the indent feature, and since TM's SmartMove is basically a fancy way of saying, 'make the cursor jump over a tab where tab was pressed', he had the foundation by knowing that 'tabstop' in the JavaScript files were the default size of a tab. Combined with Skype and TeamViewer (using TeamViewer because Harjinder could not run Skype on Linux and could not run Bespin on Windows), we banded together to work on bug 558783 and successfully completed it before the sun came up. We finished our work at 3:30 am, at which point I was still at the school because my DSL modem at my apartment appears to have broken down and needs to be replaced (at probably one of the worst possible times...).

I encountered a few issues while working on the patch, but for the most part they were mistakes caused by it being a late night and having worked on other things all day. These problems included, but were not limited to:

var line = lines[range.start.end];

instead of

var line = lines[range.start.row];

or little algorithm issues such as:

if(((count * 1) * -1) >= tabstop){
count = tabstop;
count = count * -1;
}
else{
count = -1;
}

in the moveLeft function instead of

if((count * -1) >= tabstop){
count = tabstop;
count = count * -1;
}
else{
count = -1;
}

which would end up making the if statement evaluate count as a negative instead of a positive which would end up having the cursor's behaviour unpredictable and incorrect once the left cursor was pressed. A lot of the time, however, when different changes were made, it would just break the function altogether and when left was pressed, the cursor would be at a standstill.

You can find the bug page here and the source code that was required to implement this smart-move behaviour in Bespin here

Sunday, April 11, 2010

New bug to work on

So I went to IRC to ask around for implementations/bugs that would be found useful in Bespin. Jviereck helped me out once again by suggesting this one implementation that he was hoping to get around to involving the 'TM Smartmove' option, which in other words, means that if you have 4 spaces and tabstop/width is 4 and you press left or right while in the editor, the cursor will move 1 tab instead of 1 space. Very common in many editors so it only makes sense that Bespin should have it too!!
It's only a matter of time, now...

Thursday, April 8, 2010

Bespin Working Again

I updated my Bespin pull after a couple of days of trying to understand why it's not working properly and it is now looking and working better than ever. It appears that it has a new title screen which gives it a whole new initial look. I tried to reproduce the 'code-commenting failing to show' bug but it was unsuccessful and I was unable to reproduce the bug. Now to find another bug to work on, unfortunately Java and C++ are taking up a lot of my time and the last week of school is upon us. I need more time!!! I was kind of hoping that strike happened lol because I knew that it was going to be hard to keep up with everything but it did not and now I fall behind. I will do my best to complete the next two bugs as soon as possible.

Sunday, April 4, 2010

Bespin Not Working Again...

It had been a little while since I had worked on Bespin, being so busy with a number of other assignments the past month, but I remembered that jviereck had mentioned a bug regarding the issue of code commenting failing to display on page load until start of comment appears. I tried to reproduce this bug but unfortunately I could not load up Bespin client anymore. I pulled the newest Bespin from the repository and it came up like the attached picture. Hopefully I can resolve this soon so I can get working on some code commenting bug or any other.

I haven't been getting enough time to work on open source stuff due to assignments keeping me busy, but I'd really like to because I really enjoy it. I also look forward to starting work on my prj666 project come the summer. Just have to get these assignments out of the way...

Tuesday, March 30, 2010

Helping Out

So last night I was working away on C++ while talking to Harjinder and he was telling me that he was having some issues with a bug for Bespin. He said that jviereck wanted him to do the 'indent' bug, where it jumps 4 spaces to the right when tab is pressed. He was able to solve that part on his own but he wanted some help with the 'unindent' portion when you press shift + tab. I spent some time in text.js and found something in Canon/keyboard.js that could be the code for detecting whether shift was being held down. It was late so we ended early, but we'll be getting back to it shortly. I also have to do two bugs by the end of OSD and I'm pretty jam-packed with other homework...this will undoubtedly be a busy few weeks.

Wednesday, March 17, 2010

Week 8

I have been studying this prototype that was given to us last week to try to gain a better understanding of the code behind a web-based IDE such as the one we are going to make. It seems very interesting, as it is in a multitude of files and languages already and it is quite early in the process. Like, the current prototype is as basic and as skeletal as it gets and it is already separated into 5 files including one of just pictures. I think it is more compressed than it could be even, as all the buttons are in one .png file and seem to be cut from the .png file using css. That is some skillful programming. I have thought of an idea of what the file system should look like but have yet to put it on paper/e-paper and share it among the team. That is the next step...

Wednesday, March 10, 2010

Thunderbird Build


I did the thunderbird build lab over the reading week. It involved updating a file so that it no longer displayed non-links in the link format.

I was having trouble building thunderbird first of all. I tried a number of times to rebuild but it kept getting this one error that would not allow me to open thunderbird. Whenever I ignored it or aborted it, the command prompt window would stop responding and close, and when I pressed cancel it closed it. A few days later I re-built it, however, and was successful.

I tried to reproduce the error but didn't realize that it would only reproduce once it was saved as a draft. I can attribute Scott's blog for that little tidbit. Since I had already read Scott's blog, I had a good idea of how to solve the issue. I opened up the mozTXTToHTMLConv.cpp file in the mozilla/netwerk/streamconv/converters directory and changed the necessary code, retested it and sure enough, success on all accounts (see picture).

Patch can be found here
Bug can be found here

Wednesday, February 24, 2010

Firefox - debug build

I am on my way to doing that Firefox Lab from ever so long ago (2 weeks) but I just had the regular Firefox build on my computer so I had to go back and build the debug version. Unfortunately, I spent some of last night and today trying to figure out why it kept saying update.exe.manifest in mozilla-central/toolkit/mozapps/update/updater/ was not found (aside from the obvious, the file not being there)...it seemed it should be there but after trying a number of rebuild commands and talking on IRC in the #developer channel trying to get some ideas and having them say to do things I had already tried, I decided to scrap it all and start from scratch. I did basically the same thing I did in the beginning except this time I made the .mozconfig file contain the settings for the debug build in the first place rather than just the original build, and waited for an hour or more for everything to complete (hg clone ___ and make -f client.mk) and sure enough, updater.exe.manifest was there.
Should have just done that from the beginning...
Tomorrow will be a day of labs. I intend to do the Firefox Lab as well as the lab about fixing a bug in Thunderbird. It shall be good fun...isn't it always?? :)

Sunday, February 21, 2010

Uploaded Patch For Bug # 540112

Introduction
I was able to complete my bug over the course of the weekend after a few frustrations and getting reacquainted with a language that I had not used for a good two years. It was nice to revisit it and it feels good to get that patch done and uploaded. Details about the bug can be found on my wiki.

Specifications
For my bug, I had to make the text-cursor in the editor blink when the editing area had focus, like a cursor regularly does in a text-editor. The file that I had to edit was

bespinclient/plugins/supported/editor/views/text.js
.

There wasn't too much editing in regards to this patch, but I had to make a timer function which called the drawInsertionPoint function, which placed the cursor on the page, and I had to make it so it would blink...so I used a boolean that would change every time the function was called so it would either colour the cursor the same colour as the background or colour it the colour that the cursor is supposed to be (blue). I had a lot of help from Julian Viereck in finding the right file and about the file system of Bespin. When I was struggling with getting it to work, Harjinder helped me to debug it and we worked together to find what was wrong with it. He was a huge help.

What I learned

  • Learned how to iterate through large pieces of code
  • Learned that I should check to see if the bug is still current/test it to see if the issue is still occuring
  • Memorized how to update my files using Mercurial (hg pull -u). Previously, kept forgetting that syntax
  • Learned how important communication is in the open source community
  • When you work together you're bound to resolve the problem quicker because each person has a different approach to the problem, more things are noticed, and different solutions are brought to the table
Conclusion
The cursor now blinks in Bespin and my code is up for its first review. I hope it gets accepted but either way I am looking forward to the constructive criticism.

Bug 540112

I have been working on my bug for quite some time now, which seems to be, for the majority, trying different things to make it work and reviewing my JavaScript...I am a little out of practice with JavaScript at the moment as I have not done it since second semester in INT222. I missed it, it's a good language...unfortunately nothing I do to make this cursor blink is working...I will need to use an SC.Timer to make it blink but I think I'd have to pass parameters into the timer, as the function that draws the cursor has two parameters: rect, and context. I remember having to make or call a fire method, or something like it, to fire off the function in question but that would also need parameters and you can't send in parameters with the timer's action property.
What I have now is...

The cursor drawing function...

_drawInsertionPoint: function(rect, context) {
var range = this._selectedRange;
var characterRect = this.get('layoutManager').
characterRectForPosition(range.start);

context.save();

context.strokeStyle = this.get('theme').cursorStyle;

context.beginPath();
context.moveTo(characterRect.x + 0.5, characterRect.y);
context.lineTo(characterRect.x + 0.5,
characterRect.y + characterRect.height);
context.closePath();
context.stroke();

context.restore();
},

The timer function...

_cursorBlinkTimer: function() {
this._cursorBlinkTimer = SC.Timer.schedule({
target: this,
action: '_fireDrawInsertionPoint', /*Had _drawInsertionPoint but can't pass in parameters with this */
interval: 250,
repeats: true
});
},

I thought it needed some sort of other method to send in the parameters but that would need to be called using parameters in the action: property above so that couldn't work...

_fireDrawInsertionPoint: function(rect, context) {
if(this.get('isFirstResponder')) {
drawInsertionPoint(rect, context);
}
},

The place that calls the cursor drawing function...

_drawSelection: function(rect, context) {
if (this._rangeIsInsertionPoint(this._selectedRange)) {
this._drawInsertionPoint(rect, context); //Thought this had to be this._cursorBlinkTimer()
} else {
this._drawSelectionHighlight(rect, context);
}
},



So I'm in a bit of a bind and have been looking around for quite some time but am not coming up with much to go on. I even asked Yahoo Answers lol and they said the way it was coded would be tricky. A fellow on irc told me that I should look into property-observing functions of SC...for something like an isCursorVisible property...I've been looking but haven't been coming up with much and that is much different than what I have done so far but anything is acceptable as long as it works and is it good taste. Hmm. Tricky.

Saturday, February 20, 2010

Firefox Build Finally Complete

And I have successfully built FireFox finally!! I scrapped my old cygwin gcc which seems to be a bit of a failure and traded it in for one packaged with this 'mozilla build' toolkit containing what seems to be everything we need to build mozilla tools ??? Well, it works, I've succeeded, and I will be working on the bug and the lab simultaneously now. Excellent.

Trying to complete my build of FireFox to work on lab

Sooo I am having a bit of trouble with my bug so I thought I would let my mind dwell deep into the caverns of JavaScript and hopefully it would come up with something while I tried to build FireFox. Unfortunately, while trying to build FireFox, after installing the SDK and hoping that it would all be good from here on out, it's telling me that my gcc that came with cygwin can not execute binary files??
To be exact...it says...

checking for gcc... cl
checking whether the C compiler (cl ) works... no
configure error: installation or configuration problem: C compiler cannot create executables.
*** Fix above errors and then restart with "make -f client.mk build"


Now...why in the world wouldn't my C compiler be working properly. It's obviously detected and it is evident that it is there...why in the world...would it...not be...working?
Frustrating.

Latest Bug 542578 Also Outdated

Well, Mr Patrick Walton, who seems to be a lead developer on Bespin, gave me bug 542578 yesterday when I found out that my bug was outdated and asked him if there are any current ones available. Unfortunately, that bug was also outdated...so this morning I was talking to a Mr Julian Viereck and he gave me a tried, tested and true bug that he said he wanted to work on but he'd save it for someone just starting out with Bespin. Lucky for me, I am that fellow, and he's guided me along with finding its location. I was somewhat frustrated last night after finding out that bug after bug seems to already be resolved, but after a good night's sleep and a bug truly in need of fixing, my mood is lifted and I am feeling much better.
Thank you Mr Julian Viereck, you have made my day...

Friday, February 19, 2010

Initial Project Plan - Bug 540112

I'll be working on Bespin for Mozilla and have requested to be assigned a few bugs I found on Bugzilla. I have requested to contribute to issue 516852, about how the scrollbar cursor doesn't change to the correct cursor when it's over the custom scrollbars in the editor, and issue 521823 about how commented code doesn't display as being 'greyed-out' when the cursor is near the bottom of the file, but becomes greyed out once you move the cursor to the top of the comment block. I chose to work on these two issues because I thought it would give me an introduction to the Bespin code, give me some access to the code, and begin my understanding of the inner-workings of Bespin. Unfortunately, I was denied working on issue 521823, due to the fact that 'it's unclear to me(Kevin Dangoor) when we will bring the debugging functionality back. There are significantly more important things on our plate than that...'. That is unfortunate because I was looking forward to working on it a lot, but that will have to wait. It also appears that bug 516852 has already been resolved so that is also out of the picture. My latest and hopefully final bug for this iteration is bug number 542578. Apparently, adding new lines to the buffer causes a one pixel wide line in the color of the selection to appear on the left side of the editor view.
UPDATE: I just found out late last night that the bug in question...542578...is also a thing of the past and have been blessed, finally, with a bug that needs to currently needs to be fixed. This bug is bug number 540112 about how the Bespin cursor doesn't blink when it's inside the text editing area. Well, I'm going to fix that right now.



Background

Bespin is an online IDE developed by Mozilla Labs. It allows users to create and edit code, similar to Microsoft Visual Studio, from within a web-browser with no client-side installation necessary. It will allow multiple users to work on and discuss a single piece of code/program collaboratively. It is also a piece of open-source software...a very attractive option to developers everywhere.



Progress Tracking

I will be tracking this progress on my wiki. I will also post things that other developers would find important on the issue page (540112). They will be able to follow me through my wiki and through my posts on the issue pages listed above. I expect to have looked at the code for these issues by February 19th and to have issue 540112 finished by February 20th. Yes, there's not a lot of time but this bug is due the week of February 15th and according to all logic, Saturday is still a part of the week. Sometimes you run into obstacles and you just need to kick them down and run over them a few times, and that is what I plan on doing. This little setback of my original bug not really being a bug anymore will not keep me down.

Different Versions of Each Release

As stated previously, I don't have long to do it so I'm going to tackle it head on. It shouldn't be too big anyway, at least I hope not. For issue 540112, I plan on it being done for February 20th. I will then continue to work on more bugs to help out the mozilla community. I will discuss my issues with Julian Viereck for assistance and guidance with the issue. He has already been a big help in guiding me to it's general location and giving me a truly current bug.

Overall

I will be using JavaScript since that is what the majority of files in Bespin are coded in. It has been a little while since I've used it but I reviewed it while working on the last fail of a bug, so it's coming back to me. I was talking to Julian Viereck on irc about the issue and he said it was still open and needed to be resolved. I will use Google for help with syntax as well as clarify my questions about the issue with Julian Viereck. I've already experienced a few barriers, namely the bug I was working on previously and spent a good amount of time on was obsolete, but I am sure to experience new barriers as time progresses. I will be talking to people over irc and learn on my own using google to overcome barriers. We shall see how it works in the end. I think it'll be good to look around in bespin some more but understanding it all is pretty impossible since it's a massive repository.

My Bespin Bug Was Outdated!!

So I have been working on this bug for a number of hours now and was curious as to how some of the things I did was not fixing the issue. It seemed like they really should have...but then I thought I'd check something out. I went on the bespin client located at http://bespin.mozilla.com and realized that some things were much different between that one and mine. On the online version, the cursor is an I while it's in the Bespin editor, but on my local copy, it stays as the regular windows arrow. This is really the only difference I care about...the others are things like...the front page is different (mine has Italian or some foreign language on the start-up page while the Bespin one just has instructions, but I'm sure they tweaked that), and there are no buttons on the top in mine whereas there are buttons on the top in the online one. On irc, they said that the button issue and the foreign language differences were supposed to happen, but at that time I didn't think to ask whether the cursor should be an I, as I didn't realize it was supposed to be.

Unfortunately, I was just on IRC talking to pwalton and it seems that the issue has been resolved and it was outdated. http://bespin.mozilla.com uses version 0.0.4 and the recent version is 0.0.7. Joy!!!!!!!!!! That was a good use of a multitude of hours. Well, so much for that. He assigned me to another bug now...bug # 542578. So, I better get to work. I'll make another initial project plan for it since the last one is obsolete.
Joy.
I guess life is in fact winning this round.

Thursday, February 18, 2010

Bug in Bespin ... the search...

After a few hours of searching in and around the area that was given to me inside my bug listing on bugzilla, I believe to have found the section in which the error lies. Inside bespinclient/plugins/supported/Editor/views there's a couple of javascript files called scroll.js and scroller.js. Around line 278 in scroller.js, the code begins focusing around whether the scrollbar is highlighted and has code such as:

_isHighlighted: function() {
return this._isMouseOver === true
this._mouseDownScreenPoint !== null;
},

which is just the first of many similar lines but that goes to show you it's discussing whether the scrollbar is highlighted based on the mouse-event, which is pretty close to focusing on my bug, being that the custom scrollbar doesn't change when the mouse scrolls over the scrollbar. It just stays as the regular mouse cursor, and that ain't right...unfortunately my brain is pretty fried right now due to my 3 hours of sleep last night so I will have to resume it in the morning. Wish me luck, world.