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 timo on January 25, 2012 20:13:13    Last update: January 25, 2012 20:13:13
The MIPS CPU is able to run both big-endian and little-endian. So a system built on MIPS can be either big-endian (mips) or little-endian (mipsel). The file command shows the architecture: $ file ls ls: ELF 32-bit LSB executable, MIPS, ... but readelf will tell the endianness: $ readelf -h ls ELF Header: Magic: 7f 45...
Created by Fang on January 04, 2012 09:54:05    Last update: January 04, 2012 09:54:05
There are two ways to validate a form with JSF: jsf validation on the page with <f:validate...> tags (for example: <f:validateLength> , <f:validateRegex> , etc.), or JSR303 bean validation. This note is about how to customize messages for JSR303 bean validation. The validation message is specified in the message attribute for each validation annotation type. The mesage attribute is not a literal string, but a string that is interpolated in various ways. For example, the default validation message for AssertFalse is {javax.validation.constraints.AssertFalse.message} , which is replaced with the corresponding string in ValidationMessages.properties (or ValidationMessages_tr.properties , ValidationMessages_es.properties , depending on the locale). This is the contents of ValidationMessages.properties in the hibernate validator reference implementation: javax.validation.constraints.AssertFalse.message =... To customize the messages, just provide the new value in...
Created by Fang on October 28, 2011 14:49:53    Last update: October 28, 2011 14:52:19
Facelet templates can be nested, for example, a page can use a template which inherits from another template. To demonstrate this, let's start from the simple example and make these additions: Add a place holder for CSS style sheets in WEB-INF/templates/default.xhtml : <h:head> <title>Facelets Template Demo</tit... Add a derivative template ( WEB-INF/templates/default-style.xhtml ) which provides CSS: <?xml version="1.0" encoding="UTF-8"?> <ui:comp... Add a page that uses the styled template ( home-style.xhtml ): <?xml version="1.0" encoding="UTF-8"?> <ui:comp... The only difference between this file and home.xhtml is the template being used. Compare the display of the pages home.xhtml and home-style.xhtml .
Created by magnum on October 08, 2011 20:37:04    Last update: October 08, 2011 20:37:35
Three APIs for event based non-blocking I/O: select() select() is limited to FD_SETSIZE handles. This limit is compiled in to the standard library and user programs. poll() There is no hardcoded limit to the number of file descriptors poll() can handle, but it does get slow about a few thousand. epoll() The epoll event mechanism is much more scalable than the traditional poll when there are thousands of file descriptors in the interest set. The work done by poll depends on the size of the interest set whereas with epoll (like Solaris /dev/poll ) the registration of interest is separated from the retrieval of the events. Reference: The C10K problem
Created by woolf on September 23, 2011 15:02:15    Last update: September 23, 2011 15:02:15
There's no file for OpenWRT syslog. Instead, syslog is a fixed size buffer in memory. Use logread to look at syslog: root@OpenWrt:/# logread -h logread: invalid opt... To tail the log: root@OpenWrt:/# logread -f
Created by voodoo on August 14, 2011 15:42:43    Last update: August 14, 2011 15:42:43
When I ran this code snippet with strace : f = fopen("TZ", "rb"); fseek(f, 0, SEEK_END); ... I saw ENOTTY error with uClibc : open("TZ", O_RDONLY|O_LARGEFILE) = 3 ioc... With the normal gnu libc , there's no such error: open("TZ", O_RDONLY) = 3 fstat64... There was no error running the program. But for some reason, uClibc did a ioctl call when it opened a file, and handled it appropriately.
Created by voodoo on August 12, 2011 14:43:57    Last update: August 14, 2011 15:19:21
#include <stdio.h> #include <stdlib.h> i...
Created by voodoo on August 12, 2011 14:44:45    Last update: August 12, 2011 14:44:45
#include <fstream> #include <iostream> i...
Created by voodoo on August 12, 2011 12:47:50    Last update: August 12, 2011 13:03:00
Use fstream and seekg : #include <iostream> #include <fstream> i... With stat : #include <iostream> #include <sys/stat.h> ...
Previous  1 2 3 4 Next