2014-01-01から1年間の記事一覧
ParentsUntil文で行にいき、その後ろにdivダグを挿入し, divダグのに中身を図をいれる.表にマウスオーバーしたらリンク先の図をだ $(".fig").hover( function(){ link1=$(this).attr("href"); $(this).parentsUntil("tr").after('<div id="tmp1"></div>'); $("#tmp1").append('<img src="'+link1+'" width="100%" height="100%" />'…
カンマをとってsortして、カンマをつけるスクリプト sed "s/\"//g" $1 | sort -gr | sed "s/\,/\",\"/g;s/^/\"/g;s/$/\"/g" ;
(1)どんなログがながれているか? Network -> ファイル名-> Headers: HTML Hedear Response: 実際の文字列(2)エラーとかのチェック -> Console (3)要素の解析 Elements (4)ライブラリなどのSource -> Sources
flexgridでJSONを読んで動的なかっこいい動的な表を作る まず基本バージョン、とりあえずだせるように (0)JSONを作る JSONは""でじゃないとだめ。 JSONの説明: http://hakuhin.jp/js/json.html grid2.txt を書きをCGIフォルダに保存 を参考に.http://jquery…
sshポート転送を利用するGWサーバ(CGI起動できる) サーバ1[ch](GWサーバーからみえる、サーバー2からみえる GWとサーバー1をつなぐ踏み台 兼 サーバー1のポートとLWBのポートが結ばれている) サーバ2[in](サーバ1からみえ、LWBもみえる サーバー1とLWB…
sshで以下のエラーが出る場合の対処法 >クライアントの/.ssh/known_hosts ファイルの該当PCのアドレスが入っている 行を削除すればよろしい. $ ssh ~/.ssh/id_rsa fdafda@fdafdfdsf.fdafads.com @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@…
たぬきの絵を返すCGI require 'open-uri' #require 'cgi' #cgi=CGI.new f=open("http://upload.wikimedia.org/wikipedia/commons/thumb/5/51/Tanuki01_960.jpg/250px-Tanuki01_960.jpg","rb") #f=open("http://www.yahoo.co.jp") #f=open("http://ja.wikiped…
シェルスクリプトのCGIの注意. #!/bin/sh echo "Content-Type: text/html" echo "" echo "test" 1行目と2行目の空白がないと とかいわれる. sudo cat /etc/httpd/logs/error_log | tail [Mon Dec 08 15:42:00 2014] [error] [client xxx.xxx.xxx.xxx] ma…
sqlでデータ名が異なる場合テーブルに挿入 require 'rubygems' require 'sqlite3' f=open("food_list_2014_12_03_b.txt") f=f.map{|i| i.split(",")}.sort_by{|elem| elem[3];} #f.each{|i| # puts i; #} #exit db=SQLite3::Database.new("syoku.sqlite3") f…
ruby でCSVファイルの3列目でsort f=open("test.txt","r") f=f.map{|i| i.split(",")}.sort_by{|elem| elem[3];}
sqlのデータベースををコマンドラインから使う echo "select * from adj_count_data where id="2";" | sqlite3 syoku.sqlite3 | sed "s/|/\n/g"
CSVデータからsqlにデータをいれるためのスクリプトを書くスクリプト CSVファイル 1,リンゴ 2,ミカン 3,おもち 4,桃 adj_list_hokan_tmp.sh for i in `cat id_adj_hokan.txt`; do j1=`echo $i | awk -F"," '{print $1}'`; #echo $j1 j2=`echo $i | awk -F","…
基本的には,create table adj_count_data_new as select $str from adj_count_data でテーブスを必要なところだけコピーする. $strに行名をいれる tmp.query pragma table_info(adj_count_data); tmp3.query str=`cat tmp5` echo "create table adj_count_…
シェルスクリプトCGIでデータベース状態の更新 echo "update update_info set flg=\"4\";" > test_query.txt chmod a+r test_query.txt chmod a+x test_query.txt chmod a+w test_query.txt /usr/bin/sqlite3 syoku.sqlite3 < test_query.txt 権限つけすぎな…
だから、 http://seqanswers.com/forums/showthread.php?p=154972 これを参照して旧バージョンをいれる wget http://pkgs.fedoraproject.org/repo/pkgs/R-RSQLite/RSQLite_0.11.4.tar.gz/c2a1a8fca2146a910e9e13879a88cbc9/RSQLite_0.11.4.tar.gz install.pa…
.find.package()関数を使う. > library("RSQLite") 要求されたパッケージ DBI をロード中です > .find.package() [1] "/home/xxxx/R/x86_64-unknown-linux-gnu-library/2.15/RSQLite" [2] "/home/xxxx/R/x86_64-unknown-linux-gnu-library/2.15/DBI" [3] "/…
igraphでのエッジ列の取得(とりだし) get.edges(q4,E(q4)) これはエッジIDなので、エッジ名とずれている場合は注意が必要
データベースから値を読んでそれに応じてボタンを押せなくなる. <html lang="ja"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>tryjquery_hide_p test</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script> $(document).ready(function(){ var up_date_…</meta></head></html>
キャレントディレクトリのフォルダごとの容量の確認 du -s *
sqlでファイル内容とデータベースで相違があるデータの挿入 require 'rubygems' require 'sqlite3' db=SQLite3::Database.new("syoku.sqlite3") f=open("food_list.txt","r"); k=0; f.each{|i| i.chomp! db.execute("insert into tmp_flg (id,flg) values (#…
sqlでtableのコピー create table food_list_tmp as select * from food_list;
スイッチをおしたらほかのページの情報を出力する 基本 <html lang="ja"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>tryjquery_hide_p test</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script> $(document).ready(function(){ $("input#update"…</meta></head></html>
リストのデータフレーム化 qq2",1:length(qq2),")"),",names=qq2)") ) )
原則: (1)苦手や困難なことは苦手や敵の大きさを認識することが大事. (2)困難とわかったときは,敵を分解したり,,一つ一つ、なぜ苦手か?なぜ難しか?を考えつつ, どうすれば困難を避けられるか?等の性質を切り分けてそれぞれごとに対処するのが…
http://d.hatena.ne.jp/Zellij/20110421/p1 を参考にさせていただきました。 wget http://tug.ctan.org/tex-archive/macros/latex/contrib/algorithms/algorithms.ins wget http://tug.ctan.org/tex-archive/macros/latex/contrib/algorithms/algorithms.dtx…
Rですべてのグラフィックデバイスを閉じる for(i in dev.list()){dev.off(i)}
Rからsqlite を使う rsqliteの導入まず、インストール install.packages("RSQLite") ためす。 drv<-dbDriver("SQLite") con<-dbConnect(drv,dbname="test.sqlite") dbGetQuery(con,"create table test (a,b)") NULL dbGetQuery(con,"insert into test values…
データの結合 rowid は表明を指定して,onで結合しなきゃだめ。 select food_count_data.[2006-11-01],food_count_data.ROWID,food_list.ROWID,food_list.foodname from food_count_data join food_list on food_count_data.rowid=food_list.rowid;
sql cast演算 http://d.hatena.ne.jp/unageanu/20081121/1227265217 select [2014-02-01] || "さん" as "hontai",[2014-02-02]*1000 as "hentai" from food_count_data where cast([2014-02-02] as int) >= 2300 order by [2014-02-01] desc;
PRAGMA TABLE_INFO(TABLE_NAME);