You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
Importing Frameworks To import a framework in RubyCocoa, you use a combination of Ruby’s require method and RubyCocoa’s require_framework addition: # RubyCocoa code require 'osx/cocoa' OSX.require_framework('CoreData') MacRuby unifies these methods with the framework method added to the Kernel module: # MacRuby code framework 'Cocoa' framework 'CoreData' Namespaces In RubyCocoa, all imported Objec
HotCocoaの実装を知りたかったので、MacRuby » HotCocoa Mappings Tutorialを適当に訳してみました。 はじめに HotCocoaを利用すると、特定のObjective-CクラスをMacRubyで簡単に使用できるようにマッピングを定義してくれます。 マッピング定義はRubyベースのDSLで行われます。HotoCoca DSLでは、 マッピングの基本文法 objectインスタンス (required) デフォルトオプション (optional) 定数マッピング (optional, inherited) カスタムメソッド (optional, inherited) 定数マッピング、カスタムメソッド delegateメソッドマッピング (optional) を用います。マッピング定義では、基本文法以外でobjectインスタンスが必須項目になります。ほかの4項
Check out the tutorial and other learning resources and examples available for MacRuby. 17-18 Apr 2009 » Golden Gate Ruby Conference San Francisco, CA, USA Rich Presents MacRuby & HotCocoa 15-16 May 2009 » Ruby on OS X Amsterdam, Holland, The Netherlands Laurent & Rich Presenting MacRuby and Hotcocoa 27-29 Aug 2009 » Lone Star Ruby Conference Austin, Texas, USA Rich Gives a MacRuby & HotCoco
Introduction A HotCocoa mapping defines a structure that sits on top of a particular Objective-C class and simplifies its usage in !MacRuby. This structure is defined in a simple, Ruby-based DSL DSL (domain-specific language).The HotCocoa DSL includes syntax to aid in object instantiation, constant mapping, default options, customized methods, and delegate-method mappings. The only required sectio
HotCocoaResources This page is an informal index to HotCocoa resources. Applications Dan Sinclair SilverLining (Amazon EC2 Instance Browser) Rife (Start of a news reader) Postie (The app from the "heating up" tutorials) Articles, etc. Isaac Kearse Stopwatch - A HotCocoa Status Bar Timer Packaging A HotCocoa Application SafariRSS - HotCocoa Safari RSS Handler Dan Sinclair Heating up with HotCocoa P
MacRuby 0.6 の GCD API README.rdocに書かれていることに沿って、自分が使いそうなのをまとめてみました。 Dispatch::Job Dispatch::Proxy Dispatch Enumerable Dispatch::Sources Dispatch::SourcesのSignal、File descriptor、Process state changeの使い方がよく分からなかったので書いてません。そのうち書くかも(^ ^; MacRuby 0.6+ではREADME.rdocが修正されています。そのうち対応したいとは思っています。あと、README.rdocで書かれているスクリプトのサンプルが付属するようになりました。実際に動かしながら試すのが良いでしょう。
MacRubyとhotcocoaを使うとステータスメニューにアイコンを簡単に表示することができるようです。動作確認にはMacRuby 0.6とhotcocoa 0.5.1を使いました。 hotcocoaは $ sudo macgem install hotcocoa とコマンドを実行してインストールできます。 #!/usr/local/bin/macruby # -*- coding: utf-8 -*- require "rubygems" require "hotcocoa" # ステータスバーに表示するアイコン ICON = "icon-11.png" # クリックされたときに表示するアイコン ICON2 = ICON class Application include HotCocoa def start @app = application(:name => "sample",
MacRuby 0.6では動かないので、最新版のMacRubyをSVNから取得してください(^ ^; #!/usr/local/bin/macruby # -*- coding: utf-8 -*- framework "JavaScriptCore" module JSC module_function def eval(program) kJSPropertyAttributeNone = 0 unless(kJSPropertyAttributeNone) callback = Proc.new do |ctx, obj, this, len, args, exp| if(len > 0) tmp = args.cast!('^{OpaqueJSValue=}') string = JSValueToStringCopy(ctx, tmp[0], exp) size = JSStri
Not your computer? Use a private browsing window to sign in. Learn more about using Guest mode
Not your computer? Use a private browsing window to sign in. Learn more about using Guest mode
_ [OpenGL] OpenGL 3.3と4.0 急に来たのでびっくりしたよ。GDCで出る可能性をすっかり忘れていた。 まだちゃんと見てないけど。 OpenGL4.0は基本的にはDirect3D11クラスの機能を詰め込んだ様子。Direct3D11は詳しくないんだけど、テッセレータとかそのまま追加されちゃった。そのままかよ…。 OpenGL3.3は名前通り3.x系の拡張。ちょこちょこと機能追加されてるが、インターフェース変更ででかいのがSampler Objectの追加か。 今までのOpenGLではテクスチャの中身とサンプラが一緒になってた。フィルタやリピート処理、ミップマップなんかの設定をテクスチャオブジェクトに行うようになってて不可分だった。 でも一つテクスチャを別設定で読み込みたい時にテクスチャ2枚作らなきゃいけないのは無駄だよね困るよね。ということで設定を別に分けられるようにした
環境 PC: Mac mini CPU: Intel Core 2 Duo 1.83 GHz RAM: 1GB DDR2 SDRAM 667 MHz OS: Mac OS X 10.6.3 使用したRuby ruby-1.9.2 rev.27984 : svn co -r 27984 http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_2 ruby 1.9.1-p378 ruby 1.8.7-p249 MacRuby 0.6 MacRuby 0.5 JRuby 1.5.0 JRuby 1.4.0 Rubinius 1.0.0 ベンチマークに使用したスクリプト http://github.com/acangiano/ruby-benchmark-suite 結果 ベンチマーク結果の単位はsecです。青字は一番高いパフォーマンス値で、赤字
下のほうに日本語版があります。 [En] AO Bench is a small ambient occlusion renderer for benchmarking floating point performance by Syoyo Fujita. AO Bench was ported to various languages. See http://lucille.atso-net.jp/aobench/ A Ruby version of AO Bench is ported by id:miura1729 I rewrote ao-render.rb to eliminate redundant statements and reduce temporary objects. I also wrote ao-render-gcd.rb using Grand Central
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く