Skip to content

Instantly share code, notes, and snippets.

View nak3's full-sized avatar

Kenjiro Nakayama nak3

View GitHub Profile
use std::io::*;
use std::str::*;
const MOD: i32 = 1000000007;
fn read<T: FromStr>() -> Option<T> {
let stdin = stdin();
let s = stdin
.bytes()
.map(|c| c.unwrap() as char)
@nak3
nak3 / main.go
Created November 26, 2017 05:27
test of viper and glog combination
package main
import (
"flag"
"fmt"
"github.com/golang/glog"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/spf13/viper"
apiVersion: v1
kind: ImageStream
metadata:
annotations:
openshift.io/display-name: Perl
name: perl
spec:
tags:
- annotations:
version: "5.20"
package main
import (
"fmt"
"io/ioutil"
"sync"
"github.com/dgraph-io/badger"
)

Getting start with Azure, packer and terraform

Recently, I started using Azure for my test env. This is a reminder for myself.

Preparation

Install Azure CLI

How https://github.com/Azure/azure-cli

package main
import (
"bytes"
"crypto/sha256"
"fmt"
"io"
"math/rand"
c "github.com/restic/chunker"
package main
import (
"time"
"github.com/opentracing/opentracing-go"
"github.com/uber/jaeger-client-go"
"github.com/uber/jaeger-client-go/config"
)
@nak3
nak3 / split.cpp
Created March 30, 2017 12:00
read one line including spaces and split the words by the spaces
#include <bits/stdc++.h>
using namespace std;
#define INF 2000000000
#define MOD 1000000007
typedef long long ll;
typedef pair<int, int> P;
#include <bits/stdc++.h>
using namespace std;
#define INF 2000000000
#define MOD 1000000007
typedef long long ll;
typedef pair<int, int> P;
int n;
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main () {
vector<int> v{4,1,0,1,2,3,5,10,12,11};
sort(v.begin(), v.end());
cout << "i: ";
for (int i = 0; i < v.size(); i++) {