This file contains 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
def f idx | |
code = read.lines.map{|x| | |
a,b = x.split | |
[a,b.to_i] | |
} | |
return if code[idx][0] == 'acc' | |
code[idx][0] = code[idx][0] == 'jmp' ? 'nop' : 'jmp' | |
executed = code.map{false} |
This file contains 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
#!/usr/bin/env bash | |
go() { | |
curl $1$2 | sed 's!url(\(.\)\.\.!url(\1'$1'..!g' | |
} | |
{ | |
go https://cdn.sstatic.net/Shared/ stacks.css | |
go https://cdn.sstatic.net/Sites/stackoverflow/ primary.css | |
} | sed ' | |
s/theme-dark/unified-theme/g; | |
s/prefers-color-scheme:dark/min-width:1px/g; |
This file contains 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
1-INDEXED, TOP TO BOTTOM, 2D | |
[[8, 10, 3, 11], [2, 11, 8, 12], [1, 7, 4, 9], [8, 7, 11, 13], [1, 12, 6, 13], [2, 7, 11, 1], [7, 12, 8, 3], [9, 5, 6, 10], [13, 13, 4, 5], [2, 6, 12, 4], [3, 5, 9, 10], [5, 4, 9, 10], [6, 1, 3, 2]] | |
[[8, 5, 4, 13], [11, 3, 7, 9], [11, 6, 12, 12], [4, 2, 6, 9], [10, 1, 3, 1], [6, 10, 9, 11], [6, 4, 7, 2], [8, 5, 13, 7], [5, 10, 3, 13], [2, 7, 1, 3], [1, 13, 8, 10], [12, 9, 8, 5], [12, 4, 2, 11]] | |
[[11, 6, 13, 12], [9, 1, 9, 5], [11, 12, 13, 8], [3, 8, 13, 5], [3, 7, 3, 7], [1, 8, 6, 13], [8, 12, 9, 6], [11, 4, 5, 2], [10, 2, 1, 7], [1, 6, 9, 3], [2, 11, 10, 4], [5, 2, 7, 4], [10, 4, 10, 12]] | |
[[7, 12, 1, 5], [5, 6, 11, 11], [5, 11, 3, 4], [7, 12, 9, 13], [12, 1, 4, 8], [4, 9, 3, 13], [7, 10, 10, 6], [1, 3, 13, 10], [1, 8, 6, 4], [6, 5, 12, 13], [10, 2, 2, 3], [9, 9, 8, 2], [2, 7, 8, 11]] | |
[[11, 10, 12, 9], [9, 8, 8, 4], [10, 13, 5, 13], [5, 13, 5, 6], [2, 6, 9, 2], [11, 4, 3, 8], [3, 10, 12, 11], [1, 7, 5, 9], [7, 6, 4, 3], [12, 7, 2, 7], [11, 4, 10, 3], [1, 12, 13, 6], [1, 2, 8, 1]] |
This file contains 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
aa | |
2h | |
3ed | |
ing | |
s | |
2l | |
3iis | |
s | |
2rdvark | |
8s |
This file contains 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
/* | |
* Copyright 2017 Haiku, Inc. All rights reserved. | |
* Distributed under the terms of the MIT License. | |
* | |
* Authors: | |
* Andrew Tockman, [email protected] | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> |
This file contains 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
#include <Font.h> | |
#include <String.h> | |
int main() | |
{ | |
BString str("test"); | |
int len = str.CountChars(); | |
bool has[len]; | |
be_fixed_font->GetHasGlyphs(str.String(), len, has); | |
} |
This file contains 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
#include "planck.h" | |
#include "action_layer.h" | |
#include "virtser.h" | |
#include "keymap_steno.h" | |
extern keymap_config_t keymap_config; | |
#define QWERTY 0 | |
#define PLOVER 1 | |
#define RAISE 2 |
This file contains 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
# license: unlicense <http://unlicense.org/> | |
times <- system2('bash', args=c('-c', shQuote('grep "\\[ALPM\\] transaction started" /var/log/pacman.log | cut -c 13-17')), stdout=TRUE) | |
times <- strtoi(substr(times, 1, 2), 10) + strtoi(substr(times, 4, 5), 10) / 60 | |
plot(density(c(times-24, times, times+24), bw=0.3), xlim=range(0:24), xaxs="i", axes=FALSE) | |
axis(side=1, at=c(0:24), las=2) | |
box() |
This file contains 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
#include "planck.h" | |
#include "action_layer.h" | |
extern keymap_config_t keymap_config; | |
#define QWERTY 0 | |
#define PLOVER 1 | |
#define RAISE 2 | |
#define DEAD 3 | |
#define RAISE_DEAD 4 |
This file contains 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(try_from)] | |
use std::{ops,convert,clone,fmt}; | |
fn generic_odds<T>(v: &Vec<T>) -> Vec<T> | |
where T: ops::Rem<T> + convert::TryFrom<u8> + clone::Clone, | |
<T as ops::Rem<T>>::Output: PartialEq<T>, | |
<T as convert::TryFrom<u8>>::Err: fmt::Debug { | |
v.iter().cloned().filter(|elt| { | |
elt.clone() % T::try_from(2u8).unwrap() == T::try_from(1u8).unwrap() |
NewerOlder