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
Future<Size> resolveSize(ImageProvider image) async { | |
final resultController = StreamController<Size>(); | |
resolve(image, (info, _) { | |
final size = Size( | |
info.image.width.toDouble(), | |
info.image.height.toDouble(), | |
); | |
resultController.sink.add(size); | |
}); |
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
Future<Size> resolveSize(ImageProvider image) async { | |
final completer = Completer<Size>(); | |
resolve(image, (info, _) { | |
final size = Size( | |
info.image.width.toDouble(), | |
info.image.height.toDouble(), | |
); | |
completer.complete(size); | |
}); |
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
/* | |
Ali Ghanbari - 970216657 | |
AI Homework 4 - Wumpus World | |
*/ | |
import 'package:flutter/material.dart'; | |
///####################################### | |
/// constants | |
/// ###################################### |
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
/* | |
Ali Ghanbari - 970216657 | |
online compiler: https://dartpad.dev/a2c7d1d325c61bf06df68c85235d8ae9?null_safety=true | |
*/ | |
const n = 3; | |
enum Position { Left, Right } | |
enum Move { MM, M, MC, C, CC, None } | |
void main() { |
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
/* | |
* Ali Ghanbari - 970216657 | |
* online compiler: https://dartpad.dev/b7812076139d58b2c46258c33b5e7f30?null_safety=true | |
*/ | |
import 'dart:math'; | |
const n = 8; | |
enum Moves { Up, Down } | |
final random = Random(); |
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
/* | |
* Ali Ghanbari - 970216657 | |
* online compiler: https://dartpad.dev/a69b65959d0207f02adf4e78c532f87a?null_safety=true | |
*/ | |
/// | |
/// Constants | |
/// | |
enum Action { Left, Right, Suck, Idle } | |
enum RoomState { Clean, Dirty } |
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
/* | |
* Ali Ghanbari - 970216657 | |
* online compiler: https://dartpad.dev/a72a868f4690256e2f58f69b01823942?null_safety=true | |
*/ | |
/// | |
/// Constants | |
/// | |
enum Action { Left, Right, Suck } | |
enum RoomState { Clean, Dirty } |
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
s = list(input()) | |
stk = [] | |
for c in s: | |
if c == '=': | |
if stk: | |
stk.pop() | |
else: | |
stk.append(c) | |
print(''.join(stk)) |
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'; | |
void main() { | |
runZoned(() { | |
try { | |
try { | |
throw 'exception 1'; | |
} catch (e) { | |
throw LinkedException('exception 2',e); | |
} |
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 'package:html/parser.dart'; | |
void main() { | |
var document = parse(body); | |
var selectElements = document | |
.getElementsByClassName('hello') | |
.where((element) => element.attributes['data-time'] == '9112020') | |
.map((item) => item.text) | |
.toList(); | |
NewerOlder