Notes by Dr. Xi
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 Dr. Xi on March 28, 2011 11:11:33
Last update: March 28, 2011 11:13:21
grep is a versatile command with many variations (grep, egrep, fgrep, then various implementations). It uses a regula expression (regex) pattern to filter input. But then there are basic and extended flavors of regex - leading to even more confusion. And, beware that there are lots of bad examples of regex in the wild... There are two critical questions to ask when you use grep: which grep implementation are you using? what is the flavor of the regex? Here are some examples for gnu grep v2.7:
# Find all numbers (no decimal point), basic regex... Use the -o flag to show only the matching part instead of the whole matching line: grep -o -E '\b[0-9]{2}\b' The good thing about the gnu grep is that it...
Created by Dr. Xi on March 08, 2011 15:53:33
Last update: March 08, 2011 15:53:33
Use the date_format function to format a date:
mysql> select now() now;
+---------------------...
Created by Dr. Xi on March 07, 2011 16:23:40
Last update: March 07, 2011 16:25:05
Oracle operator || doesn't work for MySQL. Looks like I have to use the concat function:
mysql> select 'abc' || '123';
+----------------...
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 October 03, 2008 02:36:41
Last update: January 11, 2011 19:53:25
Demo page to retrieve the value and text of a dropdown box using JavaScript.
<html>
<head>
<script language="JavaScript" ...
Created by Dr. Xi on March 26, 2008 20:11:53
Last update: January 11, 2011 19:47:07
Suppose you have a select box like this in your HTML:
<select id="selectbox">
<option value="1">O...
and you want to use jQuery to select the last option, use this code:
$("#selectbox option:last").attr("selected", t...
Consult the jQuery documentation for more details.
Created by Dr. Xi on December 30, 2008 17:54:26
Last update: July 19, 2010 15:48:30
Changing password for hotmail is buried deep in the navigation links. This is a route that worked for me:
Click the "Profile" link at the top
Click "Options" from the "Profile" page and select "More Options"
In the "Account" section, click "Reset your password"
Or, enter URL directly:
http://home.live.com/options/
Created by Dr. Xi on June 20, 2010 14:35:17
Last update: June 20, 2010 14:35:17
This XML signature validator comes from the Apache XML Security project. It validates the signature according to the core validation processing rules .
It does not verify that the key used to generate the signature is a trusted key. You can override the KeySelector class to make sure that the signing key is from a trusted store.
import javax.xml.crypto.*;
import javax.xml.cry...