タグ

programmingとCに関するdarwiniaのブックマーク (10)

  • Terra

    Terra is a low-level system programming language that is embedded in and meta-programmed by the Lua programming language: -- This top-level code is plain Lua code. function printhello() -- This is a plain Lua function print("Hello, Lua!") end printhello() -- Terra is backwards compatible with C, we'll use C's io library in our example. C = terralib.includec("stdio.h") -- The keyword 'terra' introd

  • Big Sky :: clib の使い勝手にマジ感動した

    C言語でアプリケーションを書くのは他の言語と比べて少し気合が必要ですよね。例えば HTTPからデータを取得する 取得したデータを json パースする 結果の一部を色付きで表示する こんな場合、C言語プログラマは 「HTTP か、じゃぁcurlかな」 「JSON か、parson かな」 「色表示か...エスケープシーケンスでもいいけどWindowsがなー...」 といった事を考え、そこから curl や parson といった資材の調達を始める事になります。途中で新しい機能を追加したくなり、それを外部ライブラリに頼る場合だとその都度資材を調達する必要があり、思考を停止しなければなりません。 この辺は rubyperl、nodejs、golang 等の様に、ちょっとした手間だけで済ませたい物です。 またC言語の場合、ヘッダファイルはシステムの include フォルダに提供元が期待す

    Big Sky :: clib の使い勝手にマジ感動した
  • Learn C the Hard Way

    Learn to think like the computer hates you, because it does. Learn C The Hard Way (LCTHW) is a practical book teaching real world useful C using the same proven Learn The Hard Way method. LCTHW teaches real robust C coding and defensive programming tactics on real hardware rather than abstract machines and pedantic theory. The book emphasizes breaking your code on purpose, and in the process teach

  • Cello • High Level C

    #include "Cello.h" int main(int argc, char** argv) { /* Stack objects are created using "$" */ var i0 = $(Int, 5); var i1 = $(Int, 3); var i2 = $(Int, 4); /* Heap objects are created using "new" */ var items = new(Array, Int, i0, i1, i2); /* Collections can be looped over */ foreach (item in items) { print("Object %$ is of type %$\n", item, type_of(item)); } /* Heap objects destructed via Garbage

  • あらゆるCプログラマが未定義の動作について知るべきこと - YAMDAS現更新履歴

    LLVM Project Blog: What Every C Programmer Should Know About Undefined Behavior #1/3 LLVM Project Blog: What Every C Programmer Should Know About Undefined Behavior #2/3 LLVM Project Blog: What Every C Programmer Should Know About Undefined Behavior #3/3 コンパイラ基盤 LLVM のブログで、未定義の動作という C 言語のダークサイドについての記事が3回シリーズで公開されている。 C 言語で未定義の動作を実行したら、「鼻から悪魔が飛び出しても文句が言えない」というジョークは有名で……いや、そんなのを知ってるのは年寄りくらいか(参考:nasa

    あらゆるCプログラマが未定義の動作について知るべきこと - YAMDAS現更新履歴
  • Pythonでアルゴリズム - Konnichiwa, A doumo

    これはなんですか? 奥村晴彦氏の著書「C言語による最新アルゴリズム事典」をPythonでやろうと決意。Rubyに翻訳されていたので、Pythonでもやってみようと。でも実は書籍はもっていなくてCとRubyのソースを見つつ翻訳しています。1日1個ペースで進んでいます。 やっているうちにこのが欲しくなってきました。 個人のPython力を高めるために始めましたので、間違いが含まれているかもしれません。ご指摘等ございましたら連絡[syobosyobo at gmail dot com]ください。 ちょっと方針をかえて、ctopyで訳すことにした。またまた方針をかえて、、、ctopyはあまりつかえない。ちょっといじってやらないと、出力がよくない。コメントとか入ってると、うまく変換してくれないし。 で、そのあとPythonらしい書き方で書いていこう、かと。どうなるかわかりませんが。

    darwinia
    darwinia 2007/10/22
    自分の。ちょと宣伝。
  • IBM Developer

    IBM Developer is your one-stop location for getting hands-on training and learning in-demand skills on relevant technologies such as generative AI, data science, AI, and open source.

    IBM Developer
  • C言語: 実行時間測定の方法

    C言語において実行時間を測定する為の方法はいくつかある。gettimeofday, clock, getrusage, timesを利用する方法である。ここではこれらの方法について検証してみる。これは2005/12/30時点での情報であり、古い亊が考えられるので注意して頂きたい。さらに、内容のほとんどはmanを移しただけなので、正確な情報を得るためにそれぞれの関数のmanを見ることを強く推奨する。 System: Linux 2.6.12 glibc: glibc 2.3.5-1ubuntu12 gettimeofdayを使用する方法 通常はこの関数を使用するのをお勧めする。 gettimeofdayはSVr4, BSD 4.3準拠である。返り値の型はsys/time.hに定義されるstruct timevalで有る。

  • J (2006-08-08)堕落したCプログラマのレベル10

    「偽札対応済み」って書いてある両替機。 川口市立中央図書館屋の上にある図書館。に行ってきた。特に何もないけど。あと、マイコンショップ川口つぶれてた。 ある程度能力を持ってるなら、成果を残せるか残せないかは自信を持ってるか持ってないかの違いだけかもしれないというような話。 最近思うのだけど、使えない奴(例えば、僕のような)の特徴として、「どうせ自分が何をどうやっても、何もどうにもならない」的な思考があると思う。 例えば、上の一行で言うと、「使えない奴(例えば僕」とか、そういったような思考。 こういった思考は、いったん根付いてしまうと、循環するので、なかなかやめられない。「どうせ自分は何もできないんだ→何もできないから何もやらない→何も成果を残せない→どうせ自分は何もできないんだ」とかいった感じで。 矯正しようと思っても、「いや、こういう性格だから、矯正は無理だし。」と、いう思考になってし

    J (2006-08-08)堕落したCプログラマのレベル10
  • Clearsilver

    What is Clearsilver? Clearsilver is a fast, powerful, and language-neutral HTML template system. In both static content sites and dynamic HTML applications, it provides a separation between presentation code and application logic which makes working with your project easier. The design of Clearsilver began in 1999, and evolved during its use at onelist.com, egroups.com, and Yahoo! Groups. Today ma

  • 1