Skip to content

Instantly share code, notes, and snippets.

View ahmetaa's full-sized avatar

Ahmet A. Akın ahmetaa

  • Turkey
View GitHub Profile
class SliderSample {
SliderMenu sliderMenu;
final List<String> menuItems;
SliderSample() : menuItems = const["Apple", "Banana", "Cherry", "Durian"] {}
void ready() {
document.query("#status").innerHTML = "Slider Menu Sample App";
sliderMenu = new SliderMenu(menuItems, (selectedText) {
package hashash;
public class IntIntLinearProbing {
private final int INITIAL_SIZE = 8;
private final double DEFAULT_LOAD_FACTOR = .7;
private int modulo = INITIAL_SIZE - 1;
int[] keys;
int[] values;
@ahmetaa
ahmetaa / gist:3673231
Created September 8, 2012 10:19
mphf
/** modified - shortened Jenkins 32 */
int _hash(List<int> key, int seed) {
int h1 = seed;
for (int i in key) {
h1 += i;
h1 += (h1 << 10);
h1 ^= (h1 >> 6);
}
return h1 & 0x7fffffff;
@ahmetaa
ahmetaa / gist:4072323
Created November 14, 2012 14:14
Sak's disambiguator
#!/usr/bin/perl
#Author: Haşim Sak @ Department of Computer Engineering - Boğaziçi University.
#Email: hasim.sak@gmail.com
#Version: 1.0
#Date: August 17, 2007
#Description: This program implements an averaged perceptron based morphological disambiguation system for Turkish text.
# You can find the most up to date version at http://www.cmpe.boun.edu.tr/~hasim.
# For more information, you can see readme.txt and read the following paper.
# Haşim Sak, Tunga Güngör, and Murat Saraçlar. Morphological disambiguation of Turkish text with perceptron algorithm.
# In CICLing 2007, volume LNCS 4394, pages 107-118, 2007.
import 'dart:math';
import 'dart:scalarlist';
main() {
print("Generating 10 40-length vector");
List<List<double>> dataSmall = getData(10,40);
perfGaussian(dataSmall);
perfSimdGaussian(dataSmall);
print("Generating 100000 40-length vector");
List<List<double>> dataLarge = getData(100000,40);
@ahmetaa
ahmetaa / gist:5258044
Last active December 15, 2015 12:09
Dart Merhaba Dünya - Konsol
main() {
print("Merhaba Dünya");
}
import 'dart:html';
void main() {
query("#ornek_yazi_id").text = "Merhaba Dünya";
}
import 'dart:math';
import 'dart:typeddata';
main() {
print("Generating 10 40-length vector");
GaussData g = new GaussData.random(4);
InputData dataSmall = new InputData.random(4,4);
perfList(g, dataSmall);
perfTyped(g, dataSmall);
perfSIMD(g, dataSmall);
library gmm;
import 'dart:math';
class DiagonalGaussian {
List<double> means;
List<double> variances;
List<double> negativeHalfPrecisions;
double logPrecomputedDistance;
import 'dart:math';
import 'dart:typeddata';
main() {
print("Generating 4 4-length vector");
GaussData g = new GaussData.random(4);
InputData dataSmall = new InputData.random(4,4);
perfList(g, dataSmall);
perfTyped(g, dataSmall);
perfSIMD(g, dataSmall);
@ahmetaa
ahmetaa / gist:6624743
Created September 19, 2013 14:57
PositiveIntMap
import java.util.Arrays;
public class PositiveIntMap {
static final int INITIAL_SIZE = 8;
static final double DEFAULT_LOAD_FACTOR = 0.5;
// This is the size-1 of the key and value array length. Array length is a value power of two
private int modulo = INITIAL_SIZE - 1;