Skip to content

Instantly share code, notes, and snippets.

//-----------------------------------------------------
// Setup.
use std::collections::HashMap;
fn solve(i: usize, z: i128, levels: Vec<HashMap<i128, Vec<(i128, i128)>>>) -> Option<i64> {
let mut level = levels[i].get(&z).unwrap();
level.sort();
None
use std::{
fmt::{Display, Write},
ops::AddAssign,
};
use itertools::Itertools;
//-----------------------------------------------------
// Setup.
// This only works if your offset is bigger than half the length of your data…
fn run_big_fft(data: &[char], iterations: usize, offset: usize) -> String {
let mut curr: Vec<i32> = data
.iter()
.skip(offset)
.map(|&i| i.to_digit(10).unwrap() as i32)
.collect();
for _ in 0..iterations {
let mut next: Vec<i32> = vec![];
let mut sum: i32 = curr.iter().sum();
@bwinton
bwinton / q02.rs
Last active December 2, 2019 05:59
//-----------------------------------------------------
// Setup.
static INPUT: &str = include_str!("data/q02.data");
fn run_tape(ints: &mut Vec<usize>) -> usize {
let mut position = 0;
loop {
let opcode = &ints[position];
match opcode {
The locale requested by LC_CTYPE=en_CA.UTF-8 isn't available here.
Running `locale-gen en_CA.UTF-8' may be necessary.
The locale requested by LC_CTYPE=en_CA.UTF-8 isn't available here.
Running `locale-gen en_CA.UTF-8' may be necessary.
mosh-server needs a UTF-8 native locale to run.
Unfortunately, the local environment (LC_CTYPE=en_CA.UTF-8) specifies
the character set "US-ASCII",
diff --git a/browser/components/touchbar/MacTouchBar.js b/browser/components/touchbar/MacTouchBar.js
--- a/browser/components/touchbar/MacTouchBar.js
+++ b/browser/components/touchbar/MacTouchBar.js
@@ -288,13 +288,16 @@ class TouchBarHelper {
this.activeUrl = data;
if (data.startsWith("about:reader")) {
kBuiltInInputs.ReaderView.disabled = false;
- this._updateTouchBarInput("ReaderView");
} else {
// ReaderView button is disabled on every location change since
@bwinton
bwinton / user-style.css
Created April 26, 2018 14:14
LimeChat-ish styles for irccloud
::-webkit-scrollbar-thumb,
::-webkit-scrollbar-track-piece {
background-color: transparent !important;
}
::-webkit-scrollbar-thumb {
border-radius: 4px;
}
div#sidebarwrapper:hover ::-webkit-scrollbar-thumb,
0:20.60 TEST_END: MainThread ERROR, expected PASS
Traceback (most recent call last):
File "c:\Users\bwinton\Programming\mozilla-central\testing/marionette/harness\marionette_harness\marionette_test\testcases.py", line 188, in run
self.tearDown()
File "c:\Users\bwinton\Programming\mozilla-central\testing\firefox-ui\tests\functional\sessionstore\test_tabbar_session_restore_button.py", line 54, in tearDown
super(TestBaseTabbarSessionRestoreButton, self).tearDown()
File "c:\Users\bwinton\Programming\mozilla-central\testing/marionette/puppeteer/firefox\firefox_puppeteer\mixins.py", line 100, in tearDown
self._check_and_fix_leaked_handles()
File "c:\Users\bwinton\Programming\mozilla-central\testing/marionette/puppeteer/firefox\firefox_puppeteer\mixins.py", line 60, in _check_and_fix_leaked_handles
self.browser.tabbar.close_all_tabs([self.browser.tabbar.tabs[0]])
@bwinton
bwinton / merged log
Last active June 20, 2017 19:42
session restore failures.
{"source": "Firefox UI - functional Tests", "thread": "MainThread", "time": 1497987321100, "action": "log", "message": "Using workspace for temporary data: \"c:\\Users\\bwinton\\Programming\\mozilla-central\"", "level": "INFO", "pid": 6636}
{"source": "Marionette test runner", "thread": "MainThread", "time": 1497987321114, "action": "log", "message": "Application command: c:/Users/bwinton/Programming/mozilla-central/obj-i686-pc-mingw32\\dist\\bin\\firefox.exe -no-remote -marionette -profile c:\\users\\bwinton\\appdata\\local\\temp\\tmptagjos.mozrunner", "level": "INFO", "pid": 6636}
1497987324374 Marionette INFO Listening on port 2828
1497987324730 Marionette DEBUG Accepted connection 0 from 127.0.0.1:54027
{"source": "Firefox UI - functional Tests", "thread": "MainThread", "time": 1497987324733, "action": "log", "message": "Profile path is c:\\users\\bwinton\\appdata\\local\\temp\\tmptagjos.mozrunner", "level": "INFO", "pid": 6636}
{"source": "Firefox UI - functional Tests", "thread": "MainThread", "time": 1
@bwinton
bwinton / tofino-windows.log
Created April 6, 2017 14:56
Problems running Tofino on Windows.
> [email protected] dev+logging C:\Users\bwinton\Programming\tofino
> cross-env NODE_ENV=development LOGGING=on gulp build+start --obj-dir-name development
[10:54:49] Requiring external module babel-register
[10:54:52] Using gulpfile ~\Programming\tofino\gulpfile.babel.js
[10:54:52] Starting 'build+start'...
[10:54:52] Starting 'build'...
[10:54:52] Starting 'build:write-build-type'...
[10:54:52] Creating build-type