jwallace.us

tech, tunes, and other stuff

I Love Opera, But…

Note:  I had originally posted this on my (short) blog on the myOpera web site last year (Jan 2013).  Unfortunately the site is going away this March 1, so I am reposting it here.

I guess I picked the wrong time to get serious using the Opera browser.

I’ve flirted with Opera for years, dating all the way back to when there was an Opera browser for BeOS R5. Never heard of BeOS? Its been resurrected as Haiku OS, but that will have to be for another blog post – maybe. I also used Opera on my Sharp Zaurus handhelds – the SL 5000D and the SL6000.

So I finally decided to give Opera a serious try. I mean I WANTED Opera to be my number one browser to use on ALL of my OSes: OSX, Linux, iOS, and Windows. There is a lot to love about it. I started by moving ALL of my old browser links and passwords from all of my past browsers (Firefox, Camino, SRware Iron, Safari) onto Operalink. Well, you might imagine that took a lot of work, but I wanted to use one browser on all of the platforms I run.

Well.. Guess which version I started doing this with? just before – 12.10. Yup. Needless to say, I wasn’t happy at all. 12.10 was SO buggy it made me RUN away from Opera – FAST – back to SRware Iron. Thats when I discovered Lastpass and Xmarks. They are sweet. I think Lastpass is better and more feature rich than Opera’s password manager via Operalink. Xmarks is quite nice too, and now that I am using both of these utilities… I will continue using Iron. I’m hoping Opera has cleaned most of its 12.1x bugs in 12.12, but until there is an Xmarks version for Opera I’ll continue using other browsers. BOTH password and bookmark syncing way more important to me than any one browser.

How to Pass the ZCE PHP 5.3 Exam

This topic recently came up in our Nashville PHP User’s Group.  I made a reply to someone’s question as to what was involved in passing the exam.  I felt it was good a good post, so I have posted it here for posterity:

I took and passed the ZCE PHP 5.3 exam back in March of this year.  If you wish to prepare for this exam, I would do the following.  Get Ben Ramsey’s book.  It was an essential part of my study as I read it a couple of times and took notes while doing so.  It is old and written for the PHP 5.0 exam.  Much has changed since it was written,  but it is still essential in my opinion.  You can pick up a copy HERE.  There is also a PHP 4 practice test book which is out of print.  Unlike Ben’s book it is geared towards the PHP 4 exam, but it is also useful.  You can find it HERE.  Zend also has a study guide HERE.  The practice questions in the study guide at the end of each chapter are good,  but I would wait to take those practice questions towards the end of your study.  There is a practice test engine for the exam (requires Windows) that you can purchase from uCertify HERE.  I bought the test at a discount, and it was useful.  (Search for online coupon codes.)   Its good to use as a practice for taking timed PHP exams, but don’t expect it to reflect the actual exam.  The actual exam is MUCH more difficult.  As I said, the Zend study guide is helpful as is Ben’s book,  however they are by no means comprehensive as to what you need to know.  So what do you need to know?  THIS pretty much says it all.  You need to know everything.  Its a lot to memorize, but to pass this exam you’ll need to go to the PHP Manual and memorize it ALL.  That includes classes, functions and methods, function parameters, what gets returned given the different arguments,  initialization settings, etc, etc…  Memorize the whole manual because they can (and probably will) ask you anything or a little of everything.  For me, the amount of memorization required was the most difficult part of preparing for this exam.   However, its more than simply memorization.  The questions make you think while you are taking the exam.  Be prepared for the unexpected, trick questions, and don’t panic.  :–)  You have to know how it all fits together.  All this being said.  I’m not trying to discourage you.  Just be prepared to study hard,  and when you pass you’ll know and appreciate (even if no one else does) what it is you have achieved.  To date, only 25 people in Tennessee have passed this exam.

YouTube Music Downloads

