(println "Hello, world!")
- The same in Python,
#include <iostream> | |
#include <string> | |
int main(int argc, char* argv[]) | |
{ | |
string name; | |
std::cin >> name; | |
std::cout << "Hello " << name << "!" << std::endl; | |
return 0; |
[credential] | |
helper = cache --timeout=7200 | |
[merge] | |
tool = meld | |
[diff] | |
tool = meld | |
[alias] | |
st = status | |
ci = commit | |
br = branch |
template <bool defaultState = false> | |
class BitSet | |
{ | |
public: | |
BitSet(std::size_t size) | |
: size_(size), bits_((size_ + 7) / 8, defaultState ? 0xff : 0x0) | |
{ | |
// Masks for each bit. Example, | |
// | |
// 7 6 5 4 3 2 1 0 |
void AllPrimesTill(int32_t till, std::vector<int32_t>& primes) | |
{ | |
BitSet<true> isPrime(till + 1); | |
isPrime.Reset(0); | |
isPrime.Reset(1); | |
int32_t cap = static_cast<int32_t>( std::sqrt(till) ) + 1; | |
primes.clear(); | |
for (int32_t i = 2; i <= cap; ++i) |
template <class FwdIt> | |
FwdIt Merge( | |
FwdIt first1, FwdIt last1, | |
FwdIt first2, FwdIt last2, | |
FwdIt result | |
) | |
{ | |
while (true) | |
{ | |
if (*first2 < *first1) |
#include <cstddef> | |
#include <vector> | |
template <typename T> | |
class Array2D | |
{ | |
public: | |
Array2D() | |
: height_(0), width_(0) | |
{} |
# The following should be in `/etc/sudoers`. To edit `/etc/suoders` use the command `sudo visudo` in a terminal. | |
# *Do NOT attempt to modify the file directly* | |
Defaults env_reset | |
Defaults mail_badpass | |
Defaults env_keep+="http_proxy ftp_proxy all_proxy https_proxy no_proxy" # Add this line | |
... |
#!/usr/bin/env bash | |
INPUT_DIR="../50_5_5" | |
OUTPUT_DIR=".." | |
PARAMETERS=( "like-mindedness" "modularity" ) | |
LABELS=( "Like-mindedness" "Modularity (Q)" ) | |
for i in ${!PARAMETERS[*]}; do | |
gnuplot <<- EOF |
;;; gn-mode.el --- A major mode for editing gn files. | |
;; Copyright 2015 The Chromium Authors. All rights reserved. | |
;; Use of this source code is governed by a BSD-style license that can be | |
;; found in the LICENSE file. | |
;; Author: Elliot Glaysher <erg@chromium.org> | |
;; Version: 1.0 | |
;; Created: April 03, 2015 | |
;; Keywords: tools, gn, ninja, chromium |