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 class Main { | |
| public static void main(String[] args) { | |
| byte zero = 0b0000_0000; | |
| byte mid = (byte)0b1000_0000; | |
| byte max = 0b0111_1111; | |
| System.out.println(zero + " -> 0b0000_0000"); | |
| System.out.println(mid + " -> 0b1000_0000"); | |
| System.out.println(max + " -> 0b0111_1111"); | |
| System.out.println("0b0111_1111 (127) + 0b0000_0001 (1) = 0b1000_0000 (" + (byte)(max + 1) + ")"); |
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
| final column = OutVar<Column>(); | |
| init( | |
| Center( | |
| child: Column( | |
| outVar: column, | |
| space: 20, | |
| align: Align.start, | |
| children: [ | |
| Box( |
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
| class ToDoItem { | |
| String name; | |
| bool check; | |
| ToDoItem(this.name, [this.check = false]); | |
| } | |
| class ToDo { | |
| final List<ToDoItem> init; |
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
| class ToDo { | |
| final List<String> init; | |
| ToDo({required this.init}) { | |
| update(); | |
| } | |
| final edit = OutVar<Edit>(); | |
| final listView = OutVar<ListView>(); | |
| final buttonsRow = OutVar<Row>(); |
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
| async login(request: Request, response: Response) { | |
| const { email, password } = request.body; | |
| try { | |
| const user = assert(await User.findOne({ email })); | |
| assert(bcrypt.compareSync(password, user.password)); | |
| } catch(_) { | |
| return response.status(404).json({ message: 'email or password incorrect' }) | |
| } | |
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 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
| fn main() { | |
| let mut editor = Editor::new(); | |
| let mut history = History::new(); | |
| input("one", &mut editor, &mut history); | |
| input("_", &mut editor, &mut history); | |
| input("two", &mut editor, &mut history); | |
| undo_all(&mut editor, &mut history); | |
| } |
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
| fn main() { | |
| let mut c = CompoundGraphics::new(); | |
| c.add_all(vec![ | |
| Box::new(Dot { | |
| x: 100, | |
| y: 200, | |
| }), | |
| Box::new(Rectangle { | |
| x: 200, | |
| y: 300, |
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
| fn main() { | |
| CvsMiner.mine("file.cvs"); | |
| TxtMiner.mine("file.txt"); | |
| } | |
| trait Miner { | |
| fn mine(&self, file_name: &str) { | |
| let file = self.open_file(file_name); | |
| let raw = self.extract_data(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
| #![feature(trait_upcasting)] | |
| #![allow(incomplete_features)] | |
| extern crate core; | |
| use std::borrow::Borrow; | |
| use std::thread::sleep; | |
| use std::time::Duration; | |
| use crate::gui_app::{Form, GuiFactory}; |