Skip to content

Instantly share code, notes, and snippets.

@gr883e5b
gr883e5b / template.bat.txt
Created November 12, 2012 06:53
bat ひな形っぽいメモ
* 引数にファイル/ディレクトリを与えたときの展開
数値は(以下の例では 1) n 番目の引数に相当。%1 -> argv[1]
rem ---------------------------
rem %~1 全ての引用句(")を削除して%1を展開する。
rem %~f1 %1を完全修飾パス名に展開する。
rem %~d1 %1をドライブ名だけに展開する。
rem %~p1 %1をパスだけに展開する。
rem %~n1 %1をファイル名だけに展開する。
rem %~x1 %1をファイル拡張子だけに展開する。
@gr883e5b
gr883e5b / memo.c
Created November 7, 2012 05:45
junk C
/* memo */
/* csv を読み込む */
....
while ((NULL != fgets(buf, BUFSIZ, fp))) {
ret = sscanf(buf, "%[^,],%[^,],%[^,]", id, date, title);
....
}
@gr883e5b
gr883e5b / dump.c
Created October 27, 2012 01:24
junk C programs
#include <stdio.h>
main(int argc, char *argv[])
{
FILE *fp;
int data;
int i1;
unsigned long
@gr883e5b
gr883e5b / memo.txt
Created October 13, 2012 00:23
x86_64-w64-mingw32 cross compile on Ubuntu
$ mkdir /opt/mingw-w64
$ cd /opt/mingw-w64
$ wget http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-linux_20121010.tar.bz2 -nc
$ tar xf mingw-w64-bin_i686-linux_20121010.tar.bz2
$ export PATH=/opt/mingw-w64/bin:$PATH
* autoconf, automake, libtool ...
素直に apt-get。依存(perl, m4)するものもインストールされるし。
* svn, git
@gr883e5b
gr883e5b / faac-1.28.diff
Created October 9, 2012 22:23
MinGW Faac
http://blog.k-tai-douga.com/article/26604536.html
diff -ur faac-1.28.orig/common/mp4v2/mpeg4ip_win32.h faac-1.28/common/mp4v2/mpeg4ip_win32.h
--- faac-1.28.orig/common/mp4v2/mpeg4ip_win32.h Sun Jan 25 10:14:34 2009
+++ faac-1.28/common/mp4v2/mpeg4ip_win32.h Sat Jul 10 18:32:45 2010
@@ -42,10 +42,18 @@
#include <stdlib.h>
#include <time.h>
#include <limits.h>
+#include <ctype.h>
@gr883e5b
gr883e5b / faad-cvs-mingw.diff
Created October 9, 2012 21:17
MinGW Faad off_t redeclaration compile failure
URL : http://sourceforge.net/tracker/?func=detail&aid=2618563&group_id=704&atid=100704
--- frontend/main.c 2009-02-19 19:33:04 -0800
+++ frontend/main.c.new 2009-02-19 19:25:14 -0800
@@ -31,7 +31,9 @@
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
+#ifndef __MINGW32__
#define off_t __int64
@gr883e5b
gr883e5b / __dvd2ts.pl
Created October 6, 2012 23:23
REGZA 用 ts を作るためのスクリプトたち
#!perl -w
use strict;
use warnings;
use Encode;
use Data::Dumper;
use XML::Simple;
# wget http://cpansearch.perl.org/src/TNAGA/PHP-Functions-File-0.04/lib/PHP/Functions/File.pm -P lib/PHP/Functions/
use PHP::Functions::File qw(file_put_contents);
@gr883e5b
gr883e5b / TODO
Created September 23, 2012 04:43
TODO
* autoconf (http://www.gnu.org/software/autoconf/autoconf.html) がビルドできない件。
m4 (http://www.gnu.org/software/m4/m4.html) を自前ビルドしたからいけないのか?
perl (http://strawberryperl.com/) x64 がいけないのか?
solution:
http://lists.gnu.org/archive/html/autoconf/2008-12/msg00012.html
@gr883e5b
gr883e5b / install_msys-mingw.bat
Created September 22, 2012 14:44
msys/mingw cross compile env
@echo off
rem mingw-get:
rem http://sourceforge.net/projects/mingw/files/Installer/mingw-get/
rem
rem cross-compile: bin
rem http://xhmikosr.1f0.de/
rem http://komisar.gin.by/
rem
rem strawberry perl: bin
@gr883e5b
gr883e5b / build.sh
Created September 11, 2012 22:41
ビルド用シェル
#!/bin/sh
WORK=${HOME}/sandbox
#PREF64=/mingw/x86_64-w64-mingw32
PREF64=/usr/local
HOST64=x86_64-w64-mingw32
CROSS64=x86_64-w64-mingw32-
LOG=${HOME}/${0##*/}.log
mkdir ${WORK}