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 <iostream> | |
#include <iomanip> | |
#include <set> | |
#include <vector> | |
void printIt(uint64_t n, char s[11], size_t digits = 10) { | |
char format[100]; | |
snprintf(format, 100, "%%0%dju", digits); | |
snprintf(s, 11, format, n); | |
} |
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
# GitHub recently "deprecated" the network view of repositories, which was a tool i relied on. | |
# merging this S.O. answer: https://stackoverflow.com/a/9074343/230851 | |
# with some other research gets me to the command below. | |
# the only notable addition is setting the ordering to --date-order, to match github's network view. | |
# | |
# note! | |
# you'll still need to `git fetch` prior to this to view branches on the server. | |
git log --all --graph --date-order --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit |
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
using System; | |
using UnityEngine; | |
using UnityEngine.UI; | |
// based on https://gist.github.com/jmbeach/78c3e46669db89628fce | |
public class BetterToggleGroup : ToggleGroup { | |
public Action<Toggle> OnChange; | |
protected override void Start() { |
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
<html> | |
<head> | |
<script type="text/javascript" src="/src/brython.js"></script> | |
<script type="text/python"> | |
from browser import window | |
import json | |
def call_me(): | |
s = json.dumps(window.my_dict_1.to_dict()) | |
print("dict 1 serialized by python: %s" % (s)) |
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
import copy | |
import time | |
# fun from Ernest! | |
# | |
# Given two strings s and t, determine whether some anagram of t is a substring of s. | |
# For example: if s = "udacity" and t = "ad", then the function returns True. | |
# Your function definition should look like: question1(s, t) and return a boolean True or False. | |
def q_ernest(s, t): |
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
import copy | |
# fun from Ernest! | |
# | |
# Given two strings s and t, determine whether some anagram of t is a substring of s. | |
# For example: if s = "udacity" and t = "ad", then the function returns True. | |
# Your function definition should look like: question1(s, t) and return a boolean True or False. | |
# approach by orion. |
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
/* | |
0 0x00 0b00000000 | |
1 0x01 0b00000001 | |
2 0x02 0b00000010 | |
3 0x03 0b00000011 | |
4 0x04 0b00000100 | |
5 0x05 0b00000101 | |
6 0x06 0b00000110 | |
7 0x07 0b00000111 | |
8 0x08 0b00001000 |
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
#!/bin/bash | |
# this is provided as-is, with no guarantees that it will work or not explode your computer. | |
# written for OSX. | |
# | |
# orion elenzil 2017 | |
# | |
# Motivation: | |
# If you are moving to two-factor authentication, | |
# you may also want to move from http-access to ssh-access. |
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
this is the puzzle: http://www.techworm.net/2015/04/when-the-hell-is-cheryls-birthday-a-math-problem-from-singapore-goes-viral.html | |
first, the puzzle is a little weird because it doesn't explain how Albert knows Bernard does not know. | |
but ignoring that, or assuming that before Albert spoke, Bernard said "I do not know". | |
it's also not explicit about who knows which: | |
I make the assumption that Albert knows the month and Bernard knows the day number. | |
Albert knows Bernard does not know, which means it's not one of the day numbers which occur only once, | |
which means it's not May 19 or June 18. |