Skip to content

Instantly share code, notes, and snippets.

View c0rp-aubakirov's full-sized avatar
🏠
Working from home

Sanzhar Aubakirov c0rp-aubakirov

🏠
Working from home
View GitHub Profile
@Test
public void testBigDecimal() throws Exception {
final Random random = new Random();
for (int j = 0; j < 100; j++) {
long val = random.nextInt();
Timer.executeFunctionWithTimer(() -> {
int value = 0;
for (int i = 0; i < 1000000; i++) {
value = new BigDecimal(val).intValueExact();
}
<android.support.v4.widget.DrawerLayout
android:id="@+id/drawer_layout"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.CoordinatorLayout
android:id="@+id/main_content"
xmlns:android="http://schemas.android.com/apk/res/android"
@c0rp-aubakirov
c0rp-aubakirov / magzhan_dict
Created April 4, 2016 19:34
All Magzhan dictionary with word count in first column
1 aaaan
1 aan
1 ab
1 abaddnew
1 abstract
1 abstractrequest
1 act
1 addressid
1 ae
1 against
@c0rp-aubakirov
c0rp-aubakirov / oleg_dict
Created April 4, 2016 19:34
All Oleg dictionary with word count in first column
1 |
1 aasawodli
1 abstractrequest
1 access
1 act
1 ae
1 afanalyzer
1 ago
1 ahybsifeo
1 air
@c0rp-aubakirov
c0rp-aubakirov / mag_non_stop
Created April 4, 2016 19:35
Magzhan top words, that not in STOP_WORDS
написать
решение
a
вижу
class
поэтому
работать
+
джаве
new
@c0rp-aubakirov
c0rp-aubakirov / oleg_non_stop
Created April 4, 2016 19:35
Oleg top words, that not in STOP_WORDS
пример
проблемы
типа
решение
делать
например
проект
проект
кстати
стоит
@c0rp-aubakirov
c0rp-aubakirov / stop
Last active April 4, 2016 19:45
Stop words
а
в
г
е
ж
и
к
м
о
с
package kz.moe.classifier;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import kz.moe.classifier.genetic.creature.BasicCreature;
import kz.moe.classifier.genetic.creature.Chromosome;
import kz.moe.classifier.genetic.creature.Gene;
import kz.moe.classifier.genetic.creature.ICreature;
import kz.moe.classifier.genetic.crossover.ICrossover;
boolean consecutiveAscending = true;
boolean consecutiveDescending = true;
// Check to see if the newPin is made up of consecutive numbers in
// ascending order
for (int j = 0; j < newPin.length() - 1; j++) {
if (Convert.toLong(newPin.substring(j, j + 1)) == null
|| Convert.toLong(newPin.substring(j + 1, j + 2)) == null) {
consecutiveAscending = false;
break;
}
public class CrossoverFactory extends AbstractFactory{
public static ICrossover createCrossover(CrossoverType type) {
report(type.name(), "Crossover");
switch (type) {
case ONE_POINT_CROSSOVER:
return new OnePointCrossover();
case TWO_POINT_CROSSOVER:
return new TwoPointCrossover();
case UNIFORM_CROSSOVER:
return new UniformCrossover();