Live in southern Ontario? Attending dinner meetings is free.
PegaSoft's October Dinner Meeting
Attendence
Ken B, Ian Z, Giles O, Alan C, Madison K, Scott E, Amanda
Mike H, Lorie L, Ross M unable to attend.
Meeting BusinessPegaSoft Orientation
Ken opened the meeting by talking about PegaSoft's activity in Toronto over
the past 5 years.
PegaSoft Pin-on Buttons
Final button designs were being reviewed.
Open Forum - Industry Quote
[The views are those of the participants.]
"There are a number of problems with (ReiserFS), some purely technical,
some more related to maintenance," Jeff Mahoney of Suse Labs said in a
September letter. "ReiserFS has a small and shrinking development community,"
he said, and pointed to problems running on large servers and Reiser's
preference for version 4, which still isn't stable, he said. Ext3, in
contrast, is stable and likely will match ReiserFS's performance advantages
"soon."
SuSE's decision began long before Reiser was arrested on suspicion of killing
his girlfriend. According to reports, the employees were not surprised by
Reiser's arrest: he was difficult to work with.
The Reiser File System was reportedly hard on laptops because it required
access to the hard drive every few seconds.
Ken asked about open source and cutting edge projects. ReiserFS came out
before ext3 and was regarded as a better product for many years. However,
developers flocked to ext3 instead of ReiserFS, incorporating the superior
features into an inferior product. He had seen this on other open source
projects: someone comes up with a cutting-edge idea and then hordes of
developers retrofit the ideas into an inferior but more popular project
instead of moving development to the cutting-edge project. As a result,
the source code base for open source development is weakened.
Madison pointed out the problem of open source projects with bad names.
She tried without success to sell the GIMP to management as a serious
image management tool. Ken pointed out the problem of FreeBSD's devil
mascot which has caused problems in certain parts of the U.S. Ian
mentioned his username used to be "thedevil" but that caused problems when
applying for jobs. Ken jokingly suggested that someone should start a
financial project called "bankruptcy" and see how many business would be
interested.
Open Forum - Linux in the News
[The views are those of the participants.]
Intel announces plans for Quad-core chips.
It was pointed out that chips with multiple cores are not the same as
multiprocessor machines because the cores are fighting over control of
a single motherboard bus. Multiprocessor machines have been available
for some time. Increasing the number of cores has an effect of
diminishing returns.
Ken mentioned the misleading TV ads which suggested doing homework and
burning DVD's required a dual-core chip. Madison pointed out that she could
do those tasks with a old Pentium III.
NewTLUG announced a demonstration of Unison.
unison was presented last month at PegaSoft. Ian suggested that
"imitation is the sincerest form of flattery" and it should be taken as
an example of PegaSoft's leadership in Linux in Toronto.
Software Demonstration - Audacity (Ken B)
Ken's laptop was down while he was upgrading video drivers. Scott tried
using one of the bootable Ubuntu CD's at the Caffe but they were not
equipped with Audacity. Postponed to next month.
PegaSoft Member ProjectsBusiness Shell (BUSH) (Ken B)
No work.
Ken is alpha testing his client's project this month and didn't have time to
work on BUSH. The source code is still disrupted due to half-finished
redesign for loadable modules.
Amanda pointed out that "BUSH" and "TIA" in the PegaSoft menus make PegaSoft
sound like a company working for the U.S. government. Ken said BUSH was
started before George W. Bush became the president of the U.S. Someone on
the TLUG mailing list suggested that BUSH should be renamed to "Dubyah".
Alternative names were thrown around based on Ada's NASA and military
appeal, including NESH (NASA-Enabled SHell) and "HASH" (Heavy Artillery
SHell).
Online Game Project (Ken B)
Ken created a working chat window and was implementing 2D textures. He
briefly investigated Sun's JOGL OpenGL for Java project.
Ken was concerned over Mel's disappearance: he wasn't sure what the status
of the game project was.
Perimeter 911 Project (Alan C)
Perimeter 911 (www.perimeter911.com) is a system monitoring package similar
to open source projects like Big Brother. The financial model requires that
someone is available to monitor client systems over the Internet and alerts
be sent out when a client system becomes inaccessible.
Perimeter 911 is currently running on Intel machines using Linux and TSX.
(TSX for Intel is based on TSX for DEC computers. TSX is a descendant of
RSX which was available before DEC VMS.)
Although there was no money available to hire developers, Alan suggested that,
if a viable financial model could be created, Perimeter 911 could be ported
entirely to Linux.
Various ideas were proposed on how Perimeter 911 could be enhanced, including
the possibility of open sourcing the software while still having paid support
personnel.
Atomic OS (WAJAX) (Scott E)
Scott gave a brief demonstration of the Atomic OS project. This was an effort
to create a desktop that was accessible through a web browser, including
access to files on a remote machine and a command line console window. The
project is in its early stages and is still quite unstable.
Scott said he would be available to do a presentation on Atomic OS at a future
PegaSoft meeting.
David Patrick said Atomic OS could be used at the Linux Caffe to give people
personal desktops and storage space.
Discussion: Introduction to JavaScript (Ken B)
- a programming language that ties the web browser to the web page
- invented by Netscape, based on C and Perl but has its own rules
- not related to Java (originally called "LiveScript")
- PHP, Flash, Java, .Net do not replace JavaScript
- a web developer needs a good JavaScript reference
- to write larger script, a developer needs to think in JavaScript
- errors appear in the JavaScript Console
- Firefox has a JavaScript debugger (Venkman )
- run step by step through a script, print out values, or abort a script
- example of use: google maps uses JavaScript for its interface
- Scott pointed out that there was a JavaScript for .NET project
- Madison pointed out that Geocities and their floating logos and stuff gave
JavaScript a bad reputation
- Scott mentioned the problem of finding good web sites for JavaScript scripts.
A new project called Open JSAN is attempting to be the JavaScript equivalent
of Perl's CPAN source code repository.
- hello world example
- javascript:alert( 'hello world') in your web browser location bar
- alert is an important debugging tool
- use alert to check that a particular line is executing
- use alert to display values (will be "undefined" for something that
doesn't exist, e.g. typos)
- Scott believed these were known as "bookmarklets"
- running JavScript
- "javascript:" URL
- runs when link is clicked or in a browser's location bar
- e.g. <a href="javascript: alert('Hello World')">
- messy since script appears in the bar at the bottom of the web browser
- on(something) tag attribute
- runs on a condition (a.k.a. an event handler)
- can be attached to most items in a web page, including tables, images and links
- ONCLICK, when the mouse button is clicked on an element;
- ONDBLCLICK, when the mouse button is double-clicked on an element;
- ONMOUSEDOWN, when the mouse button is pressed over an element;
- ONMOUSEUP, when the mouse button is released over an element;
- ONMOUSEOVER, when the mouse is moved onto an element;
- ONMOUSEMOVE, when the mouse is moved while over an element;
- ONMOUSEOUT, when the mouse is moved away from an element;
- ONKEYPRESS, when a key is pressed and released over an element;
- ONKEYDOWN, when a key is pressed down over an element;
- ONKEYUP, when a key is released over an element.
- e.g. <a onClick="alert('Hello World')">Click Me</a>
- in a <SCRIPT> tag
- runs when encountered by browser
- can be embedded in the web page or loaded from a .js text file
- e.g. <SCRIPT TYPE="text/javascript">alert('Hello World')</SCRIPT>
- functions are usually place in the <HEAD> tag
- <BODY onLoad="..."> problem
- must appear after the header but often don't know if you need until later
- running a script at the bottom of a web page is almost the same thing
- mixing PHP, JavaScript and HTML can be confusing
- print "document.write(\"<A ONCLICK=\\\"alert('Hello World')\\\">\")\n";
- Ian asked what would happen if there was another nesting level. Ken said 7
backslashes would be required
- working with the web page
- "document" refers to the current web page
- any named items in a web page can be referred to by "document.name"
- any items with ID's instead of names can be referred to by "document.getElementById"
- e.g. thing = document.getElementById( "thing" ); thing.value = 1;
- rules for when name or id can be used
- IDs must be unique, NAMEs do not
- IDs are used with style sheets
- free text normally has no identification
- use a <SPAN> tag with id
- e.g. thing = document.getElementByID( "thing" ); thing.innerHTML = "New text";
- working with forms
- information is passed around between web pages using <FORM>s
- input tags in a form have values that can be read or changed
Click To Add One
<FORM NAME="click_form" action="new_page.html">
<INPUT NAME="click_counter" TYPE="text" VALUE="0">
</FORM>
<A ONCLICK="document.click_form.click_counter.value++">Click To Add One</a>
- force this form to submit using "document.main_form.submit()"
- a form may be redirected to another page using "document.main_form.action='...'"
- forms may have an onsubmit handler to check the for errors
<SCRIPT TYPE="text/javascript">
function check_form( f ) {
err_flag = true
if ( f.name.value.length == 0 ) {
e = document.getElementById( "name_error" )
e.innerHTML = "A name is required"
err_flag = false
}
return err_flag
} // check_form
</SCRIPT>
<FORM NAME="main_form" action="new_page.html" onsubmit="return check_form(this)">
<INPUT NAME="name" TYPE="text" VALUE="">
<FONT COLOR="red"><SPAN ID="name_error"></SPAN></FONT>
<BR>
<INPUT NAME="submit" TYPE="submit" VALUE="Submit">
</FORM>
- animation and effects
- to run JavaScript in the background you need to set a timer
- timer runs a task when the timer runs out
- you must set the timer again if you want to run the game repeatedly
- several guests reported a problem with timers that they used large amounts
of CPU time
<FORM NAME="another_form" action="new_page.html">
<INPUT NAME="click_counter" TYPE="text" VALUE="0">
</FORM>
<SCRIPT TYPE="text/javascript">
var task_id2
var speed_in_milliseconds2 = 1000
function background_task2() {
document.another_form.click_counter.value++
task_id2 = setTimeout( "background_task2()", speed_in_milliseconds2 )
}
task_id2 = setTimeout( "background_task2()", speed_in_milliseconds2 )
</SCRIPT>
- working with HTML colour
- colours are in hexadecimal which means you have to convert your numbers to hex
- the following function converts between 0..255 and 00..FF
var hexDigit=new Array("0","1","2","3","4","5","6","7","8",
"9","A","B","C","D","E","F")
function dec2hex(dec){return(hexDigit[dec>>4]+hexDigit[dec&15])}
function hex2dec(hex){return(parseInt(hex,16))}
- it was decided that there was probably a way of using decimal numbers with
modern browsers but it was not able to be determined how to do this
- example: text changing message and colour
<SPAN ID="counter"><</SPAN>
<SCRIPT TYPE="text/javascript">
var task_id
var speed_in_milliseconds = 200
var grey_colour = 15
var hexDigit=new Array("0","1","2","3","4","5","6","7","8",
"9","A","B","C","D","E","F");
function dec2hex(dec){return(hexDigit[dec>>4]+hexDigit[dec&15])}
function hex2dec(hex){return(parseInt(hex,16))}
function background_task() {
grey_colour--
if ( grey_colour < -14 ) grey_colour = 15
// convert grey level to "#FFFFFF" format
grey_colour_str = "#" +
dec2hex( Math.abs( grey_colour ) + Math.abs( grey_colour * 16 ) ) +
// red
dec2hex( Math.abs( grey_colour ) + Math.abs( grey_colour * 16 ) ) +
// green
dec2hex( Math.abs( grey_colour ) + Math.abs( grey_colour * 16 ) )
// blue
c = document.getElementById( "counter" );
c.innerHTML = grey_colour_str
c.style.color = grey_colour_str
task_id = setTimeout( "background_task()", speed_in_milliseconds );
}
task_id = setTimeout( "background_task()", speed_in_milliseconds );
</SCRIPT>
- common problems
- documentation is hard to find
- a web search suggested that most of O'Reilly's cornerstone books on
HTML and JavaScript were now 8 years out of date
- case-sensitive: getElementById not getElementByID
- hard to debug (no development environment)
- language with unique rules that is only used occasionally
- behaviour is not always consistent across different browsers – check pages
- many times a developer knows something is possible but doesn't know how to
implement it
- Math.abs() versus object.length - different syntax for different features
- future topics could include AJAX and XML on JavaScript
Next Dinner
Unless otherwise notified, the next dinner meeting is Thursday,
November 16, 2006 at the Linux Caffe. Topic: Introduction to Atomic OS
« Truth Humility Communication Nobility Freedom Purity
Excellence Right Support Courage Compassion Quality Honesty Trust
Cooperation Challenge Education »
PegaSoft Canada - A Linux Association Since 1994