Recent Notes

Displaying keyword search results 101 - 110
Created by Dr. Xi on March 05, 2011 14:39:42    Last update: March 05, 2011 14:40:35
Select from information_schema : mysql> select cc.character_set_name -> from... Other columns available from the information_schema tables: mysql> desc tables; +-----------------+--------... Note that show create table <table_name> also works.
Created by Dr. Xi on March 05, 2011 14:31:44    Last update: March 05, 2011 14:32:21
Select from information_schema.tables : mysql> select table_collation from information_sch... Or, show create table mysql.host; CREATE TABLE `host` ( `Host` char(60) collate...
Created by Dr. Xi on November 23, 2010 20:20:01    Last update: March 01, 2011 13:38:51
I tried to find a GZIP compression servlet filter to compress a large log file that we send down to the browser. Most of the implementations I found were overly complicated and many buggy. This is a simple implementation that worked for me. The filter: package filter.demo; import java.io.*; i... Config web.xml : <filter> <filter-name>gzipFilter</filte... The ugly anonymous inner class could have been avoided if the servlet API did not insist on ServletResponse.getOutputStream returning the bogus ServletOutputStream class (instead of the plain OutputStream ). Additional Note: In an earlier version of this filter, the gzip headers were added in doFilter , like this: // This is NOT good! if (supportsGzip) { ... It turned out that the ServletResponse methods sendError bypasses the gzip...
Created by Dr. Xi on January 22, 2011 20:26:05    Last update: January 22, 2011 20:26:05
Deciding which one to use is not that easy. Chrome and Safari always use document.body.scrollTop , while IE and Firefox use document.body.scrollTop for quirks mode and document.documentElement.scrollTop for standard mode. Your best bet may be something like: var scrollTop = document.body.scrollTop || doc... Test page for quirks mode: <html> <head> <title>Quirks Mode</title> ... Test page for standard mode: <!doctype html> <html> <head> <title>Sta...
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 August 21, 2007 21:25:58    Last update: January 10, 2011 22:19:09
You can grab some animated icons here: http://mentalized.net/activity-indicators/ . And here's some code to demonstrate how to use such an icon. <html> <head> <script language="JavaScript"... However, if you use Ajax and send a synchronous request, the icon won't show up at all, i.e., the following code doesn't work: function eventHandler() { startBusy(); ... This works: function eventHandler() { startBusy(); ...
Created by nogeek on December 31, 2010 11:56:25    Last update: December 31, 2010 11:56:25
These are the steps to create a JBoss 5.1.0 configuration with Tomcat from the built-in minimal configuration. Change directory to $JBOSS_HOME/server . Make a copy of the minimal configuration. cp -R minimal tomcatonly Copy bindingservice.beans from the default configuration. cp -R default/conf/bindingservice.beans tomcatonly... Copy login-config.xml from the default configuration. cp default/conf/login-config.xml tomcatonly/conf/ Edit tomcatonly/conf/jboss-service.xml : Add jars from the common/lib directory: <!-- Load all jars from the JBOSS_DIST/serv... Add the JAAS security manager section (copy from the default profile, and yes, JBoss tomcat can't live without the JBoss JAAS manager). <!-- JAAS security manager and realm mappin... Copy the Tomcat (JBoss web) deployer from the default configuration. cp -R default/deployers/jbossweb.deployer tomcaton... Copy metadata-deployer-jboss-beans.xml and security-deployer-jboss-beans.xml from the default profile. cp default/deployers/metadata-deployer-jboss-b... Copy...
Created by Dr. Xi on November 23, 2010 22:11:54    Last update: November 23, 2010 22:12:49
JavaDoc says that you can call getOutputStream or getWriter on ServletResponse , but you cannot call both. The second call will get IllegalStateException . So this works: import java.io.*; import javax.servlet.*; im... So does this: import java.io.*; import javax.servlet.*; im... But not this: import java.io.*; import javax.servlet.*; im... You can make the last servlet work if you insert a filter like this: import java.io.*; import javax.servlet.*; im... But depending on the underlying implementation, the order of the output strings may be undetermined.
Created by Dr. Xi on August 03, 2010 16:23:55    Last update: October 22, 2010 15:35:20
According to Java documentation: The Java compiler and other Java tools can only process files which contain Latin-1 and/or Unicode-encoded (\udddd notation) characters. This utility converts a utf-8 encoded file to ascii with unicode escape strings for non-ascii characters. import java.io.*; /** * Reads file in U... It is equivalent to: native2ascii -encoding utf-8 using the standard Java native2ascii utility.
Created by Fang on August 16, 2010 21:44:41    Last update: August 16, 2010 22:01:46
The tags <sql:query> Queries a database. Syntax: <sql:query sql="sqlQuery" var="varName" [scope... or, put the query within the element body: <sql:query var="varName" [scope="{page|req... Attributes: Name Dynamic? Type Description sql true String SQL query statement. dataSource true javax.sql.DataSource or String Data source associated with the database to query. A String value represents a relative path to a JNDI resource or the JDBC parameters for the DriverManager class. maxRows true int The maximum number of rows to be included in the query result. If not specified, or set to -1, no limit on the maximum number of rows is enforced. startRow true int The returned Result object includes the rows starting at the specified index. The first row of the original query result set is at index...
Previous  6 7 8 9 10 11 12 13 14 15 Next