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 "datamapper" | |
class Person | |
include DataMapper::Resource | |
property :id, Serial | |
property :name, String, :required => true | |
property :role, String, :set => %w(boss rookie) |
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
module DataMapper | |
class Collection | |
# A query friendlier group_by method | |
def group_by | |
assoc = {} | |
self.each do |item| | |
key = yield(item) | |
if assoc.has_key? key | |
assoc[key] << item | |
else |
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
$sql = "SELECT word, COUNT(word) AS count FROM log WHERE true "; | |
if( isset($_GET["c"]) && $_GET["c"] != "" ) $sql .= " AND county = ". $_GET["c"]; | |
if( isset($_GET["g"]) && $_GET["g"] != "" ) $sql .= " AND gender = '". $_GET["g"] ."'"; | |
if( isset($_GET["b"]) && $_GET["b"] != "" ) $sql .= " AND age BETWEEN ". $_GET["b"] ." AND ". $_GET["t"]; | |
$sql .= " GROUP BY word ORDER BY count DESC LIMIT 10"; |
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
diff --git a/swflib/actionScript.ml b/swflib/actionScript.ml | |
index f8d9f04..05e5dce 100644 | |
--- a/swflib/actionScript.ml | |
+++ b/swflib/actionScript.ml | |
@@ -208,7 +208,7 @@ let action_data_length = function | |
| _ -> | |
0 | |
-let action_length a = | |
+let action_length a = |
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 DisplayObjectUtil { | |
public static function iterator( obj : flash.display.DisplayObjectContainer ) { | |
var i = 0; | |
return { | |
next: function(){ | |
return obj.getChildAt(i++); | |
}, | |
hasNext: function(){ | |
return i < obj.numChildren; | |
} |
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
brew install bazaar | |
==> Downloading http://launchpadlibrarian.net/41811693/bzr-2.1.1.tar.gz | |
######################################################################## 100.0% | |
==> make man1/bzr.1 | |
==> /usr/bin/gzip man1/bzr.1 | |
==> make | |
building extension modules. | |
python setup.py build_ext -i | |
No Pyrex, trying Cython... |
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
*** /Users/slaskis/test/src/Main.cpp 2010-04-12 09:02:24 +0200 | |
--- /Users/slaskis/test2/src/Main.cpp 2010-04-12 09:04:10 +0200 | |
*************** | |
*** 37,48 **** | |
} | |
}; | |
Dynamic properties = _Function_1_1::Block(); | |
struct _Function_1_2{ | |
inline static Dynamic Block( ){ | |
hx::Anon __result = hx::Anon_obj::Create(); |
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 "dm-core" | |
require "pp" | |
DataMapper::Logger.new(STDOUT,:debug) | |
DataMapper.setup(:default, "sqlite3://#{Dir.pwd}/bula.db") | |
class Entry |
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
Index: Makefile | |
=================================================================== | |
--- Makefile (revision 3171) | |
+++ Makefile (working copy) | |
@@ -1,45 +1,73 @@ | |
-EXTLIB=../../mtcvs/extlib-dev | |
-SWFLIB=../../mtcvs/swflib | |
-EXTC=../../mtcvs/extc | |
-NEKO=../neko | |
-XML=../../mtcvs/xml-light |
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 Test extends flash.display.Sprite { | |
public function new() { | |
super(); | |
var bmd = new flash.display.BitmapData( 200 , 200 ); | |
var channels = flash.display.BitmapDataChannel.RED | flash.display.BitmapDataChannel.BLUE; | |
bmd.perlinNoise(100, 80, 6, Math.floor(Math.random() * 10), false, true, channels, false, null); | |
var o = new haxe.io.BytesOutput(); |