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 <string> | |
#include <vector> | |
#include <stack> | |
#include <windows.h> // PE関連の構造体のため | |
int addr_putchar = 0x00405044; | |
int addr_getchar = addr_putchar + 4; | |
int addr_buf = 0x00406000; |
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
open System | |
open System.Text | |
let bin (a:uint64) b = | |
new String( | |
[| for i in 1..b -> | |
if (a &&& (1UL <<< (b - i))) = 0UL then '0' else '1' |]) | |
let reverse (u:uint32) = | |
let rec rev ret i = |
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
// public domain | |
open System | |
open System.Text | |
let reverse (u:uint32) = | |
let rec rev ret i = | |
if i = 32 then ret else | |
rev (if (u &&& (1u <<< i)) = 0u then ret else | |
ret ||| (1u <<< (31 - i))) |
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
' public domain | |
Option Explicit | |
Private Crc32Table&(255) | |
Private Type ZipHeader | |
ver As Integer | |
flags As Integer | |
compression As Integer |
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
=> http://github.com/7shi/FSharpZip/blob/master/Zip/Zip.fs |
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
#import <AppKit/AppKit.h> | |
@implementation TestWin: NSObject | |
- (void)applicationDidFinishLaunching:(NSNotification*)aNotification | |
{ | |
id win, button, menu = [NSMenu new]; | |
NSRect wf = { {100, 200}, {100, 50} }; | |
NSRect bf = { { 20, 15}, { 60, 20} }; | |
unsigned int style = NSTitledWindowMask | NSClosableWindowMask; | |
[menu addItemWithTitle:@"Quit" |
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
type Hash3() = | |
let list = Array.zeroCreate<List<int>> 65536 | |
let data = new List<byte>() | |
let mutable pos = 0 | |
let mutable prev2 = 0uy | |
let mutable prev1 = 0uy | |
let getList (b1:byte) (b2:byte) (b3:byte) = | |
let i = ((int b1) <<< 8) ^^^ ((int b2) <<< 4) ^^^ (int b3) | |
let ret = list.[i] |
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
type ReadBuffer(sin:Stream) = | |
let mutable length = buflen | |
let mutable buf :byte[] = null | |
let mutable buf':byte[] = null | |
let mutable hash :List<int>[] = [| for _ in 0..4095 -> new List<int>() |] | |
let mutable hash':List<int>[] = [| for _ in 0..4095 -> new List<int>() |] | |
let read() = | |
let buf'', hash'' = buf', hash' | |
buf' <- buf |
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
--- Download.cs.orig | |
+++ Download.cs | |
@@ -161,6 +161,13 @@ | |
{ | |
case "Edition": | |
Date = xr2["Date"]; | |
+ try | |
+ { | |
+ var dt = DateTime.Parse(date); | |
+ var dir = Path.GetDirectoryName(BaseDir); |
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
// 描画するとこ | |
protected override void OnPaint(PaintEventArgs e) | |
{ | |
base.OnPaint(e); | |
// listに入ってるものすべてを描画 | |
for (int i = 0; i < list.Count;i++) | |
{ | |
// listの中身i番目の(X,Y)のXを3つ進めて、それをlistの中身i番目に戻す | |
var p = list[i]; |