Skip to content

Instantly share code, notes, and snippets.

View ahmetaa's full-sized avatar

Ahmet A. Akın ahmetaa

  • Turkey
View GitHub Profile
@ahmetaa
ahmetaa / count.py
Last active May 26, 2021 21:02
Csv counter
import csv
from collections import Counter
def load_csv(csv_file_path):
with open(csv_file_path) as csv_file:
csv_reader = csv.reader(csv_file, delimiter=',')
first_line_read = False
items = []
#include <iostream>
#include <unordered_map>
class Bar {
public:
Bar()= default;
};
class Foo {
public:
@ahmetaa
ahmetaa / Robot.java
Last active January 15, 2019 08:49
robot
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Random;
import java.util.Set;
public class OyunAlani {
public static final int MAX_DENEME_SAYISI = 10000;
@ahmetaa
ahmetaa / hash locate
Created October 12, 2018 12:03
hash locate
protected int locate(int key) {
int slot = hash(key) & modulo;
int pointer = -1;
while (true) {
final int k = keys[slot];
if (k == EMPTY) {
return pointer < 0 ? (-slot - 1) : (-pointer - 1);
}
if (k == DELETED) {
package zemberek.core.collections;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* A simple hashmap with integer keys and T values.
* Implementation is open address linear probing with some heuristics on
* expansion limits. Some parts of the map is optimized for tiny maps.
public class CopyStuff {
public static void main(String[] args) throws IOException {
Path sourceRoot = Paths.get("/home/aaaa/prototip/exec"); // normalde kullanılan dosyalar bu exec dizininde
Path kaldiSrcRoot = Paths.get("/home/aaaa/apps/kaldi/src"); // kaldi src dizini yolu.
Path targetRoot = Paths.get("/home/aaaa/prototip/exec-new"); // yeni dosyaların kaydedileceği dizin.
// dosya isimlerini topla.
Set<String> paths = Files.walk(sourceRoot)
.filter(s -> s.toFile().isFile())
.map(s -> s.toFile().getName())
.collect(Collectors.toSet());
@ahmetaa
ahmetaa / gist:2bb8e1103b485f7696c07a98cdb065cf
Last active May 20, 2021 11:35
~5000 variations of "yap" (to do)
yap
yapa
yapabil
yapabildi
yapabildiği
yapabildiğidir
yapabildiğim
yapabildiğimce
yapabildiğimde
yapabildiğimden
package suskun.nn;
public class SigmoidLookup {
public static final float SCALE_FACTOR = 50.0f;
public static final int LOOKUP_SIZE = 1024;
int[] lookup;
static final float SIGMOID_QUANTIZATION_MULTIPLIER = 255.0f;
static final int SIGMOID_QUANTIZATION_MULTIPLIER_UCHAR = 255;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
@ahmetaa
ahmetaa / avx
Last active August 29, 2015 14:05
avx
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <immintrin.h>
// gcc -Wall -O3 -march=native -mtune=native -mavx avx_simple.c -o avx
void check_alloc(int alloc_result);
void initialize(int amount);