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
| /v/t/uci ❯❯❯ git co 825be5d0cd699919fbad15901c63044f0efffe82 | |
| Note: checking out '825be5d0cd699919fbad15901c63044f0efffe82'. | |
| You are in 'detached HEAD' state. You can look around, make experimental | |
| changes and commit them, and you can discard any commits you make in this | |
| state without impacting any branches by performing another checkout. | |
| If you want to create a new branch to retain commits you create, you may | |
| do so (now or later) by using -b with the checkout command again. Example: |
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
| /t/d/perforce-server ❯❯❯ cat Makefile | |
| .PHONY: all build run push | |
| IMAGE=perforce-server | |
| NAME=perforce | |
| HOST=perforce.c7-titan.localdomain | |
| all: build | |
| build: |
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.ByteArrayInputStream; | |
| import java.io.ByteArrayOutputStream; | |
| import java.io.IOException; | |
| class Test | |
| { | |
| public void convertInputStreamToByteArray() throws IOException | |
| { | |
| InputStream is = new ByteArrayInputStream(new byte[] { 0, 1, 2 }); // not really unknown |
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
| is_root() { | |
| if [[ $EUID -ne 0 ]]; then | |
| printf "Hi $USER, please run this script as root or with sudo\n" | |
| exit 1 | |
| fi | |
| } |
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 | |
| # Define log levels, the prefix strings are inspired from xorg-server | |
| ERROR="\e[1;41m!!\e[0m" | |
| WARNING="\e[1;43m**\e[0m" | |
| INFO="\e[1;42m--\e[0m" | |
| DEBUG="\e[1;44m++\e[0m" | |
| # Declare tbl to be an associative array | |
| declare -A tbl |
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
| #include <iostream> | |
| #include <vector> | |
| #include <cstdint> | |
| using namespace std; | |
| uint32_t zeroNum = 0; | |
| typedef uint8_t byte; | |
| vector<byte> 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
| package com.simplo.netapp; | |
| public class RateStatistics { | |
| private int num_buckets_; | |
| private long[] buckets_; | |
| private long accumulated_count_; | |
| private long oldest_time_; | |
| private int oldest_index_; |
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
| #include <iostream> | |
| #include <array> | |
| #include <vector> | |
| template <size_t M, size_t N, class T> | |
| using Matrix = std::array<std::array<T, N>, M>; | |
| template <size_t M, size_t N, class T> | |
| std::ostream& operator<<(std::ostream& os, Matrix<M, N, T>& matrix) { | |
| for (auto row = matrix.begin(); row != matrix.end(); row++) { |
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 | |
| infile="mylist.txt" | |
| verbose="warning" | |
| true > ${infile} | |
| for photo in *.JPG; do | |
| tag=$(exiv2 -K Exif.Image.ImageDescription pr "${photo}" 2>/dev/null | cut -b60-) | |
| case "${tag}" in |
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
| #include <iostream> | |
| #include <limits> | |
| #include <sstream> | |
| #include <string> | |
| using namespace std; | |
| /** | |
| * This program helps to convert sorted numbers to counted numbers. | |
| * |