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
import java.io.BufferedWriter | |
import java.io.File | |
import java.io.FileInputStream | |
import java.util.* | |
import kotlin.test.assertTrue | |
const val FOLDER_PATH = "c:/data" | |
const val CHINESE_FILE_PATH = "$FOLDER_PATH/chinese.txt" | |
const val CHINESE_FILE_TEST_PATH = "$FOLDER_PATH/chinese_temp.txt" |
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
import java.io.File | |
import java.io.FileInputStream | |
import java.util.* | |
// Unique index for each Vertex | |
var currentIndex = 0 | |
class Vertex(private val index: Int = ++currentIndex) { | |
var terminate = false | |
val edges = mutableMapOf<Char, Vertex>() |
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
# custom IntelliJ IDEA VM options | |
# from https://github.com/adben/config/blob/master/idea64.vmoptions | |
-ea | |
-server | |
-Xms2G | |
-Xmx4096M | |
-Xss16m | |
-XX:MaxMetaspaceSize=2G | |
-XX:MetaspaceSize=512m | |
-XX:ConcGCThreads=6 |
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
.assertJ : AssertJ | |
ANY → org.assertj.core.api.Assertions.assertThat($expr$) | |
.isEqualTo: AssertJ And isEqualTo | |
ANY → org.assertj.core.api.Assertions.assertThat($expr$).isEqualTo($END$) | |
.isZero: AssertJ And isZero | |
ANY → org.assertj.core.api.Assertions.assertThat($expr$).isZero() | |
.isCloseTo: AssertJ And isCloseTo | |
ANY → org.assertj.core.api.Assertions.assertThat($expr$).isCloseTo($value#1$, Percentage.withPercentage(.1))$END$ | |
.isTrue: AssertJ And isTrue | |
ANY → org.assertj.core.api.Assertions.assertThat($expr$).isTrue() |
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
#Main > .box tr > td:first-child { | |
width: 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
<code_scheme name="Default" version="173"> | |
<HTMLCodeStyleSettings> | |
<option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" /> | |
</HTMLCodeStyleSettings> | |
<JSCodeStyleSettings> | |
<option name="USE_SEMICOLON_AFTER_STATEMENT" value="false" /> | |
<option name="FORCE_SEMICOLON_STYLE" value="true" /> | |
<option name="USE_DOUBLE_QUOTES" value="false" /> | |
<option name="FORCE_QUOTE_STYlE" value="true" /> | |
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" /> |
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
// A typings definition of some telegram data structure | |
// author: Richard He<[email protected]> | |
// https://gist.github.com/richard1122/1eb54cd4e422aeb707718ab307decd34 | |
// see more detail: https://core.telegram.org/bots/api | |
declare namespace TL { | |
export interface IResponse<T> { | |
ok:boolean | |
result:T | |
} |
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
TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 10, mContext.getResources().getDisplayMetrics()); |
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
public static String networkInputstreamtoString(InputStream is) throws IOException { | |
byte []sig = new byte[2]; | |
final PushbackInputStream pb = new PushbackInputStream(is, sig.length); | |
pb.read(sig); | |
pb.unread(sig); | |
if (sig[0] == (byte) 0x1f && sig[1] == (byte) 0x8b) { | |
is = new GZIPInputStream(pb); | |
} else { | |
is = new BufferedInputStream(pb); | |
} |
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
#include <iostream> | |
#include <omp.h> | |
#include <ctime> | |
using namespace std; | |
#define N 3000000000L | |
int main() { | |
omp_set_num_threads(8); |
NewerOlder