My Pokemon shiny raid seed checker https://cute.berichan.net/ which is essentially a dudu bot clone runs on a Raspberry Pi 4 so I thought I'd write down how I compiled an arm-64 optimized version of SysBot.NET/Pokemon.
This guide assumes you have a working and 64-bit compatible Raspberry Pi with the 64-bit version of Raspbian installed and have at least a basic understanding of how to use Raspbian/Linux. If you can't get this set up, you should ask for help in the official Raspberry Pi forums. Note, the 64-bit OS is only installable on the Pi 3 and Pi 4 (and onwards) devices. 32-bit compilation (not covered) is easier but significantly slower for a variety of things SysBot.NET uses, so I don't recommend it.
Make sure your pi is up-to-date by running sudo apt-get update
then sudo apt-get dist-upgrade
.
Note, This guide also assumes you have already used (with success) SysBot.NET at least once and are able to copy over your c
extern crate itertools; // 0.8.0 | |
use itertools::Itertools; // 0.8.0 | |
fn g(x: u32) -> u32 { | |
let s = x.to_string(); | |
s.chars() | |
.map(|c| c.to_digit(10).unwrap()) | |
.into_iter() | |
.group_by(|&x| x) | |
.into_iter() |
#![allow(unused)] | |
macro_rules! nested { | |
($x:expr) => { ($x) }; | |
($x:expr, $($rest:expr),+) => { | |
( | |
$x, | |
nested!($($rest),*) | |
) | |
}; |
CertSimple just wrote a blog post arguing ES2017's async/await was the best thing to happen with JavaScript. I wholeheartedly agree.
In short, one of the (few?) good things about JavaScript used to be how well it handled asynchronous requests. This was mostly thanks to its Scheme-inherited implementation of functions and closures. That, though, was also one of its worst faults, because it led to the "callback hell", an seemingly unavoidable pattern that made highly asynchronous JS code almost unreadable. Many solutions attempted to solve that, but most failed. Promises almost did it, but failed too. Finally, async/await is here and, combined with Promises, it solves the problem for good. On this post, I'll explain why that is the case and trace a link between promises, async/await, the do-notation and monads.
First, let's illustrate the 3 styles by implementing
// sending to sender-client only | |
socket.emit('message', "this is a test"); | |
// sending to all clients, include sender | |
io.emit('message', "this is a test"); | |
// sending to all clients except sender | |
socket.broadcast.emit('message', "this is a test"); | |
// sending to all clients in 'game' room(channel) except sender |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent
/** \mainpage | |
* | |
* __NaCl__ (pronounced _salt_) is a new easy-to-use high-speed | |
* software library for network communication, encryption, decryption, | |
* signatures, etc. NaCl's goal is to provide all of the core | |
* operations needed to build higher-level cryptographic tools. | |
* | |
* __Sodium__ is a portable, cross-compilable, installable, | |
* packageable, API-compatible version of NaCl. | |
* |