2016年1月14日木曜日

cordovaの罠

cordovaのAPIとかを使うには以下の一行が必要になる
 <script type="text/javascript"> charset="utf-8" src="cordova.js"<script>
リファレンス関連をちゃんと読まないで始めるから簡単なところでハマる。 皆さんはそんなことのないようお気をつけ下さい。

2016年1月11日月曜日

なんか事故った時のための俺のvimrc

なんか事故った時の為に自分のvimrcをここに置いておくことにする。
自分が最近よくつかっているのはUnite.vim
目的のファイルまですぐに行けるのが嬉しい。
if has('vim_starting')
  set nocompatible               " Be iMproved

  " Required:
  set runtimepath+=~/.vim/bundle/neobundle.vim/
endif

" Required:
call neobundle#begin(expand('~/.vim/bundle/'))

" Let NeoBundle manage NeoBundle
" Required:
NeoBundleFetch 'Shougo/neobundle.vim'

" My Bundles here:
NeoBundle 'Shougo/neosnippet.vim'
NeoBundle 'Shougo/neosnippet-snippets'
NeoBundle 'tpope/vim-fugitive'
NeoBundle 'kien/ctrlp.vim'
NeoBundle 'flazz/vim-colorschemes'
NeoBundle 'scrooloose/nerdtree'
NeoBundle 'Shougo/unite.vim'
NeoBundle 'plasticboy/vim-markdown'
NeoBundle 'kannokanno/previm'
NeoBundle 'tyru/open-browser.vim'
NeoBundle 'thinca/vim-quickrun'
NeoBundle 'Markdown'

" You can specify revision/branch/tag.
NeoBundle 'Shougo/vimshell', { 'rev' : '3787e5' }

call neobundle#end()

" Required:
filetype plugin indent on


" If there are uninstalled bundles found on startup,
" this will conveniently prompt you to install them.
NeoBundleCheck


set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
 set rtp+=~/.vim/bundle/Vundle.vim
 call vundle#begin()
" " alternatively, pass a path where Vundle should install plugins
" "call vundle#begin('~/some/path/here')
"
" " let Vundle manage Vundle, required
 Plugin 'VundleVim/Vundle.vim'
"
 " The following are examples of different formats supported.
 " Keep Plugin commands between vundle#begin/end.
 " plugin on GitHub repo
 Plugin 'tpope/vim-fugitive'
 " plugin from http://vim-scripts.org/vim/scripts.html
 Plugin 'L9'
 " Git plugin not hosted on GitHub
" Plugin 'git://git.wincent.com/command-t.git'
 " git repos on your local machine (i.e. when working on your own plugin)
" Plugin 'file:///home/gmarik/path/to/plugin'
 " The sparkup vim script is in a subdirectory of this repo called vim.
 " Pass the path to set the runtimepath properly.
 Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
 " Avoid a name conflict with L9
" Plugin 'user/L9', {'name': 'newL9'}

Plugin 'Yggdroot/indentLine'
" " All of your Plugins must be added before the following line
 call vundle#end()            " require
 filetype plugin indent on    " required
" " To ignore plugin indent changes, instead use:
" "filetype plugin on
" "
let g:indentLine_color_term = 239
"let g:indentLine_char = 'c'
" " Brief help
" " :PluginList       - lists configured plugins
" " :PluginInstall    - installs plugins; append `!` to update or just
" :PluginUpdate
" " :PluginSearch foo - searches for foo; append `!` to refresh local cache
" " :PluginClean      - confirms removal of unused plugins; append `!` to
" auto-approve removal
" "
" " see :h vundle for more details or wiki for FAQ
" " Put your non-Plugin stuff after this line
syntax on
set number
set encoding=utf-8 
set fileencodings=utf-8,sjis
set ff=unix
let g:quickrun_config = {}
set autoindent
set shiftwidth =4

google.maps.geometry.spherical.computeDistanceBetweenが使えない。(多分)

jQueryをさらっとさわったので調子にのってjQuery mobileも同じ感じと思って手を出してみた。

画面遷移の仕様がちょっとわからなかったが、今はどうにか分かった。

今ぶち当たっている壁は


