Skip to content

Instantly share code, notes, and snippets.

nao@host ~ $ rm symbolic_link/
rm: `symbolic_link/' を削除できません: ディレクトリです
nao@host ~ $ unlink symbolic_link/
unlink: `symbolic_link/' を削除 (unlink) できません: ディレクトリではありません
// ========================== KeySnail Init File =========================== //
// この領域は, GUI により設定ファイルを生成した際にも引き継がれます
// 特殊キー, キーバインド定義, フック, ブラックリスト以外のコードは, この中に書くようにして下さい
// ========================================================================= //
//{{%PRESERVE%
// Put your codes here
// Metaplus
plugins.options["metaplus.metakeys"] = ["ESC", "C-t"];
#include <chrono>
#include <iostream>
// compile with -std=c++11 option
int main(){
typedef std::chrono::duration <int,std::ratio<24*60*60> > chomado_year;
std::chrono::hours seven_days(24*7);
std::cout << "7 days is " << std::chrono::duration_cast<chomado_year>(seven_days).count() << " years for chomado" << std::endl;
}
@NaokiKuzumi
NaokiKuzumi / cfunction.c
Created June 17, 2013 08:31
関数の宣言func(void)とfunc()は厳密に違う。 引数のない関数を宣言するのはfunc(void)でなければならない。
void hoge(){
}
void fuga(void){
}
int main(void){
hoge("piyo");
fuga("java");
return 0;
@NaokiKuzumi
NaokiKuzumi / gist:5635563
Created May 23, 2013 11:57
携帯彼氏に出てきたLispっぽいコード片。
(defun dead-doggie-p (objol.117.2.32)
(eq astore::flag-dead
(logand (astore::os-instance-flags (astore::p-so-pptr obj))
astore::iflag-222.7.56.32 /
(defstruct node
(rireki nil :type list)
(state '(3 2 1 2) :type (and list (not null))))
(defun inner-solve (slist)
(if
(issolved (car slist))
(printrireki (car slist))
(inner-solve (nconc (cdr slist) (nextnodesforall (car slist) '(0 1 2 3))))))
@NaokiKuzumi
NaokiKuzumi / longerthansrcgolf
Created January 31, 2013 12:44
https://twitter.com/b2/status/296948889179811841 21bytes 環境に強依存。一桁の+で見つかったのはラッキーだった。
main(){puts(main+9);}
@NaokiKuzumi
NaokiKuzumi / .emacs
Created December 5, 2012 02:47
どこまでをemacsでやり、どこまでをportageでやるのか悩みつつまた大幅減量がなされた.emacs
;;;;
;;;; emacs config file
;;;;
;;;
;;; common settings
;;;
;; no startup message
;;;;
;;;; emacs config
;;;;
;;;
;;; general config
;;;
;; set load-path
(setq load-path