Skip to content

Instantly share code, notes, and snippets.

View master-q's full-sized avatar
🌴
On vacation

Kiwamu Okabe master-q

🌴
On vacation
View GitHub Profile
@master-q
master-q / gist:5293101
Created April 2, 2013 15:29
[Ajhc] Occur cpp error on a Windows environment.
searching for ghc in path.
found ghc at c:\Program Files (x86)\Haskell Platform\2012.4.0.0\bin\ghc.exe
("c:\\Program Files (x86)\\Haskell Platform\\2012.4.0.0\\bin\\ghc.exe",["--numeric-version"])
c:\Program Files (x86)\Haskell Platform\2012.4.0.0\bin\ghc.exe is version
7.4.2
looking for tool "ghc-pkg" near compiler in c:\Program Files (x86)\Haskell
Platform\2012.4.0.0\bin
found ghc-pkg in c:\Program Files (x86)\Haskell
Platform\2012.4.0.0\bin\ghc-pkg.exe
("c:\\Program Files (x86)\\Haskell Platform\\2012.4.0.0\\bin\\ghc-pkg.exe",["--version"])
@master-q
master-q / Test.hs
Created June 4, 2013 19:09
AjhcさんdeRefStablePtrでIOを戻すと実行できない。。。
import Foreign.StablePtr
main :: IO ()
main = do
p <- newStablePtr $ print "hoge"
d <- deRefStablePtr p
d
@master-q
master-q / main.c
Created July 3, 2013 07:52
某マイコン付属プログラムより
int main(void)
{
uint8_t i = 0;
/* SysTick end of count event each 10ms */
RCC_GetClocksFreq(&RCC_Clocks);
SysTick_Config(RCC_Clocks.HCLK_Frequency / 100);
/* Initialize LEDs and User Button available on STM32F3-Discovery board */
STM_EVAL_LEDInit(LED3);
STM_EVAL_LEDInit(LED4);
@master-q
master-q / crt0.c
Created July 12, 2013 14:55
http://www.chibios.org/ のリセットベクタ
/*
ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
2011,2012,2013 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
ChibiOS/RT is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
@master-q
master-q / Hoge.hs
Created September 5, 2013 10:30
let semWaitList = filter ((== s).snd) sL
s = 35806904
sL = [(1,35806904)]
main = do
let semWaitList = filter ((== s).snd) sL
print semWaitList
@master-q
master-q / console.log
Created September 6, 2013 15:40
cabal install derive-2.5.11をraspberrypiでやってみた。悲しみ。
pi@raspberrypi:~$ cabal install derive-2.5.11
Resolving dependencies...
[1 of 1] Compiling Main ( /tmp/haskell-src-exts-1.13.5-2255/haskell-src-exts-1.13.5/Setup.hs, /tmp/haskell-src-exts-1.13.5-2255/haskell-src-exts-1.13.5/dist/setup/Main.o )
/tmp/haskell-src-exts-1.13.5-2255/haskell-src-exts-1.13.5/Setup.hs:1:1:
Warning: In the use of `runTests'
(imported from Distribution.Simple, but defined in Distribution.Simple.UserHooks):
Deprecated: "Please use the new testing interface instead!"
Linking /tmp/haskell-src-exts-1.13.5-2255/haskell-src-exts-1.13.5/dist/setup/setup ...
Configuring haskell-src-exts-1.13.5...
@master-q
master-q / main_code.c
Created October 1, 2013 15:23
mini-os-with-ajhc(f0fd2261b169c5b936333f367726e88efc5b6666) main_code.c compile with ajhc 0.8.0.9 (bb2db48f6c3cc9b00ef25f100630d47e5820bcdd).
char jhc_c_compile[] = "gcc rts/rts/profile.c rts/rts/rts_support.c rts/rts/gc_none.c rts/rts/jhc_rts.c rts/lib/lib_cbits.c rts/rts/gc_jgc.c rts/rts/stableptr.c rts/rts/conc.c -Irts/cbits -Irts jhc_custom/main_code.c -o jhc_custom/main_code.c '-std=gnu99' -D_GNU_SOURCE '-falign-functions=4' -ffast-math -Wextra -Wall -Wno-unused-parameter -fno-strict-aliasing -DNDEBUG -O3 '-D_JHC_GC=_JHC_GC_JGC' '-D_JHC_CONC=_JHC_CONC_NONE'";
char jhc_command[] = "ajhc -funboxed-values -fffi -fcpp -C --tdir rts -o jhc_custom/main_code.c Main.hs Time.hs Util.hs Xen.hs Struct.hs Console.hs XenconsRing.hs Gnttab.hs Sched.hs List.hs Xenbus.hs Fbfront.hs TimeShadowInfoStub.hs XenconsoleStub.hs GnttabStub.hs SchedStub.hs XsWireStub.hs XenbusStub.hs FbfrontStub.hs";
char jhc_version[] = "ajhc 0.8.0.9 (bb2db48f6c3cc9b00ef25f100630d47e5820bcdd)";
#include "jhc_rts_header.h"
struct s_caches_pub {
struct s_cache *cCJhc_Prim_Prim_$x3a;
struct s_cache *cCJhc_Type_Word_Int64;
struct s_cache *cCJhc_Type_Ptr_Ptr;
struct s_cac
@master-q
master-q / log.txt
Created October 30, 2013 10:42
Bug report from Henk-Jan van Tuyl.
C:\Documents and Settings\Henk-Jan\Mijn documenten\SoftwareOntwikkeling\Haskell\Temp>cabal install ajhc
Resolving dependencies...
Configuring HsSyck-0.50...
Building HsSyck-0.50...
Preprocessing library HsSyck-0.50...
gcc.exe: --hash-size=31: linker input file unused because linking not done
gcc.exe: --reduce-memory-overheads: linker input file unused because linking not done
gcc.exe: --hash-size=31: linker input file unused because linking not done
gcc.exe: --reduce-memory-overheads: linker input file unused because linking not done
[1 of 1] Compiling Data.Yaml.Syck ( dist\build\Data\Yaml\Syck.hs, dist\build\Data\Yaml\Syck.o )
@master-q
master-q / hoge.txt
Created December 6, 2013 15:42
ほげ
とりあえず「自身」→「自信」の誤字は見つけた
「APIを切る」ってどういう意味ですか?
「apkファイル」っていきなり出てきた気がするけど、拡張子ですか?
ポインタの「peek」と「poke」ってもうちょっと説明があった方が分かりやすいかも
char jhc_c_compile[] = "gcc tdir/rts/profile.c tdir/rts/rts_support.c tdir/rts/gc_none.c tdir/rts/jhc_rts.c tdir/lib/lib_cbits.c tdir/rts/gc_jgc.c tdir/rts/stableptr.c tdir/rts/conc.c -Itdir/cbits -Itdir tdir/main_code.c -o hs.out '-std=gnu99' -D_GNU_SOURCE '-falign-functions=4' -ffast-math -Wextra -Wall -Wno-unused-parameter -fno-strict-aliasing -g -lm '-D_JHC_GC=_JHC_GC_JGC' '-D_JHC_CONC=_JHC_CONC_NONE'";
char jhc_command[] = "ajhc Main.hs -fdebug --tdir=tdir";
char jhc_version[] = "ajhc 0.8.0.10 (ef04922345d3503235620c86405af838f0271347)";
#include "jhc_rts_header.h"
struct s_caches_pub {
struct s_cache *cCJhc_Type_Basic_Integer;
struct s_cache *cCJhc_Prim_Prim_$x3a;
struct s_cache *cCJhc_Prim_Prim_$LccR;
struct s_cache *cFtheMain$d4;