Skip to content

Instantly share code, notes, and snippets.

@hasayvaz
hasayvaz / makine.py
Created January 3, 2012 11:07
arayüzlü bir hesap makinesi(işlem önceliği, parantez vs dahil) - derleyici tasarım dersi ödevi
#!/usr/bin/python
from Tkinter import *
def frame(root, side):
w = Frame(root)
w.pack(side = side, expand = YES, fill = BOTH)
return w
def button(root, side, text, command = None):
@hasayvaz
hasayvaz / regex.php
Created December 5, 2011 22:31
tez çalışması - regular expressions with php
#!/usr/bin/php
<?php
$ayrisacak = "Tablet
Pfizer
Asetilsalisilikasit
Ambalaj: 80mgx20 tablet.
@hasayvaz
hasayvaz / regexp1.rb
Created October 18, 2011 19:52
stringteki boşluk, virgül, noktalı virgül vs karakterden arındırıp kelimeleri dizgiye atan kodcuk
#!/usr/bin/ruby
dizi = Array.new
string = "hasan eve;kos:git,gel"
if string =~ /\W/
dizi = string.split(/ |,|:|;/)
else
puts "boşluk, virgül, noktalı virgül vs yok"
end
@hasayvaz
hasayvaz / regexp.rb
Created October 12, 2011 13:01
regular expressions examples in ruby
#!/usr/bin/ruby
string1 = "hasan eve kos, kos hasan kos"
if string1 =~ /^hasan/
puts "buldum ", $1
else
puts "bulamadim"
end
@hasayvaz
hasayvaz / agac.cs
Created May 14, 2011 21:55
mini bir sözlük çalışması
using System;
using System.Collections;
using System.Collections.Generic;
namespace KelimeUzayi
{
class KelimeAgaci
{
Dictionary<string, string> d = new Dictionary<string, string>();
@hasayvaz
hasayvaz / romantikcocuk.py
Created May 9, 2011 23:21
her eve lazım :)
#-*- coding: utf-8
def name():
hayal = ["89", "69", "83", "105", "76"]
hayalet = ""
for i in hayal:
hayalet += chr(int(i))
return hayalet
def teklif():
@hasayvaz
hasayvaz / terscevir.py
Created April 6, 2011 20:31
verilen bir sayiyi ters ceviren program
#!/usr/bin/python
def cevir(a):
a = str(a)
i = -1
b = ""
while -i < len(a) + 1:
b += a[i]
i -= 1
print int(b)
@hasayvaz
hasayvaz / merhaba.bf
Created April 5, 2011 21:04
beef dilinde "Hello World!" programı
+++++ +++++
[
> +++++ ++
> +++++ +++++
> +++
> +
<<<< -
]
> ++ .
> + .
@hasayvaz
hasayvaz / kattopla.py
Created March 18, 2011 19:28
verdiğiniz sınıra kadar istediğiniz iki sayının katlarının toplamını bulan program
#!/usr/bin/python
#-*-coding:utf-8-*-
sayi1 = 3
sayi2 = 5
sinir = input("lutfen sınır sayısını girin : ")
a = []
top = 0
for i in range(1, sinir+1):
if i % 3 == 0 or i % 5 == 0:
@hasayvaz
hasayvaz / fibotopla.py
Created March 18, 2011 18:28
fibonacci serisini göze alarak, serideki değerlerin hepsinin toplamını bulan program
#!/usr/bin/python
#-*-coding:utf-8-*-
def fibo(n):
if n == 0:
return 0
elif n == 1:
return 1
elif n > 1:
return fibo(n - 1) + fibo(n - 2)