start new:
tmux
start new with session name:
tmux new -s myname
#include <array> | |
#include <cassert> | |
#include <iostream> | |
#include <set> | |
#include <sys/ioctl.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <unistd.h> |
void main() { | |
int? x = 42; | |
print(x); | |
void? v; // compile error | |
} |
package com.company; | |
import java.util.logging.*; | |
public class Main { | |
public static void main(String[] args) { | |
Logger logger = Logger.getLogger("main"); |
#pragma once | |
#include <algorithm> | |
#include <functional> | |
template<typename ForwardIt, typename Compare = std::less<>> | |
void insertion_sort(ForwardIt begin, ForwardIt end, Compare comp = Compare{}) | |
{ | |
if (std::distance(begin, end) < 2) { | |
return; | |
} |
// Example from Bjarne Stroustrup's Programming | |
#include <iostream> | |
using namespace std; | |
void swap_v(int a, int b) | |
{ int temp; temp = a, a = b; b = temp; } | |
void swap_r(int& a, int& b) | |
{ int temp; temp = a, a = b; b = temp; } |
#!/usr/bin/python3 | |
import operator | |
import re | |
number_re = re.compile('^\d+') | |
operator_or_paren = re.compile('^[()+*-/]') | |
OPERATORS = {'+': (1, operator.add), '-': (1, operator.sub), | |
'*': (2, operator.mul), '/': (2, operator.truediv)} |
use std::path::{Path, PathBuf}; | |
struct Model { | |
u: f32, | |
} | |
fn texture_fname(path: &Path) -> PathBuf { | |
let fullname = format!("{}{}", path.file_stem().unwrap().to_str().unwrap(), "_diffuse"); | |
let mut buf = PathBuf::from(path); |
#!/bin/bash | |
# Based on http://algs4.cs.princeton.edu/linux/ | |
declare -r ALGS4_DIRECTORY=~/.local/algs4 | |
get_drjava() { | |
wget http://algs4.cs.princeton.edu/linux/drjava.jar | |
wget http://algs4.cs.princeton.edu/linux/drjava | |
chmod 700 drjava |
#include <cctype> | |
#include <cstdlib> | |
#include <fstream> | |
#include <iostream> | |
#include <string> | |
#include <unordered_map> | |
#include <queue> | |
const int kDefaultNumberOfResults = 100; |