Skip to content

Instantly share code, notes, and snippets.

View jackpot51's full-sized avatar

Jeremy Soller jackpot51

View GitHub Profile
extern crate syscall;
use std::sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT, Ordering};
static RUNNING: AtomicBool = ATOMIC_BOOL_INIT;
extern "C" fn handler(sig: usize) {
println!("handler: signal {:X}", sig);
RUNNING.store(false, Ordering::SeqCst);
Index: accountsservice-0.6.42/src/daemon.c
===================================================================
--- accountsservice-0.6.42.orig/src/daemon.c
+++ accountsservice-0.6.42/src/daemon.c
@@ -92,7 +92,7 @@ G_DEFINE_TYPE_WITH_CODE (Daemon, daemon,
#define DAEMON_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_DAEMON, DaemonPrivate))
static const GDBusErrorEntry accounts_error_entries[] =
-{
+{
file:///home/jeremy/Projects/checkbox/checkbox-converged/components/SelectionPage.qml:313: ReferenceError: fullListIndex is not defined
qml: invoking remember_testplan on object created with converged_app.create_app_object, with args: [null] ...
ERROR:converged:remember_testplan(...) raised KeyError(None,)
Traceback (most recent call last):
File "/home/jeremy/Projects/checkbox/checkbox-converged/py/converged_app.py", line 117, in wrapper
result = func(*args, **kwargs)
File "/home/jeremy/Projects/checkbox/checkbox-converged/py/converged_app.py", line 360, in remember_testplan
self.assistant.select_test_plan(test_plan_id)
File "/usr/lib/python3/dist-packages/plainbox/impl/decorators.py", line 104, in wrapper
raise exc
*asm:
%{m16|m32:--32} %{m64:--64} %{mx32:--x32}
*asm_debug:
%{!g0:%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}} %{fdebug-prefix-map=*:--debug-prefix-map %*}
*asm_final:
%{gsplit-dwarf:
objcopy --extract-dwo %{c:%{o*:%*}%{!o*:%b%O}}%{!c:%U%O} %{c:%{o*:%:replace-extension(%{o*:%*} .dwo)}%{!o*:%b.dwo}}%{!c:%b.dwo}
objcopy --strip-dwo %{c:%{o*:%*}%{!o*:%b%O}}%{!c:%U%O} }
*asm:
%{m32:--32} %{m64:--64} %{mx32:--x32}
*asm_debug:
%{!g0:%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}} %{fdebug-prefix-map=*:--debug-prefix-map %*}
*asm_final:
%{gsplit-dwarf:
objcopy --extract-dwo %{c:%{o*:%*}%{!o*:%b%O}}%{!c:%U%O} %{c:%{o*:%:replace-extension(%{o*:%*} .dwo)}%{!o*:%b.dwo}}%{!c:%b.dwo}
objcopy --strip-dwo %{c:%{o*:%*}%{!o*:%b%O}}%{!c:%U%O} }
n = 1000000000, x = 14622190132730527136
n = 2000000000, x = 15799384551747529019
n = 3000000000, x = 12057155484686758616
n = 4000000000, x = 16100124633115225323
n = 5000000000, x = 358195542072555808
n = 6000000000, x = 15547862251926591294
n = 7000000000, x = 13804566994898632252
n = 8000000000, x = 8966348984431324450
n = 9000000000, x = 9718865654975967802
n = 10000000000, x = 10998662142082385990

Rust is Software's Salvation

After the post by Steve Klabnik, "Rust is more than safety", and a reply by Graydon Hoare, "Rust is mostly safety" - I thought it wise to throw my opinion into the mix, whether warranted or not. This is going to be a long article, which I hope raises some points that will be interesting to you.

Experience with Rust

First, I would like to clarify my experience with Rust. I first discovered Rust through reddit, in late 2014, version 0.11. What stood out to me immediately was a different focus on software - a focus on being the best language possible.

What I found in Rust was a language that was:

  • Better safety than Ada
@jackpot51
jackpot51 / redox_cross.sh
Last active June 13, 2018 04:43
How to use the new Redox cross compile support
# Clone Rust with Redox cross compilation support
git clone https://github.com/redox-os/rust -b redox_cross --recursive
# Make a build directory
cd rust
mkdir build
cd build
# Create a config.toml
cat > config.toml <<EOF