The easiest way to get music from YouTube is to use a YouTube music downloader. The best one I’ve found is a free utility from MediaHuman. I talked about it in my previous post “Downloading music from YouTube”. It comes in both Windows and Mac versions. It will download to any or all of these formats: MP3, AAC, OGG. To get the best sound quality use the fmt option in the URL. A discussion of the different fmt options can be found here: YouTube quality and codecs.

jQuery Notes: Javascript Events

Javascript (and hence jQuery) wouldn’t be very useful without the ability to handle events.  There are four basic types of events:

  • mouse events
  • document and window events
  • form events
  • keyboard events

There are three basic categories of mouse events:

  • When a mouse button is engaged
  • When the mouse button is disengaged
  • When a mouse is clicked
Mouse Events
event description
click fires after the mouse button is clicked and released
dblClick fires after the mouse button is clicked and released twice in quick succession
mousedown fires when a mouse button is depressed, but not released
mouseup fires when a mouse button is released after being depressed
mouseover fires when a mouse pointer is moved over an element
mouseout fires when a mouse pointer is moved off an element
mousemove fires when a mouse pointer is moved
Document and Window Events
event description
load
resize
scroll
unload
Form Events
event description
submit
reset
change fired when a form’s field has changed
focus fires when a text field is entered
blur fires when the currently focused field is exited

 

Keyboard Events
event description
keypress continually fires while a key is pressed down
keydown fires when a key is pressed down (and just before the keypress event)
keyup fired when a key is released

This page is a summary of information found in: JavaScript and jQuery: The Missing Manual, pp157-162

jQuery Notes - Working With Content

There are a few functions that jQuery provides to add content to a web page.

