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_relative "untangle/version" | |
| require "nokogiri" | |
| require "stringio" | |
| module Untangle | |
| class Element | |
| attr_accessor :is_root | |
| def initialize(name=nil, attributes=nil) | |
| @name = name | |
| @attributes = attributes |
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
| # -*- coding: utf-8 -*- | |
| require 'Qt4' | |
| require 'qtwebkit' | |
| class Foo < Qt::Object | |
| signals 'mySignal()' | |
| slots "int compute(int)" | |
| def compute value | |
| value * 2 |
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
| =begin | |
| Find pi by the Monte-Carlo method. | |
| area of a circle = pi r^2 | |
| area of a square = (2r)^2 = 4 r^2 | |
| Perform random uniform sampling between -1 and 1. | |
| The proportion of points in the unit circle is: | |
| p = (pi r^2) / (4r^2) |