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'; | |
| import 'dart:convert'; | |
| void main(List<String> arguments) { | |
| //run a command process | |
| Process.run('ls', ['-l']).then((ProcessResult results) { | |
| print(results.stdout); | |
| print('Exit code: ${results.exitCode }'); //0 is good | |
| }); |
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:async'; | |
| int counter=0; | |
| void main(List<String> arguments) { | |
| Duration duration =new Duration(seconds: 5); | |
| Timer timer = new Timer.periodic(duration, timeOut); | |
| print('Started: ${getTime()}'); | |
| } |
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 'async.dart'; | |
| import 'dart:io'; | |
| main() async{ | |
| print('Statring:'); | |
| File file =await appendFile(); | |
| print('Appended to file ${file.path}'); | |
| print('END*******************'); | |
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'; | |
| import 'dart:async'; | |
| main() async{ | |
| print ('Creat a file and write to it'); | |
| File file = await appendToFile(); | |
| print ('File has been appended'); | |
| print('now attempt to read the file'); |
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'; | |
| import 'dart:async'; | |
| import 'dart:convert'; | |
| import 'package:pedantic/pedantic.dart'; | |
| void main(List<String> arguments) { | |
| Directory pwd = Directory.current; | |
| final myfile = new File(pwd.path + '/new.txt'); | |
| Directory temp = Directory.current; |
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'; | |
| import 'dart:async'; | |
| import 'dart:convert'; | |
| import 'package:pedantic/pedantic.dart'; | |
| void main(List<String> arguments) { | |
| Directory pwd = Directory.current; | |
| final myfile = new File(pwd.path + '/new.txt'); | |
| Directory temp = Directory.current; |
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
| /* | |
| This is more sample code showing compression and use of the assert command | |
| In this example there is two examples of compression | |
| A very large compression of the bible, reading it from a file, converting it to a list | |
| removing whitespace and special characters with regex and then utf8 encoding | |
| compressing the file with with gzip, uncompressing the file with gzip and comparing the file | |
| to the original with the assert command. Unfortunately the assert fails, I am not | |
| sure why, it looks good? | |
| So I created another example on a smaller scale. |
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
| /* | |
| This compares two compression codecs in DART and compares them | |
| GZIP and ZLIB | |
| */ | |
| import 'dart:html_common'; | |
| import 'dart:io'; | |
| import 'dart:convert'; |
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
| /* | |
| This compares two compression codecs in DART and compares them | |
| GZIP and ZLIB | |
| */ | |
| import 'dart:io'; | |
| import 'dart:convert'; | |
| main (List<String> arguments){ |
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'; | |
| import 'dart:math'; | |
| import 'package:pointycastle/pointycastle.dart'; | |
| import 'dart:typed_data'; | |
| import 'dart:convert'; | |
| import 'package:collection/collection.dart'; | |
| void main(List<String> arguments) { |
OlderNewer