This file contains 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
removeOne(list) { var i = list[0]; list.removeRange(0,1); return i; } | |
fold(value, f(v, n), List ns){ | |
if (ns.isEmpty()) return value; | |
return fold(f(value, removeOne(ns)), f, ns); | |
} | |
// sum of squares becomes | |
sumOfSquares(list) => fold(0, (v, n) => v + n * n, list); |
This file contains 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
#import("dart:isolate"); | |
iso() { | |
port.receive((msg, reply) { | |
port.close(); | |
}); | |
} | |
void main() { | |
SendPort sp = spawnFunction(iso); |
This file contains 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
#import('dart:html'); | |
#source('FruitView.dart'); | |
void main() { | |
List fruits = ['apples', 'oranges', 'bananas']; | |
Hello hello = new Hello("Bob", fruits); | |
hello.p.on.click.add((e) => print('clicked on paragraph!')); | |
document.body.elements.add(hello.root); | |
} |
This file contains 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
#import('dart:io'); | |
main() { | |
Socket s = new Socket("127.0.0.1", 8888); | |
print('s = ${s.available()}'); | |
} | |
/* | |
From the folllowing build socketTest.dart had no problems running. |
This file contains 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
#import('dart:html'); | |
/* | |
Internal error: 'file:///Users/adam/Documents/DartEditor/dart/dart-sdk/lib/frog/file_system_dom.dart': Error: line 40 pos 15: type 'e' is not loaded | |
} catch(e) { | |
^ | |
$ diff file_system_dom.dart file_system_dom.dart.original | |
40c40 | |
< } catch(var e) { | |
--- | |
> } catch(e) { |
This file contains 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/core/crimson.dart b/core/crimson.dart | |
index 50c09e1..938c7a8 100644 | |
--- a/core/crimson.dart | |
+++ b/core/crimson.dart | |
@@ -6,7 +6,7 @@ | |
#library("crimson:core"); | |
-#import('../../log4dart/LogLib.dart'); | |
+#import('../../log4dart/Lib.dart'); |
This file contains 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
#import('dart:html'); | |
#import('dart:uri'); | |
/* | |
Cannot load Dart script dart:uri FIXME:1 | |
Failed to load resource dart:uri | |
*/ | |
class DartiumUriBug { | |
DartiumUriBug() { | |
} |
This file contains 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
#import('dart:io'); | |
final String PATH_TO_DARTSDK = "/Users/XYZ/dart-sdk"; | |
final String SUBDIRECTORY = ""; | |
final String LIBRARY_DARTFILE = "XYZ.dart"; | |
This file contains 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
Run Patch |
This file contains 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
#import("dart:io"); | |
#import("dart:utf"); | |
#import('dart:json'); | |
#import('dart:isolate', prefix:'isolate'); | |
String API_KEY = "INSERT_KEY_HERE"; | |
class Bot { | |
Socket socket; | |
bool sendNick = true; | |
String botName = "dartBot"; |