This file contains 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 main | |
import ( | |
"bufio" | |
"fmt" | |
"golang.org/x/crypto/ssh" | |
"io" | |
"log" | |
"os" | |
"strconv" |
This file contains 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 main | |
import ( | |
"sync" | |
"fmt" | |
) | |
const MAX_CONCURRENCY = 40 | |
const NUMBER_OF_JOBS = 1000000 |
This file contains 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
# Licensed to the Apache Software Foundation (ASF) under one | |
# or more contributor license agreements. See the NOTICE file | |
# distributed with this work for additional information | |
# regarding copyright ownership. The ASF licenses this file | |
# to you under the Apache License, Version 2.0 (the | |
# "License"); you may not use this file except in compliance | |
# with the License. You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
This file contains 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
try: | |
raise Exception("Bang") | |
except Exception e: | |
# -- Create prepared statement and store exception information in Cassandra here -- | |
# Re-raise exception, this works fine with protocol version 4 but fails | |
# with version 3 because the exception context has been cleared | |
raise |
This file contains 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
# Run cassandra with Jolokia to expose JMX metrics over HTTP | |
# Add the following to /etc/cassandra/cassandra-env.sh | |
JVM_OPTS="$JVM_OPTS -javaagent:/opt/jolokia/jolokia-jvm-agent.jar" | |
# See https://www.flexinvesting.fi/2014/jolokia-apache-cassandra/ | |
# for more information. | |
# Collect information with Telegraf according to the below config. | |
# There's also a http json plugin that should be useful for fetching | |
# information from arbitrary HTTP JSON interfaces. |
This file contains 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
/* test.c */ | |
#include <stdio.h> | |
#define LEN 200000000 | |
void main() { | |
static int arr[LEN]; | |
int i = 0; | |
int result = 0; |
This file contains 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 bench is a package which contains | |
// programs of Go Benchmark Competition. | |
package bench | |
import ( | |
"errors" | |
"bufio" | |
"os" | |
"fmt" | |
"bytes" |
This file contains 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
from collections import OrderedDict | |
from bs4 import BeautifulSoup | |
# TODO | |
# * Find table by ID | |
# * Multi column headers | |
# * Multi row headers | |
# * Table with multiple columns with the same name | |
from prettytable import PrettyTable |
This file contains 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
def candidates_for(world): | |
return set.union(*[neighbours_of(cell) | set([cell]) for cell in world]) | |
DIRECTIONS = {(-1, 1), (0, 1), (1, 1), | |
(-1, 0), (1, 0), | |
(-1, -1), (0, -1), (1, -1)} | |
def neighbours_of(cell): | |
x, y = cell |
This file contains 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 primegenerator; | |
import java.io.BufferedOutputStream; | |
import java.io.FileNotFoundException; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.OutputStreamWriter; | |
import java.io.Writer; | |
//import org.springframework.stereotype.Component; |