| Action | Sublime | VSCode | PyCharm |
|---|---|---|---|
| Select next occurrence | Cmd + D | Cmd + D | Alt + J |
| Select all occurrences | Control + Cmd + G | ||
| Break selection into one cursor per line | Cmd + Shift + L | Shift + Option + I | Option + Mouse selection |
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 tensorflow as tf | |
| import numpy as np | |
| from random import randint | |
| def init_weights(shape): | |
| # Initializes a Tensor of size (x,y) with random weights | |
| weights = tf.random_normal(shape, stddev=1) | |
| return tf.Variable(weights) |
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.util.concurrent.Callable; | |
| import java.util.concurrent.ExecutionException; | |
| import java.util.concurrent.FutureTask; | |
| public class Main { | |
| public static void main(String[] args) throws InterruptedException, ExecutionException { | |
| class Query1Callable implements Callable<String> { | |
| private final String arg1; | |
| private Query1Callable(String arg1) { |
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
| # source: https://github.com/freebroccolo/docker-haskell/blob/master/examples/7.10/snap/Dockerfile | |
| FROM haskell:8 | |
| WORKDIR /opt/app | |
| RUN cabal update | |
| # Cache dependency installation | |
| COPY ./haskelldockertest.cabal /opt/app/haskelldockertest.cabal |
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
| acc = tf.reduce_mean(tf.cast(tf.equal(tf.argmax(softmax, axis=1), tf.cast(labels, tf.int64)), 'float'), name='acc') |
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
| \documentclass[a4paper]{article} | |
| \usepackage[utf8]{inputenc} | |
| % math | |
| \usepackage{amsmath} | |
| \usepackage{amssymb} % special set sybmols e.g. for real numbers R | |
| \usepackage{bm} % bold math | |
| \usepackage{isomath} | |
| % bracket fix (see https://tex.stackexchange.com/questions/2607) |
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
| // library imports | |
| #define SERIAL_DEBUG | |
| // global variables | |
| void setup() { | |
| #ifdef SERIAL_DEBUG | |
| Serial.begin(9600); | |
| Serial.println("Initializing..."); |
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 tensorflow as tf | |
| def vec_lookup_in_mat(mat: tf.Tensor, vec: tf.Tensor): | |
| """ | |
| Performs a lookup of values in the matrix rows using the indices stored in the vector. | |
| For example, given the matrix [[1, 2, 3], [4, 5, 6]] and the vector [0, 2], the function would return a vector | |
| consisting of the entry with index zero in the first row and index 2 in the second row, i.e. [0, 6]. | |
| :param mat: Tensor of shape [m, n, ...], values will be looked up from it; dtype any | |
| :param vec: Tensor of shape [m], indices for each row of the matrix; dtype int32 |
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
| #!/bin/bash | |
| set -euo pipefail | |
| IFS=$'\n\t' | |
| timestamp=$(date +%s) | |
| ip=192.168.1.102 | |
| echo "Taking a photo..." | |
| ssh pi@$ip "mkdir -p cam && cd cam && raspistill -o cam-$timestamp.jpg" |
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
| const TIME_MIN = new Date('2020-10-27'); | |
| const CAL_ID = 'simssosdenk@gmail.com'; | |
| const QUERIES = ['violin lesson', 'violin practice']; | |
| const RESULT_BATCH_SIZE = 40; | |
| // App Script console testing endpoint | |
| function main() { | |
| loadWeeklyPracticeTime().forEach(x => console.log(x)); | |
| } |