Friday, September 30, 2011

sqlite3 attach a database

using attach, we can deal multiple databases.
an example

attach database 'a.db' as a;

vim search ignore case

I like to keep it case sensitive most of the time.  However, sometimes, if I do not like to, see

In a nutshell, we can use 

Wednesday, September 28, 2011

sqlite3 describe table

it is not as in SQL by using describe table, it is the following instead.

.schema ?TABLE?        Show the CREATE statements
                                    If TABLE specified, only show tables matching
                                    LIKE pattern TABLE.

all the information obtained by .help in sqlite3:

.backup ?DB? FILE      Backup DB (default "main") to FILE
.bail ON|OFF           Stop after hitting an error.  Default OFF
.databases             List names and files of attached databases
.dump ?TABLE? ...      Dump the database in an SQL text format
                         If TABLE specified, only dump tables matching
                         LIKE pattern TABLE.
.echo ON|OFF           Turn command echo on or off
.exit                  Exit this program
.explain ?ON|OFF?      Turn output mode suitable for EXPLAIN on or off.
                         With no args, it turns EXPLAIN on.
.header(s) ON|OFF      Turn display of headers on or off
.help                  Show this message
.import FILE TABLE     Import data from FILE into TABLE
.indices ?TABLE?       Show names of all indices
                         If TABLE specified, only show indices for tables
                         matching LIKE pattern TABLE.
.load FILE ?ENTRY?     Load an extension library
.log FILE|off          Turn logging on or off.  FILE can be stderr/stdout
.mode MODE ?TABLE?     Set output mode where MODE is one of:
                         csv      Comma-separated values
                         column   Left-aligned columns.  (See .width)
                         html     HTML <table> code
                         insert   SQL insert statements for TABLE
                         line     One value per line
                         list     Values delimited by .separator string
                         tabs     Tab-separated values
                         tcl      TCL list elements
.nullvalue STRING      Print STRING in place of NULL values
.output FILENAME       Send output to FILENAME
.output stdout         Send output to the screen
.prompt MAIN CONTINUE  Replace the standard prompts
.quit                  Exit this program
.read FILENAME         Execute SQL in FILENAME
.restore ?DB? FILE     Restore content of DB (default "main") from FILE
.schema ?TABLE?        Show the CREATE statements
                         If TABLE specified, only show tables matching
                         LIKE pattern TABLE.
.separator STRING      Change separator used by output mode and .import
.show                  Show the current values for various settings
.stats ON|OFF          Turn stats on or off
.tables ?TABLE?        List names of tables
                         If TABLE specified, only list tables matching
                         LIKE pattern TABLE.
.timeout MS            Try opening locked tables for MS milliseconds
.width NUM1 NUM2 ...   Set column widths for "column" mode
.timer ON|OFF          Turn the CPU timer measurement on or off

Friday, September 16, 2011

rjags on ubuntu -- nonzero exit status

on ubuntu 10.10 and rjags 3.x, I could still have this problem.

On 05/27/2010 05:23 AM, Scott Brogan wrote:
> I've not been able to install rjags successfully in Ubuntu 10.04 :
> ** testing if installed package can be loaded
> Error : .onLoad failed in loadNamespace() for 'rjags', details:
> call: dyn.load(file, DLLpath = DLLpath, ...)
> error: unable to load shared library
> '/home/scott/R/i486-pc-linux-gnu-library/2.11/rjags/libs/':
> cannot open shared object file: No such file or directory
> ERROR: loading failed
> I've tried with different versions of both JAGS& rjags; lastly with R
> 2.11.0, JAGS 2.1.0,& rjags_2.1.0-4. Could anyone help ?


I also had trouble installing rjags in 10.04. I got the same error you
did, even though I could see the .so files. The fix (I think, I tried
lots of things) was to run 'ldconfig', then launch R and install the
package. Apparently, my jags install did not update the libraries.

Hope this helps,

cd/dvd driver

I have this problem as described in 

in this forum, this is the final solution.  

OK now is the truth. This is the solution. I assume all of you is using USB drive to install. When Windows is asking for driver, just click Cancel. You will be brought back to the welcome screen. At the welcome screen, remove your USB drive, insert it back to DIFFERENT USB PORT. Click Install Now again. The installation process will be like usual.....
Thanks,the problem fixed whit your methods...nice job :)

My comments:
What is microsoft doing?  make sense? does not make sense?  

Wednesday, September 14, 2011

ubuntu maverick lib64

On Ubuntu maverick: 
there is not /usr/local/lib64 link to /usr/local/lib 


sudo ln -s /usr/local/lin /usr/local/lib64 

ubuntu sudo

it seems that the path environment is not influenced by changes in /etc/profile when using sudo 

old ubuntu (maverick), new R

add the cran apt source repository to /etc/apt/sources.list

in which there is a part about security. 

Friday, September 9, 2011

grep --color=always

It would work (with color) when there is a more after grep. 
grep foo --color=always | more