Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View mertyildiran's full-sized avatar
:octocat:
Doing some octopus work

M. Mert Yildiran mertyildiran

:octocat:
Doing some octopus work
View GitHub Profile
@mertyildiran
mertyildiran / answer1.rb
Created March 17, 2014 13:05
Nesne Yonelimli Programlama Odev 1
#encoding: UTF-8
class Merhaba
def self.class_method
puts "Merhaba, ben bir sınıf metoduyum!"
end
def instance_method
puts "Merhaba, ben bir nesne metoduyum!"
end
end
@mertyildiran
mertyildiran / hash.py
Last active August 29, 2015 13:57
Excellent Hash Algorithm :)
import csv
import time
started = time.clock()
hash_list = []
unique_hash_list = []
print "\n>> TABLE: << \n"
with open('liste.csv', 'rb') as csvfile:
@mertyildiran
mertyildiran / BinaryTree.py
Last active August 29, 2015 13:57
Data Structures and Algorithms in Python
def BinaryTree(r):
return [r, [], []]
def insertLeft(root,newBranch):
t = root.pop(1)
if len(t) > 1:
root.insert(1, [newBranch,t,[]])
else:
root.insert(1, [newBranch, [], []])
return root
@mertyildiran
mertyildiran / class.rb
Last active August 29, 2015 13:57
Object Oriented Programming in Ruby
#!/usr/bin/ruby
# encoding: utf-8
class Point
# XXX Her nitelik için okuyucu yazmamız gerekmiyor
attr_reader :x, :y
def initialize(x, y)
@x, @y = x, y
end
@mertyildiran
mertyildiran / lab1part1.v
Last active August 29, 2015 13:57
Digital Circuits and Logic Design Lab.
// Simple module that connects the SW switches to the LEDR lights
module part1 (SW, LEDR);
input [17:0] SW;
// toggle switches
output [17:0] LEDR; // red LEDs
assign LEDR = SW;
endmodule
@mertyildiran
mertyildiran / LCD_helloworld.ino
Last active August 29, 2015 14:01
Arduino UNO
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int sayac = 0;
void setup() {
lcd.begin(16, 2);
lcd.print("Merhaba dunya!");
}
@mertyildiran
mertyildiran / ismail_each.rb
Last active August 29, 2015 14:08
Ismail Each
def dizi_kopyala(dizi)
hedef = []
dizi.each do |i|
if i < 4
hedef << i
end
end
puts hedef
end
@mertyildiran
mertyildiran / ismail-1.c
Created March 10, 2015 17:44
Ismail Gist - 1
#include <stdio.h>
#include <math.h>
int main(void) {
int result, n;
n = 0;
while (++n < 17) {
printf("%d\t", n);
@mertyildiran
mertyildiran / average.ty
Created March 17, 2015 13:02
Toy Machine Homework
start get
ifzero print
add total
store total
count
goto start
printf load total
print
stop
count add counter
@mertyildiran
mertyildiran / FOY2-AL1
Last active December 15, 2015 02:59
Yukarıda, standart girdiden alınan karakterleri standart çıktıya yazdıran bir C kodu verilmiştir. Bu kodu, okunan karakterlerin küçük olması durumunda okunan karakterleri büyüterek yazdıran, büyük olması durumunda ise okunan karakterleri küçülterek yazdıran hale çeviriniz. Đpucu: “ctype.h” isimli başlık dosyasında prototipleri yer alan “islower”…
#include <stdio.h>
#include <ctype.h>
int main(void) {
int c;
for ( ; ; ) {
c = getchar();
if (islower(c)){