Julia Juno Jupyter part1 [無断転載禁止]©2ch.net (745レス)
Julia Juno Jupyter part1 [無断転載禁止]©2ch.net http://mevius.5ch.net/test/read.cgi/tech/1455271513/
上
下
前
次
1-
新
通常表示
512バイト分割
レス栞
92: デフォルトの名無しさん [sage] 2016/07/20(水) 12:33:08.99 ID:IKGpFUMW 笑いどころがわからない 配列用でないreinterpretはconvertと違って慎重に使うべきもの julia> reinterpret(Bool, 256) false これは気持ち悪い ……と開発者も思ったらしくv0.5ではエラーになる見込み http://mevius.5ch.net/test/read.cgi/tech/1455271513/92
93: デフォルトの名無しさん [sage] 2016/07/20(水) 21:10:41.79 ID:AXsJLLhK 間にscheme入ってるならpythonに近い文法に変換するのも簡単に出来るのでは? http://mevius.5ch.net/test/read.cgi/tech/1455271513/93
94: デフォルトの名無しさん [sage] 2016/07/20(水) 22:23:38.39 ID:IKGpFUMW pythonに近い文法を求めているならpython使えばいいんでは? てかschemeに何の関係が? http://mevius.5ch.net/test/read.cgi/tech/1455271513/94
95: デフォルトの名無しさん [] 2016/07/21(木) 18:47:37.68 ID:Vj/xPVWN S式でなんでもできるのは面白いな http://mevius.5ch.net/test/read.cgi/tech/1455271513/95
96: デフォルトの名無しさん [sage] 2016/07/21(木) 18:53:51.10 ID:IyjPITzN マクロで真っ黒 http://mevius.5ch.net/test/read.cgi/tech/1455271513/96
97: デフォルトの名無しさん [sage] 2016/07/22(金) 11:45:49.87 ID:f6dSUOKk >>7-11 >>25 >>28 >>30-32 定義はmacro使うと楽 macro c(restype, fnc, argtypes) local args = [symbol("a", n) for n in 1:length(argtypes.args)] quote $(esc(fnc))($(args...)) = ccall($(string(fnc)), $restype, $argtypes, $(args...)) end end @c UInt32 printf (Ptr{Cchar},) @c UInt32 printf (Ptr{Cchar}, UInt32,) printf(pointer(Array{UInt8,1}([65,66,0,67,68,0,0]))) printf("%s\n", pointer(Array{UInt
8,1}([65,66,0,67,68,0,0]))) macro m(lib, restype, fnc, argtypes) local args = [symbol("a", n) for n in 1:length(argtypes.args)] quote $(esc(fnc))($(args...)) = ccall(($(string(fnc)), $(Expr(:quote, lib))), $restype, $argtypes, $(args...)) end end @m libcurl Cint curl_free (Ptr{Void},) @m libcurl Ptr{Cchar} curl_getenv (Ptr{Cchar},) @m libcurl Ptr{Cchar} curl_version () v = curl_getenv("TZ") printf(v) curl_free(v) printf(curl_version()) http://mevius.5ch.net/test/read.cgi/tech/1455271
513/97
98: デフォルトの名無しさん [sage] 2016/07/22(金) 11:49:20.02 ID:f6dSUOKk >>9 macro w(lib, restype, fnc, argtypes) local args = [symbol("a", n) for n in 1:length(argtypes.args)] quote $(esc(fnc))($(args...)) = ccall(($(string(fnc)), $(Expr(:quote, lib))), stdcall, $restype, $argtypes, $(args...)) end end @w user32 UInt32 MessageBoxA (UInt32, Ptr{Cchar}, Ptr{Cchar}, UInt32,) MessageBoxA(C_NULL, "hage", "title", 1) http://mevius.5ch.net/test/read.cgi/tech/1455271513/98
99: デフォルトの名無しさん [] 2016/07/22(金) 13:42:42.08 ID:hQsD+JBa >>97-98 32bit 限定のコードを書くべきじゃないな http://mevius.5ch.net/test/read.cgi/tech/1455271513/99
100: デフォルトの名無しさん [sage] 2016/07/22(金) 15:31:36.78 ID:TotCshYe 呼び出すライブラリの仕様は確定しているのだから実用上問題ないのでは? http://mevius.5ch.net/test/read.cgi/tech/1455271513/100
101: デフォルトの名無しさん [sage] 2016/07/23(土) 10:27:35.38 ID:6lYjBmg5 ヒ素2さんかな(ヒソヒソ) http://mevius.5ch.net/test/read.cgi/tech/1455271513/101
102: デフォルトの名無しさん [] 2016/07/23(土) 11:05:54.45 ID:+Jc7SqHC x = UInt32(0x12345678) a = pointer_to_array(convert(Ptr{UInt8}, pointer_from_objref(x)), 4) a[2] = 51 println(@sprintf "%08X" x) # 0x12343378 http://mevius.5ch.net/test/read.cgi/tech/1455271513/102
103: デフォルトの名無しさん [] 2016/07/23(土) 11:07:52.09 ID:+Jc7SqHC immutable TT a::UInt16 b::UInt16 end x = UInt32(0x12345678) a = pointer_to_array(convert(Ptr{TT}, pointer_from_objref(x)), 1) println(a) # [TT(0x5678,0x1234)] a[].a = 0xaabb # ERROR: type TT is immutable http://mevius.5ch.net/test/read.cgi/tech/1455271513/103
104: デフォルトの名無しさん [] 2016/07/23(土) 11:12:28.69 ID:+Jc7SqHC type XX a::UInt16 b::UInt16 end x = UInt32(0x12345678) # ↑ここまでは動く a = pointer_to_array(convert(Ptr{XX}, pointer_from_objref(x)), 1) # ↑インタプリタ環境だとこれを実行した時点で環境ごと落ちる (下へ行くケースあり) println("reach here") println(a) # インタプリタの外から julia hoge.jl で実行したときは println(a) まで実行すると落ちる http://mevius.5ch.net/test/read.cgi/tech/1455271513/104
105: デフォルトの名無しさん [] 2016/07/23(土) 11:13:02.17 ID:+Jc7SqHC なぜでしょう?(unsafeなことしてるのは判ってるのですが・・・) http://mevius.5ch.net/test/read.cgi/tech/1455271513/105
106: デフォルトの名無しさん [sage] 2016/07/23(土) 12:22:24.60 ID:lFeXmVIf なぜって自分でbitstypeでもimmutableでもないって分かっている書きぶりじゃん その上で聞いているならソース読め http://mevius.5ch.net/test/read.cgi/tech/1455271513/106
107: デフォルトの名無しさん [sage] 2016/07/23(土) 17:00:36.64 ID:6lYjBmg5 へー Julia ってこういう壊れ方するのかー julia> n = UInt32(3) 0x00000003 julia> p = Ptr{UInt32}(pointer_from_objref(n)) Ptr{UInt32} @0x06e474f0 julia> pointer_to_array(p, 1) 1-element Array{UInt32,1}: 0x00000003 julia> UInt32(3) 0x00000003 julia> pointer_to_array(p, 1)[] = 9 9 julia> UInt32(3) 0x00000009 http://mevius.5ch.net/test/read.cgi/tech/1455271513/107
108: デフォルトの名無しさん [sage] 2016/07/23(土) 17:11:02.05 ID:6lYjBmg5 こうなってるのかー 気付かんかったわー julia> e = UInt32(11) 0x0000000b julia> f = UInt32(11) 0x0000000b julia> p = Ptr{UInt32}(pointer_from_objref(e)) Ptr{UInt32} @0x06e47770 julia> pointer_to_array(p, 1) 1-element Array{UInt32,1}: 0x0000000b julia> UInt32(11) 0x0000000b julia> pointer_to_array(p, 1)[] = 17 17 julia> UInt32(11) 0x00000011 julia> f 0x00000011 http://mevius.5ch.net/test/read.cgi/tech/14
55271513/108
109: デフォルトの名無しさん [sage] 2016/07/24(日) 09:37:49.42 ID:wdZTIji9 インタラクティブシェルのヒストリーってどうやったら消せるん? http://mevius.5ch.net/test/read.cgi/tech/1455271513/109
110: デフォルトの名無しさん [sage] 2016/07/24(日) 09:48:14.01 ID:wdZTIji9 ~/.julia_history 消したら解決しました! http://mevius.5ch.net/test/read.cgi/tech/1455271513/110
111: デフォルトの名無しさん [] 2016/07/25(月) 18:13:55.98 ID:r9xhFlm6 Cのunionと同じような機能ってreinterpret以外にないの? http://mevius.5ch.net/test/read.cgi/tech/1455271513/111
112: デフォルトの名無しさん [] 2016/07/26(火) 10:16:34.91 ID:oKnTJYes transpose と ctranspose って何が違うん? http://mevius.5ch.net/test/read.cgi/tech/1455271513/112
113: デフォルトの名無しさん [sage] 2016/07/26(火) 10:29:26.50 ID:As2nHGxN >>112 cはcomplex(複素数)のconjugate http://mevius.5ch.net/test/read.cgi/tech/1455271513/113
114: デフォルトの名無しさん [] 2016/07/27(水) 09:34:21.46 ID:nl1cCFz0 >>107-108 julia> 100 100 julia> 100 - 23 77 julia> 100 + 23 123 julia> pointer_to_array(Ptr{Int}(pointer_from_objref(100)), 1)[] = 119 119 julia> 100 119 julia> 100 - 19 119 # ← ここだけ納得いかない julia> 100 + 19 138 http://mevius.5ch.net/test/read.cgi/tech/1455271513/114
115: デフォルトの名無しさん [sage] 2016/07/27(水) 22:18:04.56 ID:vxMObH7b 納得いかないのが納得いかない "100" - 19 → 119 - 19 →"100" → 119 http://mevius.5ch.net/test/read.cgi/tech/1455271513/115
116: デフォルトの名無しさん [sage] 2016/07/28(木) 19:00:25.38 ID:O8Vfrh0P なるほど! 目から鱗でした http://mevius.5ch.net/test/read.cgi/tech/1455271513/116
117: デフォルトの名無しさん [sage] 2016/07/31(日) 11:27:08.15 ID:DMqYYSfk llvm使いたくない。gccではビルドできないの? http://mevius.5ch.net/test/read.cgi/tech/1455271513/117
118: デフォルトの名無しさん [sage] 2016/08/01(月) 12:23:48.40 ID:6PNy08If C++AMPもそうだったんだけど llvmがバージョンアップするとC++AMPの仕様も変わったりして 誰も安定してC++AMPを利用できなったので C++AMPは消えたと思う juliaがllvm使ってるのは嫌な予感しかしない http://mevius.5ch.net/test/read.cgi/tech/1455271513/118
119: デフォルトの名無しさん [sage] 2016/08/01(月) 15:22:44.54 ID:JXVULl1x コンパイル遅すぎ http://mevius.5ch.net/test/read.cgi/tech/1455271513/119
120: デフォルトの名無しさん [sage] 2016/08/01(月) 16:51:02.97 ID:8rwcghCB 寧ろgccの方が先行き不安なような http://mevius.5ch.net/test/read.cgi/tech/1455271513/120
121: デフォルトの名無しさん [sage] 2016/08/01(月) 17:20:22.43 ID:6PNy08If llvmは安定して使うことよりもgccの妨害が目的っぽい部分があって 利用者は軽視(gccの足引っ張りが重要) そんな印象がある http://mevius.5ch.net/test/read.cgi/tech/1455271513/121
メモ帳
(0/65535文字)
上
下
前
次
1-
新
書
関
写
板
覧
索
設
栞
歴
あと 624 レスあります
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.008s