Skip to content

Instantly share code, notes, and snippets.

View haldun's full-sized avatar

Haldun Bayhantopcu haldun

  • Berlin, Germany
View GitHub Profile
#include <stdio.h>
void Identity(int *matrix, size_t size)
{
for (size_t i = 0; i < size; ++i) {
for (size_t j = 0; j < size; ++j) {
matrix[i * size + j] = (i == j) ? 1 : 0;
}
}
}
@haldun
haldun / build.sh
Created March 9, 2014 22:16
lame build script for iOS
#!/bin/bash
## Mini-Xcode: XCode 5
MIN_VERSION="6.0"
# set default output folder is build
OUTPUT_FOLDER=${PREFIX-build}
# set default compiler
CC=${CC-$(xcrun --find gcc)}
- (BOOL)shouldPerformSegueWithIdentifier:(NSString *)identifier sender:(id)sender
{
if ([identifier isEqualToString:@"NewPhotoAdded"]) {
if ([self.titleTextField.text length] == 0) {
[self alert:@"Title'i doldur haci"];
return NO;
}
if ([self.remoteIDTextField.text length] == 0) {
[self alert:@"remote id'yi doldur haci"];
[
{
"title": "first image",
"url": "http://www.hdwallpapers3g.com/wp-content/uploads/2014/01/hd-wallpaper-desktop-1.jpeg"
},
{
"title": "second image",
"url": "http://walpopular.com/wp-content/uploads/2013/12/high-resolution-walpapers.jpg"
},
{
@haldun
haldun / gist:8418068
Created January 14, 2014 13:11
nc finder
http://146.185.174.238:8888
@haldun
haldun / gist:8282998
Last active January 2, 2016 09:29
outline
* Title:
A noun compound extractor for Turkish
Noun compound identification for Turkish
Turkish noun compound extraction based on rules
Abstract
Introduction
- Define NLP
@haldun
haldun / gist:8282418
Created January 6, 2014 12:45
nc finder
http://146.185.174.238:8888
@haldun
haldun / gist:8101433
Created December 23, 2013 17:43
fibonacci in haskell
import Data.Ratio
data Q5 = Rational :+ Rational deriving (Show)
instance Num Q5 where
(a :+ b) + (c :+ d) = (a + c) :+ (b + d)
(a :+ b) * (c :+ d) = (a * c + 5 * b * d) :+ (a * d + b * c)
phi = (1 % 2) :+ (1 % 2)
% LD_LIBRARY_PATH=/lib/x86_64-linux-gnu/:/usr/local/lib ./configure --enable-static=no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
@haldun
haldun / gist:7616496
Created November 23, 2013 16:12
word iterator like smth
class MyIterator(object):
def __init__(self, sentence):
self.sentence = sentence
self.index = 1
self.step = 1
def __iter__(self):
return self