Skip to content

Instantly share code, notes, and snippets.

@k-takata
k-takata / 486-OpenWatcom.md
Last active March 4, 2024 06:43
『はじめて読む486』のサンプルを OpenWatcom でビルドする

『はじめて読む486』のサンプルを OpenWatcom でビルドする

概要

『はじめて読む486』のサンプルプログラム集 をできるだけ簡単に試してみるために、OpenWatcom を使ってビルドしてみました。

※ 16bit 用の無料で使えるコンパイラとしては LSI C-86 試食版が有名ですが、関数の呼び出し規約が MSC や Borland C とは異なっているため、アセンブリプログラムの修正が必須となってしまいます。また、Turbo C 2.01 もありますが、インストールが面倒で TASM も含まれていません。

ダウンロード

@k-takata
k-takata / createfile.c
Last active August 29, 2015 14:07
Create a very long file name with ANSI API
#include <windows.h>
main(int argc, char *argv[])
{
char *filename = "あいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえおあいうえお.txt";
HANDLE h;
h = CreateFileA(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
printf("handle:%p, length:%d\n", h, strlen(filename));
CloseHandle(h);
@k-takata
k-takata / mqpull.sh
Last active May 31, 2024 04:39
Do 'hg pull' and 'hg pull --mq' easily
#!/bin/sh
mainbundle=hg_main.bundle
mqbundle=hg_mq.bundle
rm -f $mainbundle $mqbundle
hg --pager=no incoming -v --bundle $mainbundle
if [ $? -eq 255 ]; then
exit 1
@k-takata
k-takata / pre-push
Last active August 29, 2015 14:05
Git hook to prevent pushing when patches are applied by StGit
#!/bin/sh
if stg top > /dev/null 2>&1; then
echo error: patch applied.
exit 1
fi
@k-takata
k-takata / testpy_ic.py
Last active August 29, 2015 14:03
onigmo test script for cclass with ignorecase
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import onig
import testpy
import sys
x2 = testpy.x2
x3 = testpy.x3
diff --git a/autoload/vimproc.vim b/autoload/vimproc.vim
index bb79a8c..543af50 100644
--- a/autoload/vimproc.vim
+++ b/autoload/vimproc.vim
@@ -884,10 +884,8 @@ function! s:read(...) dict "{{{
" return s:hd2str([hd])
endfunction"}}}
function! s:read_lines(...) dict "{{{
- let res = self.buffer
-
@k-takata
k-takata / hd2str_time.vim
Created June 16, 2014 12:55
Performance of map() and for loop (VimL)
let hds = []
for j in range(1, 200)
for i in range(0x20, 0x7e)
let hds += [printf("%02x", i)]
endfor
endfor
let hd = join(hds, '')
" Time of split
let stime = reltime()
@k-takata
k-takata / concattime.vim
Created June 12, 2014 12:38
Performance of string concatenation (VimL)
let lines = readfile('vim/runtime/doc/eval.txt')
echo len(lines) . " lines"
" ----------------------------
" 1. Simplest string concatenation (.=)
let stime = reltime()
let line = ''
for l in lines
let line .= l
endfor
--- a/autoload/vimproc.vim
+++ b/autoload/vimproc.vim
@@ -857,10 +857,10 @@ function! s:read(...) dict "{{{
let timeout = get(a:000, 1, s:read_timeout)
let max = 100
- let hd = ''
+ let hds = []
for cnt in range(1, max)
let [hd_r, eof] = self.f_read(number, timeout/max)
--- a/plugin/editorconfig-core-py/editorconfig/ini.py
+++ b/plugin/editorconfig-core-py/editorconfig/ini.py
@@ -17,10 +17,10 @@ import re
from codecs import open
import posixpath
from os import sep
-from os.path import normcase, dirname
+from os.path import dirname
from editorconfig.exceptions import ParsingError