key words: ssh password scp
Tuesday, October 25, 2011
Wednesday, October 5, 2011
sqlite3 concatenate a column by group
there is function:
So we can easily from say, we have table tname as
| group_concat(X) group_concat(X,Y) So we can easily from | The group_concat() function returns a string which is the concatenation of all non-NULL values of X. If parameter Y is present then it is used as the separator between instances of X. A comma (",") is used as the separator if Y is omitted. The order of the concatenated elements is arbitrary. |
id|attr
1|black
1|female
2|male
2|white
3|other
to by ``select id, group_concat(attr) from tname group by id'':
1|black,female
2|white,male
3|other
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
/\cfootbar
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.
> 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/rjags.so':
> libjags.so.2: 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 ?
>
Scott,
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,
Michael
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?
Subscribe to:
Posts (Atom)