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
#import('dart:isolate', prefix:'isolate'); | |
List split(List numbers) { | |
int size = numbers.length; | |
int middleIndex = (size/2).floor().toInt(); | |
var list1 = numbers.getRange(0, middleIndex); | |
var list2 = numbers.getRange(middleIndex, size-middleIndex); | |
return [list1, list2]; | |
} |
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
#import("dart:html"); | |
void main() { | |
document.query('#button').on.click.add( (e) | |
{ | |
document.query('#result').innerHTML="clicked!"; | |
}); | |
MouseEvent e = new MouseEvent( 'click', window, 0,0,0,0,0,0, | |
canBubble:true, cancelable:true, |
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
void parse(HTTPRequest req, var cb){ | |
if(_testingHandler != null){ | |
_testingHandler(data); | |
return; | |
} | |
writeHeaders(req.headers); | |
_callBack = cb; | |
print('parsing data'); | |
//_callBack(); | |
req.dataReceived = dataReceivedHandler; |
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
#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 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 SudokuBoardPresenter { | |
TableCellElement activeElement; | |
SudokuBoard _currentBoard; | |
SudokuBoardPresenter(SudokuBoard currentBoard){ | |
_currentBoard = currentBoard; | |
} | |
TableElement renderSuduokuBoard(){ | |
//render grids first | |
List<SudokuCell> allCells = _currentBoard.allCells; |
NewerOlder