Content Adding Functions
jQuery example effect
.html() alert(($’#errors’).html(‘Oops’)); creates an alert with the message ‘Oops’ for an element with ID ‘errors’
.text() $(‘#errors h2′).text(‘no errors found’); will replace the text in an h2 block for an element with ID ‘errors’
.append() $(‘#errors’).append(‘some errors found’); will append the text to an element with ID ‘errors’
.prepend() $(‘#errors’).prepend(‘some errors found’); will prepend the text to an element with ID ‘errors’
.after() $(‘#username’).after(‘User Name is required’); will place the text after to an element (e.g. div) with ID ‘username’
.before() $(‘#username’).before(‘User Name is required’); will place the text before to an element (e.g. div) with ID ‘username’
.remove() $(‘#popup’).remove(); deletes an element
.replaceWith() $(‘#cartInfo’).replaceWith(‘Item added to cart.’); replaces an element – note this could have also replaced an different tag (e.g. img) with the p tag
.addClass() $(‘a[href^=”http://”]‘).addClass(‘externalLink’); adds a class called ‘externalLink’ to all external links
.removeClass() $(‘a[href^=”http://”]‘).removeClass(‘externalLink’); removes a class called ‘externalLink’ to all external links
.toggleClass() $(‘a[href^=”http://”]‘).toggleClass(‘externalLink’); adds a class to an element if it doesn’t already exist, or removes a class if it does exist
css() $(‘#main’).css(‘background-color’); GET a CSS property from an element
css() $(‘body’).css(‘font-size’, ’200%’); SET a CSS property element
css() $(‘body’).css({‘font-size’ : ’200%’ , ‘border’ : ’2px solid #FE0037′}); SET more than one CSS properties using an object literal
css() (‘body’).css(‘font-size’,’200%’).css(‘border’,’2px solid #FE0037′); SET more than one CSS properties using chaining (more efficient than 2 function calls)
attr() var imgFile = $(‘#banner img’).attr(‘src’); returns the src property for first img tag inside another tag with ID of banner
attr() $(‘#banner img’).attr(‘src’, ‘images/newImg.png’); change a tag’s (e.g. ‘src’) attribute
removeAttr() $(‘body’).removeAttr(‘bgColor’); completely remove an attribute from a tag
fadeOut() $(‘img’).fadeOut(); jQuery automagically loops and fades out each img element
each() $(‘img‘).each(function() { alert(‘hello’); }); performs a series of actions on each element

 

Anonymous Functions

Anonymous functions are functions with – you guessed it – no name. Here is an example of one.  In this example we are looking for every anchor tag with an ID of  extLinkList which starts with the substring ‘http://’:

1
2
3
4
$('a(href^=http://]').each(function() {
   var extLink = $(this).attr('href');
   $('#extLinkList').append('<li>' + extLink + '</li>');
});

Note the the use of $(this) to refer to an individual element in the list.

This page is a summary of information found in: JavaScript and jQuery: The Missing Manual, pp138-150

jQuery Notes - Selectors

In order to manipulate web page elements, the element must first be selected.  jQuery provides for selecting web pages elements via jQuery objects.

There are three basic types of selectors:  IDs, classes, and elements.

Basic Selectors
CSS jQuery
class

John Doe

$(‘author’)
id

This can be anything

$(‘#anything’)
element Ixquick Search $(‘a’)

 

More advanced selectors can be made: descendent, child, adjacent, attribute

 

Advanced Selectors
CSS jQuery effect
descendent
$(‘#navBar a’) selects only links in the unordered list
child $(‘body > p’) selects only the p tags that are children of the body tag
adjacent $(‘h2 + div’) selects only the div tags that are directly after an h2 tag

 

A special set of selectors are the attribute selectors, which allow for the selection of elements based on their attribute values.

 

Attribute Selectors
jQuery example effect
[attribute] $(a[href]) matches all elements that have a specific type of attribute
[attribute=”value”] $(input[type=”text”]) matches a specific attribute value
[attribute^=”value”] $(a[href^=”http://”]) matches a specific value at the beginning of an attribute
[attribute$=”value”] $(a[href$=”.pdf”]) matches a specific value at the end of an attribute
[attribute*=”value”] $(a[href*=”jwallace.us”]) matches a specific value anywhere in the attribute

 

Selections can be filtered in jQuery too:

 

Selector Filters
jQuery example effect
:even $(‘tr:even’) matches every even row in a table
:odd $(‘tr:odd’) matches every odd row in a table
:first $(‘p:first’) matches the first paragraph on a page
:last $(‘p:last’) matches the last paragraph on a page
:not $(‘a:not(.header)’) matches all anchors not in a the .header class
:has $(‘li:has(a)’) matches all list elements that have an anchor tag
:contains $(‘p:contains(ABACAB)’) matches all paragraphs that contain the text “ABACAB”
:hidden $(‘div:hidden’) matches all hidden div elements
:visible $(‘div:visible’) matches all visible div elements

 

Selection Chaining

It is possible to chain several selectors together for a combined effect.  For example, to select an element with an ID of popup, you could do the following:

$(‘#popup’).width(300).height(300).text(‘hello world’).fadeIn(1000);

This page is a summary of information found in: JavaScript and jQuery: The Missing Manual, pp129-137

Computer Languages and Systems I’ve Used

The other day I was thinking about all of the computer language and operating systems I’ve known or used.  I’ll try to put it to a list here.  No doubt I’ll forget one or two and have to add them later.  Well here goes..

Languages..

Basic, Pascal, 8086 assembler, C, C++, Lisp, Smalltalk-80, Expect, Perl, BASH script, PHP, Java, Ruby, Flex, Actionscript, Javascript, Rexx.

Operating Systems..

MS DOS, MS Windows (3,0, 3,1, NT, 2000, XP, 7), IBM OS/2, Commodore Amiga OS, Apple Mac OS X, Sun Solaris, HP-UX, Puma, SCO UNIX, IBM AIX, Silicon Graphics Irix, Honeywell CP-6, DEC OSF/1, Digital Ultrix, Linux (Slackware, Red Hat, SUSE, Ubuntu, Mint), BeOS, Haiku.

Adding Old Projects

I have a few old projects that I’ve worked on in the past.  In the coming days I’ll be placing some of them here so people can download them and use them if they want.  Some I did on my own, and others I wrote for clients.