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 java.util.HashMap; | |
| import org.bukkit.Achievement; | |
| public class AchievementName { | |
| private static HashMap<Achievement, String> names = new HashMap<Achievement, String>(); | |
| static { | |
| names.put(Achievement.OPEN_INVENTORY, "Taking inventory"); | |
| names.put(Achievement.MINE_WOOD, "Getting Wood"); |
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
| public static List<String> itemLoreFriendly(String text) { | |
| final int maximumCharsPerLine = 50; | |
| final char space = ' '; | |
| final char newLine = '\n'; | |
| List<String> lines = new ArrayList<String>(); | |
| while (text.length() > maximumCharsPerLine) { | |
| StringCharacterIterator it = new StringCharacterIterator(text); | |
| //Find the last location of a space befor the character limit. |
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
| procedure TForm1.btnAddItClick(Sender: TObject); | |
| var sum, i: integer; | |
| begin | |
| sum := 0; | |
| for i := 1 to 4 do begin | |
| sum := sum + (random(6) + 1); | |
| end; | |
| ShowMessage(IntToStr(sum)); | |
| 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 javax.crypto.SecretKey; | |
| import javax.crypto.SecretKeyFactory; | |
| import javax.crypto.spec.PBEKeySpec; | |
| import java.security.GeneralSecurityException; | |
| import java.security.SecureRandom; | |
| import java.util.Base64; | |
| public class PasswordHasher { | |
| private static final int HASHING_ITERATIONS = 128_000; |
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:flutter/material.dart'; | |
| import 'package:http/http.dart'; | |
| import 'package:web3dart/web3dart.dart'; | |
| void main() { | |
| runApp(MaterialApp( | |
| home: EthApp(), | |
| theme: ThemeData( | |
| primaryColor: Colors.orange, | |
| typography: Typography( |
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:moor_flutter/moor_flutter.dart'; | |
| part 'database.g.dart'; | |
| class Rooms extends Table { | |
| IntColumn get id => integer().autoIncrement()(); | |
| TextColumn get desc => text()(); | |
| } | |
| @UseMoor(tables: [Rooms]) |
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:convert'; | |
| import 'dart:html'; | |
| import 'dart:typed_data'; | |
| void main() { | |
| final content = '["general kenobi", "you are a bold one"]'; | |
| download('message.json', utf8.encode(content) as Uint8List, type: 'application/json'); | |
| } | |
| void download(String filename, Uint8List data, {String type = 'octet/stream'}) { |
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:moor/moor.dart'; | |
| import 'database.dart'; | |
| part 'dao.g.dart'; | |
| @UseDao(tables: [Users]) | |
| class SomeDao extends DatabaseAccessor<Database> with _$SomeDaoMixin { | |
| SomeDao(Database db) : super(db); | |
| } |
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:moor/moor.dart'; | |
| import 'package:moor/moor_vm.dart'; | |
| import 'package:rxdart/rxdart.dart'; | |
| part 'shopping_cart.g.dart'; | |
| class ShoppingCarts extends Table { | |
| IntColumn get id => integer().autoIncrement()(); | |
| } |
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:convert'; | |
| import 'package:moor_flutter/moor_flutter.dart'; | |
| part 'database.g.dart'; | |
| @DataClassName("Journal") | |
| class Journals extends Table { | |
| IntColumn get id => integer().autoIncrement()(); | |
| TextColumn get name => text().withLength(min: 1, max: 50)(); | |
| TextColumn get description => text().withLength(min: 1, max: 100)(); |
OlderNewer