Recent Notes

Displaying keyword search results 1 - 10
Created by Dr. Xi on February 06, 2012 12:14:11    Last update: February 07, 2012 15:39:35
Oracle sqlplus command line tools does not support command line editing out-of-the-box. But on Linux there's a handy utility that enables command line editing with any command line tool: rlwrap - readline wrapper. Install rlwrap: $ sudo apt-get install rlwrap Create a keywords file .sql.dict (optional, but convenient): false null true access add as asc begin by chec... It would be nice to add the tables names also. Create an alias for sqlplus (put it in .bashrc ): alias sqlplus='rlwrap -f $HOME/.sql.dict sqlplus'
Created by James on January 26, 2012 21:23:56    Last update: January 26, 2012 21:23:56
In an HTML page, elements can overlap because of position styles. When there's an overlap, elements coming later in the HTML code are displayed on the top. This can be altered by specifying z-index in the CSS. Elements with higher z-index are placed on the top. However , z-index only works for elements that are not static positioned. Static positioned elements are always at the bottom compared to relative , fixed and absolute positioned elements. This is a test page: <!DOCTYPE html> <html> <head> <style t... Effects of z-index can be tested by adding it to the elements, for example: <div id="bg" class="big" style="z-index: 3"></div>...
Created by jinx on May 18, 2011 20:09:05    Last update: May 18, 2011 20:09:05
The PHP function file_get_contents reads the entire contents of a file into a string, while the function file reads a file into an array. file_get_contents('filename') is equivalent to implode('', file('filename')) : <?php // reads entire file into array, one elem...
Created by jinx on April 26, 2011 09:33:17    Last update: April 26, 2011 09:33:17
PHP arrays may be combined together with the array_merge function or the array union operator ' + '. But they give different results: array_merge re-assigns index to numerical keys. It keeps both items when two values are indexed to the same numerical key in the original arrays. The union operator does not change array indexes, numerical or not. When same index appears in both original arrays, array_merge overwrites the value of the first array by the second array. The union operator ( + ) keeps the value in the first array. Example: <?php $a1 = array( '1' => 'Apple', ... Output: Using array_merge; array(5) { [0]=> s...
Created by jinx on April 10, 2011 15:00:16    Last update: April 10, 2011 15:01:25
In PHP, arrays are associative arrays (maps). As such, the elements in an array are supposedly not ordered. But they are . PHP provides the function end to let you peek at the last element of an array, and array_pop to pop the last element. So how are the elements ordered? By the order they are added to the array, not by the index! <?php $fruits = array('orange', 'banana', 'appl... Outputs: apple pea array(3) { [0]=> string(...
Created by jinx on April 10, 2011 14:43:19    Last update: April 10, 2011 14:43:35
The function substr accepts negative index number, which counts from the end of the string backwards. <?php // get the last character echo substr(...
Created by James on March 29, 2011 11:37:53    Last update: March 29, 2011 11:37:53
The test page below reports the column and row indexes of the table cell you clicked. <!DOCTYPE html> <html> <head> <title>jQu...
Created by Dr. Xi on August 31, 2008 20:43:44    Last update: January 22, 2011 12:48:08
It's probably more useful to make the JavaScript executor a bookmarklet. That way it gains access to the page on which it is invoked. Therefore, more helpful while debugging. Here's the code: <html> <body> <a href="javascript:(funct... Or, you can add this link to your bookmarks, name it "JS Executor". For a full featured JavaScript console, you may need Jash
Created by Dr. Xi on October 26, 2010 04:47:37    Last update: January 11, 2011 20:00:36
The code presented here is a simple implementation of a tab set. It is used to demo how a tab set could be implemented. The code is stand alone and does not depend on any JavaScript libraries. Multiple tab sets within the same page is supported. The HTML markup is fairly simple: Tabs sets are contained within a DIV element with class name "tabsContainer". Define a UL list for the tabs. Follow the UL list with equal number of DIVs for the tab contents. The Nifty Corners Cube technique is used to draw the rounded corners (original form, not the enhanced JavaScript form). HTML, CSS and JavaScript: <!doctype html> <html> <head> <style typ...
Created by Dr. Xi on April 26, 2007 23:00:25    Last update: January 10, 2011 22:15:32
If you ever wonder how those "cool" dialog boxes are made, copy and paste the following code to a file and test it with your browser. This is probably the simplest code for such effects. If you don't know what I mean, try it anyway. <html> <head> <title>Test Overlay</ti...
Previous  1 2 Next