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
[ | |
{ | |
"numero": 1, | |
"nom": "الله", | |
"transliteration": "ALLAH", | |
"en": "Allah", | |
"fr": "Allah" | |
}, | |
{ | |
"numero": 2, |
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
//Set the value if it doesn't | |
//You may be tempted to implement some conditional logic to handle this: | |
class ShoppingCart { | |
final Map<String, int> items = {}; | |
void add(String key, int quantity) { | |
if (items.containsKey(key)) { | |
// item exists: update it | |
items[key] = quantity + items[key]!; |
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 SimpleBlocObserver extends BlocObserver { | |
@override | |
void onEvent(Bloc bloc, Object? event) { | |
super.onEvent(bloc, event); | |
print(event); | |
} | |
@override | |
void onTransition(Bloc bloc, Transition transition) { | |
super.onTransition(bloc, transition); |
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
#division entière | |
int n = 7 ~/ 3; | |
résult by excess | |
int exces = (7/3).ceil(); | |
result by default | |
int dfault = (7/3).floor(); | |
print(n); | |
print(exces); | |
print(dfault); |
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
If on a console, that would be (as root): | |
# sudo loadkeys fr |