This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"os" | |
"bufio" | |
) | |
func ReadLineByLine(filepath string, out chan string) { | |
defer close(out) |
This file contains hidden or 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
func ToUtf8(to_decode string) string { | |
to_decode_buf := []byte(to_decode) | |
buf := make([]rune, len(to_decode_buf)) | |
for i, b := range to_decode_buf { | |
buf[i] = rune(b) | |
} | |
return string(buf) | |
} |
This file contains hidden or 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
--- | |
title: <TITLE> | |
author: Lucy Linder | |
date: <DATE> | |
toc: false | |
mainfont: palatino | |
geometry: left=3.5cm, right=3.5cm, top=4cm, bottom=4cm | |
colorlinks: true | |
smart: true |
This file contains hidden or 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
%% Use this configuration of lstlistings to support extended characters (i.e. acctents) and automatic line wrapping. | |
\usepackage{listings} | |
\usepackage{listingsutf8} | |
\usepackage{inconsolata} % nicer font | |
\lstset{basicstyle=\footnotesize\ttfamily,breaklines=true} % set default font and line breaks | |
\lstset{% support extended characters | |
inputencoding=utf8, |
This file contains hidden or 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 ( | |
"io/ioutil" | |
"encoding/json" | |
) | |
struct Something { | |
i int `json:"i"` | |
s string `json:"name"` | |
} |
This file contains hidden or 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 java.io.InputStream; | |
import java.io.StringReader; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import javax.xml.bind.JAXBContext; | |
import javax.xml.bind.JAXBElement; | |
import javax.xml.bind.JAXBException; | |
import javax.xml.bind.Unmarshaller; | |
import javax.xml.transform.stream.StreamSource; |
This file contains hidden or 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
# left and right click reversed, scroll with small right button, middle click with small right button, go back with small left button | |
# xinput buttons: left-click middle-click right-click wheel-up wheel-down -wheel-left wheel-right thumb1 thumb-2 extbt7 extbt8 | |
xinput set-button-map "Logitech USB Trackball" 3 9 1 4 5 6 7 8 2 # left-handed | |
xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation Button" 8 9 # wheel on small button right | |
xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation" 8 8 |
This file contains hidden or 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
from IPython.display import SVG | |
from keras.utils.visualize_util import model_to_dot | |
SVG(model_to_dot(model, show_shapes=True).create(prog='dot', format='svg')) | |
# and to save it directly to a file | |
from keras.utils.visualize_util import plot | |
plot(model, show_shapes=True, to_file='/tmp/model.png') |
This file contains hidden or 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
// see http://introcs.cs.princeton.edu/java/92symbolic/Polynomial.java.html | |
public class Polynomial{ | |
private int[] coef; // coefficients | |
private int deg; // degree of polynomial (0 for the zero polynomial) | |
// a * x^b | |
public Polynomial( int a, int b ){ | |
coef = new int[ b + 1 ]; |
This file contains hidden or 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
/* change bootstrap 4 tooltip colors, including the arrow ! */ | |
.tooltip-inner { | |
background-color: #555; | |
} | |
/* tooltip top arrow */ | |
.tooltip.bs-tether-element-attached-bottom .tooltip-inner::before, .tooltip.tooltip-top .tooltip-inner::before { | |
border-top-color: #555; | |
} | |
/* tooltip bottom arrow */ |