<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7950840353484096378</id><updated>2011-08-08T05:54:16.836-07:00</updated><category term='open source'/><title type='text'>Scott Downe</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>62</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-7302195521811691429</id><published>2010-06-05T15:40:00.000-07:00</published><updated>2010-06-05T15:50:16.209-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>Moving to wordpress...</title><content type='html'>I'm in the middle of moving my blog over to &lt;a href="http://scottdowne.wordpress.com"&gt;http://scottdowne.wordpress.com/&lt;/a&gt;. I will be spending the next few weeks fiddling with the smaller details of design, the sort of detail that can get someone like me wrapped up for days doing, but not accomplishing anything :).&lt;br /&gt;&lt;br /&gt;I was impressed that I was able to just export all my old posts over to wordpress, by clicking a "magic button", literally, that's what it was labeled as. It's all automated, and a really painless process.&lt;br /&gt;&lt;br /&gt;The reason for the move was for more robust visitor tracking.&lt;br /&gt;&lt;br /&gt;I have some pretty cool ideas in mind for my new blog, as far as design goes, so we'll see how far wordpress allows me to hack it. I would like to get some &lt;a href="http://processingjs.org/"&gt;processing.js&lt;/a&gt; sketches in my design, maybe in the background, or the banner, or both! if it's possible. If not, I might consider writing something myself, and hosting it myself, but I'm not there yet.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-7302195521811691429?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/7302195521811691429/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/06/moving-to-wordpress.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/7302195521811691429'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/7302195521811691429'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/06/moving-to-wordpress.html' title='Moving to wordpress...'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-5633654897703808428</id><published>2010-05-21T19:46:00.001-07:00</published><updated>2010-05-21T19:46:54.301-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>JavaScript is not Java</title><content type='html'>Just how deep does this rabbit hole go?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-5633654897703808428?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/5633654897703808428/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/05/javascript-is-not-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/5633654897703808428'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/5633654897703808428'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/05/javascript-is-not-java.html' title='JavaScript is not Java'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-6381087423003232026</id><published>2010-05-15T05:05:00.000-07:00</published><updated>2010-05-15T05:28:55.828-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>Make one to throw it away</title><content type='html'>The title of this blog becomes more and more true the more I work in open source, but if you don't know what the title means, let me describe to you something about open source before i tell you what it means.&lt;br /&gt;&lt;br /&gt;Open source development differs from school, and I can only assume, propriety jobs like a bank because in open source, if something has been written before, why are you going to write it again? At school, you spend so much time writing code that has been written hundreds of times before, by hundreds of students before you, these assignments are possible, have been proven, and if they were not possible, and they asked you to do it, you would be pretty ticket off spending days trying to figure it out, and you would probably think you accomplished nothing, and wasted time. You are wrong. When you are working on something that has never been done before, you have to try different things, there is no one to tell you what works, only ideas, because no one has done it. You have to think for yourself, make decisions for yourself, and be prepared to be wrong most of the time, until you get it right. You can be wrong hundreds of times, but only be right once... per problem that is.&lt;br /&gt;&lt;br /&gt;To "make one to throw it away" means, before you get code that is working, and doing what you want, you have to make one or more versions that fail. This isn't too bad when dealing with a couple hundred lines of code, but something like 8000+ well, that bring me to my next story.&lt;br /&gt;&lt;br /&gt;I've been spending the last week, trying to figure out a way to remove the final with() function call from &lt;a href="http://processingjs.org/"&gt;Processing.js&lt;/a&gt;. In order to remove the with() function call, I had to rewrite a lot of the code... 8000+ lines of code, which also meant I had to understand (more or less) 8000 lines of code. If you are curious, here is the &lt;a href="http://processingjs.org/content/download/processing-js-0.9/processing-0.9.js"&gt;source&lt;/a&gt; in all it's glory. When you "make one to throw it away", you have just written and thrown away 8000 lines of code... if you think that's a waste of time, you are again wrong. This was 8000 lines more educational for me than rewriting 500 lines. It's simple math, really.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;lines written * rewrites = productivity score :P&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-6381087423003232026?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/6381087423003232026/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/05/make-one-to-throw-it-away.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/6381087423003232026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/6381087423003232026'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/05/make-one-to-throw-it-away.html' title='Make one to throw it away'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-4176661202341659747</id><published>2010-05-06T10:45:00.000-07:00</published><updated>2010-05-06T11:09:29.652-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>Processing.js casting bug</title><content type='html'>I have been working on &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/625-parse-error-with-the-following-code"&gt;processing.js bug #625&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;What's happening is there is some Java like code, that's being converted into JavaScript, so it can be run in a browser, and this bug deals with converting cast like syntax in java, into something usable in JavaScript.&lt;br /&gt;&lt;br /&gt;JavaScript is typeless, what is important about this is the types between variables don't matter (for the most part) so when I create a variable of an int, I just create a variable, and make it an int, and if I need to know the type of the variable, I can check the type of what's in the variable, which would be an int. Looking at &lt;a href="http://processing.org/reference/append_.html"&gt;p5 append()&lt;/a&gt;, is what the cast is being used for in this bug.&lt;br /&gt;&lt;br /&gt;"When using an array of objects, the data returned from the function must be cast to the object array's data type. For example: SomeClass[] items = (SomeClass[]) append(originalArray, element)."&lt;br /&gt;&lt;br /&gt;In pjs, I don't think the cast is even needed, as append just returns an array, this is the pjs append code:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    p.append = function(array, element) {&lt;br /&gt;      array[array.length] = element;&lt;br /&gt;      return array;&lt;br /&gt;    };&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Maybe p5 (the Java version of processing) has append returning an array list, which would require the cast.&lt;br /&gt;&lt;br /&gt;Either way, JavaScript does not need the cast.&lt;br /&gt;&lt;br /&gt;I removed the cast in the example, and it works, but the problem still remains with parsing the cast, as it's valid code. In p5 the cast still needs to be handled by the parser, cannot just remove it. There is a way to do this currently in the parser, but it will only parse out classes inside a list.&lt;br /&gt;&lt;br /&gt;One thing I could do is add "PVector" to the list of classes, which currently looks like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;var classes = ["int", "float", "boolean", "String", "byte", "double", "long", "ArrayList"];&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;then in this code:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    // Remove Casting&lt;br /&gt;    aCode = aCode.replace(new RegExp("\\((" + classes.join("|") + ")(\\[\\])*\\)", "g"), "");&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;It would find PVector, and remove the cast, without hurting anything else. Only problem I see in this is we'll have to add each and every pjs class to the list of classes, and if a new class is added to pjs, someone will have to remember to add the class to the list of classes. There must be a more dynamic way to accomplish this, which is what I want.&lt;br /&gt;&lt;br /&gt;I thought about possibly parsing any instance of \(/w+\) and check that the match in w+ is "typeof Object" or something along those lines. Then I could remove the list of classes all together. Yes, I will try that. Thanks for the help blog.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-4176661202341659747?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/4176661202341659747/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/05/processingjs-casting-bug.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/4176661202341659747'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/4176661202341659747'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/05/processingjs-casting-bug.html' title='Processing.js casting bug'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-7619495638165473032</id><published>2010-05-05T08:28:00.001-07:00</published><updated>2010-05-05T08:43:56.491-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>Building Firefox on Fedora</title><content type='html'>Today I went to set up a working Firefox build environment ON Linux Fedora. It was actually easier than I first felt. When I would run into an error message, I would google it, and get an answer usually saying to add modifications in the config file to pass over, or to include, or change the version of various products. &lt;br /&gt;&lt;br /&gt;Some of the problems:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Something called necko-wifi was not compatible, researching it I found I could just disable it in the mozconfig file by appending a line "ac_add_options --disable-necko-wifi". Solved, next error!&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Something called maemo was causing an error message, and researching that I found a similar solution that didn't work, to append "ac_add_options --with-maemo-version=5", fixed, but this caused other issues.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;I then found out, I could do a search for the missing files Firefox was complaining about using Fedora's "yum search 'name of file'" looking for something that looked like what was missing, and then "yum install 'file you found'" and crossed my fingers, would sometimes take a couple hits and misses before it would build, but after that each and every error was solved in that manner, including maemo.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;I have to say I'm liking Fedora a lot. I also found a neat trick using vim, where you can do ctrl-p while typing a word to finish it, or scroll through words kinda like auto-complete. Linux can pretty much do anything I would need now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-7619495638165473032?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/7619495638165473032/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/05/building-firefox-on-fedora.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/7619495638165473032'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/7619495638165473032'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/05/building-firefox-on-fedora.html' title='Building Firefox on Fedora'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-541439190072060797</id><published>2010-04-25T17:29:00.001-07:00</published><updated>2010-04-25T17:55:23.761-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>Solution to my last post.</title><content type='html'>In my last &lt;a href="http://scottdowne.blogspot.com/2010/04/copy-multidimensional-array-in-js.html"&gt;post&lt;/a&gt; I was trying to create a function that receives a multidimensional array inside parameters like (2, 4, 5) but with an infinite amount that could be passed in, and I was having problems with pass by reference, instead of pass by value.&lt;br /&gt;&lt;br /&gt;I fixed it, and came up with a very simple solution:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    p.ArrayList = function() {&lt;br /&gt;      var createArrayList = function(args){&lt;br /&gt;        var array = new Array();&lt;br /&gt;        for (var i = 0; i &lt; args[0]; i++){&lt;br /&gt;          array[i] = (args.length !== 1 ? createArrayList(args.slice(1)) : 0 );&lt;br /&gt;        }&lt;br /&gt;    &lt;br /&gt;        return array;&lt;br /&gt;      };&lt;br /&gt;      return createArrayList(Array.prototype.slice.call(arguments));&lt;br /&gt;    };&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I came across the problem of arguments only acting like an array, but not having access to many array like functions, like slice(). Solution.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Array.prototype.slice.call(arguments)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Array.prototype.slice gets the slice method from the Array object.&lt;br /&gt;call() allows you to call an object's function from the context of another object.&lt;br /&gt;and the slice method would be called, using the function definition attached to Array, like it was part of arguments, and just return a copy of the array's values, as an array. :D&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-541439190072060797?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/541439190072060797/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/04/solution-to-my-last-post.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/541439190072060797'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/541439190072060797'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/04/solution-to-my-last-post.html' title='Solution to my last post.'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-17269983828895673</id><published>2010-04-25T07:34:00.000-07:00</published><updated>2010-04-25T08:59:21.524-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>copy a multidimensional array in js.</title><content type='html'>I'm working on ticket &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/587-parraylist-should-work-for-more-than-3-dimensions"&gt;#587&lt;/a&gt;, for &lt;a href="http://processingjs.org/"&gt;processing.js&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;What I have to do is convert a custom ArrayList function to create a multidimensional array based on parameters passed in. For example:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;var array = new ArrayList(4, 5, 6);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;would create a 3D array, similar to:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;int[][][] array = new int[4][5][6]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This is what I've put together:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    p.ArrayList = function() {&lt;br /&gt;      var array = [],&lt;br /&gt;          tempArray = [];&lt;br /&gt;&lt;br /&gt;      for (var i = 0, aLength = arguments[arguments.length-1]; i &lt; aLength; i++){&lt;br /&gt;        array[i] = 0;&lt;br /&gt;      }&lt;br /&gt;        &lt;br /&gt;      for (var i = arguments.length-2; i &gt;= 0; i--){&lt;br /&gt;        tempArray = array.slice();&lt;br /&gt;        array = [];&lt;br /&gt;        for (var j = 0, aLength = arguments[i]; j &lt; aLength; j++){&lt;br /&gt;          array[j] = tempArray.slice();&lt;br /&gt;        }&lt;br /&gt;      }&lt;br /&gt;      return array;&lt;br /&gt;    };&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It starts at the back of the arguments, and copies the array recursively until it's done arguments[0], then returns the array.&lt;br /&gt;&lt;br /&gt;In JavaScript arrays are copied by reference, and not by value, but if you use array.slice() it creates a copy of the array's values, but not a copy of the array inside the array, those are still passed by reference. In other words, it only works for single, and 2D arrays, anything larger and you start getting arrays containing references to the same data, which is not good.&lt;br /&gt;&lt;br /&gt;I'm going to have to find a better way to do this, it must be recursive, and must be based on the number of arguments.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-17269983828895673?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/17269983828895673/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/04/copy-multidimensional-array-in-js.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/17269983828895673'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/17269983828895673'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/04/copy-multidimensional-array-in-js.html' title='copy a multidimensional array in js.'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-2571212110315136852</id><published>2010-04-21T18:22:00.000-07:00</published><updated>2010-04-21T18:34:19.967-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>OSD600 is over</title><content type='html'>After tomorrow, I'm done this semester, and the real test begins: will I continue blogging between OSD600 and OSD700. It's already been a week since my last post, but not because of being almost finished, but because of English assignments and exams, and right now I have a breather (I never study hard the night before the exam, I just make sure I didn't miss anything). I would like to say I'll continue blogging for as long as the internet lives, but time is a better test. I really do feel like I've found a great spot in open source, and I'll enjoy it while it lasts.&lt;br /&gt;&lt;br /&gt;Anyway, I've been trying to do at least one push to &lt;a href="https://processing-js.lighthouseapp.com"&gt;processing.js&lt;/a&gt; a day, while I study, big or small, at least one contribution.&lt;br /&gt;&lt;br /&gt;Over the last week though, I've really got into irc, and branched into a few of the other channels, which have a totally different atmosphere than the processing.js channel. I got involved in the open source vs proprietary argument, which despite being educational and funny, really is never solved. I've tried to get some to at least try it before they slag it, but I guess for some programming is for money *shrugs*. I've told them to at least take the osd600 class in the fall, because they are quite promising students, just bias and not willing to try certain things. I tried explaining that open source is a good way to get work experience to get those jobs that make all the money they keep talking about. For them to take OSD600, they wouldn't be programming for free, but for marks, and that's what they do in all their other classes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-2571212110315136852?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/2571212110315136852/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/04/osd600-is-over.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/2571212110315136852'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/2571212110315136852'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/04/osd600-is-over.html' title='OSD600 is over'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-8908673923030718492</id><published>2010-04-14T04:35:00.000-07:00</published><updated>2010-04-14T05:21:41.776-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>JavaScript this keyword</title><content type='html'>I know this this keyword's (in JavaScript) meaning changes depending on how it's called, considering this class:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;function Obj() {&lt;br /&gt;  this.item = "contents";&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;and using it like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;var obj = new Obj();&lt;br /&gt;obj.item += " of this.item"; // item now contains "contents of this.item"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;the this. keyword means the object only when it's called with new keyword, which declares it as an object.&lt;br /&gt;&lt;br /&gt;Now, if I am to change the object slightly, like so:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;function Obj() {&lt;br /&gt;  this.item = "contents";&lt;br /&gt;  var funct = this.funct = function(){&lt;br /&gt;    return this.item;&lt;br /&gt;  };&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I have two functions that should return the item inside the object. var funct should be usable inside the object, and this.funct should be usable outside the object, and do the same thing. Cept, when a function is created with var funct, the meaning of this. changes again. I'm not sure what it changes into, but in the above example, when I call funct() from inside the class, it returns "undefined". Everything makes sense, I'm just not sure what happens to this. in that crazy example. There is a way to fix this. You need to put the function inside of a closure, sending this, and using it as another word. For example:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;function Obj() {&lt;br /&gt;  this.item = "contents";&lt;br /&gt;  var funct = this.funct = (function(obj) { return function(){&lt;br /&gt;    return this.item;&lt;br /&gt;  };})(this);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;What this does is, instead of sending a function using the this. keyword inside, it creates an anonymous function, sending the object this, RENAMING it to obj, and returning a new function where this is changed to obj, hiding the double meaning of the this keyword, making it refer to the same thing no matter when and how it's called.&lt;br /&gt;&lt;br /&gt;I've been learning the meaning of this, and I thought I had it figured out. This just shows you can never know you know everything, only that you don't know everything, by learning something you didn't know :P&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-8908673923030718492?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/8908673923030718492/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/04/javascript-this-keyword.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/8908673923030718492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/8908673923030718492'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/04/javascript-this-keyword.html' title='JavaScript this keyword'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-323326194963252922</id><published>2010-04-12T01:47:00.001-07:00</published><updated>2010-04-12T02:00:13.327-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>with(this) { ... } // no more</title><content type='html'>&lt;a href="http://matrix.senecac.on.ca/~sdowne/processingjs/withNoMore/"&gt;Here&lt;/a&gt; is the source, and an example for &lt;a href="http://processingjs.org/"&gt;processing.js&lt;/a&gt; with "with(this) { ... }" removed.&lt;br /&gt;&lt;br /&gt;I was having issues using the new getters and setters. What was happening was considering this JavaScrpt class.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;function Foo() {&lt;br /&gt;  this.value = 0;&lt;br /&gt;  __defineGetter__('value', function()  { return this.value; });&lt;br /&gt;  __defineSetter__('value', function(x) { this.value = x;    });&lt;br /&gt;&lt;br /&gt;  this.getValue = function(){ return value; };&lt;br /&gt;  this.setValue = function(x) { value = x; };&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The this. keywords scope wasn't as intended. It was actually referring to the getter or setters, and not the object that uses it. I solved this by putting it into a closure, and passing the object I wanted the getters and setters to be added to, like so:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;function Foo() {&lt;br /&gt;  this.value = 0;&lt;br /&gt;  __defineGetter__('value', (function(obj) { return function()  { return obj.value; };})(this));&lt;br /&gt;  __defineSetter__('value', (function(obj) { return function(x) { obj.value = x;    };})(this));&lt;br /&gt;&lt;br /&gt;  this.getValue = function(){ return value; };&lt;br /&gt;  this.setValue = function(x) { value = x; };&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-323326194963252922?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/323326194963252922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/04/withthis-no-more.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/323326194963252922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/323326194963252922'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/04/withthis-no-more.html' title='with(this) { ... } // no more'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-4613836790303337902</id><published>2010-04-12T01:18:00.000-07:00</published><updated>2010-04-12T09:11:34.135-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>OSD600 release 0.3</title><content type='html'>I guess technically I'm late on this release, but these things happen when you're doing stuff with this ;)&lt;br /&gt;&lt;br /&gt;I have been back and forth on this private &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/133-private-keyword#ticket-133-9"&gt;ticket&lt;/a&gt; for while, trying different things, doing research, and then finally worked with &lt;a href="http://vocamus.net/dave/"&gt;Dave&lt;/a&gt; to get it perfect. I did get lots done on it, even thought it's not all going to be used, I consider the research and work I did to be part of my 0.3. &lt;a href="http://scottdowne.blogspot.com/2010/04/withthis-no-more.html"&gt;Here&lt;/a&gt; is a post on what me and Dave worked on, and this is a better foundation for future work in the class parser.&lt;br /&gt;&lt;br /&gt;I also worked with &lt;a href="http://asalga.wordpress.com/"&gt;Andor Salga&lt;/a&gt;. One of his 3D examples had a silly parser error, so I filed a &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/549-function-parameter-newlines"&gt;ticket&lt;/a&gt; and fixed it. It was up for review, but I had to back up because it was relying on code from a previous fix that's not going in. It was a simple parser fix, so it won't be hard for me to re implement it when the time comes. Also, Andor has a way around it, so his 3D example does work now. &lt;a href="http://processing.org/learning/3d/birds.html"&gt;This&lt;/a&gt; is the example he was working with, if anyone is interested.&lt;br /&gt;&lt;br /&gt;I was able to fix, and not have to back up ticket &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/536-returning-array-of-floats-breaks-parser"&gt;#536&lt;/a&gt; and it's awaiting review.&lt;br /&gt;&lt;br /&gt;I have learned one very important lesson; if two, or more bugs reside in the same spot in the code, I should consider keeping them in the same ticket, then I wouldn't of had the problems I'm having with ticket #133, mainly, having to revert a bunch of my "peer review requested". Really though, with the getters and setter, these are all going to be easy to refix (also, because I've already fixed them).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-4613836790303337902?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/4613836790303337902/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/04/osd600-release-03.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/4613836790303337902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/4613836790303337902'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/04/osd600-release-03.html' title='OSD600 release 0.3'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-7457207997887711507</id><published>2010-04-09T21:44:00.000-07:00</published><updated>2010-04-09T21:53:26.491-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>processing.js private and public finally working, I think</title><content type='html'>I think I have finally finished &lt;a href="http://processingjs.org/"&gt;processing.js&lt;/a&gt; ticket &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/133-private-keyword"&gt;#133&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;A simple &lt;a href="http://matrix.senecac.on.ca/~sdowne/processingjs/shiffman/example2.html"&gt;test&lt;/a&gt; to see it.&lt;br /&gt;&lt;br /&gt;And a cool &lt;a href="http://matrix.senecac.on.ca/~sdowne/processingjs/shiffman/example.html"&gt;example&lt;/a&gt; that uses public variables. This particular test program was giving me the most difficulties while I was coding. It seemed whenever I would run the automated tests, this one would always have a new problem, and it also happens to be a long test, so it's harder to debug, so to be able to edit it and change the example is satisfying.&lt;br /&gt;&lt;br /&gt;I just need to write some clear, simple, and thorough test cases for private and public use, and I'll be done.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-7457207997887711507?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/7457207997887711507/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/04/processingjs-private-and-public-finally.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/7457207997887711507'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/7457207997887711507'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/04/processingjs-private-and-public-finally.html' title='processing.js private and public finally working, I think'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-4872466862929600666</id><published>2010-04-08T20:48:00.000-07:00</published><updated>2010-04-08T21:08:29.685-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>I love you word boundary.</title><content type='html'>A word boundary is, other than my savior, a regular expression match that matches the tiny, invisible space between a word character (a-zA-Z0-9_) and a non-word character.&lt;br /&gt;&lt;br /&gt;You use it with \b and \B (\B matching a non-word boundary, same as [^\b])&lt;br /&gt;&lt;br /&gt;Example: "this is some text" with the regular expression \bs. This would only match the "s" in "some" because there is a non word character before the s. Also, if you did s\b it would match the "s" in "this" because it's before a non word character. Finally, \Bs would match "this" and "is" and s\B would match "some". I hope that all made sense.&lt;br /&gt;&lt;br /&gt;I needed this in a particular problem where I had to parse some code, and catch any specific words, globally. The problem was, when I checked for a match (previously) I was checking for (\W) which is a non word character, then check for my matching word, so if I was looking for all instances of "scott" I would not want to catch "scotty" as in this case, would be a different variable. So, /(\W)(scott){\W)/g, problem with this is, it would "eat" the leading and trailing characters, making any other matches in the string not check the leading and trailing characters again.&lt;br /&gt;&lt;br /&gt;By using \b, I was able to check what I needed, without "eating" the leading and trailing characters.&lt;br /&gt;&lt;br /&gt;If anyone is curious, the final product looks like so:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;      // add this. to public variables used inside member functions, and constructors&lt;br /&gt;      if (publicVars) {&lt;br /&gt;        // Search functions for public variables&lt;br /&gt;        for (var i = 0; i &lt; methodsArray.length; i++) {&lt;br /&gt;          methods += methodsArray[i].replace(/(addMethod.*?\{)([\s|\S]*\}\);)/g, function(all, header, body) {&lt;br /&gt;            return header + body.replace(new RegExp("(\\.)?\\b(" + publicVars.substr(0, publicVars.length-1) + ")\\b", "g"), function (all, first, variable) {&lt;br /&gt;              if (first === ".") {&lt;br /&gt;                return all;&lt;br /&gt;              } else {&lt;br /&gt;                return "this." + variable;&lt;br /&gt;              }&lt;br /&gt;            });&lt;br /&gt;          });&lt;br /&gt;        }&lt;br /&gt;        // Search constructors for public variables&lt;br /&gt;        constructors = constructors.replace(new RegExp("(var\\s*?|\\.)?\\b(" + publicVars.substr(0, publicVars.length-1) + ")\\b", "g"), function (all, first, variable) {&lt;br /&gt;          if (/var\s*?$/.test(first) || first === ".") {&lt;br /&gt;            return all;&lt;br /&gt;          } else {&lt;br /&gt;            return "this." + variable;&lt;br /&gt;          }&lt;br /&gt;        });&lt;br /&gt;      }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Obviously, there is code before and after, with declared variables, but just use your imagination ;) and I'm still looking for bug, but feel free to scrutinize my code.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-4872466862929600666?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/4872466862929600666/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/04/i-love-you-word-boundary.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/4872466862929600666'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/4872466862929600666'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/04/i-love-you-word-boundary.html' title='I love you word boundary.'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-6338224145658593180</id><published>2010-04-07T11:45:00.000-07:00</published><updated>2010-04-07T12:32:00.168-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>Stuck on Processing.js private and public variables</title><content type='html'>It's been awhile since I posted, but I needed to create some time, which meant moving things around.&lt;br /&gt;&lt;br /&gt;Warning, this may seem more like a rant, or crazy ramblings than a normal blog post. I'm just going to write it all down, in hopes that it helps me better understand all that I'm dealing with.&lt;br /&gt;&lt;br /&gt;Alright, to start off I'm working on &lt;a href="http://processingjs.org/"&gt;processing,js&lt;/a&gt;, specifically &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/133-private-keyword"&gt;ticket #133&lt;/a&gt; (still). It didn't seem hard at first, and I had a lot of initial success, but as I went deeper, I kept finding more and more. This has really taken a lot to get right.&lt;br /&gt;&lt;br /&gt;What I'm trying to accomplish, is to grab a class, so I can work with, and parse just the class, as to not parse non class related code. Once I'm in the class, I want to grab and remove the class functions, and constructors for later use, I don't want to be parsing "var i" that is contained in a function, into a private variable. Outside the function, anything that's private, is private, and public is public, but by default, it should be public. This is why I cannot be parsing functions and constructors, but I also have to know what's public, and what's private by the time I work with the functions and constructors, because when a public variable is used in a function or constructor, I need to add a "this." in front of it.&lt;br /&gt;&lt;br /&gt;I think some day, hopefully soon, all this class parsing code should have a major overhaul, as I keep coming to code that I don't see any use for, but I'm not comfortable removing it yet. I'm starting to fix things, and as I do, other areas should be removed. I think that would be better suited for a separate bug once I got private and public working.&lt;br /&gt;&lt;br /&gt;I did take an attempt at overhauling the class parsing, but I'm conflicted if I should just redo it, and go from there, or if I should use what's already there. I believe most would say not to redo it, but it's still tempting.&lt;br /&gt;&lt;br /&gt;Right now, I'm dealing with some code that's being "left behind" as I move parts of the class up, and other parts down. I know that classes with a constructor is parsed separately than a class without a constructor, but I don't think we should be doing this. What we should do is, open the class up, from top brace to bottom brace, and deal with any constructors contained within, as we get to them. This also has the advantage of not needing constructors to be declared first thing, and any member variables can also be declared anywhere. I've made a work around for this, but now I think it's causing my "code left behind" problem, as the code left behind is either the class declaration, or a constructor declaration. For example, imagine a class called Place, when I parse it, I'm left with a line of code like this "processing.Place = function" I think it's a case of a regex somewhere just working with what's between the {} and not what's also in front of it.&lt;br /&gt;&lt;br /&gt;Another issue that was solved about a day ago, is private and public functions, being declared with a custom "addMethod()" function, which for the longest time made no sense to me, and I hated it. I have since understood it, and although I still don't like it much, I see the need and don't want to remove it. This function wants an object, a String, and a function as it's parameters, and it will then create a function, with that name, and add it to the object you send, also allowing for overloading (the reason why it's there, is for overloading) I was stuck figuring out how to add a function to this. without making it public. I would send "this" as the object, into addMethod, I thought about intercepting it, and making private functions separately, but then we would be left with separate code for public functions, and private functions, not very ideal. I decided on adding a private object called private to the scope of the class, then when I want to add a function to the private scope, instead of sending "this" I would send my "private" object. The caveat with this is I now have to parse the functions and constructors in the class for any use of a private function, and add "private." in front of it, much like how I add "this." to public variables.&lt;br /&gt;&lt;br /&gt;The other option would be to add a "with(this){with(private){ .. }}" around all the code. This would check all variable and function calls if it's inside private (which I would create as "var private = {}"), if not, it would then check if it exists inside this, the problem is, if it doesn't exist inside private, or this, it would be created as a global variable, I think, possibly overwritting any global instances of that variable already defined. Processing.js already uses "with(this) { .. }", and I'm trying to remove it, with moderate success, but it's extremely helpful in this case, and is the difference between 2 lines of code, vs 50 lines of code (I may be exaggerating, as I have not counted which lines are new, and which are being left, or modified, but it's a lot). I plan on talking to &lt;a href="http://vocamus.net/dave/"&gt;David Humphrey&lt;/a&gt; in person about possibly, continuing the use of "with()" even with the dangers involved.&lt;br /&gt;&lt;br /&gt;I have to admit, this has been quite challenging, and I'm getting kinda frustrated with it, but I guess that's a good thing? *shrugs*&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-6338224145658593180?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/6338224145658593180/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/04/stuck-on-processingjs-private-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/6338224145658593180'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/6338224145658593180'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/04/stuck-on-processingjs-private-and.html' title='Stuck on Processing.js private and public variables'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-6317227492070709634</id><published>2010-03-30T20:34:00.000-07:00</published><updated>2010-03-30T20:49:14.170-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>public and private in JavaScript</title><content type='html'>In order to enjoy programming in JavaScript you have to be at least a little crazy. Take this for example:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;function Obj() {&lt;br /&gt;  var private = {};&lt;br /&gt;&lt;br /&gt;  this.publicVar = "inside";&lt;br /&gt;  private.privateVar = "inside";&lt;br /&gt;  this.getPublic = function() {with(this){with(private){&lt;br /&gt;    return publicVar;&lt;br /&gt;  }}};&lt;br /&gt;  this.getPrivate = function() {with(this){with(private){&lt;br /&gt;    return privateVar;&lt;br /&gt;  }}};&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This is, I think, the complete way to emulate Java objects with private and public usage. All other ways are close, but always lack some little oddity that makes it less than pure. Another good thing about this method is it's easily created after parsing Java-like code.&lt;br /&gt;&lt;br /&gt;Take this usage for the above object:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;var obj = new Obj();&lt;br /&gt;alert(obj.getPublic());     // should alert inside&lt;br /&gt;alert(obj.publicVar);       // should alert inside&lt;br /&gt;obj.publicVar = "outside";&lt;br /&gt;alert(obj.publicVar);       // should alert outside&lt;br /&gt;alert(obj.getPublic());     // should alert outside&lt;br /&gt;&lt;br /&gt;alert(obj.getPrivate());    // should alert inside&lt;br /&gt;alert(obj.privateVar);      // should alert undefined&lt;br /&gt;obj.privateVar = "outside";&lt;br /&gt;alert(obj.privateVar);      // should alert outside&lt;br /&gt;alert(obj.getPrivate());    // should alert inside&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now, I think I've thought of everything, and everything else, but if anyone out there can break this, or find a shortcut, or challenge it in another means, I would be very grateful. Note, if you want to try breaking it, you don't have to understand the class itself, just how to use it, like I did in the second example.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-6317227492070709634?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/6317227492070709634/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/03/public-and-private-in-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/6317227492070709634'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/6317227492070709634'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/03/public-and-private-in-javascript.html' title='public and private in JavaScript'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-4639934681425053866</id><published>2010-03-29T17:28:00.000-07:00</published><updated>2010-03-29T18:15:49.152-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>blog post patch</title><content type='html'>Ok, I wasn't 100% correct in my last &lt;a href="http://scottdowne.blogspot.com/2010/03/processingjs-public-members-public-to.html"&gt;post&lt;/a&gt;. There was something I didn't consider.&lt;br /&gt;&lt;br /&gt;Where I said:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Considering this class:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;class Obj {&lt;br /&gt;  private String item;&lt;br /&gt;  public void setItem(String str) {&lt;br /&gt;    item = str;&lt;br /&gt;  }&lt;br /&gt;  public String getItem() {&lt;br /&gt;    return item;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;and consider this usage:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Obj thing = new Obj();&lt;br /&gt;thing.setItem("this has been set");&lt;br /&gt;println(thing.getItem()); // prints "this has been set"&lt;br /&gt;println(thing.item); // prints undefined, as it's not been used yet&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Everything working as intended, until I try this:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;thing.item = "if you see this, it's broken";&lt;br /&gt;println(thing.getItem()) // prints "if you see this, it's broken" :(&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I was wrong, that should work as I originally had hoped, but what was happening was &lt;a href="http://processingjs.org/"&gt;processing.js&lt;/a&gt; would wrap it inside a with(this){...} function, which I'm still looking into, but it was doing things that I figured was just normal JavaScript, so I over looked it.&lt;br /&gt;&lt;br /&gt;Here are some comparing classes, to illustrate what I mean:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;// What should, and does work as intended.&lt;br /&gt;function Obj() {&lt;br /&gt;  var privateMember = "hidden";&lt;br /&gt;  this.getMember = function() {&lt;br /&gt;    return privateMember;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;var obj = new Obj();&lt;br /&gt;alert(obj.getMember()); // alerts "hidden"&lt;br /&gt;obj.privateMember = "not hidden";&lt;br /&gt;alert(obj.getMember()); // alerts "hidden" :D&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now, what processing.js does:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;// Does not work as intended.&lt;br /&gt;function Obj() { with (this) { // This is the only change&lt;br /&gt;  var privateMember = "hidden";&lt;br /&gt;  this.getMember = function() {&lt;br /&gt;    return privateMember;&lt;br /&gt;  }&lt;br /&gt;}}&lt;br /&gt;var obj = new Obj();&lt;br /&gt;alert(obj.getMember()); // alerts "hidden"&lt;br /&gt;obj.privateMember = "not hidden";&lt;br /&gt;alert(obj.getMember()); // alerts "not hidden" :(&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now, why not yank "with(this){...}" right out of there? I don't know what it's doing, yet. More on that later. But I'm hopeful to say I have a pretty solid direction.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-4639934681425053866?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/4639934681425053866/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/03/blog-post-patch.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/4639934681425053866'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/4639934681425053866'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/03/blog-post-patch.html' title='blog post patch'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-6969753935857275480</id><published>2010-03-29T12:27:00.000-07:00</published><updated>2010-03-29T13:47:39.563-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>processing.js public members public to everyone but itself</title><content type='html'>Ok, here's what I'm doing. I'm trying to implement the &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/133-private-keyword"&gt;private/public&lt;/a&gt; keywords for &lt;a href="http://processingjs.org/"&gt;processing.js&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And here are the problems. First attempt was ages ago, and that was to, inside a class, use this.variable; for public, and var variable; for private. This sort of worked, as it allowed me to use public members freely inside and outside the object, and I could not access private members, until they were set from outside the object. &lt;br /&gt;&lt;br /&gt;Considering this class:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class Obj {&lt;br /&gt;  private String item;&lt;br /&gt;  public void setItem(String str) {&lt;br /&gt;    item = str;&lt;br /&gt;  }&lt;br /&gt;  public String getItem() {&lt;br /&gt;    return item;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;and consider this usage:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Obj thing = new Obj();&lt;br /&gt;thing.setItem("this has been set");&lt;br /&gt;println(thing.getItem()); // prints "this has been set"&lt;br /&gt;println(thing.item); // prints undefined, as it's not been used yet&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Everything working as intended, until I try this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;thing.item = "if you see this, it's broken";&lt;br /&gt;println(thing.getItem()) // prints "if you see this, it's broken" :(&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It's not very useful if private is restrictive but not protective. I thought the whole purpose was to protect you, the person using the object, from themselves, and not just restrict them from, themselves.&lt;br /&gt;&lt;br /&gt;Anyway, I wasn't done there. I spent this weekend rewriting the way processing.js translates a class. I was changing it so when you created an object, instead of returning an object, I would call a function that would set all the private members and functions, then return an object literal that would contain all the public variables and functions, which had access to the members in the preceding function, but those members no longer existed, and it worked! Here is an example of what I mean:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;function Obj() {&lt;br /&gt;  var privateVariable = "It's a secret to everybody";&lt;br /&gt;  function privateFunction() {&lt;br /&gt;    ...&lt;br /&gt;  }&lt;br /&gt;  return {&lt;br /&gt;    publicVariable: "...",&lt;br /&gt;    publicFunction: function() { return privateVariable; }&lt;br /&gt;  };&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Usage of this is like so:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;var obj = new Obj();&lt;br /&gt;alert(obj.publicVariable); // alertss "..."&lt;br /&gt;alert(obj.publicFunction()); // alerts "It's a secret to everybody"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Everything as expected until I try this... Consider this modified class:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;function Obj() {&lt;br /&gt;  return {&lt;br /&gt;    publicVariable: "...",&lt;br /&gt;    publicFunction: function() { return publicVariable; }&lt;br /&gt;  };&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;and this usage:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;var obj = new Obj();&lt;br /&gt;alert(obj.publicFunction()); // crashes&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So now, a private member is private to everyone but itself, which is good, and a public member is public to everyone... but itself. Two solutions, with two completely opposite caveats.&lt;br /&gt;&lt;br /&gt;Final though: while writing this, I was thinking, and organizing my thoughts (kinda the point of blogging, for me) and I have two options I need to explore.&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Change the public functions to use public variables with a "this." before it. Example:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;  return {&lt;br /&gt;    publicVariable: "...",&lt;br /&gt;    publicFunction: function() { return this.publicVariable; }&lt;br /&gt;  };&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This works, but isn't very practical as I'm translating Java-like class syntax into the javascript you see now, and I don't want to go through all the code, just the structure; this method would require looking for the usage of all public variables, once I have a list of public variables, and add "this.". Not ideal.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Another option, which I'll try, is to add a list of public variables at the top of the code inside a function, like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;  return {&lt;br /&gt;    publicVariable: "...",&lt;br /&gt;    publicFunction: function() { var publicVariable = this.publicVariable; return publicVariable; }&lt;br /&gt;  };&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Passes the public variable inside this, into a new variable with said name, so I don't have to touch the code inside the function, just add a header of sorts. I would have to do this with functions too.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-6969753935857275480?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/6969753935857275480/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/03/processingjs-public-members-public-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/6969753935857275480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/6969753935857275480'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/03/processingjs-public-members-public-to.html' title='processing.js public members public to everyone but itself'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-5095739601989088941</id><published>2010-03-28T11:42:00.000-07:00</published><updated>2010-03-28T12:22:21.289-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>JavaScript and multiline regular expressions</title><content type='html'>Just something I would like to share, because it was causing me grief :P.&lt;br /&gt;&lt;br /&gt;While working on parsing a Java-like class into a JavaScript class, for &lt;a href="http://processingjs.org/"&gt;processing.js&lt;/a&gt;. I needed to grab all member variables that are marked as public, using a regular expression, and return them as an object literal. Given this as an example:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public String thingOne;&lt;br /&gt;public String thingTwo;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Into this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;{&lt;br /&gt;  thingOne: null,&lt;br /&gt;  thingTwo: null&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This is what I ended up doing:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;      middle = middle.replace(/(?:(private|public)\s+)?(var[\s|\S]*?;)/g, function(all, access, variable) {&lt;br /&gt;        if (access === "private") {&lt;br /&gt;          return variable;&lt;br /&gt;        } else {&lt;br /&gt;          variable = variable.replace(/,\s*/g, ";\nvar ");&lt;br /&gt;          publicVars += variable.replace(/(?:var\s+)?(\w+)\s*=?\s*([^;,]*)(?:;)?/g, function(all, name, value) {&lt;br /&gt;            if (value) {&lt;br /&gt;              return "\n" + name + ": " + value + ",";&lt;br /&gt;            } else {&lt;br /&gt;              return "\n" + name + ": null,";&lt;br /&gt;            }&lt;br /&gt;          });&lt;br /&gt;          return "";&lt;br /&gt;        }&lt;br /&gt;      });&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now don't worry too much about that, just a short background of what I was doing to bring me to the problem. Multiline regular expressions in Javascript.&lt;br /&gt;&lt;br /&gt;From my favourite Javascript regex &lt;a href="http://www.evolt.org/regexp_in_javascript"&gt;resource&lt;/a&gt; "Multiline Input 'm' This flag makes the beginning of input (^) and end of input ($) codes also catch beginning and end of line respectively.". It does NOT do what you would expect, it simply allows code like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;String one;&lt;br /&gt;String two;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;to match both lines with this /^String/gm. Without m, String two; would not match as it does not start at the beginning of the line, but after a \n. Another way to look at it is, m changes the meaning of ^ and $ to also match \n and \r (\r being carriage return). JavaScript regular expression is already multiline, in a way, as all lines are actually one long line with newline characters.&lt;br /&gt;&lt;br /&gt;What I wanted to do was match any instance of "var (bunch of stuff) ;" spanning multiple lines. To grab examples like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public String thingOne,&lt;br /&gt;  thingTwo;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;What I was using was something like this /var.*?;/g grabbing anything between var and ;, including whitespace and newlines? right? Nope, apparently not.&lt;br /&gt;&lt;br /&gt;There was a trick I found to solve this. /var[\s|\S]*?;/ This uses \s which is any whitespace, including newline, OR \S which is anything NOT a white space, this is the TRUE anything, and a neat little trick.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-5095739601989088941?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/5095739601989088941/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/03/javascript-and-multiline-regular.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/5095739601989088941'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/5095739601989088941'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/03/javascript-and-multiline-regular.html' title='JavaScript and multiline regular expressions'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-2383814738382939891</id><published>2010-03-24T05:22:00.000-07:00</published><updated>2010-03-24T06:11:26.956-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>morning train ride tangent</title><content type='html'>This morning, on the train, I wanted to open up &lt;a href="http://processingjs.org/"&gt;processing.js&lt;/a&gt; and get back to working on &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/237-custom-classes-not-handled-properly"&gt;ticket #237&lt;/a&gt;. I got into it, earlier and reproduced all the problems that the ticket entails. We have empty classes with no methods or constructors not working, we have constructors following methods working, but the methods above the constructor not working, and we have the hardest problem in overloading only working in terms of number of arguments, and not types of arguments. What I mean is:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;void addItem(int item){...}&lt;br /&gt;void addItem(String item){...}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This is valid processing, because the two methods are different, but, in JavaScript, variable types are not important, and the above code will be translated into:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;var addItem = function(var item){...};&lt;br /&gt;var addItem = function(var item){...};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The methods are translated into the same method, this also does not work with constructors either, which is a different problem because the way processing.js handles consturctors. What processing.js does is, because you can send any number of arguments into a method or constructor, and access the variable by using arguments[n], in a for loop less than arguments.length. This is how constructor overloading is handled in processing.js. There is only one real constructor, it just has if statements checking how many arguments there are. Here is an example for how processing.js translates a class:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class Obj{&lt;br /&gt;  Obj(String item){&lt;br /&gt;    item = "in constructor one";&lt;br /&gt;  }&lt;br /&gt;  Obj(int item, String item2){&lt;br /&gt;    item = "in constructor two";&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;into this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;function Obj() {with(this){&lt;br /&gt; if ( arguments.length === 1 ) {&lt;br /&gt; var item = arguments[0];&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    item = "in constructor one";&lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  if ( arguments.length === 2 ) {&lt;br /&gt; var item = arguments[0];&lt;br /&gt; var  item2 = arguments[1];&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    item = "in constructor two";&lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If you notice, it's just one method that filters out the contents of the constructor into various if statements, but it's only the length of the arguments, and not the types. What I would need to do is grab the types before the types are lost, and then add a type check for all variables at the same time I check the argument length, but methods are not like this.&lt;br /&gt;&lt;br /&gt;Funny thing is, while researching this, I came across &lt;a href="http://ejohn.org/blog/javascript-method-overloading/"&gt;this&lt;/a&gt; blog post, and as soon as I saw the code, I recognized it. This is John Resig's &lt;a href="http://ejohn.org/blog/"&gt;blog&lt;/a&gt;, and he is the creator of processing.js, and his post helped me a lot with how to understand the addMethod, method, and the caveats involved.&lt;br /&gt;&lt;br /&gt;Ah shoot, I got off on another tangent. Ok, While I was planning on doing this ticket I have been talking about up to this point on the train, I ended up seeing something in code that made me go back to my last &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/440-syntax-error-with-declared-typed-array-init"&gt;ticke&lt;/a&gt; on array initialization. I noticed, later in the code, the use of ArrayList() for more than just creating an array, but initializing. I still cannot get it to initialize the array, but I've spend an unexpected morning on this. The idea of ArrayList is to send a size for the array, to create it, but all the values will be empty. Like so:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;new ArrayList(2); // creates an arraylist with 2 empty items&lt;br /&gt;new ArrayList(2, 2);  // creates a 2D arraylist with an array of two, with two empty items&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I saw later in the code something like this&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;new ArrayList(["Thing 1", "Thing 2"]); // apparently, this is creating and initializing an arraylist&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Like I said, I didn't (yet) get this to work, but I think it would improve the way it's already being done, with just the array like this: &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;var things = ["Thing 1", "Thing 2"];&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I should get this wrapped up into:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;var things = new ArrayList(["Thing 1", "Thing 2"]); // this would be ideal&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;My train ride tests did not work, but I'm going to reduce it more and see why. First I should get arraylist initialization to work. period. Then I will attempt to add it into processing.js. Anyway, that's all for today.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-2383814738382939891?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/2383814738382939891/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/03/morning-train-ride-tangent.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/2383814738382939891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/2383814738382939891'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/03/morning-train-ride-tangent.html' title='morning train ride tangent'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-4832686216585968165</id><published>2010-03-23T19:08:00.000-07:00</published><updated>2010-03-24T05:22:25.450-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>Processing.js array initialization</title><content type='html'>Just the other day I fixed a bug for &lt;a href="http://processingjs.org/"&gt;processing.js&lt;/a&gt;, where creating an array and initializing it at the same time would crash the parser. What was happening was, code like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;float[] baz;&lt;br /&gt;baz = new float[] {1.0, 2.5};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;when parsed, "new float[]" would be converted to "new ArrayList[]" then "{1.0, 2.5};" would get tacked onto the end, and it shouldn't. "new ArrayList[]" is only for creating an empty array, without initializing it. If you want to initialize, you want the JavaScript to look like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;baz = [1.0, 2.5];&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;notice how I no longer use new ArrayList. ArrayList just isn't setup for initialization that I could see, but the above method works.&lt;br /&gt;&lt;br /&gt;Anyway, I got all this working fine and dandy &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/440-syntax-error-with-declared-typed-array-init"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;When the parser came across something with the word "new\s(\w)" which translates to "new" + whitespace + any word, it would package it all up, what I did was added a check for the array contents, ie. everything inside {} it even worked for 2D arrays and beyond. I would then simply replace the whole thing with the array initialization, and later in the parser it would be changed from {} to []. So, whatever the array was, {{1.2, 2.1}, {7.6, 8.8}} for a 2D array, would just replace all {}'s with []. The problem was, and I didn't notice this until after the patch was submitted, noticed it on the train ride home, was that two arrays can be declared on one line. Sometimes things like this just slip everyone's minds, there are so many ins and outs of a language, and to translate one language to another you have to have good attention to detail. So, something like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;baz = new float[][] {{1.0, 2.0}, {3.0, 4.0}}; baz2 = new float[][] {{1.0, 2.0}, {3.0, 4.5}};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;would break my fix. It would gobble up the whooole thing into one, and the second "new" would get lost, and cause a syntax error. the fix was pretty easy, and I fixed it one the same train I thought of it on. All I had to do was eat all {}'s and everything inside of them until I hit the semi-colon, then stop! the stop is important, and the part I was lacking before. Before I would gobble it all up until I hit the last semi-colon, so, it was greedy.&lt;br /&gt;&lt;br /&gt;Here is the &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/471-two-array-initializations-on-the-same-line#ticket-471-2"&gt;fix&lt;/a&gt;. Also, I'll be fitting this work into my 0.2 release as it's so very close.&lt;br /&gt;&lt;br /&gt;Something else I noticed today (hijacking my own blog post here) working in Processing.js has a pretty big advantage over working in other open source projects. We are a community of developers, so when someone finds a bug, half the time, most of the work in finding the bug is done for us, because the person that found the bug can read the code, and reduce it to a acceptable level of code. But, in a project like Firefox, when a user finds a bug, it might just be a description of what they were doing at the time, and that it crashed. Which is an interesting aspect maybe some of the other members of the processing.js team might not of considered, yet.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-4832686216585968165?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/4832686216585968165/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/03/just-other-day-i-fixed-bug-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/4832686216585968165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/4832686216585968165'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/03/just-other-day-i-fixed-bug-for.html' title='Processing.js array initialization'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-5200578639553324801</id><published>2010-03-19T04:17:00.000-07:00</published><updated>2010-03-19T12:06:21.272-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>0.2</title><content type='html'>&lt;h2&gt;Intro&lt;/h2&gt;&lt;br /&gt;This release has been weird. My main, original tickets &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/230-mouse-scroll-wheel-support"&gt;230&lt;/a&gt; and &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/133-private-keyword"&gt;133&lt;/a&gt; for this release were not as expected.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Problems and Challenges&lt;/h2&gt;&lt;br /&gt;&lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/230-mouse-scroll-wheel-support"&gt;230&lt;/a&gt; already existed, but just didn't have any life, I just needed to breathe some life into it by writing some code to show it works, it was more of a documentation issue. The ticket is still awaiting review. I felt out of place with this one, and still do. I had a lot of fun writing it, and even more fun creating this &lt;a href="http://matrix.senecac.on.ca/~sdowne/processingjs/scrollWheelFun/example.html"&gt;example&lt;/a&gt;, but the fact that my code isn't really going to be added, just, feels weird. What I think would be best, and I'll push for this when the time comes. In the original &lt;a href="http://processing.org/"&gt;processing&lt;/a&gt; there is a place on their website for &lt;a href="http://processing.org/hacks/"&gt;hacks&lt;/a&gt;, basically, lists features, and shows examples, of things that can be done with processing through the use of java, that was not intended. What could happen in &lt;a href="http://processingjs.org/"&gt;processing.js&lt;/a&gt; is sort of the same thing, a place on the website, that documents all the hacks that can be used, through the use of JavaScript inside the processing.js code, and this would be a big job, but something that should probably be done much later, maybe even after 1.0 of processing.js has been released. Until then, I feel like my &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/230-mouse-scroll-wheel-support"&gt;230&lt;/a&gt; creation is a lost soul.&lt;br /&gt;&lt;br /&gt;My other main ticket, ticket &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/133-private-keyword"&gt;#133&lt;/a&gt; also had issues. In the past I struggled with getting the private keyword to work on member functions, but the way processing.js created member functions, through using an addMember function, caused me issues. I would have to intercept the the addMember function, and create it my way. Although, &lt;a href="http://vocamus.net/dave/"&gt;Dave&lt;/a&gt;, was showing a &lt;a href="http://matrix.senecac.on.ca/~sdowne/processingjs/JavaScript/counter.html"&gt;trick&lt;/a&gt; in JavaScript, on how to make classes, with members, and it seemed to make a lot of sense. This is the code.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;  var counter = (function (){&lt;br /&gt;    var c = arguments[0];&lt;br /&gt;    var i = arguments[1];&lt;br /&gt;&lt;br /&gt;    return {&lt;br /&gt;      increase: function(){c+=i;},&lt;br /&gt;      getValue: function(){return c;}&lt;br /&gt;    };&lt;br /&gt;  })(1, 2);&lt;br /&gt;&lt;br /&gt;  counter.increase();&lt;br /&gt;  alert(counter.getValue());&lt;br /&gt;&lt;br /&gt;  counter.increase();&lt;br /&gt;  alert(counter.getValue());&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Also, I have mentioned before, that &lt;a href="http://weare.buildingsky.net/"&gt;Corban Brook&lt;/a&gt; is working on ticket &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/237-custom-classes-not-handled-properly"&gt;#237&lt;/a&gt; and talked about restructuring the way classes are parsed. I've been holding off working on ticket &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/133-private-keyword"&gt;#133 prviate keyword&lt;/a&gt; because of possible changes.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Specifications&lt;/h2&gt;&lt;br /&gt;What I did do for 0.2:&lt;br /&gt;The main one, was the &lt;a href="http://matrix.senecac.on.ca/~sdowne/processingjs/scrollWheelFun/example.html"&gt;example&lt;/a&gt; used for &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/230-mouse-scroll-wheel-support"&gt;230&lt;/a&gt;, and the ticket itself.&lt;br /&gt;&lt;br /&gt;I also did three little ones to to supplement this release.&lt;br /&gt;Tickets:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/382-date-and-month"&gt;#382&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/411-parser-breaks-on-arrays-declarations-that-have-a-space-between-and"&gt;#411&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/351-tabs-break-code"&gt;#351&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;I've done some review of other tickets, and found a &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/183-splittokens-returning-undefined"&gt;ticket&lt;/a&gt; that was fixed from my 0.1 that I didn't see. All easy stuff, but it adds up, and still must be done right.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Conclusion&lt;/h2&gt;&lt;br /&gt;This release has been very different than my &lt;a href="http://scottdowne.blogspot.com/2010/02/processingjs-01-release.html"&gt;last&lt;/a&gt; in terms of the work done, and I spent a lot less time trouble shooting, and more time creating tests and examples. I am still finding my groove. Finally, &lt;a href="http://weare.buildingsky.net/"&gt;Corban&lt;/a&gt; said I could take a stab at ticket &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/237-custom-classes-not-handled-properly"&gt;#237&lt;/a&gt;, I will probably do that and my private keyword at the same time, for my 0.3, and still try to get my regex parser fit in somehow, it shouldn't be a problem as it's really only two tickets, and all related to parsing, stuff I've been doing since the beginning of my stay here :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-5200578639553324801?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/5200578639553324801/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/03/02.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/5200578639553324801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/5200578639553324801'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/03/02.html' title='0.2'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-4244248519084260961</id><published>2010-03-16T17:42:00.000-07:00</published><updated>2010-03-16T21:05:40.034-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>Quick little fix</title><content type='html'>Yesterday, while cruising the &lt;a href="http://processingjs.org/"&gt;processing.js&lt;/a&gt; bug tracking website &lt;a href="https://processing-js.lighthouseapp.com/projects/41284-processingjs/overview"&gt;lightouse&lt;/a&gt; looking at the open tickets, and seeing what was happening I can across ticket &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/382-date-and-month#ticket-382-7"&gt;#382&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;It was small so I figured I might as well do it. Throw it in with my 0.2.&lt;br /&gt;&lt;br /&gt;I've also started thinking about doing what I did here for &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/226-parsing-indifferent-to-string-content"&gt;string parsing&lt;/a&gt; to regular expressions. The first thing that comes to mind is the order in which I must do this. I can mask all strings first, then mask all regular expressions, or vice versa. I would have to replace them in the opposite order in which I mask them, that's a given. I also have to now modify my &lt;STRING n&gt; as I now have to check if a string contains &lt;STRING n&gt; OR &lt;REGEX n&gt;, as an example. I think it would be easiest to mask regex first, as I already have the code to check that it's not in a string. So, use that code, find all regex's not in a string, mask them, and any string like code inside the regex will already be gone, so I wouldn't have to check for regex when I mask the strings, and replace again, but in reverse.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-4244248519084260961?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/4244248519084260961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/03/quick-little-fix.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/4244248519084260961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/4244248519084260961'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/03/quick-little-fix.html' title='Quick little fix'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-7502029532768871537</id><published>2010-03-14T20:42:00.000-07:00</published><updated>2010-03-14T21:01:40.832-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>Tabs break nothing!</title><content type='html'>I mentioned in my last &lt;a href="http://scottdowne.blogspot.com/2010/03/back.html"&gt;post&lt;/a&gt; that I would be taking something on to add to my 0.2, so I did processing.js ticket &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/351-tabs-break-code"&gt;#351&lt;/a&gt; and wrapped it up the same day. Not bad, but it was easy.&lt;br /&gt;&lt;br /&gt;In my last post I talked about how I was able to reproduce the bug, and the next step was to find, where in the code, variables are changed to var. This is what the code in question looked like before I got to it.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    // float foo = 5;&lt;br /&gt;    aCode = aCode.replace(/(?:static\s+)?(?:final\s+)?(\w+)((?:\[\])+| ) *(\w+)\[?\]?(\s*[=,;])/g, function (all, type, arr, name, sep) {&lt;br /&gt;      if (type === "return") {&lt;br /&gt;        return all;&lt;br /&gt;      } else {&lt;br /&gt;        return "var " + name + sep;&lt;br /&gt;      }&lt;br /&gt;    });&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;What is happening, is it's matching a regular expression to the code to be parsed, sending the matched groups into a function in the order of (all, type, arr, name, sep) the first parameter is always the whole matching string, and each one that follows is the next match group and so on. The function will do something with the sent values, in this case, swapping the variable type for "var " and removing any array brackets. this new string is then replaced with the original matching string.&lt;br /&gt;&lt;br /&gt;The problem was, it was only doing this if there was a space between "int i" this is a closer look at the culprit "(\w+)((?:\[\])+| ) *(\w+)" first it matches a word, something like int, char, anything like that, then it look for any number of [] OR a space, then 0 or more spaces, then another word. I simply changed the spaces to \s, which included all whitespace, including tab, and not just a space, resulting in this.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    // float foo = 5;&lt;br /&gt;    aCode = aCode.replace(/(?:static\s+)?(?:final\s+)?(\w+)((?:\[\])+|\s)\s*(\w+)\[?\]?(\s*[=,;])/g, function (all, type, arr, name, sep) {&lt;br /&gt;      if (type === "return") {&lt;br /&gt;        return all;&lt;br /&gt;      } else {&lt;br /&gt;        return "var " + name + sep;&lt;br /&gt;      }&lt;br /&gt;    });&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now when a tab is found between int i; it's not ignored, the parsing of int i; is not ignored.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-7502029532768871537?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/7502029532768871537/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/03/tabs-break-nothing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/7502029532768871537'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/7502029532768871537'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/03/tabs-break-nothing.html' title='Tabs break nothing!'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-3042693398119950828</id><published>2010-03-13T11:44:00.000-08:00</published><updated>2010-03-13T12:34:20.184-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>Back!</title><content type='html'>It's been a week since I blogged, but I've been all over the place doing small stuff and getting organized, and there wasn't much to say :P&lt;br /&gt;&lt;br /&gt;My 0.2 is due next week and I've got my &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/230-mouse-scroll-wheel-support"&gt;mouse scroll&lt;/a&gt; awaiting review, and here is my &lt;a href="http://scottdowne.blogspot.com/2010/02/todays-challenge.html"&gt;post&lt;/a&gt; covering that, but I would like to get one more thing pushed out before next week is over.&lt;br /&gt;&lt;br /&gt;I have the &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/133-private-keyword"&gt;private keyword&lt;/a&gt; that I've been working on in the past, and kinda pushed it to the side in favour of &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/226-parsing-indifferent-to-string-content"&gt;string parsing&lt;/a&gt;. I figured I would go back to the private keyword but I noticed &lt;a href="http://weare.buildingsky.net/"&gt;Corban Brook&lt;/a&gt; was working on this &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/237-custom-classes-not-handled-properly"&gt;ticket&lt;/a&gt;, which may include an overhauling for the way &lt;a href="http://processingjs.org/"&gt;processing.js&lt;/a&gt; handles the parsing of classes, which would make the way it handles the private keyword too, hopefully making it easier for me later. This excites me and I'm going to be following it, and pushing the private key word back to 0.3 along with another planned ticket to parse regex content much like I parsed string content.&lt;br /&gt;&lt;br /&gt;Anyway, for now, I've decided to take on this one &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/351-tabs-break-code"&gt;tabs break code&lt;/a&gt;. This is a bug that causes the code to crash if a tab is used in a certain place instead of a space. I have reproduced the bug and it seems to only work (the bug works, not the code:P) when there is a tab after a variable type, but before the variable name, like so:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;int  anInt = 0;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This does not work, but oddly enough, these example DO work:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; int anInt = 0;&lt;br /&gt; println  (anInt);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The only place this causes the error (that I have found) is after the variable type and before the variable name. I printed off the translated code, after it's been turned into javascript to see what's going on, and this is the result of the above error:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;int  anInt = 0;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;and if I take out the tab, I get:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;var anInt = 0;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Which works, so obviously, the tab is stopping the conversion of variable names in java like int, to var in javascript. The solution is probably pretty easy, just need to look through the parser, look for the regex that converts variables to vars, and add in a condition for tabs&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-3042693398119950828?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/3042693398119950828/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/03/back.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/3042693398119950828'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/3042693398119950828'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/03/back.html' title='Back!'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-8936245647324801368</id><published>2010-03-04T17:49:00.000-08:00</published><updated>2010-03-04T18:29:10.566-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>Study week day 4: something to show</title><content type='html'>My five day &lt;a href="http://scottdowne.blogspot.com/2010/02/study-week-project-day-05.html"&gt;mission&lt;/a&gt; is coming to an end, and I have something to show for it.&lt;br /&gt;&lt;br /&gt;In order to view this experiment, you must have a capable browser. I use &lt;a href="http://www.mozilla.org/projects/minefield/"&gt;Minefield&lt;/a&gt;. Click this &lt;a href="http://learningwebgl.com/blog/?p=11"&gt;link&lt;/a&gt; for more information.&lt;br /&gt;&lt;br /&gt;Once inside, you can use the arrow keys to rotate the cubes up and down. Not much else to tell, so here are the examples: &lt;a href="http://matrix.senecac.on.ca/~sdowne/webGL/lesson4%20-%20Copy.html"&gt;example 1&lt;/a&gt; and &lt;a href="http://matrix.senecac.on.ca/~sdowne/webGL/lesson4.html"&gt;example 2&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;A screen shot of example 2 for those currently not with a capable browser.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_EOa0hnOPG8w/S5BrA89fw9I/AAAAAAAAAC8/RfmBjl8uH9k/s1600-h/New+Bitmap+Image+(9).bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 250px;" src="http://1.bp.blogspot.com/_EOa0hnOPG8w/S5BrA89fw9I/AAAAAAAAAC8/RfmBjl8uH9k/s400/New+Bitmap+Image+(9).bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5444969613599163346" /&gt;&lt;/a&gt;&lt;br /&gt;This gives me an idea though. Have a player that can be moved with the arrow keys, and he moves along this giant cube. You can rotate the cube with the mouse, and there is a 3D randomly generated maze on the cube. As the cube moves gravity would change, so the player (and the maze) wrap around the cube. Finally, add multiplayer.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-8936245647324801368?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/8936245647324801368/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/03/study-week-day-4-something-to-show.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/8936245647324801368'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/8936245647324801368'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/03/study-week-day-4-something-to-show.html' title='Study week day 4: something to show'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_EOa0hnOPG8w/S5BrA89fw9I/AAAAAAAAAC8/RfmBjl8uH9k/s72-c/New+Bitmap+Image+(9).bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-1109126245671048486</id><published>2010-03-03T17:32:00.000-08:00</published><updated>2010-03-03T18:18:15.246-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>Study week day 3: Vectors Matrices and Vertices</title><content type='html'>In this &lt;a href="http://scottdowne.blogspot.com/2010/02/study-week-project-day-05.html"&gt;post&lt;/a&gt;, I blindly set out on a mission, a mission that may or may not change, and has changed. &lt;br /&gt;&lt;br /&gt;I was going through these &lt;a href="http://learningwebgl.com/blog/?p=28"&gt;tutorials&lt;/a&gt; and as helpful as they are, it's just syntax at this point. I am able to modify, through trial and error, and create and move things, the problem is I don't fully understand what's going down. In these three things: Vectors Matrices and Vertices, are giant question marks.&lt;br /&gt;&lt;br /&gt;So I've decided to back it up, and get an understanding of how to represent, modify, and move 3D objects.&lt;br /&gt;&lt;br /&gt;What I know and understand.&lt;br /&gt;&lt;br /&gt;A vertices is a set of three x, y and z axis that create one point (or corner) of a 3D object. x and y axis is left right, top and down, 2D stuff, the z axis is the third dimension.&lt;br /&gt;&lt;br /&gt;These are stored in a matrix, which is just a grid of numbers, rows and columns, that hold these vertices, kinda like an array of vertices. example:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;1, 0, 0, 0&lt;br /&gt;0, 1, 0, 0&lt;br /&gt;0, 0, 1, 0&lt;br /&gt;0, 0, 0, 1&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This is called the identity matrix (correct me if I'm wrong). It's like a null matrix as anything you try to translate it into would end up being the same thing as it was before the translation. I cannot explain it much more as the technical concepts of translation still escapes me, but I know it's used to move the objects axis in a uniform manner, keeping the integrity of the shape, I get the concepts, I just don't know how it all works (yet).&lt;br /&gt;&lt;br /&gt;Not sure what the fourth axis is for; I know it should always be a one, and &lt;a href="http://gpwiki.org/index.php/3D:Matrix_Math"&gt;"is needed to transform points this way"&lt;/a&gt; I read that it was also not always needed, but helpful. It's a one, so it's not going to be a problem, as one times anything is always the later.&lt;br /&gt;&lt;br /&gt;I'm spending time just doing matrix math, and it's fun, and is giving me a better understanding of what's going on, then, I will go back to the code. Really, this matrix math concept is the only thing that's new in what I'm doing, so I'm pretty confident that I'm on the right track with this.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-1109126245671048486?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/1109126245671048486/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/03/study-week-day-3-vectors-matrices-and.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/1109126245671048486'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/1109126245671048486'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/03/study-week-day-3-vectors-matrices-and.html' title='Study week day 3: Vectors Matrices and Vertices'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-1370729197787154980</id><published>2010-03-02T16:12:00.000-08:00</published><updated>2010-03-02T17:29:20.471-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>Study week day 2</title><content type='html'>After yesterday's &lt;a href="http://scottdowne.blogspot.com/2010/03/study-week-day-1.html"&gt;post&lt;/a&gt; I started on &lt;a href="http://learningwebgl.com/blog/?p=134"&gt;lesson 2&lt;/a&gt;. It all made relative sense, and it was pretty small compared to the &lt;a href="http://learningwebgl.com/blog/?p=28"&gt;first one&lt;/a&gt;, which is good I think. I have to admit I just flipped through lesson 2, as the colour stuff isn't of huge interest to me yet; I wanted to make it move! Which is where &lt;a href="http://learningwebgl.com/blog/?p=239"&gt;lesson 3&lt;/a&gt; comes in.&lt;br /&gt;&lt;br /&gt;Lesson 3 was neat, and repeatedly drawing the scene makes perfect sense to me ;) I've done stuff like that in Java applets, although this is much cleaner implementation of the code. Java has a nasty flicker which you must compensate for. Basically, what happens in java is when you draw the screen, it's drawn as you processing the code, and not all at once. So, say you try and draw six objects on the screen; first clear the screen, then the first object will get drawn, and second, and so on. This causes a flicker for whatever reason. The solution is called a &lt;a href="http://java.sun.com/docs/books/tutorial/extra/fullscreen/doublebuf.html"&gt;double buffering&lt;/a&gt; Basically, you draw each item to an offscreen image, one at a time, then draw the offscreen image to the onscreen image in one shot. With this, I did not have to worry about stuff like that, or I do, and it's been done for me and I will soon find out. Actually, it's probably happening behind the scenes because it's awesome. A quick google out of curiosity came up with &lt;a href="http://www.khronos.org/message_boards/viewtopic.php?f=43&amp;t=2180"&gt;this&lt;/a&gt; four posts down, someone gives a good simple explanation for how double buffering works in webgl.&lt;br /&gt;&lt;br /&gt;really though, the way the lessons have it worked out, it's a lot like drawing with an x, y and z axis; the z axis is the third dimension, and all you have to do is change this axis at set intervals to make something move. Pretty simple!! or this info has been spoon fed to me, either way, I'm liking it!&lt;br /&gt;&lt;br /&gt;The basis for what I accomplished today is reading lesson 3, and played with it a bit; changing the axis of the objects to -1, to make it spin the other way, or making it spin on a different axis. All neat stuff but now I think I'm done with lesson 3 and want to get started on lesson 4 where I get to make a true 3D object spin! Like &lt;a href="http://www.youtube.com/watch?v=Oa71cNJdkts&amp;feature=player_embedded"&gt;so&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Also, giles, the author of these wonderful tutorials has been on my blog, which kinda proves the usefulness of blogging, for all those naysayers. I must thank him for his service and help in making these tutorials :)&lt;br /&gt;&lt;br /&gt;I also feel like I've given myself very little time to do this, 5 days is not enough, so I'll get as much as I can, and pick up the pieces later. Think of it like getting my feet wet, then splashing wildly around in the water, It's chaos! but it's fun.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-1370729197787154980?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/1370729197787154980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/03/study-week-day-2.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/1370729197787154980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/1370729197787154980'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/03/study-week-day-2.html' title='Study week day 2'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-996200274717786223</id><published>2010-03-02T11:27:00.000-08:00</published><updated>2010-03-03T22:21:08.582-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>Thunderbird lab</title><content type='html'>I have finished the &lt;a href="http://zenit.senecac.on.ca/wiki/index.php/Thunderbird_Bug_Fix_Lab"&gt;Thunderbird lab&lt;/a&gt;. I need to make the patch and push it still, and I will updated this post with that later tonight.&lt;br /&gt;&lt;br /&gt;Basically, I was doing the whole processing of fixing a bug, from start to end.&lt;br /&gt;&lt;br /&gt;A few hurdles.&lt;br /&gt;&lt;br /&gt;I was able to find the file I needed to edit, the location in that file, and a pretty good idea of what needed to be done, quite quickly. The hard part was reproducing the bug, getting a built version that worked, and getting a result from editing the file.&lt;br /&gt;&lt;br /&gt;The first thing was, when I tried to run my built Thunderbird, I would get this:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_EOa0hnOPG8w/S41pMFp1kqI/AAAAAAAAACc/C83ArBA6AyY/s1600-h/New+Bitmap+Image+(4).bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 211px;" src="http://1.bp.blogspot.com/_EOa0hnOPG8w/S41pMFp1kqI/AAAAAAAAACc/C83ArBA6AyY/s400/New+Bitmap+Image+(4).bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5444123180957799074" /&gt;&lt;/a&gt;&lt;br /&gt;Two other students: &lt;a href="http://jmchen11.wordpress.com/2010/02/26/thunderbird-debug-build/"&gt;Jianming&lt;/a&gt; and &lt;a href="http://cldenobrega.wordpress.com/2010/02/28/thunderbird-bug-fix-lab/"&gt;Crystal&lt;/a&gt; also received this. I think this was simply an error in the branch that was now fixed, as I don't *think* I did anything to fix it, but I tried. I tried using the comm-1.9.1 repo, which allowed me to build and run the program, but was ridden with error pop ups. I tried for awhile to use comm-1.9.1, but I could not seem to reproduce the bug; I thought it could be because of the version I was using. When it comes to experimenting, you need a completely perfect simulation to be sure something is not the problem, and in this case, I could not be sure until I had the same errors in the comm-central build; which wasn't running. So I continued.&lt;br /&gt;&lt;br /&gt;I was having problems reproducing the bug. I was just trying to send myself an email, containing an email in the text, and receive it and expect the mail address to be linked, which it was not. I came across something helpful while re reading the &lt;a href="http://zenit.senecac.on.ca/wiki/index.php/Thunderbird_Bug_Fix_Lab"&gt;instructions&lt;/a&gt; about reproducing the bug. It said "try creating a message with the text above, saving it to Drafts, then open in Drafts to see how it gets rendered." Ah, something I did not try. I did this, and I got the links I wanted.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_EOa0hnOPG8w/S41sz2s5UvI/AAAAAAAAACk/YB1A5LCNzw8/s1600-h/New+Bitmap+Image+(6).bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 321px; height: 400px;" src="http://4.bp.blogspot.com/_EOa0hnOPG8w/S41sz2s5UvI/AAAAAAAAACk/YB1A5LCNzw8/s400/New+Bitmap+Image+(6).bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5444127162673746674" /&gt;&lt;/a&gt;&lt;br /&gt;So the bug is now reproduced, now I need to break this area of the code. I already know where and what I have to do, but I'm just going to make sure I'm in the right spot and it's working before I start coding.&lt;br /&gt;&lt;br /&gt;I tried simply adding some letters "HAHA" to the end of the "mailto:" string, to see if I'm in the right spot. and it didn't seem to accept the change. I would reload my draft, and it would just be a boring old "mailto:". I was stumped, and was looking wondering why the code I was changing, did not change the program. Usually these simple, but seemingly impossible problems are the silly ones. I was thinking maybe I had two separate directories I was working in, one I was editing, and the other I was building, or something along those lines. I figured it out when I tried to copy and paste a previous draft into a new email, which shouldn't link the mail address, but all of a sudden it was. It hit me, if I change the code, and wanted to see the results, I would have to make a NEW draft, each time, as the draft only uses the code at the time you create it, and not when you view it. I created a new draft, and voila.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_EOa0hnOPG8w/S41uXkmCmhI/AAAAAAAAACs/j_Z16DNPJzk/s1600-h/New+Bitmap+Image+(7).bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 400px;" src="http://4.bp.blogspot.com/_EOa0hnOPG8w/S41uXkmCmhI/AAAAAAAAACs/j_Z16DNPJzk/s400/New+Bitmap+Image+(7).bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5444128875800074770" /&gt;&lt;/a&gt;&lt;br /&gt;I'm in HAHA.&lt;br /&gt;the next step is to code. I had to find a way to check if there were any "." after the @ but not "..". It was already checking for "." inside an if, so I just needed to add an &amp;&amp; !string.contains(".."), or something along those lines. It's already using FincChar to find the "." which won't work for me as I need a character string, and not just a character. My answer was google. I googled "nsDependentString" and came up with &lt;a href="https://developer.mozilla.org/en/nsDependentString_external#Find"&gt;Find()&lt;/a&gt;. Seems logical "FindChar()" for chars, and "Find()" for strings. Anyway, I implemented it, and ran it.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_EOa0hnOPG8w/S41vtUfYgKI/AAAAAAAAAC0/UntrItSkXyg/s1600-h/New+Bitmap+Image+(8).bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 315px; height: 400px;" src="http://1.bp.blogspot.com/_EOa0hnOPG8w/S41vtUfYgKI/AAAAAAAAAC0/UntrItSkXyg/s400/New+Bitmap+Image+(8).bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5444130348945932450" /&gt;&lt;/a&gt;&lt;br /&gt;Looks good to me. I'm leaving out the actual code in case another student wants to read this for hints, but if you want help please ask.&lt;br /&gt;&lt;br /&gt;Update: The bug and patch is awaiting review, and located &lt;a href="https://landfill.bugzilla.org/bugzilla-3.0-branch/show_bug.cgi?id=7331"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-996200274717786223?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/996200274717786223/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/03/thunderbird-lab.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/996200274717786223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/996200274717786223'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/03/thunderbird-lab.html' title='Thunderbird lab'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_EOa0hnOPG8w/S41pMFp1kqI/AAAAAAAAACc/C83ArBA6AyY/s72-c/New+Bitmap+Image+(4).bmp' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-273648588173006930</id><published>2010-03-01T06:46:00.000-08:00</published><updated>2010-03-01T11:48:56.478-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>Study week day 1</title><content type='html'>&lt;h2&gt;What's a vertices?&lt;/h2&gt;&lt;br /&gt;Today I am starting with this &lt;a href="http://learningwebgl.com/blog/?p=28"&gt;tutorial&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;First thing, get a browser that can support webGL. I already have one, but if you don't I recommend &lt;a href="http://www.mozilla.org/projects/minefield/"&gt;Minefield&lt;/a&gt;. I used it mostly because I had it installed anyway, and it sounds cool. If you don't know what I'm talking about, you should start at &lt;a href="http://learningwebgl.com/blog/?p=11"&gt;tutorial 0&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Anyway, I was going through the code example, and figuring things out along the way. It did some basic stuff like:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;body onload="webGLStart();"&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;which just loaded the code when it "hit" the body tag.&lt;br /&gt;Inside the body it setup a canvas:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;canvas id="lesson01-canvas" style="border: none;" width="500" height="500"&amp;gt;&lt;/canvas&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Then inside the webGLStart(), which was called in the body onload, it got our canvas element:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;var canvas = document.getElementById("lesson01-canvas");&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I kept on cruising through the code, and got to something I could edit, and see the result!&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    var vertices = [&lt;br /&gt;         0.0,  1.0,  0.0,&lt;br /&gt;        -1.0, -1.0,  0.0,&lt;br /&gt;         1.0, -1.0,  0.0&lt;br /&gt;    ];&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;A vertices is the plural of &lt;a href="http://en.wikipedia.org/wiki/Vertex_%28geometry%29"&gt;vertex&lt;/a&gt;. Basically the dots that connect the shape, or corners.&lt;br /&gt;&lt;br /&gt;By looking at this, I figured out the triangle, and made the top point larger. I was actually looking at it upside down, and still not sure why. Either -1 means down or to the right, and 1 mean up or to the left, or it's flipped later in the code *shrugs* time will tell. See if you can spot the top most point of the triangle, and make it bigger or smaller. Hint: 0, 0, 0 is the center of the triangle.&lt;br /&gt;&lt;br /&gt;There was more stuff to setup and a second shape, a square which is the same as the triangle cept it has an extra vertex.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;First moment of weakness&lt;/h2&gt;&lt;pre&gt;&lt;br /&gt;gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;When I first hit this, and at the time of writing this, sentence, I am lost on this one. This | operator, what's it doing. I've never seen this other than c++ bitwise operator, either that, or I'm forgetting something long buried in my head. But as with most thing in javascript, I must trust that they know what they are doing, move along, and the pieces will fall into place when they are ready to. Also, it doesn't seem like a line that I really have to worry about; I just use it, and it does it's thing, for now. This is what the tutorial said about this line "A simple first step: we clear the canvas in preparation for drawing on it." Um, ok, I know what it does, and it sounds pretty simple. It clears the canvas. This must be done once everytime the screen is to be drawn, inside the:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;function drawScene() {&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This was setup earlier as:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;setInterval(drawScene, 15);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;These setup a function to be called every 15 intervals, in this case, the function drawScene(), not sure, probably in milliseconds, but as I'm displaying a static none moving image, it could be 15 seconds, but not likely.&lt;br /&gt;&lt;br /&gt;Next line... lost again.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;perspective(45, 1.0, 0.1, 100.0);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Nvm, it's not as bad as I though. I changed the 45 to 100, and reloaded, and the shapes zoomed out. I'm sure the other three numbers do something just as cool. Weird, I changed the first parameter to 1000 and it flipped the shapes. Something it not what I thought it was. The first parameter is called the &lt;a href="http://en.wikipedia.org/wiki/Field_of_view"&gt;field of view&lt;/a&gt;. Starting to make sense of it with this "This perspective function is very useful, but is not built into WebGL, so it’s defined as a utility function further up in the code." So, I can see the inner workings of this function and why it's doing things I did not expect. Excellent.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;What's a matrices?&lt;/h2&gt;&lt;br /&gt;Like vertices, matrices is the plural for &lt;a href="http://en.wikipedia.org/wiki/Matrix_%28mathematics%29"&gt;matrix&lt;/a&gt;. It's beyond me right now, but I think it's how you track the movement of a 3D object. Actually, I think it tracks the movements, or path, of an object as it moves, maybe. Anyway, it looks like a grid of numbers, rows and columns. I think that's all I can handle on matrices at this moment, but I'll come back to them as other pieces fall into place.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Making another side of a cube&lt;/h2&gt;&lt;br /&gt;I decided, with what I've learned, to try and copy and paste bits of the square to make another side of the square. I was able to tilt the one square I had, SO i figured if I drew another square under it, and lined them up, it would look like another side of the square.&lt;br /&gt;&lt;br /&gt;Anyway, I played around with the numbers, and settled on this.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_EOa0hnOPG8w/S4wVrU6O39I/AAAAAAAAACU/rCH4XpExdOM/s1600-h/New+Bitmap+Image+(5).bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 250px;" src="http://2.bp.blogspot.com/_EOa0hnOPG8w/S4wVrU6O39I/AAAAAAAAACU/rCH4XpExdOM/s400/New+Bitmap+Image+(5).bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5443749883675598802" /&gt;&lt;/a&gt;&lt;br /&gt;I could of probably of documented more, but I went through a lot of iterations while playing, and noticed a lot of what I was doing is still limited because I'm not using shaders, colour, and doing it in a pretty manual way. I am sure there are better ways so I don't want to spend too much time on it. I want to get to the good stuff!&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Pay no attention to that man behind the curtain&lt;/h2&gt;&lt;br /&gt;The rest of what is covered in this tutorial is the use of a few functions used to make everything work. Stuff that can be copied and pasted and used without understanding; I of course must understand it.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Conclusion&lt;/h2&gt;&lt;br /&gt;This is all the blogging I can handle. I will keep playing with this and get a better understanding of the matrix in general.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-273648588173006930?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/273648588173006930/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/03/study-week-day-1.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/273648588173006930'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/273648588173006930'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/03/study-week-day-1.html' title='Study week day 1'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_EOa0hnOPG8w/S4wVrU6O39I/AAAAAAAAACU/rCH4XpExdOM/s72-c/New+Bitmap+Image+(5).bmp' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-151441629226748274</id><published>2010-02-28T18:37:00.000-08:00</published><updated>2010-03-01T06:46:24.969-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>Study week project: day 0.5</title><content type='html'>This week (starting tomorrow), I'll be going through and learning as much as I can of webGl and 3D programming.&lt;br /&gt;&lt;br /&gt;I am doing this because it interests me, and this is the sort of stuff I wanted to learn when I first applied to Seneca. Although, what I have been learning up to this point has been great, and it's all one piece of something valuable, sometimes, it doesn't matter what. A challenge is a challenge.&lt;br /&gt;&lt;br /&gt;I will start by going through these &lt;a href="http://learningwebgl.com/blog/?p=28"&gt;tutorials&lt;/a&gt;. See how far I get and how long it takes me. I'm not in any rush, and I don't know how far I will end up. I hope to finish up these tutorials and just play around with it a bit. I would like to be able to create a house like object sitting on a flat green surface. I really don't know what I'm getting into, though, so this objective might be too small, or too large, so we'll see. Should be fun.&lt;br /&gt;&lt;br /&gt;I skimmed through the tutorials, and they seem to move pretty quick, and it looks like it's mostly the building blocks I will be doing, so that's always good. 15 tutorials total, so obviously if I want to get through this in a week, I must do more than one a day, might be harder than expected *shrugs* The &lt;a href="http://learningwebgl.com/blog/?p=1778"&gt;final&lt;/a&gt; tutorial has a spinning planet with a reflective water surface. So it's got a moving, 3D shape with a texture, lighting, camera, and reflective surface. Start at the beginning I must.&lt;br /&gt;&lt;br /&gt;That is all.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-151441629226748274?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/151441629226748274/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/02/study-week-project-day-05.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/151441629226748274'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/151441629226748274'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/02/study-week-project-day-05.html' title='Study week project: day 0.5'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-2979011304480921418</id><published>2010-02-26T07:33:00.000-08:00</published><updated>2010-02-26T16:14:46.545-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>Today's Challenge:</title><content type='html'>Today, I am going to see if I can edit what I created in my last &lt;a href="http://scottdowne.blogspot.com/2010/02/mouse-scroll-wheel-hack-update.html"&gt;post&lt;/a&gt;, but this time, when the mouse scrolls, I want the circle in this &lt;a href="http://matrix.senecac.on.ca/~sdowne/processingjs/mouseWheel2/example.html"&gt;example&lt;/a&gt; to follow a circular track, and not an up and down track. Then before the end of the day, I will post my results.&lt;br /&gt;&lt;br /&gt;So far, I believe this is what I must do.&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Create a circle of x and y points, and store them in an array instead of drawing them to the screen&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Sort the array's points, as I cannot think of a way(yet) to draw a circle in the order it is used.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;When the mouse wheel is moved up, go to the next point up in the array if it's not the last one, if it's the last one, go to the first. Same thing but reversed for mouse wheel down.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;Update: I have created the circle, and set the point into an unsorted array.&lt;br /&gt;Next: sort it, and apply the "track" to the mouse scroll&lt;br /&gt;&lt;br /&gt;Update: To make my life and my computer's life easier, I'm going to just create an arc, and sort the arc, then apply the arc three more times. Kinda like 1/4 of the circle, then must copy and paste it, flipping it, after the arc is sorted.&lt;br /&gt;&lt;br /&gt;Update: And challenge &lt;a href="http://matrix.senecac.on.ca/~sdowne/processingjs/scrollWheelFun/example.html"&gt;complete&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Self reminder: As of this point, when I scroll the mouse, it moves the objects, but it will also scroll the scroll bar in the window, I want to figure out a way to disable this, while still allowing the mouse wheel to scroll the scroll bar when the user wants it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-2979011304480921418?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/2979011304480921418/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/02/todays-challenge.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/2979011304480921418'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/2979011304480921418'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/02/todays-challenge.html' title='Today&apos;s Challenge:'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-1496318695030662092</id><published>2010-02-24T16:10:00.000-08:00</published><updated>2010-02-24T16:56:58.388-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>Mouse scroll wheel hack: update</title><content type='html'>Hey.&lt;br /&gt;&lt;br /&gt;So I was playing around with my solution, my little mouse wheel hack for &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/230-mouse-scroll-wheel-support"&gt;processing.js&lt;/a&gt;, that I mentioned in my last &lt;a href="http://scottdowne.blogspot.com/2010/02/mouse-scroll-wheel-hack.html"&gt;post&lt;/a&gt;. I first was making sure I could get it to work in Firefox, Safari, Opera, and Chrome. It really wasn't all that hard. I also wanted to jazz it up a bit, and use the mouse scroll for something more meaty. &lt;a href="http://matrix.senecac.on.ca/~sdowne/processingjs/mouseWheel2/example.html"&gt;This&lt;/a&gt; is what I came up with.&lt;br /&gt;&lt;br /&gt;In my last &lt;a href="http://matrix.senecac.on.ca/~sdowne/processingjs/mouseWheel/example.html"&gt;example&lt;/a&gt;, it was setup to work in all browsers, but it was only being called the Firefox way.&lt;br /&gt;&lt;br /&gt;The problem was in this line:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;addEventListener('DOMMouseScroll', wheel, false);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Firefox uses 'DOMMouseScroll', Opera, Chrome, and Safari use "mousewheel"&lt;br /&gt;&lt;br /&gt;So, after some research, I changed the line to this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;addEventListener(/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel", wheel, false);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;What this is doing, is testing the navigator.userAgent for the word Firefox. Obviously, if you're using Firefox, the word will exist in the same spot. There are other less reliable ways to do this, as I found in my researching of this problem. I usually lean towards the solutions that make the most sense to me (obviously :P). The rest of the line just loads the certain string inside a ?: conditional statement.&lt;br /&gt;&lt;br /&gt;I'll do some testing and cleaning tomorrow, and if I don't find any bugs, I'll flag it for peer-review.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-1496318695030662092?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/1496318695030662092/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/02/mouse-scroll-wheel-hack-update.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/1496318695030662092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/1496318695030662092'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/02/mouse-scroll-wheel-hack-update.html' title='Mouse scroll wheel hack: update'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-4208511173479354822</id><published>2010-02-20T04:22:00.000-08:00</published><updated>2010-02-20T04:50:57.800-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>Mouse scroll wheel hack</title><content type='html'>Progress for the &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/230-mouse-scroll-wheel-support"&gt;mouse wheel&lt;/a&gt; feature in &lt;a href="http://processingjs.org/"&gt;processing.js&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;This is the &lt;a href="http://processing.org/hacks/doku.php?id=hacks:using-the-mousewheel-scrollwheel-in-processing"&gt;hack&lt;/a&gt;. They call it a hack, as it was not intended for use with &lt;a href="http://processing.org/"&gt;processing&lt;/a&gt;. It just so happens that any Java code written in processing works, I believe. So I think all I need to do here is the same thing, add a hack. It's already possible to use the mouse wheel in processing.js, as I show &lt;a href="http://matrix.senecac.on.ca/~sdowne/processingjs/mouseWheel/example.html"&gt;here&lt;/a&gt; Note, this only works in Firefox that I know of, it does not work in Chrome or Opera. This is without adding anything to the processing code. Because processing.js uses javascript, any javascript is valid code, so I wrote a simple mouse wheel event in javascript using &lt;a href="http://www.emanueleferonato.com/2006/07/29/mouse-wheel-handler-in-javascript/"&gt;DOMMouseScroll&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;I want to clean up the code in the example, though. That's my next task.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-4208511173479354822?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/4208511173479354822/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/02/mouse-scroll-wheel-hack.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/4208511173479354822'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/4208511173479354822'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/02/mouse-scroll-wheel-hack.html' title='Mouse scroll wheel hack'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-4768688194396333027</id><published>2010-02-19T08:46:00.000-08:00</published><updated>2010-02-19T10:42:40.999-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>processing.js 0.1 release</title><content type='html'>&lt;b&gt;Introduction&lt;/b&gt;&lt;br /&gt;I have finished my work for 0.1 as detailed in my project plans &lt;a href="http://scottdowne.blogspot.com/2010/02/re-initial-project-plan.html"&gt;here&lt;/a&gt; and &lt;a href="http://scottdowne.blogspot.com/2010/01/initial-project-plan.html"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The project wiki: &lt;a href="http://zenit.senecac.on.ca/wiki/index.php/SdowneProject"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Specifications&lt;/b&gt;&lt;br /&gt;my 0.1 release was in time to make it into the 0.5 release of &lt;a href="http://processingjs.org/download"&gt;processing.js&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I did bug &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/226-parsing-indifferent-to-string-content"&gt;#226&lt;/a&gt; for my 0.1 as well as some automated &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/325-automated-tests-string-parsing"&gt;test cases&lt;/a&gt; for the new code I implemented.&lt;br /&gt;&lt;br /&gt;What I had to do was protect string content from the procesing.js parser, then test it.&lt;br /&gt;&lt;br /&gt;my initial patch: &lt;a href="http://github.com/ScottDowne/processing-js/commit/884a72950981d57409c175430e49a6ae4f0db644"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;second patch: &lt;a href="http://github.com/annasob/processing-js/commit/f04a491a715a90adf5f92eb632abecec234a8162"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Final result: This code was modified to increase speed every so slightly, but every bit counts.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    var strings = aCode.match(/(["'])(\\\1|.)*?(\1)/g);&lt;br /&gt;    for ( var i = 0; /(["'])(\\\1|.)*?(\1)/.test(aCode); i++){&lt;br /&gt;      aCode = aCode.replace(/(["'])(\\\1|.)*?(\1)/, "&lt;STRING " + i + "&gt;");&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;into this.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    var strings = [];&lt;br /&gt;    aCode = aCode.replace(/(["'])(\\\1|.)*?(\1)/g, function(all) {&lt;br /&gt;      strings.push(all);&lt;br /&gt;      return "&lt;STRING " + (strings.length - 1) + "&gt;";&lt;br /&gt;    });&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I have to thank &lt;a href="http://weare.buildingsky.net/"&gt;Corban Brook&lt;/a&gt; for helping me fix the code, and get it out as soon as I did.&lt;br /&gt;&lt;br /&gt;Automated tests: &lt;a href="http://github.com/ScottDowne/processing-js/commit/5ccbc2569967340d0b7764fd109bfeed6744c945#diff-0"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;What I learned&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Object orientation in javascript. By seeing Java object oriented code being transformed to JavaScript, I got a good understanding of how JavaScript objects work.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Managing and working with &lt;a href="http://processingjs.org/content/download/processing-js-0.5/processing-0.5.js"&gt;processing.js source code&lt;/a&gt;; large code, that was not created by me.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Basic uses of &lt;a href="http://en.wikipedia.org/wiki/Internet_Relay_Chat"&gt;irc&lt;/a&gt;. I used &lt;a href="http://en.wikipedia.org/wiki/ChatZilla"&gt;ChatZilla&lt;/a&gt; and later &lt;a href="http://irssi.org/"&gt;irssi&lt;/a&gt;. I switched so I could use &lt;a href="http://quadpoint.org/articles/irssi"&gt;irssi with screen&lt;/a&gt;.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Revision control: &lt;a href="https://github.com/"&gt;git&lt;/a&gt; and &lt;a href="http://mercurial.selenic.com/"&gt;mercurial&lt;/a&gt;. I used git to work with processing,js, and mercurial to work with Firefox (to setup js.exe, which I mentioned in this &lt;a href="http://scottdowne.blogspot.com/2010/02/firefox-build-20.html"&gt;post&lt;/a&gt;)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;I learned how to build Firefox, and setup a Firefox build enviroment.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;I learned some standards for code. Like where to and not to use whitespace.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;One of the most important things; I learned the importance of blogs.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;I learned there is no such thing as too much testing.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;A lot of this is technical stuff that required troubleshooting. I am confident that the next release will be less of a learning process, and I can get deeper into the code.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-4768688194396333027?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/4768688194396333027/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/02/processingjs-01-release.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/4768688194396333027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/4768688194396333027'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/02/processingjs-01-release.html' title='processing.js 0.1 release'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-9060870976887610965</id><published>2010-02-19T07:58:00.000-08:00</published><updated>2010-02-19T08:39:27.787-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>re initial project plan</title><content type='html'>&lt;b&gt;Introduction&lt;/b&gt;&lt;br /&gt;Ok, so I'm going to go back to my &lt;a href="http://scottdowne.blogspot.com/2010/01/initial-project-plan.html"&gt;initial project plan&lt;/a&gt; and re assess things.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://zenit.senecac.on.ca/wiki/index.php/SdowneProject"&gt;project wiki&lt;/a&gt;: containing basic information of the overall project. I will be updating it more frequently throughout 0.2 and 0.3.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Changes&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;0.1: Bug &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/226-parsing-indifferent-to-string-content"&gt;#226&lt;/a&gt;&lt;br /&gt;While &lt;a href="http://scottdowne.blogspot.com/2010/01/emulating-bug-133.html"&gt;researching&lt;/a&gt; my first initial &lt;a href="http://processingjs.org/"&gt;processing.js&lt;/a&gt; bug, I noticed when there was a comment // inside a character string, the parser would be happy to remove it, which is only the beginning. If there is ANYTHING inside a string that resembled code or keywords, it would break. the parser would grab the keyword, and change it to javasctipt. For example:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;text("int i = 0;", 0, 15);&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;would then be parsed to:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;text("var i = 0;", 0, 15);&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;After noticing this, I went right to the bug tracking system and found &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/226-parsing-indifferent-to-string-content"&gt;this&lt;/a&gt;. The bug I, myself just found. So, I'm going to complete that for my 0.1. I will also implement automated test cases for it.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;0.2: Bugs &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/133-private-keyword"&gt;#133&lt;/a&gt; and &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/230-mouse-scroll-wheel-support"&gt;#230&lt;/a&gt;.&lt;br /&gt;These have been bumped to 0.2 from 0.1. I will also do automated test cases for these too.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;0.3: TBD.&lt;br /&gt;I hope with the experience I have gained, I can do three bugs, and implement automated test cases for them as well.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;I've got down the process involved in doing this, and I hope to start back on 0.2 as soon as possible, Monday at the latest. It's best to start small, and start early. This stuff is not something that, for me, can always be accomplished in one night.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-9060870976887610965?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/9060870976887610965/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/02/re-initial-project-plan.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/9060870976887610965'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/9060870976887610965'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/02/re-initial-project-plan.html' title='re initial project plan'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-7651962633979913964</id><published>2010-02-18T21:20:00.000-08:00</published><updated>2010-02-18T21:38:44.268-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>Scott 1 : Firefox 0... 10</title><content type='html'>&lt;b&gt;The Problem&lt;/b&gt;&lt;br /&gt;Alright, I've been messing around with Firefox as described in two previous posts, &lt;a href="http://scottdowne.blogspot.com/2010/02/firefox-build-20.html"&gt;here&lt;/a&gt; and &lt;a href="http://scottdowne.blogspot.com/2010/02/i-broke-firefox.html"&gt;here&lt;/a&gt;. Trying to make new tabs load your homepage.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The Solution&lt;/b&gt;&lt;br /&gt;I got a solution that works perfectly (assuming you don't mind alerts popping up while browsing...). &lt;br /&gt;&lt;br /&gt;First, a HUGE thanks to &lt;a href="http://zbhuang1.blogspot.com/2010/02/let-firefox-listens-to-my-order.html"&gt;Benjamin Huang and his post&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;What I did was:&lt;br /&gt;In &lt;a href="http://mxr.mozilla.org/firefox/source/xpfe/global/resources/content/bindings/tabbrowser.xml#994"&gt;tabbrowser.xml&lt;/a&gt;. Note, my copy is a slightly different version.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;            var blank = !aURI || (aURI == "about:blank");&lt;br /&gt;&lt;br /&gt;            if ( blank &amp;&amp; confirm("would you like to load your homepage?")) {&lt;br /&gt;              aURI = gHomeButton.getHomePage();&lt;br /&gt;              blank = false;&lt;br /&gt;            }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I added a the if statement bellow the var blank statement. This made sense to me as it was an easier way to check everything, then if the page is blank (you don't want the homepage to load when you click on a non new link) it prompts the user to open his/her homepage or not, then set blank to false.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The Conclusion&lt;/b&gt;&lt;br /&gt;It's sooooo easy, it just took me time to get there. And honestly, I don't know how long it would of taken me to find gHomeButton.getHomePage() on my own, &lt;a href="http://zbhuang1.blogspot.com/2010/02/let-firefox-listens-to-my-order.html"&gt;Benjamin Huang and his post&lt;/a&gt; are to thank for that one.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-7651962633979913964?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/7651962633979913964/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/02/scott-1-firefox-0.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/7651962633979913964'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/7651962633979913964'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/02/scott-1-firefox-0.html' title='Scott 1 : Firefox 0... 10'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-889603137295447626</id><published>2010-02-18T16:09:00.000-08:00</published><updated>2010-02-18T16:42:58.630-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>I broke Firefox!</title><content type='html'>In my last &lt;a href="http://scottdowne.blogspot.com/2010/02/firefox-build-20.html"&gt;post&lt;/a&gt; I attempted to make a simple change to Firefox. Allow an option to select a new tab to open your home page, or a blank page.&lt;br /&gt;&lt;br /&gt;I said what I've accomplished. I've found the spot in the code where a new tab is created, and change it to load anything I wanted based on code hard coded right into the code.&lt;br /&gt;&lt;br /&gt;Today, I added a simple confirm box, that asked if you wanted to load your homepage (which at this point was just "google.ca") The box appeared, but the page was no longer loaded. It was not working, so I removed the code I added, and reloaded it again, which broke it more. Now, when I load a new tab, it loads the tab as a blank page with the same address fromthe first page writting in the new tabs address box, and if you chage a new tabs address, and hit enter, the original tab loads that page. I highly doubt this is a desired feature :P. &lt;br /&gt;&lt;br /&gt;It's because when you're stuck on a problem, you usually have to learn something new to solve it, but it isn't always what you think it is. For example, first step is to understand the problem, second is to get an idea or some direction for what the solution could be, this is usually an abstract idea of sorts, usually has nothing to do with code, just an idea. Like "If I could do this, or bypass this, it would solve the problem". Then, you research your solution, see if it's already been solved by someone, if not, see how it's done (it's always possible), implement it (this is the coding part (notice how it's only one step in the process (for me anyway))), then debug it. This is assuming your idea or solution is the right one, sometimes it's not, but you still learned loads from dead ends. Anyway, this happens a lot, and can happen in a short period of time, then when you discover an answer, you notice you answered the wrong question. This can break code. You can find later, something you tried that did not work, that you forgot to remove, and it's breaking the code. This is what I think I did. So now, instead of combing through 2000 lines of code trying to get it to a working state, I'm just going to start again with a fresh build (that's good practice too, as I learned that when you first clone Firefox, you can specify the name of the directory it will go in, not a big deal, but it's the little things you learn that are the most fascinating sometimes). &lt;br /&gt;&lt;br /&gt;I was recently asked in an interview how I go about solving a problem, and well, I don't feel like I gave a complete answer as I was not prepared and answered it best and honest as I could on the fly, well, that last paragraph was the whole answer :P&lt;br /&gt;&lt;br /&gt;I've been stumped on this homepage part, and on my last blog another student has given me a useful like I'm going to poke around in, see what I turn up. Reading code seems to be the most time consuming process right now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-889603137295447626?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/889603137295447626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/02/i-broke-firefox.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/889603137295447626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/889603137295447626'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/02/i-broke-firefox.html' title='I broke Firefox!'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-3148228672909685286</id><published>2010-02-16T17:28:00.000-08:00</published><updated>2010-02-16T22:23:32.345-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>Firefox build 2.0</title><content type='html'>In a &lt;a href="http://scottdowne.blogspot.com/2010/02/firefox-build.html"&gt;post&lt;/a&gt; which seems like ages ago, I attempted to build Firefox, and, I believe I got it working, and I did, I suppose, but not to my standards.&lt;br /&gt;&lt;br /&gt;After what I've learned from working on &lt;a href="http://processingjs.org/"&gt;processing.js&lt;/a&gt; and setting up js.exe to use with Javascript, by building Firefox. I needed js.exe to work with javascript right on my box, and setting up a mozilla-build was the easiest way. &lt;br /&gt;&lt;br /&gt;I thought this time, I would attempt not only building it again, but attempt some changes. Right now I'm building it to make sure it works under the new build I created for js.exe, then, I'll make some changes (thanks for the push &lt;a href="http://vocamus.net/dave/"&gt;David&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;My planned changes are simple (apparently :P ) I plan to add a feature, so when you open a new tab, you get the option to open an about:blank page, or your homepage. I'm pretty sure I know what I need to do, to do this. The step now is to start getting into the code and breaking it, and seeing what I can do :O&lt;br /&gt;&lt;br /&gt;I will be back with more later (success/failure) as I plan on pulling an all nighter.&lt;br /&gt;&lt;br /&gt;Update:&lt;br /&gt;This Firefox build was more of a success than last &lt;a href="http://scottdowne.blogspot.com/2010/02/firefox-build.html"&gt;time&lt;/a&gt;. This time I got &lt;a href="http://www.mozilla.org/projects/minefield/"&gt;Minefiled&lt;/a&gt;, which I'm using now to write this post. Last &lt;a href="http://scottdowne.blogspot.com/2010/02/firefox-build.html"&gt;time&lt;/a&gt;, I ended up with &lt;a href="https://wiki.mozilla.org/Firefox/Namoroka"&gt;Namoroka&lt;/a&gt;, which was pretty cool too because, and I wouldn't know what it is if I did not stumble upon it.&lt;br /&gt;&lt;br /&gt;Update++:&lt;br /&gt;Seriously, it's easier than I thought. &lt;br /&gt;&lt;br /&gt;I went though this &lt;a href="http://mxr.mozilla.org/firefox/source/xpfe/global/resources/content/bindings/tabbrowser.xml#1233"&gt;code&lt;/a&gt;, and found the file tabbrowser.xml, then located it on my own box, and just did a simple edit. I added a simple&lt;br /&gt;&lt;code&gt;&lt;br /&gt;  alert("hihi");&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Inside the area that is used to reload a tab *shrugs* it looked like an easy place to find my change.&lt;br /&gt;&lt;br /&gt;Recompiled it, not knowing if it would work, and expecting another 40 minutes compile time. This time, it was done in a matter of minutes, maybe 5 minutes? Anyway, I loaded up the new Firefox.exe and hit reload on a tab, and this was the result!&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_EOa0hnOPG8w/S3tkziXGcKI/AAAAAAAAACM/cDhxZCKJS_c/s1600-h/firefoxBuild.bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 250px;" src="http://2.bp.blogspot.com/_EOa0hnOPG8w/S3tkziXGcKI/AAAAAAAAACM/cDhxZCKJS_c/s400/firefoxBuild.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5439051811539808418" /&gt;&lt;/a&gt;&lt;br /&gt;I know, it's a silly update. But it worked. I think this was the hardest hurdle though, as the rest of it is just editing and playing with code, something I have experience in.&lt;br /&gt;&lt;br /&gt;Final update:&lt;br /&gt;I'm editing the "addtab" method in the &lt;a href="http://mxr.mozilla.org/firefox/source/xpfe/global/resources/content/bindings/tabbrowser.xml#994"&gt;tabbrowser.xml&lt;/a&gt; file with some success. The code is beginning to make sense, just so long as I stick to "addtab". What I've done, after breaking it a few times, is this. I fist editied line &lt;a href="http://mxr.mozilla.org/firefox/source/xpfe/global/resources/content/bindings/tabbrowser.xml#1044"&gt;1044&lt;/a&gt; to instead contain (!blank) to (true). I'm just testing here. Anyway, now that I broke the "about:blank" load, I was free to tell it to load any page I wanted, so I tested with a string of "http://www.google.ca" instead of aURI on line &lt;a href="http://mxr.mozilla.org/firefox/source/xpfe/global/resources/content/bindings/tabbrowser.xml#1054"&gt;1054&lt;/a&gt;, compiled, and reloaded. It worked, no point in a screenshot though as you'll just see a new page of google... but yes, it worked. Every time I made a new tab, I was sent to google. Now, I'm testing the "browser.startup.homepage" property? I think that's what it is, well, that's what I'll call it here in my blog, for now. I must close and finish this update in order to test, and I'll continue tomorrow as it's late, and I must wake up at 5.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-3148228672909685286?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/3148228672909685286/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/02/firefox-build-20.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/3148228672909685286'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/3148228672909685286'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/02/firefox-build-20.html' title='Firefox build 2.0'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_EOa0hnOPG8w/S3tkziXGcKI/AAAAAAAAACM/cDhxZCKJS_c/s72-c/firefoxBuild.bmp' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-1390588651887036182</id><published>2010-02-13T11:25:00.000-08:00</published><updated>2010-02-13T12:23:20.404-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>finished ticket #226, and back to private</title><content type='html'>Alright, I finished and submitted my &lt;a href="http://github.com/ScottDowne/processing-js/blob/master/processing.js"&gt;solution&lt;/a&gt; to the &lt;a href="http://processingjs.org/"&gt;processing.js&lt;/a&gt; ticket &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/226-parsing-indifferent-to-string-content#ticket-226-6"&gt;#226&lt;/a&gt;, and pushed it into my github repository, which was accepted with some advice, and modifications. I was critiqued, for the first time, on my code style. For example, putting a space before and after a conditional statement, like.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;if (foo) {&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;vs&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;if(foo){&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I even got nabbed for a spelling mistake inside a comment :P&lt;br /&gt;&lt;br /&gt;In other words, making sloppy code that works, might work in school, but it won't work in a real project that consumers are not only going to be using, but developers will be maintaining. That is why this OSD class is so great. I know the concepts, I can figure out the syntax, and learn what I need from there for the problem solving. I just didn't know the standards.&lt;br /&gt;&lt;br /&gt;Now that that is done, I'm going back to &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/133-private-keyword"&gt;#133&lt;/a&gt;. I will have to start from scratch, but I've looked at code in the source that I didn't understand the first attempt, that I understand now after my work with ticket #226. My last &lt;a href="http://scottdowne.blogspot.com/2010/02/private-working-this-time-for-real.html"&gt;post&lt;/a&gt; on ticket #133 still works, I can still make private work on variables, but I'm stuck on getting it to work on functions and nested classes. I don't think it will be difficult to implement for inner classes, as it's a variable, but functions are a problem. The way the parser applys functions is with the apply method, and I'm not sure how to tell that to be private. I've thought about bypassing the apply method for private only, or all in general, as I'm not 100% sure why the apply method is being used. For this one, I'm going to have to ponder, and read code for a day or two&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-1390588651887036182?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/1390588651887036182/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/02/finished-ticket-226-and-back-to-private.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/1390588651887036182'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/1390588651887036182'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/02/finished-ticket-226-and-back-to-private.html' title='finished ticket #226, and back to private'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-6408987050898747962</id><published>2010-02-10T08:57:00.000-08:00</published><updated>2010-02-10T14:11:44.294-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>knee deep now</title><content type='html'>Yesterday was the most frustrating day yet in my submersion of open source, but might of been the best. A lot of good things came from it.&lt;br /&gt;&lt;br /&gt;One, I got a new direction on my &lt;a href="http://processingjs.org/"&gt;http://processingjs.org/&lt;/a&gt; bug, bug &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/226-parsing-indifferent-to-string-content"&gt;#226&lt;/a&gt;. I'm still going with the mask all strings approach, and then later replace them, like I decided in this &lt;a href="http://scottdowne.blogspot.com/2010/02/there-and-back-again-and-regular.html"&gt;post&lt;/a&gt;, but the difference is in the implementation. The way  fill the array, and mask the string has not changed. For replacing the masks with the strings, before, I was simply going through a for loop, and replacing all matches for &amp;lt;STRING n&amp;gt; using n as the loop index, and replacing that with the string in the index of the array. Like this.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    // replaces all masked strings from &lt;STRING n&gt; to the appropriate string&lt;br /&gt;    if (strings != null){&lt;br /&gt;      for( var i = 0; l = i &lt; strings.length; i++ ){&lt;br /&gt;        var ex = new RegExp("\&amp;lt;STRING " + i + "\&amp;gt;");&lt;br /&gt;        aCode = aCode.replace(ex, strings[i]);&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This worked in the most basic sense, but if someone had a string containing &amp;lt;STRING n&amp;gt;, like I mentioned in the same &lt;a href="http://scottdowne.blogspot.com/2010/02/there-and-back-again-and-regular.html"&gt;post&lt;/a&gt; I earlier mentioned, it would crash. The solution was, what I thought, regular expressions. I was doing it all in one, and it looked like this.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;((((\\\"|\\')|[^'\"])*['\"]((\\\"|\\')|[^'\"])*['\"])*[^'\"]*)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;What it's doing is counting all the instances of single or double quotes that do not follow a backslash, then if it was an even number of quotes, it was NOT in a string, odd number of quotes, and I was inside a string, not including escaped quotes.&lt;br /&gt;&lt;br /&gt;It technically worked, but I over looked something. It didn't care which kind of quotes I used, so a string this like "'", which is valid, would need to be escaped. It would be expecting "\'". That last one would work, but isn't valid code as the quote being escaped can only be the one used to start the string. &lt;br /&gt;&lt;br /&gt;My solution was to look deeper into regular expressions. I looked into some advanced regular expressions and I learned a lot. It was productive, but no code was written. I looked at concepts like &lt;a href="http://www.regular-expressions.info/atomic.html"&gt;attomic grouping&lt;/a&gt;, which is not available in JavaScript, but this blog &lt;a href="http://blog.stevenlevithan.com/archives/mimic-atomic-groups"&gt;post&lt;/a&gt; explains how to emulate atomic grouping in JavaScript. It was interesting. I also found this link, on some advanced &lt;a href="http://www.smashingmagazine.com/2009/05/06/introduction-to-advanced-regular-expressions/"&gt;regular expression&lt;/a&gt; techniques. It was a great read. But, none of these had the answer I was looking for. I asked around, obviously asking my professor &lt;a href="http://vocamus.net/dave/"&gt;David Humphrey&lt;/a&gt; first. He gave me some advice, and direction, or redirection. A &lt;a href="http://mxr.mozilla.org/mozilla/source/js/narcissus/jsparse.js#167"&gt;link&lt;/a&gt; and some encouragement.&lt;br /&gt;&lt;br /&gt;I'm knee deep in a new solution now, that's a lot more code, but looks very promising already. This is the idea.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;        aCode = aCode.replace(new RegExp("(.*)(\&amp;lt;STRING " + i + "\&amp;gt;)(.*)", "g"), function(all, quoteStart, match, quoteEnd){&lt;br /&gt;&lt;br /&gt;        });&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Inside this function, which is pretty cool by the way, I'll just parse the single "quoteStart" and or "quoteEnd", without regex, and see if "match" is inside a string or not, if it's not, I return the new string, if it is, I return "all".&lt;br /&gt;&lt;br /&gt;The inner functions classes are filled based on the order of matches in the regex. So, the first parameter sent is $0, or the whole matched string. Second is $1, which is the first matched pattern, inside the first brackets. etc.&lt;br /&gt;&lt;br /&gt;I prefer it this way, it's easier to read and understand than a complex regex, and modular, because it's easier to edit what happens inside the inner function, without breaking the regular expression.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-6408987050898747962?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/6408987050898747962/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/02/knee-deep-now.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/6408987050898747962'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/6408987050898747962'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/02/knee-deep-now.html' title='knee deep now'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-1794733266740498245</id><published>2010-02-08T16:10:00.001-08:00</published><updated>2010-02-08T16:40:04.546-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>There and back again, and regular expressions are hardcore</title><content type='html'>So, I've been thinking about my solution to bug &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/226-parsing-indifferent-to-string-content"&gt;#226&lt;/a&gt;, and at one point, I changed my mind on my solution, of masking all strings, and later replacing them based on &amp;lt;STRING n&amp;gt;. I thought of a few possible bugs, mostly the odd chance someone enters &amp;lt;STRING 7&amp;gt; (for example) as a string, and that would be a problem, because the parser would put &amp;lt;STRING 7&amp;gt; into it's array, and mask it with the appropriate mask, then later replace the string, but if it happens to contain a string of a string that has yet to be replaced, the parser would then find that string, replace it. Hmm, hard to explain, but I decided the only solution would be to only replace &amp;lt;STRING n&amp;gt; later, when all the code is replaced, if the &amp;lt;STRING n&amp;gt; is NOT inside a string, and that was kinda what I wanted to avoid in the first place. &lt;br /&gt;&lt;br /&gt;So, I figured I should re consider checking all parser regexs to not parse while in a string, like I have to do while replacing &amp;lt;STRING n&amp;gt; with the appropriate strings. The advantage of doing the later, is I don't have to worry about keeping an array of all strings, which might get quite large, but only has to be done once for each time the code is parsed, I believe, which isn't too bad, but not optimal.&lt;br /&gt;&lt;br /&gt;I thought more about it (this was while taking my 2 hour bus ride home) and decided against it, so I was back to my original solution. My reasoning: KISS. The original method might not be the fastest, but it's simple, you do it once, and it's done. The other way, might be faster (marginal) and it's situational, but it's a debugging nightmare. Each time someone adds something to the parser, they must remember to check to make sure it's not in a string. I only need to check to make sure it's not in a string once, and no one else has to ever worry about my code, also making it more modular.&lt;br /&gt;&lt;br /&gt;The other thing I've been working on: really tweaking the regex for checking for strings. It's not apparent, there were a lot of things I was not considering, and I've been changing and testing various solutions, and right now, this is how it looks.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/(["'])([^"'\\]|\\.)*(\1)/g&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Before, I was being greeeedy, things like this test, would muck it all up.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;text("Hello World!" + (4 + 5) + "Hello World",50,i+=15);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now, it was being printed off fine in this case, but any processing that was between the two strings, would NOT get parsed, so I changed it to a non greedy string, and added a few more touches, like using ['"] instead of ('|"), which are pretty much the same, but to me, the first one is simpler, and using back reference on the string type, just because I think it's cleaner that way. Anyway, all for today.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-1794733266740498245?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/1794733266740498245/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/02/there-and-back-again-and-regular.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/1794733266740498245'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/1794733266740498245'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/02/there-and-back-again-and-regular.html' title='There and back again, and regular expressions are hardcore'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-4307628512938694175</id><published>2010-02-07T04:22:00.000-08:00</published><updated>2010-02-07T04:48:43.024-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'></title><content type='html'>Yesterday was not the most productive day, I sort of did little bits of work, on and off all day, amongst other things.&lt;br /&gt;&lt;br /&gt;I did get something pushed into my &lt;a href="http://github.com/ScottDowne/processing-js/blob/master/processing.js"&gt;repository&lt;/a&gt; by following these &lt;a href="http://processingjs.org/blog/?p=155"&gt;instructions&lt;/a&gt; throughout the day yesterday. &lt;br /&gt;&lt;br /&gt;Only two &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/project-workflow"&gt;things&lt;/a&gt; left to do.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;6. Update the LightHouse ticket with your repo information as well as the url's of the tests.&lt;br /&gt;7. Send annasob a pull request using the pull request button.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I've been going through other &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/84-strokecap"&gt;finished tickets&lt;/a&gt;, and looking at the tests they have completed. For example, this test &lt;a href="http://matrix.senecac.on.ca/~asalga/DPS911/release0.4/join_test/join_test.html"&gt;here&lt;/a&gt; by &lt;a href="http://asalga.wordpress.com/"&gt;Andor Salga&lt;/a&gt; is way better than &lt;a href="http://matrix.senecac.on.ca/~sdowne/processingjs/thirdTest/example.html"&gt;mine&lt;/a&gt;, which is a good thing. It's a guide, something for me to shoot for. I've actually noticed a few &lt;a href="http://wobblyretroaction.blogspot.com/"&gt;others&lt;/a&gt; using a very similar &lt;a href="http://matrix.senecac.on.ca/~mlam19/processingjs/bezierPointTest0.html"&gt;testing process&lt;/a&gt;. Maybe there is a guide on the &lt;a href="https://processing-js.lighthouseapp.com/projects/41284-processingjs/overview"&gt;processing.js lighthouse&lt;/a&gt;, and these are the standard tests? This seems like the last step, and there is still a week until release 0.1 is due.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-4307628512938694175?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/4307628512938694175/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/02/yesterday-was-not-most-productive-day-i.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/4307628512938694175'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/4307628512938694175'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/02/yesterday-was-not-most-productive-day-i.html' title=''/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-3596197082421816117</id><published>2010-02-06T15:51:00.000-08:00</published><updated>2010-02-06T16:13:59.030-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>processing.js bug #284 and #226</title><content type='html'>I've been doing some &lt;a href="http://processingjs.org/"&gt;Processing.js&lt;/a&gt; debugging and testing, for tickets &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/226-parsing-indifferent-to-string-content"&gt;#226&lt;/a&gt; and now &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/284-parsing-error-with-comments#ticket-284-5"&gt;#284&lt;/a&gt; because of the close relation.&lt;br /&gt;&lt;br /&gt;Originally, I did some tests for removing the comment regex, and these were the &lt;a href="http://matrix.senecac.on.ca/~sdowne/processingjs/noComments/"&gt;results&lt;/a&gt; source code. The problem is with the comments, the parser is having problems as it's not expecting a comment. I believe parsing out the comments is the easiest solution.&lt;br /&gt;&lt;br /&gt;Here is my solution to both tickets. &lt;a href="http://matrix.senecac.on.ca/~sdowne/processingjs/thirdTest/"&gt;souce&lt;/a&gt; and a &lt;a href="http://matrix.senecac.on.ca/~sdowne/processingjs/thirdTest/example.html"&gt;test&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;What I am doing is first, creating an array that contains all the strings.&lt;br /&gt;Then, masking all the strings, this will also grab any strings inside a comment&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    // Saves all strings into an array&lt;br /&gt;    // masks all strings into &amp;lt;STRING n&amp;gt;&lt;br /&gt;    // to be replaced with the array strings later&lt;br /&gt;    var strings = aCode.match(/("|').*("|')/g);&lt;br /&gt;    for ( var i = 0; /("|').*("|')/.test(aCode); i++)&lt;br /&gt;    {&lt;br /&gt;      aCode = aCode.replace(/("|').*("|')/, "&amp;lt;STRING " + i + "&amp;gt;");&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Then, I parse away all comments.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    // Remove end-of-line comments&lt;br /&gt;    aCode = aCode.replace(/\/\/.*\n/g, "\n");&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Any strings inside a comment do not matter, and any // inside a string have already been converted to &lt;STRING n&gt;.&lt;br /&gt;I then replace all the strings as the final step.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    // replaces all masked strings from &amp;lt;STRING n&amp;gt; to the appropriate string&lt;br /&gt;    if (strings != null){&lt;br /&gt;      for( var i = 0; l = i &amp;lt; strings.length; i++ ){&lt;br /&gt;        var ex = new RegExp("\&amp;lt;STRING " + i + "\&amp;gt;");&lt;br /&gt;        aCode = aCode.replace(ex, strings[i]);&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;any strings that were removed because of being in a comment, are not replaced, and the program simply skips it.&lt;br /&gt;&lt;br /&gt;I'm ready to upload it, and hope I have not missed anything as it's my first time! *fingers crossed*&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-3596197082421816117?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/3596197082421816117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/02/processingjs-bug-284-and-226.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/3596197082421816117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/3596197082421816117'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/02/processingjs-bug-284-and-226.html' title='processing.js bug #284 and #226'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-7770771122737762241</id><published>2010-02-05T17:13:00.000-08:00</published><updated>2010-02-05T17:39:54.785-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>Update! working tests</title><content type='html'>At the end my last &lt;a href="http://scottdowne.blogspot.com/2010/02/testing-of-bug-number-226.html"&gt;post&lt;/a&gt;, I mentioned how my program was failing tests due to testing old code with my bug fix, with new code, so my tests were off, anyway, I tested my bug fix for bug &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/226-parsing-indifferent-to-string-content"&gt;#226&lt;/a&gt; with up to date code, and these are the results!&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_EOa0hnOPG8w/S2zHIZgk1qI/AAAAAAAAABQ/mGrrKXtsBnE/s1600-h/toBlog.gif"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 310px;" src="http://4.bp.blogspot.com/_EOa0hnOPG8w/S2zHIZgk1qI/AAAAAAAAABQ/mGrrKXtsBnE/s400/toBlog.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5434937797429745314" /&gt;&lt;/a&gt;&lt;br /&gt;as you can see, the results are the same as the original &lt;a href="http://1.bp.blogspot.com/_EOa0hnOPG8w/S2x0ROw23cI/AAAAAAAAAA4/HaXKele0yRs/s1600-h/New+Bitmap+Image+%282%29.gif"&gt;test&lt;/a&gt;, which is great. I learned more by not getting it right the first time! Anyway, I have to double check the quality of my code, comment it, keep it in the appropriate style, and go for pushing it to my repository. I believe I need to put together some files for that, some examples, and show some tests. I am confident though. I am also getting down the system used to do this development, so my next few attempts will go much smoother!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-7770771122737762241?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/7770771122737762241/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/02/update-working-tests.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/7770771122737762241'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/7770771122737762241'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/02/update-working-tests.html' title='Update! working tests'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_EOa0hnOPG8w/S2zHIZgk1qI/AAAAAAAAABQ/mGrrKXtsBnE/s72-c/toBlog.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-3481464555992563602</id><published>2010-02-05T14:39:00.000-08:00</published><updated>2010-02-05T17:12:35.582-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>Testing of bug number 226</title><content type='html'>After an evening and morning of setting up an environment, my curiosity peaked when I was doing the tests on &lt;a href="http://github.com/jeresig/processing-js/blob/master/processing.js"&gt;processing.js&lt;/a&gt;, so I decided to go back to my friend bug &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/226-parsing-indifferent-to-string-content"&gt;#226&lt;/a&gt;, and run that through some tests. This is the result!&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_EOa0hnOPG8w/S2yhv4t-cmI/AAAAAAAAABA/Jcwb4IUAE_g/s1600-h/toBlog.gif"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 314px;" src="http://4.bp.blogspot.com/_EOa0hnOPG8w/S2yhv4t-cmI/AAAAAAAAABA/Jcwb4IUAE_g/s400/toBlog.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5434896694380491362" /&gt;&lt;/a&gt;&lt;br /&gt;Ah, I consider this interesting, compared to the &lt;a href="http://1.bp.blogspot.com/_EOa0hnOPG8w/S2x0ROw23cI/AAAAAAAAAA4/HaXKele0yRs/s1600-h/New+Bitmap+Image+%282%29.gif"&gt;tests&lt;/a&gt; on my blog &lt;a href="http://scottdowne.blogspot.com/2010/02/setting-up-git-and-github.html"&gt;post&lt;/a&gt; from this morning. I have to admit, I was disappointed... but it's all part of the process. One of the obvious errors was strings was == null, and I was trying to access it's length property. This was an easy fix, as I just needed to put the for loop into an if checking to see if strings was != null, like so.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    if (strings != null)&lt;br /&gt;      {&lt;br /&gt;      for( var i = 0; l = i &lt; strings.length; i++ ){&lt;br /&gt;        var ex = new RegExp("\&amp;lt;STRING " + i + "\&amp;gt;");&lt;br /&gt;        aCode = aCode.replace(ex, strings[i]);&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I then re ran the test, and there was progress. Here are the results.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_EOa0hnOPG8w/S2yx_CIqZoI/AAAAAAAAABI/cKYa-fEvSAA/s1600-h/toBlog.gif"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 316px;" src="http://1.bp.blogspot.com/_EOa0hnOPG8w/S2yx_CIqZoI/AAAAAAAAABI/cKYa-fEvSAA/s400/toBlog.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5434914546792425090" /&gt;&lt;/a&gt;&lt;br /&gt;As you can see this is considerable progress from last test, but still down from the original test. So I still have work to do. Now I think I should redirect the results from both tests into a file, and see which errors are new, and start working on them.&lt;br /&gt;&lt;br /&gt;Update!!&lt;br /&gt;&lt;br /&gt;So, I checked, and a lot of these errors I'm getting is simply because of an old build, so I'm adding all the string updates to the new Processing.js. I'll probably post the results into a new post, though, as too many updates in one post, might make it hard for people to follow my progress.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-3481464555992563602?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/3481464555992563602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/02/testing-of-bug-number-226.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/3481464555992563602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/3481464555992563602'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/02/testing-of-bug-number-226.html' title='Testing of bug number 226'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_EOa0hnOPG8w/S2yhv4t-cmI/AAAAAAAAABA/Jcwb4IUAE_g/s72-c/toBlog.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-7217892445715759657</id><published>2010-02-05T10:12:00.000-08:00</published><updated>2010-02-05T17:40:40.582-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>setting up Git and GitHub</title><content type='html'>Last night I went onto the &lt;a href="https://processing-js.lighthouseapp.com/projects/41284-processingjs"&gt;Processing.js&lt;/a&gt; Lighthouse page, to get the &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/project-workflows"&gt;instructions&lt;/a&gt; on how to push my code. I'm quite new to this, and am following the instructions, and learning what I'm doing while I do it, usually after making a mistake, then I get it right, then I know what it is I was trying to do :). I think that's normal... I hope it's normal... it's normal for me, and works.&lt;br /&gt;&lt;br /&gt;Anyway, I went to these &lt;a href="http://processingjs.org/blog/?p=152"&gt;instructions&lt;/a&gt; on setting up &lt;a href="http://en.wikipedia.org/wiki/Git_%28software%29"&gt;Git&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/Github"&gt;GitHub&lt;/a&gt;, and created a new fork of &lt;a href="http://github.com/jeresig/processing-js"&gt; jeresig's repository&lt;/a&gt; into my own&lt;a href="http://github.com/ScottDowne/processing-js"&gt;fork&lt;/a&gt;. I had some difficulty with some of the instructions setting up Git to connect to GitHub, and it was a silly mistake. It ended up being because I was so tired, as after going to bed, I woke up, and everything was so clear and easy. A good thing too, because I could of easily wasted hours on it. What was happening was, when I tried to connect, I would get an error, because my SSH key was not properly set. The key was right, the file location was wrong, as I didn't let the key go into the default location. The key is used to connect my Git command line, to GitHub, which holds my fork, I believe. Ah, so many new terms :). Anyway, I simply generated a new key with the "ssh-keygen -C “youremailinquotes@com” -t rsa" command, this time leaving all requested fields blank. So I believe the first time I tried, my key was right, it was just looking for it in the wrong place. Which is an easy mistake to over look if you over think things. Some say children are better at solving logic puzzles simply because they don't over think things, or they get more sleep :).&lt;br /&gt;&lt;br /&gt;Finally, here I am in the morning, 5:00ish, going through my newly cloned source, trying to get that setup. I figured a good place to start would be checking out the READMEs. So I've bee folloing the README instructions in the test folder, and it's been going quite well. I first had to setup a Mozilla build again, like I did on in my last &lt;a href="http://scottdowne.blogspot.com/2010/02/firefox-build.html"&gt;post&lt;/a&gt;, which I wanted to do again anyway, as I made some mistakes last time, and I will understand things better the second time though. It's always good to be able to work on one thing, and get two things done. Last time I built Firefox, I used a tarball, as apposed to cloning a new one. The tarball before worked, but it was confusing, this time, it's been smooth.&lt;br /&gt;&lt;br /&gt;I am now making a JavaScript shell, to use to for the test code for Processing.js. It is running as I started this post, and it is now done. So I'm off to do the next step.&lt;br /&gt;&lt;br /&gt;Two more things I want to improve on.&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Start putting screen shots into my blog.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;And post at least two blogs a day, as I didn't get a chance to yesterday.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Or one large, detailed post.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Update, with screen shots! I have a working js.exe, and adding the path to my Processing.js makefile. I know this, because I ran a test "make test" on the processing,js file, this was the result.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_EOa0hnOPG8w/S2x0ROw23cI/AAAAAAAAAA4/HaXKele0yRs/s1600-h/New+Bitmap+Image+(2).gif"&gt;&lt;img style="float:center; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 320px; height: 252px;" src="http://1.bp.blogspot.com/_EOa0hnOPG8w/S2x0ROw23cI/AAAAAAAAAA4/HaXKele0yRs/s320/New+Bitmap+Image+(2).gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5434846689698962882" /&gt;&lt;/a&gt;&lt;br /&gt;I am now doing "make test-parser", will come back with updates.&lt;br /&gt;&lt;br /&gt;Ok, ran "make test-parser". I won't bother with the screen shot, as it looks a lot like the last one, cept it has 662 passed, 188 failed, and 850 total. I'm excited to run my code from a few days ago through the tests, but I still have a few more steps in the README.&lt;br /&gt;&lt;br /&gt;Next step has to do with converting a processing file into JavaScript. It all made sense to me, cept it wants the processing file to be of type pde, not sure what that is, so I'll go check that out now. Here is an article on &lt;a href="http://filext.com/file-extension/PDE"&gt;pde&lt;/a&gt;. There is a spot near the bottom of interest to us.&lt;br /&gt;&lt;blockquote&gt;Processing Development Environment (PDE) (Source Code File) by ProcessingThe Processing Development Environment (PDE) consists of a simple text editor for writing code, It is an open source programming language and environment for people who want to program images, animation, and interactions. When programs are run, they open in a new window called the display window. Software written in PDE and also all Processing projects are called sketches. Each sketch is saved in its own folder. The main program file for each sketch has the same name as the folder and is found inside it. For example, if the sketch is named "Sketch123", the folder for the sketch will be called "Sketch123" and the main file will be called "Sketch123.pde". The PDE file extension stands as an acronym for the Processing Development Environment. This association is classified as Source Code.&lt;/blockquote&gt;&lt;br /&gt;I noticed some .pde files already in the processing.js test folder, going to play around with them.&lt;br /&gt;&lt;br /&gt;I just ran the command "make test/parser/shiffman-test.js", with success. What happened was, it took the file shiffman-test.pde, which is a processing file, and converted it to javascript, using processing.js. It outputted the new code right in the command line, I was expecting a new file to be saved, but that's no big deal, as I just used "make test/parser/shiffman-test.js &gt; shiffman-test.js". easy enough.&lt;br /&gt;&lt;br /&gt;Next step is to go through the &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/project-workflow"&gt;workflow&lt;/a&gt; link, add my code to the local processing.js file, test it, then submit it if everything is good.&lt;br /&gt;&lt;br /&gt;It's quite a learning process getting this all setup for the first time, and I find this class to be one of the more challenging classes. Not that it's harder, just that I'm doing more learning, and challenges. I find the solution is usually quite small, it's just getting there. Ah, I should use the word "new challenges" instead of the usual jump-through-the-same-old-hoops challenges. I'm really enjoying editing and working with code, it's more professional, I'm actually starting my career now, as apposed to before, when I was just doing academic assignments. I don't know if any Seneca faculty are reading this that don't already agree with me, but this class, this &lt;a href="http://zenit.senecac.on.ca/wiki/index.php/OSD600"&gt;OSD600&lt;/a&gt; has been the best fit for me, I highly recommend it to any 4th semester students that can get over the hurdle of making a blog *gasp*, but I would not be able to do it if it wasn't for the steps before. It feels like a long process, but to think, just 5 semesters ago, not much more than a year, I knew nothing about programming! Ok, I'm rambling now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-7217892445715759657?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/7217892445715759657/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/02/setting-up-git-and-github.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/7217892445715759657'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/7217892445715759657'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/02/setting-up-git-and-github.html' title='setting up Git and GitHub'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_EOa0hnOPG8w/S2x0ROw23cI/AAAAAAAAAA4/HaXKele0yRs/s72-c/New+Bitmap+Image+(2).gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-7573280864745058231</id><published>2010-02-03T16:48:00.000-08:00</published><updated>2010-02-03T17:57:37.204-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>Firefox build</title><content type='html'>Well, after a few problems, Firefox seems to be building fine now. It's been compiling for about twelve minutes, and before my problems all seemed to be early in the build, so I hope I'm out of the woods now.&lt;br /&gt;&lt;br /&gt;The hardest part was simply downloading the files I needed to do this. I felt like there was no guide giving step by step instructions all in one place, but parts of guides. And, it seemed all of the parts vary for different machines and versions. It was up to me to learn it, understand it, and make the right choices.&lt;br /&gt;&lt;br /&gt;Google was not much help in getting answers to my specific error messages, so what I would end up doing, when I hit a problem I didn't understand, I would go back a step or two, and try again, paying close attention to what is happening, and I may go back more than one step, or in some cases, right back to the beginning until I understand it. Each pass through I knew more and more, and by going back, I could see things with a knowledgeable eye, and stuff just sort of clicked.&lt;br /&gt;&lt;br /&gt;Anyway, on to my specific errors and how I solved them. Once I got the commands working understood, I started using the make command, until I figured that out, and my first error was something to do with --enable-application=APP, which made no sense at the time. I was trying things like adding it to the end of the make command, and moving my .mozconfig file around. I read that it was important, and I thought I had it. But, it turned out I had a .mozconfig.mk and .mozconfig.out, which are not the same. I needed to create it myself, and then add the --enable-application-APP command there, so I tried that, still didn't work. I think found some advice on the web, with "ac_add_options --enable-application=browser" thinking I needed ac_add_options before my =APP, still didn't work. So, I tried "ac_add_options --enable-application=browser" without APP and browser instead. And voila, it seems to be going error free. In fact, it's still going, and I think it's going to finish problem free from this point on. If there are any more problems, I'll be back to edit this post, actually, I;ll be back if it works too.&lt;br /&gt;&lt;br /&gt;So, it completed with what I think is no errors, although, It took me awhile to figure out how to install it. I found something under the name of Namoroka, which I believe to be it, so I installed it. It installed fine, or what I thought, but it would run, said it was missing Firefox.exe, so I aded that, just out of curiosity, then it wanted a .dll, and it kept going. So eventually I found all the files in one location in the firefox build files, so I just copied it all into the Namoroka folder. It now has no errors, but no program is actually started. Ah well, I think though, that's all I have time for and is a good amount for only an hour (7:38 - 8:48) little more than an hour. Anyway, I have to wake up tomorrow at 5:00 to make it to Java EE on time tomorrow.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-7573280864745058231?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/7573280864745058231/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/02/firefox-build.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/7573280864745058231'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/7573280864745058231'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/02/firefox-build.html' title='Firefox build'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-380323351557403075</id><published>2010-02-03T11:09:00.000-08:00</published><updated>2010-02-04T17:14:13.505-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>parsing indifferent to strings</title><content type='html'>I think I have implemented a solution to &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/226-parsing-indifferent-to-string-content"&gt;#226&lt;/a&gt;. The problem was seemingly complex, first thing I thought is I would have to keep track of all the parsing, so that it didn't parse a string, but then I thought if I could remove all strings, then replace them later, after the parsing is completed, and that's what I've done. It seems to be working! This is what I did.&lt;br /&gt;&lt;br /&gt;At the beginning of the parsing, I run this block of code&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    var strings = aCode.match(/".*"/g);&lt;br /&gt;    &lt;br /&gt;    for ( var i = 0; /".*"/.test(aCode); i++)&lt;br /&gt;    {&lt;br /&gt;        aCode = aCode.replace(/".*"/, "&amp;lt;STRING " + i + "&amp;gt;");&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This, first, goes through all the code, and grabs all strings, and saves them in an array. Then, I loop through the code, applying &lt;STRING n&gt; in place of the "string". I do this until there is no more "string"'s left.&lt;br /&gt;&lt;br /&gt;Then, at the end of the code, after all other parsing has been done, before I return aCode, I reapply all the strings like this&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    for( var i = 0; l = i &lt; strings.length; i++ ){&lt;br /&gt;      var ex = new RegExp("\&amp;lt;STRING " + i + "\&amp;gt;");&lt;br /&gt;      aCode = aCode.replace(ex, strings[i]);&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This goes through the array of strings, one at a time, until they have all been gone through, each time, applying that string to the proper &lt;STRING n&gt; with n being the index of that string in relation the the array of strings. &lt;br /&gt;&lt;br /&gt;I believe this is pretty solid and can be demonstrated &lt;a href="http://matrix.senecac.on.ca/~sdowne/processingjs/string/withPrivate.html"&gt;here&lt;/a&gt;. You should see three alert boxes, displaying messages that would normally be parsed out, then the usual black box of success. Also notice how I put a string inside the comment, to make sure it was able to handle that, as I parse the string before I parse a comment, as to avoid removing some string that happens to contain // in it. I also tested a multi line string, as I was curious, it handles it fine just so long as it's not written like this.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;alert("first line&lt;br /&gt;second line");&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;which to my knowledge, should not work anyway, plus, it's horrible code!&lt;br /&gt;&lt;br /&gt;I think I'm done this bug, and I think the next step is to figure out how to submit my code...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-380323351557403075?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/380323351557403075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/02/parsing-indifferent-to-strings.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/380323351557403075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/380323351557403075'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/02/parsing-indifferent-to-strings.html' title='parsing indifferent to strings'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-5159542155925963519</id><published>2010-02-03T05:01:00.000-08:00</published><updated>2010-02-03T05:30:26.037-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>good morning</title><content type='html'>Alright, so last night I was officially assigned a new ticket, notably the &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/226-parsing-indifferent-to-string-content"&gt;string parsing&lt;/a&gt; one I talked about last &lt;a href="http://scottdowne.blogspot.com/2010/02/bugs.html"&gt;post&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;I have been thinking about how I'm going to do this, and I think I found a solution. I'm going to parse through the whole page with a replace regex, like is frequently done in the process, and replace all strings with &amp;lt;STRING n&amp;gt; where n is a unique, incrementing number, like how when an object is created, its replaced with &amp;lt;CLASS &lt;span style="font-style:italic;"&gt;name&lt;/span&gt;&amp;gt; temporarily. Then hold all the strings in an array. I will do this before all the parsing begins, and once everything is complete, I will replace all &amp;lt;STRING n&amp;gt;'s with the appropriate string from the array. In this way, I'm masking the strings from the parser. I know the parser can move things around, so I think keeping track of them by a number, than relying on the order in which the strings appear,  is a safer way to do it.&lt;br /&gt;&lt;br /&gt;I've also still been working on &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/133-private-keyword"&gt;#133&lt;/a&gt;. Specifically, trying to get the private word to work on a method. For now I'm stuck on it. I mention the problems in this &lt;a href="http://scottdowne.blogspot.com/2010/02/private-working-this-time-for-real.html"&gt;post&lt;/a&gt;, which still stands.&lt;br /&gt;&lt;br /&gt;The member keyword still works, and I think is finished, I just now have a bug where if in the Processing code someone assigns a private member inside a method, using something like this&lt;br /&gt;&lt;code&gt;&lt;br /&gt;this.num = num;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;It will instead make a new var, "replacing" the one I already defined as private, and making this one not private. I'm not sure if this is beyond my scope at this moment, or if it should be tagged as a new, separate ticket. I show this problem &lt;a href="http://matrix.senecac.on.ca/~sdowne/processingjs/secondTest/usingPrivateWithThis.html"&gt;here&lt;/a&gt;. After clicking through all the alerts, the black screen should NOT load, as I'm trying to call a private variable directly, but it works, because the private variable is being over written by this.num, which in javascript, is how one would make a public variable inside a class.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-5159542155925963519?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/5159542155925963519/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/02/good-morning.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/5159542155925963519'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/5159542155925963519'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/02/good-morning.html' title='good morning'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-8674023517681322001</id><published>2010-02-02T11:03:00.000-08:00</published><updated>2010-02-02T11:30:55.203-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>bugs</title><content type='html'>I noticed a bug that was kinda messing with my parse fix from last &lt;a href="http://scottdowne.blogspot.com/2010/02/private-working-this-time-for-real.html"&gt;post&lt;/a&gt;, which I was simply checking for all instances of "private this.", which is working, cept if it appears inside a string. I looked through the bug &lt;a href="https://processing-js.lighthouseapp.com/projects/41284-processingjs"&gt;list&lt;/a&gt;, and found what I was looking for &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/226-parsing-indifferent-to-string-content"&gt;here&lt;/a&gt;. It's a tricky and nasty, but fascinating problem.&lt;br /&gt;&lt;br /&gt;Buy anyway, &lt;a href="http://matrix.senecac.on.ca/~sdowne/processingjs/secondTest/"&gt;here&lt;/a&gt; are some examples on what I have working.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-8674023517681322001?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/8674023517681322001/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/02/bugs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/8674023517681322001'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/8674023517681322001'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/02/bugs.html' title='bugs'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-1670038207717324012</id><published>2010-02-02T05:41:00.000-08:00</published><updated>2010-02-02T06:07:29.195-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>private working this time, for real</title><content type='html'>Still working on &lt;a href="http://github.com/jeresig/processing-js/raw/master/processing.js"&gt;Processing.js&lt;/a&gt;'s bug number &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/133-private-keyword"&gt;#133&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;In my last &lt;a href="http://scottdowne.blogspot.com/2010/02/private-working.html"&gt;post&lt;/a&gt; I said I had private working for private variables, but I was wrong. It worked, as it was able to handle the word private, as in not crash, but the variable still was not private. There were a few reasons why this was happening, but mostly I was doing my conversion in the wrong location. I decided to start printing off my html page's processing code, in various stages of conversion, and noticed my old method for converting private, was being converted back again by another part of the code, so I added my conversion to that block of code, this is what it looked like originally.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;        // Replace var foo = 0; with this.foo = 0;&lt;br /&gt;        // and force var foo; to become this.foo = null;&lt;br /&gt;        vars&lt;br /&gt;          .replace( /\s*,\s*/g, ";\n  this." ).replace( /\b(var |final |public )+\s*/g, "this." )&lt;br /&gt;          .replace( /\b(var |final |public )+\s*/g, "this." )&lt;br /&gt;          .replace( /this.(\w+);/g, "this.$1 = null;" ) + &lt;br /&gt;          ( extend ? "extendClass(this, " + extend + ");\n" : "" ) +&lt;br /&gt;          "&lt;CLASS " + name + " " + static + "&gt;" + ( typeof last == "string" ? last : name + "(" );&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;I added one line to the end of the replaces&lt;br /&gt;&lt;code&gt;&lt;br /&gt;          .replace(/\b(private this.)/g, "var ") + &lt;br /&gt;&lt;/code&gt;&lt;br /&gt;It now looks like this.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;        // Replace var foo = 0; with this.foo = 0;&lt;br /&gt;        // and force var foo; to become this.foo = null;&lt;br /&gt;        vars&lt;br /&gt;          .replace( /\s*,\s*/g, ";\n  this." ).replace( /\b(var |final |public )+\s*/g, "this." )&lt;br /&gt;          .replace( /\b(var |final |public )+\s*/g, "this." )&lt;br /&gt;          .replace( /this.(\w+);/g, "this.$1 = null;" )&lt;br /&gt;          .replace(/\b(private this.)/g, "var ") + &lt;br /&gt;          ( extend ? "extendClass(this, " + extend + ");\n" : "" ) +&lt;br /&gt;          "&lt;CLASS " + name + " " + static + "&gt;" + ( typeof last == "string" ? last : name + "(" );&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;What this now does, is after it's done parsing through the variables, if it's going to be private, it'll look like this&lt;br /&gt;&lt;code&gt;&lt;br /&gt;private this.i;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;So I'm replacing this with.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;var i;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Instead of.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;this.i;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;An apparent problem is if later in the constructor, I'm using something like this&lt;br /&gt;&lt;code&gt;&lt;br /&gt;this.num = num;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;It will cause problems. It will be trying to use a private member, by declaring it later with this., which in JavaScript, will make it a public method, ignoring the previously set private one. Also, I don't have private methods working, but I have located the location in the code that I have to work with it. It appears it's adding the methods to the object through the use of a created method called addMethod, which I don't understand yet. Here is the implementation and calling of said code.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;    p.addMethod = function addMethod( object, name, fn ){&lt;br /&gt;      if( object[ name ] ){&lt;br /&gt;        var args  = fn.length,&lt;br /&gt;            oldfn = object[ name ];&lt;br /&gt;        &lt;br /&gt;        object[ name ] = function(){&lt;br /&gt;          if( arguments.length == args ){&lt;br /&gt;            return fn.apply( this, arguments );&lt;br /&gt;          }else{&lt;br /&gt;            return oldfn.apply( this, arguments );&lt;br /&gt;          }&lt;br /&gt;        };&lt;br /&gt;      }else{&lt;br /&gt;        object[ name ] = fn;&lt;br /&gt;      }&lt;br /&gt;    };&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;and calling&lt;br /&gt;&lt;code&gt;&lt;br /&gt;        // Fix class method names&lt;br /&gt;        // this.collide = function() { ... }&lt;br /&gt;        // and add closing } for with(this) ...&lt;br /&gt;        rest = rest.replace( /(?:public )?Processing.\w+ = function (\w+)\((.*?)\)/g, function( all, name, args ){&lt;br /&gt;          return "ADDMETHOD(this, '" + name + "', function(" + args + ")";&lt;br /&gt;        });&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;I'm not sure how this is all working, but the second part of code here will change the html processing code, to call the addMethod, I'm pretty sure about this, just not sure how it's doing it.&lt;br /&gt;&lt;br /&gt;Finally, I noticed comments are removed only if a space follows the //. This is easy to fix, I'm just trying to find a good reason as to why this is here, or if it's simply been over looked. Like this.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;    // Remove end-of-line comments&lt;br /&gt;    aCode = aCode.replace( /\/\/ .*\n/g, "\n" );&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;As you can see, someone has added a space after the //, is this on purpose? why?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-1670038207717324012?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/1670038207717324012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/02/private-working-this-time-for-real.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/1670038207717324012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/1670038207717324012'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/02/private-working-this-time-for-real.html' title='private working this time, for real'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-2581057213327819445</id><published>2010-02-01T16:12:00.000-08:00</published><updated>2010-02-02T05:24:16.011-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>private working</title><content type='html'>I was able to use a simple solution on &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/133-private-keyword"&gt;#133&lt;/a&gt;. What I did was implement one line of code&lt;br /&gt;&lt;br /&gt;aCode = aCode.replace(/(private)/g, "var");&lt;br /&gt;&lt;br /&gt;I added this to line 82(about) of the &lt;a href="http://github.com/jeresig/processing-js/raw/master/processing.js"&gt;source&lt;/a&gt;. This was just to test, but it worked. You can see the implementation &lt;a href="http://matrix.senecac.on.ca/~sdowne/processingjs/firstTest/withPrivate.html"&gt;here&lt;/a&gt;. This is the &lt;a href="http://matrix.senecac.on.ca/~sdowne/processingjs/firstTest/processing.js"&gt;Processing.js&lt;/a&gt; source I am now using.&lt;br /&gt;&lt;br /&gt;I just remembered I need to make sure it doesn't parse any character strings with the word private in it. I need to test it for use with private functions, check syntax variations, and debug.&lt;br /&gt;&lt;br /&gt;Just noticed the "private" member is not actually private, probably because it's still creating a "this.variable". So in the end it looks like "var this.i;" which, probably is not private as I expect.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-2581057213327819445?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/2581057213327819445/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/02/private-working.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/2581057213327819445'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/2581057213327819445'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/02/private-working.html' title='private working'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-1184722745899814558</id><published>2010-02-01T13:47:00.001-08:00</published><updated>2010-02-01T14:32:19.948-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>Processing.js source code</title><content type='html'>Today, Feb 1st, I've been going through the JavaScript &lt;a href="http://github.com/jeresig/processing-js/raw/master/processing.js"&gt;source&lt;/a&gt; for Processing.js, and I think I've figured out what I have to do, and how I have to do it, I'm just tno sure where.&lt;br /&gt;&lt;br /&gt;I'm enabling the private keyword to be usable in Processing.js, bug number &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/133-private-keyword"&gt;#133&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Last &lt;a href="http://scottdowne.blogspot.com/2010/01/emulating-bug-133.html"&gt;post&lt;/a&gt; I mentioned how I would just need to use the basis behind the public keyword, that I could just "flip that", whatever that meant... I figured if public is working in Processing.js, the same concepts could be applied to private. Oh, how wrong I was.&lt;br /&gt;&lt;br /&gt;What I have to do is, wherever a private variable is declared, I need to change the JavaScript to specify as a var. This &lt;a href="http://phrogz.net/js/Classes/OOPinJS.html"&gt;link&lt;/a&gt; was helpful in refreshing my memory. An example.&lt;br /&gt;&lt;br /&gt;private int i; //Java&lt;br /&gt;&lt;br /&gt;var i; //JavaScript&lt;br /&gt;&lt;br /&gt;I believe this is the concept. I should find where in the source a public variable is converted. &lt;br /&gt;&lt;br /&gt;public int i; &lt;br /&gt;&lt;br /&gt;to&lt;br /&gt;&lt;br /&gt;this.i;&lt;br /&gt;&lt;br /&gt;and add a regex that does this feature, but with private. &lt;br /&gt;&lt;br /&gt;There are a few things I have not fully thought through, yet, like if a variable is created in java without the use of public, the JavaScript probably finds the int word, and creates this.i anyway, and I don't want to just look for all private and switch it with var, that would leave me with var this.i.&lt;br /&gt;&lt;br /&gt;I don't know exactly where in the source this needs to be done, but starting on line 71 there is a var called aCode going through multiple regex's. What this is, is a string containing Java source, being parsed into JavaScript.&lt;br /&gt;&lt;br /&gt;    // Remove end-of-line comments&lt;br /&gt;    aCode = aCode.replace( /\/\/ .*\n/g, "\n" );&lt;br /&gt;&lt;br /&gt;I'm going to replace instances of private with a regex in this manner.&lt;br /&gt;&lt;br /&gt;I also must consider private functions, so a small check list, of things to consider.&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Consider private member functions&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Consider private member variables&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Consider variations in the syntax&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;That seems to be all for now, I don't think getting something working is going to take much longer, hopefully it'll be done by Wed night.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-1184722745899814558?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/1184722745899814558/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/02/processingjs-source-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/1184722745899814558'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/1184722745899814558'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/02/processingjs-source-code.html' title='Processing.js source code'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-9221864329521971107</id><published>2010-01-31T16:02:00.000-08:00</published><updated>2010-01-31T16:27:30.180-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>emulating the bug, #133</title><content type='html'>I've started to tackle the &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/133-private-keyword"&gt;#133&lt;/a&gt; bug, or in this case, a missing feature. The idea is simple. Allow use of the private keyword in &lt;a href="http://processingjs.org/"&gt;Processing.js&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Ah, technically, I don't think this is a bug, but a missing feature.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;What I have done.&lt;/h3&gt;&lt;br /&gt;I setup a simple example, that creates an object that holds a number, and returns the number. It can be viewed &lt;a href="http://matrix.senecac.on.ca/~sdowne/processingjs/withoutPrivate.html"&gt;here&lt;/a&gt;. The black square shows up, which is as expected as I have not broke it yet.&lt;br /&gt;&lt;br /&gt;I also setup the same example, this time using the private keyword. This can be found &lt;a href="http://matrix.senecac.on.ca/~sdowne/processingjs/withPrivate.html"&gt;here&lt;/a&gt;. I noticed the black canvas does not load, because there is no support for the private keyword.&lt;br /&gt;&lt;br /&gt;I've started to go through the processing.js source, and after all this initial setup, I've hit my first real task. Find where, and how, the private keyword must be created or used.&lt;br /&gt;&lt;br /&gt;Ok, &lt;a href="http://processing.org/reference/private.html"&gt;here&lt;/a&gt; is the documentation on the private keyword in processing, note, this is the regular, Java based version, and not the JavaScript one.&lt;br /&gt;&lt;br /&gt;And &lt;a href="http://processingjs.org/reference/public"&gt;here&lt;/a&gt; is the documentation for the private keyword, in the JavaScript version, which works. I figure this would be a great place to start, as I may just need to flip that. &lt;a href="http://matrix.senecac.on.ca/~sdowne/processingjs/withPublic.html"&gt;Here&lt;/a&gt; is a test of the public keyword, working as expected, and &lt;a href="http://github.com/jeresig/processing-js/raw/master/processing.js"&gt;this&lt;/a&gt; is the processing.js source code that I must work with.&lt;br /&gt;&lt;br /&gt;Ah, I think that's enough for this blog post.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-9221864329521971107?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/9221864329521971107/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/01/emulating-bug-133.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/9221864329521971107'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/9221864329521971107'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/01/emulating-bug-133.html' title='emulating the bug, #133'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-5050700414530221016</id><published>2010-01-31T13:18:00.000-08:00</published><updated>2010-01-31T14:49:47.949-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>setting up Processing.js</title><content type='html'>At the end of my last &lt;a href="http://scottdowne.blogspot.com/2010/01/playing-with-processingjs.html"&gt;post&lt;/a&gt;. I mentioned I was going to start researching the bug, but it was apparent I needed to get Processing.js setup so I could run in off my box, thus able to change the source, and test it. The little &lt;a href="http://processingjs.org/learning/ide"&gt;test page&lt;/a&gt; wasn't going to cut it for very long.&lt;br /&gt;&lt;br /&gt;I am going to start by going through this &lt;a href="http://lethain.com/entry/2008/may/10/getting-started-with-processing-js/"&gt;walkthrough&lt;/a&gt; and report back in when I got it up and running, hopefully tonight as I have school tomorrow morning, and may not get a chance tomorrow.&lt;br /&gt;&lt;br /&gt;Update. It didn't take long at all to go through the example &lt;a href="http://lethain.com/entry/2008/may/10/getting-started-with-processing-js/"&gt;here&lt;/a&gt;. and this is what I came up with &lt;a href="http://matrix.senecac.on.ca/~sdowne/processingjs/test.html"&gt;link&lt;/a&gt;. I didn't have any problems, and it's pretty straight forward.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-5050700414530221016?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/5050700414530221016/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/01/setting-up-processingjs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/5050700414530221016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/5050700414530221016'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/01/setting-up-processingjs.html' title='setting up Processing.js'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-3082502279307415817</id><published>2010-01-31T08:21:00.000-08:00</published><updated>2010-01-31T09:26:10.521-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>Playing with Processing.js</title><content type='html'>My last blog &lt;a href="http://scottdowne.blogspot.com/2010/01/initial-project-plan.html"&gt;entry&lt;/a&gt;, I started my initial project plan.&lt;br /&gt;&lt;br /&gt;And today I'm starting the process of learning &lt;a href="http://processingjs.org/"&gt;Processing.js&lt;/a&gt;.&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;get the basics of the syntax&lt;/li&gt;&lt;br /&gt;&lt;li&gt;how to run a program in a canvas tag&lt;/li&gt;&lt;br /&gt;&lt;li&gt;and understand the basic, mandatory methods used to run a program&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Upon going to the Processing.js &lt;a href="http://processingjs.org/"&gt;home page&lt;/a&gt; I saw a link at the bottom &lt;a href="http://processingjs.org/learning/ide"&gt;"Try out some Processing code!"&lt;/a&gt;. What this is, is a page that you can edit, and immediately view the results of your changes.&lt;br /&gt;&lt;br /&gt;First thing I noticed is that it uses &lt;a href="http://processingjs.org/reference/setup%28%29"&gt;setup()&lt;/a&gt; and &lt;a href="http://processingjs.org/reference/draw%28%29"&gt;draw()&lt;/a&gt;, which seem to be pretty mandatory methods. setup() is pretty self explanatory, sets up the canvas, and is run once as soon as the canvas loads. The second method, draw() is called based on the interval set in &lt;a href="http://processingjs.org/reference/frameRate%28%29"&gt;frameRate()&lt;/a&gt;, which in the default case was set to 20, that's in seconds. So, the example is running at 20 frames per second, or, a better way to put it, it's calling the draw() method 20 times per second.&lt;br /&gt;&lt;br /&gt;The first thing I did was change the frames per second to 2, my results were as expected, slow. Next I tried a large number, 99999, and it seemed fast, but not nearly as fast as I expected, so I tried 30, which I believe to be the frame rate used in TV, and it seemed to be as fast as 99999. I later noticed in the &lt;a href="http://processingjs.org/reference/frameRate%28%29"&gt;frameRate()&lt;/a&gt; method, that 60 was default, and if the local machine could not handle whatever is requested, it will simply not be achieved. I tried 30 and 60, and noticed a slight difference. But, obviously not as noticeable of a difference between 1 and 30.&lt;br /&gt;&lt;br /&gt;I then noticed in the draw() method, there was &lt;a href="http://processingjs.org/reference/background%28%29"&gt;background()&lt;/a&gt; and &lt;a href="http://processingjs.org/reference/random%28%29"&gt;random()&lt;/a&gt;. I promptly changed the background(50) to background(random(9999), and it did not work well, as expected. There are not 9999 potential colours, and anything over 255 would default to 255. I then played around with &lt;a href="http://processingjs.org/reference/stroke%28%29"&gt;stroke()&lt;/a&gt; and tried some random colours there too. I found out that stroke sets the colour that is to be used while drawing to the screen. &lt;br /&gt;&lt;br /&gt;I also moved the background() method from draw() into setup(), and the results were logical. It didn't remove the old lines, and they kept drawing blue lines to the screen until the screen was blue.&lt;br /&gt;&lt;br /&gt;Then removed background() completely, by commenting it out with //. It defaulted to white.&lt;br /&gt;&lt;br /&gt;Honestly, with my experience in other programming languages, this languages seems very straight forward and within about an hour I was done playing with it and ready to start researching the bugs I was assigned.&lt;br /&gt;&lt;br /&gt;One final not about learning Processing.js, &lt;a href="http://processingjs.org/reference"&gt;this&lt;/a&gt; is a great place to get detailed into on the methods used.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-3082502279307415817?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/3082502279307415817/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/01/playing-with-processingjs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/3082502279307415817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/3082502279307415817'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/01/playing-with-processingjs.html' title='Playing with Processing.js'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-8066661708150039543</id><published>2010-01-29T12:41:00.000-08:00</published><updated>2010-01-29T15:49:35.940-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>Initial Project Plan</title><content type='html'>&lt;h3&gt;Porting processing to the canvas.&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://processing.org/"&gt;Processing&lt;/a&gt; is an open source programming language intended for programmers and artists to create programs in a visual context. A few links that are a good place to understand what it is.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://processing.org/"&gt;home page&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Processing_%28programming_language%29"&gt;wikipedia&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.openprocessing.org/"&gt;examples&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;For this project, I will be working with &lt;a href="http://processingjs.org/"&gt;Processing.js&lt;/a&gt;. Basically, allowing Processing programs to be developed, and run directly in HTML, through the use of the HTML canvas tag, retiring Flash and Java applets. This way, users can browse the web, view animation, run games, look at digital art, all without having to download and install any additional plug-ins.&lt;br /&gt;&lt;br /&gt;I mentioned a bit about this project on my last blog &lt;a href="http://scottdowne.blogspot.com/2010/01/january-26th.html"&gt;post&lt;/a&gt;. But I have officially accepted it as a project and to sum that up, I am a fan of Java, and java applets, because of how easy it is to distribute digital art through the web, and making that easier excites me not only as a programmer, but also as an artist. Maybe this will bring back my passion for art that has been beaten into submission!&lt;br /&gt;&lt;br /&gt;The essence behind what I will be doing is debugging. This is the valuable &lt;a href="https://processing-js.lighthouseapp.com/projects/41284-processingjs"&gt; bug tracking system&lt;/a&gt; used for Processing.js.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;The processing process&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;The progress of this project can easily be followed through this blog, under the &lt;a href="http://scottdowne.blogspot.com/search/label/open%20source"&gt;open source&lt;/a&gt; tag. I will be updating the blog atleast once a week, hopefully more with, what I have accomplished, what I have learned, my failures, problems and my goals as I see them. I will also have a wiki page &lt;a href="http://zenit.senecac.on.ca/wiki/index.php/SdowneProject"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;As easy as one, two, three&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;Over the course of this project, I will be working on three releases, 0.1, 0.2 and 0.3.&lt;br /&gt;&lt;br /&gt;Release 0.1 will be to work on two bugs. Bug &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/133-private-keyword"&gt;#133&lt;/a&gt; and &lt;a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/230-mouse-scroll-wheel-support"&gt;#230&lt;/a&gt;.&lt;br /&gt;I hope to get both bugs fixed for the 0.1 release.&lt;br /&gt;&lt;br /&gt;Release 0.2 and 0.3 will be more bugs to work on.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Debugging bugs&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;Bugs are something I enjoy, as they are like self contained puzzles. Debugging is not about learning a specific task, and doing that task every time you are presented with the problem that task solves. Debugging is more like a puzzle because it's always different. Once something is solved, it's no longer a puzzle, and the fun has been spoiled. Sure, it can be frustrating, and you never quite know what you're getting into, it could snowball into more than you expected, or it could be one line, or one word of code. It could be a simple matter of =+ instead of =.&lt;br /&gt;&lt;br /&gt;If by each release, I have solved the bug's puzzle, I will have been successful in my mission.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;The ingredients&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;In order to accomplish this mission, I will need to heavily refresh my JavaScript skills. It's been about a year since I last worked with it, and that was only an intro. I've been meaning to shake the JavaScript cobwebs out for a long time now, and this is a good way to do that. When I first learned JavaScript, oh so long ago, I used Seneca's INT222 &lt;a href="https://cs.senecac.on.ca/~int222/cgi-bin/int222.cgi"&gt;website&lt;/a&gt;, and that's where I will start as I work on this project&lt;br /&gt;&lt;br /&gt;I will also need to understand Processing. I expect I will be doing most of the Processing heavy learning through these two links.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://processingjs.org/learning"&gt;learning&lt;/a&gt;&lt;br /&gt;&lt;a href="http://processingjs.org/reference"&gt;reference&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;My knowledge of Java is moderately good, what I know, I know well, what I don't know, I can easily learn as I go from the java &lt;a href="http://java.sun.com/j2se/1.5.0/docs/api/"&gt;api&lt;/a&gt;. I always found the java api to be a well documented source for learning java.&lt;br /&gt;&lt;br /&gt;I have been in contact with my professor for this project, &lt;a href="https://cs.senecac.on.ca/~david.humphrey/"&gt;Prof David Humphrey&lt;/a&gt; and he has supplied me with some links to start with. He also has a &lt;a href="http://vocamus.net/dave/"&gt;blog&lt;/a&gt; which covers processing beyond what I know. A good place to start.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Collaboration of fellow students&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;There has been multiple Seneca students, past and present that have been working on this. If I need help, I can start by contacting another student through this blog &lt;a href="http://asalga.wordpress.com/2009/09/27/dps909-week-4-initial-project-plan/"&gt;posting&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;It is my hope that by having this blog I will get in contact with others, and we'll see how that goes! This is quite new to me, and I'm taking it one step at a time, moving in bit by bit, chipping away, and getting my feet wet.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Problems of the future and beyond&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;There is little that I know about this, as I have not even compiled and ran a Processing program yet. I would also need to figure out how to submit my finished work, and have it approved and entered into the collective. One step at a time, starting with research, then reading examples, compiling examples, modifying examples, looking at past bugs and how they were solved, and the compiling and running the bug in question, recreating the bug and seeing it first hand.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-8066661708150039543?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/8066661708150039543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/01/initial-project-plan.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/8066661708150039543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/8066661708150039543'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/01/initial-project-plan.html' title='Initial Project Plan'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-8495424276030389475</id><published>2010-01-26T19:36:00.000-08:00</published><updated>2010-01-26T20:06:02.615-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>January 26th</title><content type='html'>Blog time.&lt;br /&gt;&lt;br /&gt;Today we talked about our potential project for OSD, and I'm excited about learning the language &lt;a href="http://processing.org/about/"&gt;Processing&lt;/a&gt;. It's basically a more creative language for programming media and art. I like it's potential for neat, unique, 3D or 2D, physics, and games.&lt;br /&gt;&lt;br /&gt;The project would be transferring the language to be usable inside an html script tag. The task would consist of converting functions written in Java into Javascript. Allowing digital art, media and games to be run in a browser, without the need of applet software being installed. I'm a fan of Java, and java applets, because of how easy it is to distribute digital art through the web, and making that easier excites me not only as a programmer, but also as an artist. Maybe this will bring back my passion for art that has been beaten into submission!&lt;br /&gt;&lt;br /&gt;I feel my proficiency in Java is strong, but my proficiency in Javascript is slipping away, and add a new language I don't even know. It's got everything. Keeps me sharp, shakes off the dust, and pushes me into strange new lands.&lt;br /&gt;&lt;br /&gt;This is what excites me the most, for now. But I'm up for anything, and any challenge.&lt;br /&gt;&lt;br /&gt;This is all for now, up to my knowledge on the subject. If I take the project, I'll be blogging more on it.&lt;br /&gt;&lt;br /&gt;I believe I've got to read and listen to some articles this week. Been putting that aside, and then totally ignored it in favour of this blog entry!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-8495424276030389475?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/8495424276030389475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/01/january-26th.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/8495424276030389475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/8495424276030389475'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/01/january-26th.html' title='January 26th'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-1381174709389972312</id><published>2010-01-20T20:16:00.000-08:00</published><updated>2010-01-20T20:58:42.034-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'>week of Jan 18th</title><content type='html'>The article on &lt;a href="http://arstechnica.com/open-source/news/2009/06/academic-source-code-dust-up-symptom-of-cs-education-ills.ars"&gt;Academic source code dust-up symptom of CS education ills&lt;/a&gt; really caught my eye. I've long been a critic of academia, mostly the testing of  individual achievement. It's really become a student's focus of school, and it's perhaps the part of school where you do the least learning.&lt;br /&gt;&lt;br /&gt;The idea of learning in an open source environment is my white knight, and it's why I'm taking OSD600. I have high hopes, and think the open source course at seneca should mirror the importance of the sys and prj courses.&lt;br /&gt;&lt;br /&gt;Often have I mentioned my issues on academia to a prof in a casual discussion, only to hear "that's just how it's done". It's roots run deep. But on the other hand, is it school where we do our learning? or is it at home, on our own where we do our learning? A creative writing student at York university said to me "never let school get in the way of your education" and it's soo true. School only shows us the door, it's up to use to walk through it, and upon exiting, we must write a test on it. Tests have a valuable place, but the final grade portion should be from a large assignment, and a short interview with the prof about the assignment. Tests are best served as a personal marker for the student, the student exits the door, writes the test, and instead of failing or passing, the student can re enter the door, or enter the next door. That's a start, anyway. Another student at OCAD said to me that they only write tests in their history class, and that anything that you learn by doing, or you create something, has no place for a test in memory. Programming is a highly creative skill, we learn by making mistakes, and fixing them, which happens to be a lot more fun than reading a boring textbook. OCAD's solution to the lack of testing, is to interview and critique the student about their final works. If the student cheater and got someone else to create the work, it'll show in the interview no doubt when the student has no clue how to talk about the work. This also gives OCAD the chance to bring in processional art critiques to help the student, making it a positive situatio, with rewards instead of punishments. Is cheating really a big a deal as it seems? Is testing and not sharing really the only options? Not at all. It's safe to say testing and individual assignments are most valuable in the earlier semesters, and later semesters where the students that are still studying, have proven that they are there to learn. Then, roll out the group work, when my group members are more liekly to take it seriously, and at the very least, show up to class&lt;br /&gt;&lt;br /&gt;It's true, how in the article it says "it's up to the students to take their learning seriously" what I think he means is it's our job to make the change happen the way we want it to happen.&lt;br /&gt;&lt;br /&gt;Finally, not everyone learns the same way, and it's great to have options. Everything has it's place, even horrible students and teachers, it's all a learning experience.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-1381174709389972312?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/1381174709389972312/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/01/week-of-jan-18th.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/1381174709389972312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/1381174709389972312'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/01/week-of-jan-18th.html' title='week of Jan 18th'/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-8706976739212095271</id><published>2010-01-14T18:48:00.000-08:00</published><updated>2010-01-14T19:42:18.883-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'></title><content type='html'>I'm a little behind on some sort of welcome post, but here it comes anyway. In this blog, I'm going to be blogging on open source, to help me learn about it. My name is Scott Downe, and I'm a 5th semester student at Seneca College, in their computer programming and analysis program.&lt;br /&gt;&lt;br /&gt;I'll also use this blog to document my findings as I program in an open source environment.&lt;br /&gt;&lt;br /&gt;I never saw myself using a blog, but it's been two days, and I have three posts, so it must not be that bad. I also have a hard time getting into any sort of habit, good or bad. I can do something for as long as it needs to be done, and after that, I tend to move onto other things. So I don't see myself blogging after I have done, what I set out to do, with this blog. So far so good though.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-8706976739212095271?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/8706976739212095271/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/01/im-little-behind-on-some-sort-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/8706976739212095271'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/8706976739212095271'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/01/im-little-behind-on-some-sort-of.html' title=''/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-2096194590955193867</id><published>2010-01-14T18:33:00.000-08:00</published><updated>2010-01-14T19:42:28.563-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'></title><content type='html'>I just read the New York Times article on Firefox and Google, and I think, after reading this, I hold loyalty, bias, and faith towards Firefox. Mostly, it's the addons I like, something Chrome, to my knowledge, doesn't have yet.&lt;br /&gt;&lt;br /&gt;It's also interesting to hear about Google and Mozilla parting ways. Something I have not heard of until this article, or is it New York Times taking something that's not final, and make it sound more dramatic.  in this article, it definitely sounded like Mozilla and Google were at war to the same degree as Microsoft, or is it simply that their partnership is shrinking, as Mozilla grows, as it should.&lt;br /&gt;&lt;br /&gt;It's interesting though, that sometimes, it's such a small feature that puts someone on the top of a market. When left with two almost identical products, it can come down to one or two little things that decides which one gets picked up by the user, makes the choice easier, and the competition is good for all industries.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-2096194590955193867?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/2096194590955193867/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/01/i-just-read-new-york-times-article-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/2096194590955193867'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/2096194590955193867'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/01/i-just-read-new-york-times-article-on.html' title=''/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7950840353484096378.post-3027529340287268038</id><published>2010-01-13T13:48:00.001-08:00</published><updated>2010-01-14T19:42:35.555-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><title type='text'></title><content type='html'>I watched Revolution OS, and I found it to be inspiring. Although I felt a slight bias, especially towards Microsoft. Microsoft isn't the only proprietary software out there. The content was still good, but the way it was presented felt very bias, like the music, and clips of the evil Bill Gates, looking all evil. And then Linus, the father of two, with his cute little kids. Felt like I was watching an election campaign with baby kissing. Although, I can respect the tactics. I particularly liked when Microsoft used the existence of Linux in their defense. And it's a good thing they played that little rock video at the end, and not at the start. I would of been very turned off.&lt;br /&gt;&lt;br /&gt;It's amazing what they have accomplished, bigger than Microsoft. Because of the nature of open source, as long as people are writting code, Linux will always be around.&lt;br /&gt;&lt;br /&gt;I still prefer Windows as an OS, but I've also never paid for an OS, and never will. If left with the choice of free linux vs paying for windows, I'll take Linux, but free Windows vs free Linux, I take Windows. I have used Linux when it's needed, just on a daily casual basis I find Windows easier to use. And I prefer Apache over Windows Server. But in the end, they are both very usable&gt;&lt;br /&gt;&lt;br /&gt;I do on the other hand, hate MS Office. Hate it, I don't think it's usable. at all. and give me Gimp over photoshop anyday. Luckily, Gimp and OpenOffice can both be run on Windows. Oh, and I hate IE. I love Firefox, mostly because of one single addon in NoScript, but all personal decisions come down to one make or break feature. I still wouldn't use IE if it did have NoScript, though.&lt;br /&gt;&lt;a style="" href="http://video.google.ca/videoplay?docid=7707585592627775409&amp;amp;q=open+source" class="external text" title="http://video.google.ca/videoplay?docid=7707585592627775409&amp;amp;q=open+source" rel="nofollow"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7950840353484096378-3027529340287268038?l=scottdowne.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottdowne.blogspot.com/feeds/3027529340287268038/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scottdowne.blogspot.com/2010/01/i-watched-revolution-os-and-i-found-it.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/3027529340287268038'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7950840353484096378/posts/default/3027529340287268038'/><link rel='alternate' type='text/html' href='http://scottdowne.blogspot.com/2010/01/i-watched-revolution-os-and-i-found-it.html' title=''/><author><name>Scott</name><uri>http://www.blogger.com/profile/08136798146273920164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_EOa0hnOPG8w/S3Sjdiw-IhI/AAAAAAAAABc/02yhiBa-oy8/S220/sdowne.jpg'/></author><thr:total>0</thr:total></entry></feed>
