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
class SudokuBoardPresenter { | |
TableCellElement activeElement; | |
SudokuBoard _currentBoard; | |
SudokuBoardPresenter(SudokuBoard currentBoard){ | |
_currentBoard = currentBoard; | |
} | |
TableElement renderSuduokuBoard(){ | |
//render grids first | |
List<SudokuCell> allCells = _currentBoard.allCells; |
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
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 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 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 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 java.util.Iterator; | |
import java.util.List; | |
import org.apache.commons.lang.exception.ExceptionUtils; | |
import com.mitratech.teamconnect.base.BQGroupAccess; | |
import com.mitratech.teamconnect.base.YQGroup; | |
import com.mitratech.teamconnect.base.factory.GQGrupStore; | |
import com.mitratech.teamconnect.entity.BNEnterpriseObject; | |
import com.mitratech.teamconnect.entity.BNGroupAccess; |
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
class FileHandler { | |
FileHandler(){ | |
} | |
void onRequest(HttpRequest request, HttpResponse response, [String fileName = null]){ | |
final int BUFFER_SIZE = 4096; | |
if (fileName == null) { | |
fileName = request.path.substring(1); | |
} |
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
class NotFoundHandler { | |
NotFoundHandler(){ | |
} | |
List<int> _notFoundPage; | |
static final String notFoundPageHtml = """ | |
<html><head> | |
<title>404 Not Found</title> | |
</head><body> | |
<h1>Not Found</h1> | |
<p>The requested URL was not found on this server.</p> |
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('../ThirdParty/dartwatch-JsonObject/JsonObject.dart'); | |
class Stooge extends JsonObject{ | |
Stooge(this.name, this.addresses); | |
List<Address> addresses; | |
String name; | |
} | |
class Address extends JsonObject{ | |
Address(this.city); | |
String city; |
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('../ThirdParty/dartwatch-JsonObject/JsonObject.dart'); | |
class Stooge extends JsonObject{ | |
Stooge(name, addresses):super(){ | |
this.name = name; | |
this.addresses = addresses; | |
} | |
//List<Address> addresses; | |
//String name; | |
} |
OlderNewer