This file contains hidden or 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
require 'PresentationCore' | |
require 'PresentationFramework' | |
include System::Windows | |
include System::Windows::Controls | |
class FrameworkElement | |
def self.create_new( hash ) | |
elem = new() | |
hash.each_pair do |key, value| | |
elem.send( "#{key}=".to_sym, value) |
This file contains hidden or 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
require 'PresentationCore' | |
require 'PresentationFramework' | |
Application = System::Windows::Application | |
HorizontalAlignment = System::Windows::HorizontalAlignment | |
SizeToContent = System::Windows::SizeToContent | |
Thickness = System::Windows::Thickness | |
Window = System::Windows::Window | |
Button = System::Windows::Controls::Button |
This file contains hidden or 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
require 'rubygems' | |
require 'builder' | |
require 'PresentationCore' | |
require 'PresentationFramework' | |
require 'System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeytoken=b77a5c561934e089' | |
include System::Windows | |
StringReader = System::IO::StringReader; | |
XamlReader = System::Windows::Markup::XamlReader | |
XmlReader = System::Xml::XmlReader; |
This file contains hidden or 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
require 'rubygems' | |
require 'builder' | |
require 'PresentationCore' | |
require 'PresentationFramework' | |
require 'System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeytoken=b77a5c561934e089' | |
module XamlTools | |
include System::Windows | |
StringReader = System::IO::StringReader; | |
XamlReader = System::Windows::Markup::XamlReader |
This file contains hidden or 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
require 'xamltools.rb' | |
require 'PresentationFramework' | |
class ViewModel | |
attr :greeting, true | |
def initialize(greet) | |
@greeting = greet | |
end | |
end |
This file contains hidden or 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
require 'xamltools.rb' | |
class MyCommand | |
include System::Windows::Input::ICommand | |
def add_CanExecuteChanged(h) | |
@change_handlers << h | |
end | |
def remove_CanExecuteChanged(h) | |
@change_handlers.remove(h) | |
end |
This file contains hidden or 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
class DisposableHero | |
include System::IDisposable | |
attr :name | |
def initialize(name = "Jed") | |
@name = name | |
end | |
def do_something_to(other) | |
puts "#{@name} washes a car for #{other.name}" | |
end | |
def do_something |
This file contains hidden or 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 expression = | |
| Empty | |
| Number of int | |
let expression stream = | |
match stream with | |
| [] -> Empty, stream | |
| h::t -> Number( Int32.Parse(h)), t | |
let evaluate expr = | |
match expr with | |
| Empty -> 0 |
This file contains hidden or 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
require 'rubygems' | |
require 'spec' | |
require 'spec/autorun' | |
@watches = [] | |
def watch(matcher, &block) | |
@watches << Matcher.new(matcher, &block) | |
end | |
def do_a_loop(sender, arg) | |
puts "found a #{arg.change_type} with #{arg.name}" |
This file contains hidden or 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
let rec fibonacci n = | |
match n with | |
| 0 -> 0 | |
| 1 -> 1 | |
| _ -> (fibonacci (n-1)) + (fibonacci (n-2)) |
OlderNewer