This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ffi.h" | |
STATIC mp_obj_t example_printf(size_t n_args, const mp_obj_t *args) { | |
ffi_cif cif; | |
ffi_type **types = alloca(n_args * sizeof(ffi_type *)); | |
ffi_raw *values = alloca(n_args * sizeof(ffi_raw)); | |
void **arg_values = alloca(n_args * sizeof(void *)); | |
ffi_arg result; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function fwd_conv($v) { | |
// 必要な桁数を求める のと同時に 該当桁数内での順番に変換する | |
for ($c = 1; $v >= pow(26, $c); $c++) $v -= pow(26, $c); | |
// 目標桁数のアルファベット26進表現に変換 | |
$r = base_convert($v, 10, 26); | |
$r = str_pad($r, $c, '0', STR_PAD_LEFT); | |
$t = '0123456789abcdefghijklmnopqrstuvwxyz'; | |
return strtr($r, $t, substr($t, 10)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/kern/sysv_sem.c b/kern/sysv_sem.c | |
index 53b63e0..25fe343 100644 | |
--- a/kern/sysv_sem.c | |
+++ b/kern/sysv_sem.c | |
@@ -506,6 +506,17 @@ semvalid(int semid, struct semid_kernel *semakptr) | |
semakptr->u.sem_perm.seq != IPCID_TO_SEQ(semid) ? EINVAL : 0); | |
} | |
+static int | |
+jail_check_semperm(td, semakptr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Obey maxBounds during dragging a map on leaflet 0.7 | |
New option "maxBoundsResistance" (0.0 - 1.0) controls its reaction; | |
0.0: No effect | |
0.8: Modern reaction (default) | |
1.0: Strictly forbid | |
*/ | |
L.Map.addInitHook(function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
L.Map.addInitHook(function() { | |
var map = this; | |
this.dragging._draggable.on("predrag", function() { | |
var bounds_sw = map.latLngToLayerPoint(map.options.maxBounds.getSouthWest()).add(this._newPos); | |
var bounds_ne = map.latLngToLayerPoint(map.options.maxBounds.getNorthEast()).add(this._newPos); | |
var size = map.getSize(); | |
if (bounds_ne.y > 0) { | |
this._newPos.y -= bounds_ne.y / 1.2; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use gauche.array) | |
(define Tarray (array (shape 0 3 0 3) 1 0 0 0 1 0 0 0 1)) | |
(define sxsy (array (shape 0 3 0 1) 1 1 1)) | |
(dotimes (y 100) | |
(display ".")(flush) | |
(dotimes (x 100) | |
(array-mul Tarray sxsy))) | |
(newline) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
uint8_t read_uint8(FILE *fp) | |
{ | |
int ch = fgetc(fp); | |
uint8_t ret = 0; | |
if (ch == EOF) return 0; /* XXX */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- xpdf/XPDFApp.cc 2011-08-16 06:08:53.000000000 +0900 | |
+++ xpdf/XPDFApp.cc 2012-06-19 15:48:43.000000000 +0900 | |
@@ -36,8 +36,8 @@ | |
static String fallbackResources[] = { | |
"*.zoomComboBox*fontList: -*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1", | |
- "*XmTextField.fontList: -*-courier-medium-r-normal--12-*-*-*-*-*-iso8859-1", | |
- "*.fontList: -*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1", | |
+ "*XmTextField.fontList: -misc-fixed-medium-r-*-*-14-*-*-*-*-*-iso10646-1:80", | |
+ "*.fontList: -misc-fixed-medium-r-*-*-14-*-*-*-*-*-iso10646-1:80", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use srfi-1) ; iota | |
(use srfi-43) ; vector-for-each | |
(define fail #f) | |
;;; write following at the end of file | |
;;; to initialize the value of the fail. | |
(call/cc | |
(lambda (cc) | |
(set! fail |