ãããã¼ãéä¿¡ãã¦ã¤ã¡ã¼ã¸ãåå¾
NSURL* url = [NSURL URLWithString:@"hogehogehogeURL"]; NSURLSessionConfiguration* config = [NSURLSessionConfiguration defaultSessionConfiguration]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0]; [request addValue:@"hogehoge" forHTTPHeaderField:@"hogehogeHeader"]; [request setHTTPMethod:@"GET"]; NSURLSession* session = [NSURLSession sessionWithConfiguration:config]; NSURLSessionDataTask* task = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { UIImage* image = [UIImage imageWithData:data]; NSLog(@""); }]; [task resume];
度 => ã©ã¸ã¢ã³å¤æ
æ¨èª
iPhoneã¨ã³ã¸ãã¢ã§ãããªãã°ã
度ããã©ã¸ã¢ã³ãæ±ãããã¨ããå¤ã
ãã£ã¦ãã
ãã®éã®ã©ã¸ã¢ã³ãã度ã«ãããã¨ãã¯ã»ã¨ãã©ãªãã ããã
ã¨ãããã¨ã§ãã©ã¸ã¢ã³ã«ãããã¨ãã¯ä»¥ä¸ã®æ¨èªã§è¦ãã¦ããã°ãã
360ã§å²ã£ã¦2Ïã§ã©ã¸ã¢ã³
å¤æ
度ããã©ã¸ã¢ã³ã¸ã®å¤æã
(2 * M_PI/360) * hoge度
30度ãã©ã¸ã¢ã³ã«å¤æãããã®ãªã
(2 * M_PI/360) * 30度
ã§
M_PI * (1/6)
ã¨ãªã
ãããã«ããç¶æ ï¼ã¹ãã¼ã¿ã¹ï¼ã®æã¡æ¹
bitã«ãã£ã¦ç¶æ ãæã¤æ¹æ³
ããã | ç¶æ |
---|---|
0001 | ç¶æ A |
0010 | ç¶æ B |
0100 | ç¶æ C |
1000 | ç¶æ D |
ãã®ããã«ãåã
ã®æ¡ã§ãã¶ããªãããã«ç¶æ
ãä½ãã
ããããã¨ã
ç¶æ Aã¨ç¶æ Bãã¯ãA|B -> 0011
ã®ããã«å¤æãããã¨ãã§ããã
æ¡ããã¶ããã¦ç¶æ ãæã¤å ´å
4æ¡ç®ãæ¥æ¬ãªã1ããã§ãªããªã0ã¿ããã«å®ç¾©ãã¦ã
1001 | æ±äº¬ |
1010 | ç¥å¥å· |
0001 | å京 |
0010 | ãã¥ã¼ã¨ã¼ã¯ |
ãªã©ã®ããã«å®ç¾©ããæ¹æ³ãããã
ãã ãããã®ããã«4æ¡ç®ã«ãã®ãããªæå³ãæãããå ´åãå®è³ªã®æ
å ±ã3æ¡ã§è¡ããªãã¨ãããªãã®ã§ã
ããã»ã©å¤ãã®ç¶æ
ã表ããã¨ãã§ããªãã
gitlabæ§ç¯æã«æ°ã«ãªã£ãã³ãã³ãã調ã¹ã
adduser
--disabled-login
$ adduser --disabled-login --gecos 'GitLab' git
--disabled-login Do not run passwd to set the password. The user won't be able to use her account until the password is set. --disabled-password Like --disabled-login, but logins are still possible (for exam- ple using SSH RSA keys) but not using password authentication.
--gecos
--gecos
ã¯GECOSãã£ã¼ã«ãã¨ããã¨ããã« GitLabã¨ããæååãç»é²ãã¦ããï¼
sudo
-u
root以å¤ã®ã¦ã¼ã¶ã¼ã§å®è¡ããã¨ãã«æå®
-H
$HOMEããã®ã¦ã¼ã¶ã¼ã®ãã®ã«ãã
ãã£ã¹ãã¬ã¤ã®å¤§ãã
ãã¤ãå¿ãã¦ãã¾ãã®ã§ããã«æ¸ãã¦ãã
åãã¦ã®ãã¼ãã¹ã§è²·ã£ãiMacã®ãã£ã¹ãã¬ã¤ã®å¤§ãã
20ã¤ã³ã(20")
iPad
9.7ã¤ã³ã(9.7")
åãã¦è²·ã£ãMBA
MacBook Air 13ã¤ã³ã(13")
æè¿ã®vimrc
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Neobundle ç¨(ãããã) """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " Neobundleãå§ããæºå "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ set nocompatible filetype off if has('vim_starting') set runtimepath+=~/.vim/bundle/neobundle.vim call neobundle#rc(expand('~/.vim/bundle')) endif "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " ããã«ã¤ã³ã¹ãã¼ã«ããããã©ã°ã¤ã³ã®ãªã¹ããæ¸ã "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ NeoBundle 'scrooloose/nerdtree' NeoBundle 'fholgado/minibufexpl.vim' NeoBundle 'tpope/vim-endwise.git' NeoBundleFetch 'Shougo/neobundle.vim' "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " Neobundleãçµããæºå "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ filetype plugin on filetype indent on autocmd FileType * setlocal formatoptions-=ro """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Neobundle ç¨(ããã¾ã§) """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " å種è¨å® """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "set autoindent "æ°ããè¡ã®ã¤ã³ãã³ããç¾å¨è¡ã¨åãã«ãã set hidden set wildmode=list:longest "vimã®ã³ãã³ããè£å® set nu "è¡çªå·è¡¨ç¤º set showcmd "ã³ãã³ãã表示 set hlsearch "æ¤ç´¢æåããã¤ã©ã¤ã "ã¿ãå¯è¦å "set list "set listchars=tab:.. "------------------------------------------------------------------------------------" "Neocomplete & Neocomplcache "------------------------------------------------------------------------------------" " æ¡ä»¶ãæºããã°NeoCompleteãæºãããªãã¨ãã¯NeoComplcacheã使ã if has('lua') && v:version >= 703 && has('patch885') NeoBundle "Shougo/neocomplete.vim" " Disable AutoComplPop. let g:acp_enableAtStartup = 0 " Use neocomplete. let g:neocomplete#enable_at_startup = 1 " Use smartcase. let g:neocomplete#enable_smart_case = 1 " Set minimum syntax keyword length. let g:neocomplete#sources#syntax#min_keyword_length = 1 let g:neocomplete#lock_buffer_name_pattern = '\*ku\*' let g:neocomplcache_enable_auto_select = 1 else NeoBundle 'Shougo/neocomplcache.vim' " Disable AutoComplPop. let g:acp_enableAtStartup = 0 " Use neocomplcache. let g:neocomplcache_enable_at_startup = 1 " Use smartcase. let g:neocomplcache_enable_smart_case = 1 " Set minimum syntax keyword length. let g:neocomplcache_min_syntax_length = 1 let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*' let g:neocomplcache_enable_auto_select = 1 endif "------------------------------------------------------------------------------------" " NERDTREE "------------------------------------------------------------------------------------" augroup IsNotGitCommit autocmd! autocmd VimEnter * NERDTree ./ autocmd VimEnter * wincmd p augroup END autocmd BufRead COMMIT_EDITMSG autocmd! IsNotGitCommit "------------------------------------------------------------------------------------" " Rsense "------------------------------------------------------------------------------------" let g:rsenseHome = "~/opt/rsense-0.3" let g:rsenseUseOmniFunc = 1 if !exists('g:neocomplcache_omni_patterns') let g:neocomplcache_omni_patterns = {} endif let g:neocomplcache_omni_patterns.ruby = '[^. *\t]\.\w*\|\h\w*::' "------------------------------------------------------------------------------------" " minibufexpl "------------------------------------------------------------------------------------" let g:miniBufExplMapWindowNavVim = 1 let g:miniBufExplMapWindowNavArrows = 1 let g:miniBufExplMapCTabSwitchBufs = 1 let g:miniBufExplModSelTarget = 1 "------------------------------------------------------------------------------------" " neocomplete "------------------------------------------------------------------------------------" highlight Pmenu ctermbg=8 highlight PmenuSel ctermbg=1 highlight PmenuSbar ctermbg=0 "------------------------------------------------------------------------------------" " vimèµ·åæã«ååã®è¡ã§éã "------------------------------------------------------------------------------------" if has("autocmd") autocmd BufReadPost * \ if line("'\"") > 0 && line ("'\"") <= line("$") | \ exe "normal! g'\"" | \ endif endif "------------------------------------------------------------------------------------" " å種ããã°ã©ã ã§æ§æãã§ã¯(:make)ãCtr+c Ctr+cã§è¡ããããã«ãã " 表示ãããQuickFixã¯ã¦ã£ã³ãã¦ã移åããªãã¦ã " :cn ããã³ :cpãã§ç§»åå¯è½ "------------------------------------------------------------------------------------" " Perlæ§æãã§ã㯠autocmd FileType perl compiler perl autocmd FileType perl map <c-c><c-c> :make<cr> :cw<cr><cr> " PHPæ§æãã§ã㯠au BufRead,BufNewFile *.php set makeprg=php\ -l\ % au BufRead,BufNewFile *.php set errorformat=%m\ in\ %f\ on\ line\ %l autocmd FileType php map <c-c><c-c> :make<cr> :cw<cr><cr> " Rubyæ§æãã§ã㯠au BufRead,BufNewFile *.rb set makeprg=ruby\ -c\ % au BufRead,BufNewFile *.rb set errorformat=%m\ in\ %f\ on\ line\ %l autocmd FileType rb map <c-c><c-c> :make<cr> :cw<cr><cr> " HTMLæ§æãã§ã㯠autocmd FileType xhtml,html :compiler tidy autocmd FileType xhtml,html :setlocal makeprg=tidy\ -raw\ -quiet\ -errors\ --gnu-emacs\ yes\ \"%\" autocmd FileType xhtml,html map <c-c><c-c> :make<cr> :cw<cr><cr> "------------------------------------------------------------------------------------" "foldmethodï¼æãããã¿ã®è¨å®ï¼ "------------------------------------------------------------------------------------" "set foldmethod=indent "let g:xml_syntax_folding=1 "au FileType html,xml,xhtml setlocal foldmethod=syntax "set foldlevel=100 "Don't autofold anything "------------------------------------------------------------------------------------" " ã·ã³ã¿ãã¯ã¹ãã¤ã©ã¤ã "------------------------------------------------------------------------------------" syntax on if has("gui_running") "colorscheme pyte "colorscheme newspaper "colorscheme wombat else "colorscheme xoria256 "colorscheme twilight256 colorscheme elflord endif "phpç¨ let php_sql_query=1 let php_htmlInStrings=1 "------------------------------------------------------------------------------------" " 親ããã©ã£ã¦tagsãæ¢ã "------------------------------------------------------------------------------------" set tags=tags; "------------------------------------------------------------------------------------" " omniè£å® "------------------------------------------------------------------------------------" autocmd FileType php set omnifunc=phpcomplete#CompletePHP autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS autocmd FileType html set omnifunc=htmlcomplete#CompleteTags autocmd FileType xhtml set omnifunc=htmlcomplete#CompleteTags autocmd FileType css set omnifunc=csscomplete#CompleteCSS "------------------------------------------------------------------------------------" " ãã¼ãã¤ã³ã "------------------------------------------------------------------------------------" " omniè£å®ããã¼ãã¤ã³ãå¤æ´ imap <C-f> <C-x><C-o> map <C-c><C-n> :cn<CR> map <C-c><C-p> :cp<CR> " ã¤ã³ã¯ã§æ¤ç´¢ map qqq@ /<C-r>"<CR> " ã³ãã³ãå±¥æ´ map qqq: q: " æ¤ç´¢å±¥æ´ map qqq/ q/ if has("gui_running") map <C-k> :tabprevious<CR> map <C-j> :tabnext<CR> endif "------------------------------------------------------------------------------------" " èªä½ã³ãã³ã "------------------------------------------------------------------------------------" command Setphp set filetype=php command Setjavascript set filetype=javascript command Sethtml set filetype=html " y ã dããå¾ã«fcãªã©ããã°ãã " copy to clipboard if has("unix") && match(system("uname"),'Darwin') != -1 " mac " http://www.mail-archive.com/[email protected]/msg00773.html nnoremap fc :call system("pbcopy", @")<CR> nnoremap fp :r! pbpaste<CR> elseif has('win32unix') " cygwin nnoremap fc :call system("putclip", @")<CR> nnoremap fp :r! getclip<CR> endif "------------------------------------------------------------------------------------" " ã¿ãå¹ ã®è¨å® "------------------------------------------------------------------------------------" " expandtabã¯ã¿ããã¹ãã¼ã¹ã«å¤ãã "set expandtab set tabstop=2 set softtabstop=2 set shiftwidth=2 "------------------------------------------------------------------------------------" "ã¹ãã¼ã¿ã¹ã©ã¤ã³ "------------------------------------------------------------------------------------" set laststatus=2 "ã¹ãã¼ã¿ã¹ã©ã¤ã³ã常ã«è¡¨ç¤º function! GetB() let c = matchstr(getline('.'), '.', col('.') - 1) let c = iconv(c, &enc, &fenc) return String2Hex(c) endfunction " :help eval-examples " The function Nr2Hex() returns the Hex string of a number. func! Nr2Hex(nr) let n = a:nr let r = "" while n let r = '0123456789ABCDEF'[n % 16] . r let n = n / 16 endwhile return r endfunc " The function String2Hex() converts each character in a string to a two " character Hex string. func! String2Hex(str) let out = '' let ix = 0 while ix < strlen(a:str) let out = out . Nr2Hex(char2nr(a:str[ix])) let ix = ix + 1 endwhile return out endfunc "ã¹ãã¼ã¿ã¹ã©ã¤ã³ã«æåã³ã¼ãã¨æ¹è¡æåã表示ãã " set statusline=%<[%n]%m%r%h%w%{'['.(&fenc!=''?&fenc:&enc).':'.&ff.']['.&ft.']'}\ %F%=%l,%c%V%8P if winwidth(0) >= 120 set statusline=%<[%n]%m%r%h%w%{'['.(&fenc!=''?&fenc:&enc).':'.&ff.']'}%y\ %F%=[%{GetB()}]\ %l,%c%V%8P else set statusline=%<[%n]%m%r%h%w%{'['.(&fenc!=''?&fenc:&enc).':'.&ff.']'}%y\ %f%=[%{GetB()}]\ %l,%c%V%8P endif "set statusline=%{GetB()} "------------------------------------------------------------------------------------" " netrw "------------------------------------------------------------------------------------" " netrwã¯å¸¸ã«tree view let g:netrw_liststyle = 3 " CVSã¨.ã§å§ã¾ããã¡ã¤ã«ã¯è¡¨ç¤ºããªã let g:netrw_list_hide = 'CVS,\(^\|\s\s\)\zs\.\S\+' " 'v'ã§ãã¡ã¤ã«ãéãã¨ãã¯å³å´ã«éãã(ããã©ã«ããå·¦å´ãªã®ã§å ¥ãæ¿ã) let g:netrw_altv = 1 " 'o'ã§ãã¡ã¤ã«ãéãã¨ãã¯ä¸å´ã«éãã(ããã©ã«ããä¸å´ãªã®ã§å ¥ãæ¿ã) let g:netrw_alto = 1 "------------------------------------------------------------------------------------" " end "------------------------------------------------------------------------------------"
vimã®ã¡ãã£ã¨å½¹ã«ç«ã¤è¨å®
NeoBundleã使ã£ãã¨ãã³ã¡ã³ãã®æ¬¡ã®è¡ã«æ¸ããã¨ããã¨ã³ã¡ã³ããåæã«æ¿å ¥ãããã解é¤
autocmd FileType * setlocal formatoptions-=ro
NERDTreeãvimèµ·åæã«å®è¡
autocmd VimEnter * NERDTree ./