#dart:math example
How to generate random numbers in dart.
Main library: dart:math
Main element: Random.nextInt
Gist: https://gist.github.com/kasperpeulen/8c0391f110737b2b9724
DartPad: https://dartpad.dartlang.org/8c0391f110737b2b9724
#dart:math example
How to generate random numbers in dart.
Main library: dart:math
Main element: Random.nextInt
Gist: https://gist.github.com/kasperpeulen/8c0391f110737b2b9724
DartPad: https://dartpad.dartlang.org/8c0391f110737b2b9724
#dart:html example
How to dynamically load HTML and insert into a webpage with Dart
Main library: dart:html
Main element: NodeTreeSanitizer.trusted
Gist: https://gist.github.com/kasperpeulen/536b021ac1cf397d4e6d
DartPad: https://dartpad.dartlang.org/536b021ac1cf397d4e6d
#args:CommandRunner example
Main library: args:CommandRunner
Main element: CommandRunner.addCommand
Gist: https://gist.github.com/kasperpeulen/6a35b3d87f61eef1bbd5
#args:command_runner example
A basic example of a command-based application.
The command dart main.dart install [library] will add the library to the
main.dart file. For example try dart main.dart install http:http.
Main library: args:command_runner
Main elements: CommandRunner CommandRunner.addCommand
#dartson:dartson example
Dartson is a dart library which converts Dart Objects into their JSON representation.
It helps you keep your code clean of fromJSON and toJSON functions by using dart:mirrors reflection. It works after dart2js compiling.
Main library: dartson:dartson
Main elements: Dartson.JSON Dartson.encode
Gist: https://gist.github.com/kasperpeulen/ef38c9bda5dc586a78f1
#dart:math dart:core example
Runs random simulations of the Monty Hall game and compares the two different strategies.
Suppose you're on a game show and you're given the choice of three doors. Behind one door is a car; behind the others, goats. The car and the goats were placed randomly behind the doors before the show. The rules of the game show are as follows: After you have chosen a door, the door remains closed for the time being. The game show host, Monty Hall, who knows what is behind the doors, now has to open one of the two remaining doors, and the door he opens must have a goat behind it. If both remaining doors have goats behind them, he chooses one randomly. After Monty Hall opens a door with a goat, he will ask you to decide whether you want to stay with your first choice or to switch to the last remaining door. Imagine that you chose Door 1 and the host opens Door 3, which has a goat. He then asks you "Do you want to switch to Door Number 2?" Is it to your advantage to change your choice? (Krau
#mdl:mdl example
How to use MDL on dynamic websites.
Material Design Lite will automatically register and render all elements marked with MDL classes upon page load. However in the case where you are creating DOM elements dynamically you need to register new elements using the upgradeElement function.
Main library: mdl:mdl
Main element:
Gist: https://gist.github.com/kasperpeulen/d2f59227c054e82f825b
#mdl:mdl example
How to use MDL on dynamic websites.
Material Design Lite will automatically register and render all elements marked with MDL classes upon page load. However in the case where you are creating DOM elements dynamically you need to register new elements using the upgradeElement function.
Main library: mdl:mdl
Main element:
Gist: https://gist.github.com/kasperpeulen/d2f59227c054e82f825b
#mdl:mdl example
How to use MDL on dynamic websites.
Material Design Lite will automatically register and render all elements marked with MDL classes upon page load. However in the case where you are creating DOM elements dynamically you need to register new elements using the upgradeElement function.
Main library: mdl:mdl
Main element:
Gist: https://gist.github.com/kasperpeulen/d2f59227c054e82f825b
#mdl:mdl example
How to use MDL on dynamic websites.
Material Design Lite will automatically register and render all elements marked with MDL classes upon page load. However in the case where you are creating DOM elements dynamically you need to register new elements using the upgradeElement function.
Main library: mdl:mdl
Main element:
Gist: https://gist.github.com/kasperpeulen/d2f59227c054e82f825b