This file contains hidden or 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
void WebView::wheelEvent(QWheelEvent *ev){ | |
int delta = ev->delta()/SMOOTH_SCROLL_STEP; | |
m_WebPage->frameAt(ev->pos())->setFocus(); | |
if(delta > 0){ | |
for(int i = 0; i < delta; i++){ | |
QTimer::singleShot(i*SMOOTH_SCROLL_TIMER, | |
m_WebPage, SLOT(LittleScrollUp())); | |
} | |
} else { | |
delta = -delta; |
This file contains hidden or 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
(require 'cl) | |
;; よく使う関数だと名前かぶり怖いので、変数があほみたいな感じ。 | |
;; やりようはないのか知らん | |
;; fold | |
(defun foldl (lib-foldl-kons lib-foldl-knil &rest lib-foldl-lis) | |
(do ((lib-foldl-lis lib-foldl-lis (mapcar 'cdr lib-foldl-lis)) | |
(lib-foldl-knil lib-foldl-knil (apply lib-foldl-kons `(,@(mapcar 'car lib-foldl-lis) ,lib-foldl-knil)))) | |
((memq nil lib-foldl-lis) lib-foldl-knil))) |
This file contains hidden or 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
import Data.List | |
import Data.IORef | |
import System.Random | |
import Control.Monad | |
import Graphics.Rendering.OpenGL | |
import Graphics.UI.GLUT | |
width = 300 | |
height = 300 | |
widthf = 300 |
This file contains hidden or 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
(define (main-loop scr bmp dstrect) | |
(let loop ((num 0)) | |
(let ((c0 0) ;; ・ | |
(c1 1) ;; → | |
(c2 -1) ;; ← | |
(c3 (+ field-width)) ;; ↓ | |
(c4 (+ 1 field-width)) ;;↓→ | |
(c5 (+ -1 field-width)) ;;↓← | |
(c6 (- field-width)) ;;↑ | |
(c7 (- 1 field-width)) ;;↑→ |
This file contains hidden or 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
(define (offsets l) | |
(list l | |
(append (drop l 1) (take l 1)) | |
(append (take-right l 1) (drop-right l 1)))) | |
(define (next list-of-lists) | |
(apply map | |
(^ lis | |
(apply map | |
(^ k |
This file contains hidden or 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 sdl) | |
(use srfi-43) | |
(use math.mt-random) | |
(define seed (make <mersenne-twister> :seed (sys-time))) | |
(define bmp-size 3) | |
(define field-width 200) | |
(define field-height 200) | |
(define field |
This file contains hidden or 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-42) | |
(use math.mt-random) | |
(use util.match) | |
(use sdl) | |
(define bmp-size 3) | |
;; point | |
(define (make-point x y) | |
(cons x y)) |
This file contains hidden or 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 sdl) | |
(use srfi-1) | |
(use math.mt-random) | |
(use gauche.sequence) | |
(define seed (make <mersenne-twister> :seed (sys-time))) | |
(define bmp-size 3) | |
(define field-width 200) | |
(define field-height 200) |
This file contains hidden or 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
(require 'eshell) | |
(require 'cl) | |
(defun normalize-file-name(filename) | |
(let ((skip nil)) | |
(mapconcat | |
'identity | |
(nreverse | |
(mapcan | |
(lambda (str) |
This file contains hidden or 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
(defun ac-get-pre(prefix) | |
(substring prefix 0 (string-match "[^a-zA-Z0-9]" prefix))) | |
(defun filename-completer-rxexpand(prefix) | |
(let ((dlm-list (split-string prefix "[a-zA-Z0-9]+")) | |
(str-list (split-string prefix "[^a-zA-Z0-9]+"))) | |
(if (string= (car str-list) "") | |
(setq dlm-list (cons "" dlm-list))) | |
(concat "\\`" | |
(mapconcat |
NewerOlder