Changes

Jump to: navigation, search

User:Dhhodgin

3,334 bytes added, 08:10, 30 September 2010
About Me
== About Me ==
I'm a 5th 7th Semester BSD student taking DPS909DPS901. Working part time on an ASP.NET c# application.
==Technical Qualifications==
=== Week 9 stuff ===
* tba
 
==DPS911 Projects==
[[http://zenit.senecac.on.ca/wiki/index.php/Processing.js Processing.js]] - Active project<br />
 
=== Releases ===
0.4 - [http://dhodgin.wordpress.com/2010/01/25/0-4-and-triage-for-processing-js/ Full Details] Triage and peer-review of outstanding 0.2 and 0.3 code<br/>
0.5 - [http://dhodgin.wordpress.com/2010/02/06/0-5-processing-js-release-contribution/ Full Details] Review of binary() and sort(), rewrote hex(), trim(), some code efficiency cleanup<br />
0.6 - wip <br />
 
 
 
=== Weekly stuff ===
* Update Wiki
* Prepare for 0.4 release
* schedule demos for Dave in weeks 3, 7, and 10 for 0.4, 0.6, and 0.8 releases.
* Demo 1 - Feb 4 (completed)
== Code Blocks ==
Here is a list of code blocks I have written for the processing.js project<br />
=== trim() ===Trim leading and trailing whitespace from strings as well as tab characters, newlines, and nbsp characters<br/>Commit [http://github.com/dhodgin/processing-js/commit/e7f258eec8f566a0da39c23f964280637e8e2a4b trim() commit]<br />Test available [http://matrix.senecac.on.ca/~dhhodgin/dps911/examples/seneca/trim/trimtest.htm here]<br /> p.trim = function( str ) { var newstr; if (typeof str === "object") { // if str is an array recursivly loop through each element // and drill down into multiple arrays trimming whitespace newstr = new Array(0); for (var i = 0; i < str.length; i++) { newstr[i] = p.3 trim(str[i]); } } else { // if str is not an array then remove all whitespace, tabs, and returns newstr = str.replace(/^\s*/,'').replace(/\s*$/,'').replace(/\r*$/,''); } return newstr; };=== decimalToHex() ===A helper function used with hex to convert a number passed in to hex and add any specified padding  var decimalToHex = function decimalToHex(d, padding) { //if there is no padding value added, default padding to 8 else go into while statement. padding = typeof(padding) === "undefined" || padding === null ? padding = 8 : padding; if (d < 0) { d = 0xFFFFFFFF + d + 1; } var hex = Number(d).toString(16).toUpperCase(); while (hex.length < padding) { hex = "0" + hex; } if (hex.length >= padding){ hex = hex.substring(hex.length - padding, hex.length); } return hex; }; === hex() ===hex(x, y) function for processing. x is a byte, char, int, or color. y is the length of the string to return.<br />Commit [http://github.com/dhodgin/processing- wipjs/commit/d51adccc9acfeb4fa286366c98e06a33ad296524 hex() commit]<br />Test available [http: blendColor//matrix.senecac.on.ca/~dhhodgin/dps911/hextest.htm here]<br /><br /> // note: since we cannot keep track of byte, char, and int types by default the returned string is 8 chars long // if no 2nd argument is passed. closest compromise we can use to match java implementation Feb 5 2010 // also the char parser has issues with chars that are not digits or letters IE: !@#$%^&* p.hex = function hex(value, len) { var hexstring = ""; var patternRGBa = /^rgba?\((\d{1,3}),(\d{1,3}),(\d{1,3})(, blend\d?\.?\d*)?\)$/i; //match rgba(20,20,20,0)or rgba(20, copy20,20) if (arguments.length === 1) { hexstring = hex(value, 8); } else { if (patternRGBa.test(value)) { // its a color hexstring = decimalToHex(p.rgbaToInt(value),len); } else { // its a byte, char, or int hexstring = decimalToHex(value, len); } } return hexstring; }; 
=== copy() ===
p.copy = function copy(src, sx, sy, sw, sh, dx, dy, dw, dh) {
1
edit

Navigation menu