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'); | |
class SVGSamples { | |
void run() { | |
drawlines(); | |
} | |
void drawlines() { | |
final int maxY = 250; |
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
/** | |
* location: dart/frog/file_system_node.dart | |
* library: file_system_node | |
* class: NodeFileSystem | |
* File system implementation using nodejs api's (for self-hosted compiler). | |
*/ | |
#import('../../frog/file_system_node.dart'); | |
NodeFileSystem _fs = new NodeFileSystem(); |
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:dom', prefix:'dom'); | |
#import('dart:html'); | |
main() { | |
dom.AudioContext audioContext = new dom.AudioContext(); | |
dom.AudioBufferSourceNode source = audioContext.createBufferSource(); | |
dom.AudioGainNode gainNode = audioContext.createGainNode(); | |
source.connect(gainNode, 0, 0); |
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'); | |
void main() { | |
List<int> data = [0x00, 0x01, 0x10, 0x11, 0x7e, 0x7f, 0x80, 0x81, 0xfe, 0xff]; | |
ListInputStream stream = new ListInputStream(); | |
int count = 0; | |
ReceivePort donePort = new ReceivePort(); | |
stream.write(data); | |
void onData() { | |
print('bytes available on stream is ' + stream.available()); |
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: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
#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"; |
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("../lib/redis.dart"); | |
#import("dart:utf"); | |
void main() { | |
String okStr = "+OK"; | |
String getStr = "\$16\r\nmy spaced string\r\n"; | |
String listStr = "*4\r\n\$5\r\nWorld\r\n\$5\r\nHello\r\n\$3\r\nbar\r\n\$3\r\nfoo\r\n"; | |
Utils.setVerboseState(); | |
Decoder decoder = new Decoder(listStr); | |
var i = decoder.decode(); |
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
// Reference: http://en.wikipedia.org/wiki/Visitor_pattern | |
interface CarElementVisitor { | |
void visitWheel(Wheel wheel); | |
void visitEngine(Engine engine); | |
void visitBody(Body body); | |
void visitCar(Car car); | |
} | |
interface CarElement { | |
void accept(CarElementVisitor visitor); // CarElements have to provide accept(). |