KEEP IN TOUCH

Join Newsletter

CALL NOW

Share with:


Recent Posts





Programming

Very quick rdebug primer for using the debugger in Mongrel. <h1>Setting Up your Environment for Debugging</h1> gem install ruby-debug If you're in textmate go to Bundles > Bundle Editor > Edit Snippits...

Read More

Web Developer -- adds a robust set of tools to peek under the hood. Adds a toolbar to your windows to let you do things like disable Javascript, cookies, css, see field names for a form on the page etc. Firebug - the king of web...

Read More

A good area to spend some time for someone new to Ruby is to understand about objects. This serves as a basic wrap-around over view of what you need to know to get going.

First off remember to use the .class method on any object too (in your IRB, for example), giving you its class name. If you’re playing along here, that’ll help.

You will need to know what object orientation is in programming for this to make sense, and I hope it is geared to people coming from an object orientation learned in a different environment.

Everything in Ruby is an object. Even true and false have their own objects. Occasionally operators (like << and ||) are language contructs, but that's really insignificant for the purpose of this lessen. When we say nearly everything in Ruby we mean everything you think is an object and then some. Other languages have what are called primitives -- numbers, integers or floats; strings; booleans, etc. These things are see by the compiler and treated as what they are. But in Ruby all the primitives are objects too: numbers, strings, even boolean operators have their own classes. So, you can do things like ask an object if it is a nil object. Since it is used to return a negative meaning to an operation or a non-result, it's a good way to catch edge cases. False and nil are trip-ups for programmers coming from other languages where because false does not evaluate to 0 and true doesn't eval to 1.

Symbols used in CSS symbolnamewhat fornotes .dot (period)denotes class value #pounddenotes id value *staruniversal selector spacedescendant selector ,commagroup selector :colonused for pseudo-classesonly :hover and :active are supported by older IE versions; different pseudo-class support based on browser > greater thanchild selectornot supported by IE6 & earlier +plusadjacent selector CSS3 only [ ]bracketsattribute selector CSS3 only ...

Read More

def hilite_search_criteria(pattern, search_criteria) return if pattern.nil? or search_criteria.nil? pattern.gsub!(/(]*>)|\n|\t/s) {" "} match_char = pattern =~ /#{search_criteria}/i matched_string = $~.to_s return if match_char.nil? start = match_char - 25 start = (start < 0 ? 0 : start) unless match_char.nil? p = pattern[start ...

Read More