Recent Notes

Displaying keyword search results 1 - 10
Created by James on January 11, 2011 22:08:26    Last update: February 03, 2012 11:23:25
By default Firefox puts a dotted line box around the link or button label when you click them. Sometimes it's annoying and makes your sexy buttons look ugly. You can get rid of the dotted lines for links with outline:none in CSS, but that doesn't work for buttons. <!doctype html> <html> <head> <style t... For buttons you need " button::-moz-focus-inner { border: 0; } ": <!doctype html> <html> <head> <style t... I've also seen this: /* get rid of those system borders being generated... For more information : Remove Button Focus Outline Using CSS
Created by Fang on November 10, 2011 09:26:12    Last update: November 10, 2011 09:26:12
Syntax highlighted XML schema for JSF 2.0 Application Configuration Resource File ( faces-config.xml ). Almost 3000 lines! <?xml version="1.0" encoding="UTF-8"?> <xsd:sch...
Created by Fang on October 30, 2011 20:35:17    Last update: October 30, 2011 20:37:03
This note lists some of the different behaviors I found using different JSF implementations. In the simple JSF facelet example, I used Sun's reference implementation version 2.0.0-RC: <dependency> <groupId>javax.faces</gro... With this version, the DOCTYPE declaration is dropped when the page is rendered. It doesn't matter what DOCTYPE you declare in your templates, the facelet engine simply drops it. The problem with this is, your page is always displayed in quirks mode , despite your intentions to require standards compliant mode. The DOCTYPE problem is fixed in release 2.0.2-FCS . Change the dependency in pom.xml to: <dependency> <groupId>javax.faces</gro... and test again, you'll find that DOCTYPE is faithfully passed over to the browser (view source at browser). You can delete the DOCTYPE declaration in the xhtml template...
Created by Fang on October 28, 2011 13:49:40    Last update: October 30, 2011 19:23:25
This is a simple example to demonstrate the templating power of JSF facelets. If you've used struts tiles before, you'll recognize the simplicity of templating with facelets. I've stripped out everything else except the pages themselves, just to put our focus on facelets. This is a Maven based project, and you need Tomcat (or any servlet container) to run the resulting webapp. To begin with this is the list of files: ./pom.xml ./src/main/webapp/home.xhtml ./src... I left faces-config.xml in there for completeness sake, it may not be needed. The Maven POM ( pom.xml ): <?xml version="1.0" encoding="UTF-8"?> <project... Web app configuration ( WEB-INF/web.xml ): <?xml version="1.0" encoding="UTF-8"?> <web-app... Empty WEB-INF/faces-config.xml : <?xml version="1.0" encoding="UTF-8"?> <!-- Thi... index.jsp is simply a redirect to home.jsf : <% response.sendRedirect("home.jsf"); %>...
Created by voodoo on September 02, 2011 18:12:56    Last update: September 02, 2011 18:12:56
This is how to add the 3GB switch for Windows XP: Remove system and hidden attributes of C:\boot.ini : C:\>attrib -s -h boot.ini Add the 3GB switch to C:\boot.ini : [boot loader] timeout=30 default=multi(0)dis... Add system and hidden attributes: C:\>attrib +s +h boot.ini Reboot
Created by woolf on July 27, 2011 20:56:11    Last update: July 27, 2011 20:56:11
Install the DHCP server: voodoo@newpc:~$ sudo apt-get install dhcp3-server ... Edit /etc/dhcp/dhcpd.conf (this is the minimum for a local network without DNS): ddns-update-style none; default-lease-time ... Start the DHCP server: voodoo@newpc:/etc/dhcp$ sudo /etc/init.d/isc-dhcp-...
Created by magnum on June 23, 2011 13:44:21    Last update: June 23, 2011 13:59:26
Fedora/Redhat List current status (for httpd): # chkconfig --list httpd Warning: this works only when one of /etc/rc runlevel .d/ K NN name or /etc/rc runlevel .d/ S NN name exists. It exports wrong status when both K and S scripts exist (in which case the status should be enabled). Enable sshd for run levels 2, 3, 5: # chkconfig --level 2,3,5 sshd on Disable sshd for run levels 2, 3, 5: # chkconfig --level 2,3,5 sshd off By default, the on and off options affect only runlevels 2, 3, 4, and 5. Debian/Ubuntu Add apache2 with defaults : # update-rc.d apache2 defaults If defaults is used then update-rc.d will make links to start the service in runlevels 2, 3, 4, 5 and to stop...
Created by Dr. Xi on April 26, 2011 20:12:01    Last update: April 28, 2011 15:28:12
An XML schema is a definition of XML files, in XML. It plays the same role as old-time DTDs. Overall, an XML schema file looks like this: <schema attributeFormDefault = (qualified | u... The attribute meanings: targetNamespace : The name space targeted by the current schema definition. It can be any URI. id and version : For user convenience, the W3C spec defines no semantics for them. xml:lang : Natural language identifier defined by RFC 3306 . attributeFormDefault and elementFormDefault : Set default values for the form attribute for attribute and element declarations. blockDefault and finalDefault : Set default values for the block and final attributes for attribute and element declarations. The W3C defined some built-in datatypes . Examples of primitive datatypes are: string ,...
Created by jinx on April 26, 2011 11:58:33    Last update: April 26, 2011 12:00:40
The PHP function array_unique removes duplicate values from arrays. It takes an optional parameter $sort_flags , which can be one of: SORT_REGULAR : compare items normally (don't change types) SORT_NUMERIC : compare items numerically SORT_STRING : compare items as strings SORT_LOCALE_STRING : compare items as strings, based on the current locale. Example: <?php $a = array( '1' => 'Apple', ... Output: array_unique results: array(3) { [1]=> ...
Created by James on March 13, 2011 13:44:37    Last update: March 21, 2011 11:30:55
This is a jQuery input control that lets you enter any number of input rows of name and value pairs. <!DOCTYPE html> <html> <head> <title>jQu...
Previous  1 2 3 Next