google.maps.geometry.spherical.computeDistanceBetween(loc1,loc2);
が使えないこと。
とりあえず直線距離は数学的に算出できるけどさ。。。。
ちょっと面倒だからgoogle.maps.geometry.spherical.computeDistanceBetween
使いたい。

できれば教えてほしい。分かる人。。。。

2015年11月28日土曜日

Mac、外部出力VS内部出力

最近はMacbook airで作業することが多いのですが、ノートPCっていうのは使う人の姿勢をどんどん悪くしていくモノだと思っています。手元の高さを合わせれば目線がベストのところにこないし、逆に目線を合わせれば手元が次は。。。という状況になってしまいます。

僕はここでちょっと思いつきました。。。。「クラムシェルで起動すればこの状況解決できるんじゃ。。?」とね。

ただクラムシェルは排熱がうまくできないというデメリットがありますし、電源繋ぎっぱなしというのもあまり好きではありません。僕はここでまた思いつきました。思いついちゃいましたよ。

「画面は開けっ放しでディスプレイの明るさをゼロにしてディスプレイミラーリングすれば排熱もクリアできるんじゃ。。。?」

そしてこれは実現できるんですけど、懸念材料が出現しました。バッテリー問題です。「電源繋ぎっぱなしは嫌」という考えと「ディスプレイ出力は外部に出力」という考えは同時に確立し得ないのでしょうか。。。。よし。調べるぞ。結果としては以下のとおりです。

  • 10%減少するまでの時間を測定した
    • 外部出力:27分
    • 内部(Macの画面のこと)出力:41分



分かってたよ。だろうね。悲しいよ。
もうしばらく姿勢を悪くしながらMacを使うとしますよ。もう。。。

2015年7月14日火曜日

Atom pdf-vews 日本語化のバグ





setting -> Open config folder -> packages -> pdf-view ->node_modules ->pdfjs-dist -> build -> pdf.js

を編集。

//PDFJS.cMapUrl = (PDFJS.cMapUrl === undefined ? null : PDFJS.cMapUrl);
PDFJS.cMapUrl ="../cmaps/";

//PDFJS.cMapPacked = PDFJS.cMapPacked === undefined ? false : PDFJS.cMapPacked;
PDFJS.cMapPacked = true;


という感じで変更。その後ATOMを再起動する。できなかったらちょっと追加。

npm install pdfjs-dist


以上です。ではでは

2015年3月6日金曜日

スーツの持ち運びが面倒で。。。。

私は未だにモラトリアムを延長することに全力をかけている学生なのですが、スーツを着る機会があったりなかったりします。 でもスーツを持ち運ぶのってそれなりに面倒ですよね。シワが入らないようにしたいし、そうするとあんなでかいハンガーとカバーが一緒になったようなのを持ち歩かないといけないと思うとそれもまためんどくさい。。。。 そんなときに極力綺麗にたたんでしまえばそこまでシワが入ることなく、かつ少しだけコンパクトに持ち運べるので紹介しておきます。 といってもただの綺麗にたたむ方法です。リンクはここに貼っておきます。 まずたたむ人がかなり綺麗にたたむのでその時点で若干めんどくさいのですが、でも持ち運ぶときに綺麗に持ち運びたいならこれくらいの労力はかけろってことですかね。。。。 まぁ、やらないよりやっておいたほうがいいんですかね。。。。 ではでは。。。

2015年3月3日火曜日

UbuntuでデュアルデスクトップをコマンドからON/OFFする

研究室での作業では大概Ubuntuを使っているのですが、自分のなかのスタイルというかポリシーの中に出きるだけ起動しているモニタは少ないほうがかっこいいっていう美学みたなのがあります。そのほうが自分の首を振る角度も狭くなりますし楽なはず。 でも実際使う時もあるので、いつもはモニタは1つで作業して必要に応じて設定画面を開いて。。。。 っていうのが面倒なのでどうにかコマンドからできないものかと考えていました。 そしたらできるじゃないすか。そのとき参考にしたサイトをここにのせておきます。 まず普通にモニタの電源つけてコマンドを叩いて動作の確認を行いましょう。 そして動作を確認したらそのコマンドを自分が使っているシェルのエイリアスに貼り付けてしまいましょう。 そうすることでコマンドからモニタをつけたり、消したり、ミラーリング、デュアルディスプレイにしたりできます。 これで少しまた幸せになれました。 ではでは。