Skip to content

Instantly share code, notes, and snippets.

View gceylan's full-sized avatar
🏠
Working from home

Gökhan CEYLAN gceylan

🏠
Working from home
View GitHub Profile
@gceylan
gceylan / regula_falsi.py
Created March 27, 2012 17:33
yeni pc ubuntu yokken :(
# -*- coding: cp1254 -*-
import math
import time
def f(x, sbt):
return math.e ** x - sbt
def regulaFalsi(sbt=5, a=1, b=2, iterasyon=100, epsilon=10 ** -9):
t1 = time.clock()
@gceylan
gceylan / newton.py
Created March 27, 2012 17:32
yeni pc ubuntu yokken :(
# -*- coding: cp1254 -*-
import math
import time
# bu fonksiyon ile bulunan x değerlerini topluca ekrana yazdırdık.
def analiz(liste):
for ind, i in enumerate(liste):
if i != 0:
print "x[%s] = %s" %(ind, i)
@gceylan
gceylan / bisection.py
Created March 27, 2012 17:31
yeni pc ubuntu yokken :(
# -*- coding: cp1254 -*-
import math
import time
def hesapla(x, sbt):
return math.e ** x - sbt
# n = iterasyon sayısı
# sbt : e ** x - c deki c = sbt' dir.
# sbt = 1 olamaz.
@gceylan
gceylan / cozumler.py
Created March 27, 2012 15:06
sinav sorularinin cozumleri
#-*- coding: utf-8 -*-
def en_buyuk_ardil_toplam(dizi):
dizi2 = [0] * len(dizi)
en_buyuk = 0
for ind, i in enumerate(dizi):
if ind == 0:
dizi2[ind] = dizi[ind]
@gceylan
gceylan / poli.py
Created October 14, 2011 18:17
polinom
# -*- coding: utf-8 -*-
def eleman_sayilarini_esitle(liste1, liste2, yer, eleman):
n = len(liste1)
m = len(liste2)
while n != m:
if n > m:
liste2.insert(yer, eleman)
m += 1
else:
liste1.insert(yer, eleman)
@gceylan
gceylan / deneme.html
Created October 7, 2011 10:38
aslında bu iş görür
<html>
<head>
<meta charset="UTF-8" />
<title>deneme 1-2-3</title>
</head>
<body>
<section>
<div>
<canvas id="canvas" width="400" height="300"></canvas>
@gceylan
gceylan / text_to_bin_tikinter.py
Created July 31, 2011 22:53
text - binary converter
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from Tkinter import *
import sys
def temizle():
kutu1.delete(1.0, END)
kutu2.delete(1.0, END)
@gceylan
gceylan / asal_sayi_mi.php
Created July 3, 2011 10:42
bir sayının asallığı
<html>
<head>
</head>
<style>
html { background-color: #656565;}
body {margin:auto; width:400; height:400; margin-top:30px; background-color:grey; padding:20px}
</style>
<title>Asal Sayı mı?</title>
<?php
echo "Sizce 727271 sayısı asal sayı mıdır? Merak mı ettiniz?<br>";
@gceylan
gceylan / bos_betik_v2.py
Created June 7, 2011 13:49
sıraya göre isim vererek boş .py uzantısı oluşturmaya yarayan program
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from Tkinter import *
import os
pencere = Tk()
pencere.geometry("200x75+75+50")
pencere.title("Gökhan CEYLAN")
@gceylan
gceylan / rot_13.py
Created May 25, 2011 09:41
rot 13 şifreleme
#!/usr/bin/env python
#-*- coding: utf-8 -*-
def sifreLe(sifrelenecek_dosya, sifreli_dosya):
dosya = open(sifrelenecek_dosya, 'r')
sifreli = open(sifreli_dosya, 'w')
while True:
sifre = dosya.readline(50)
for i in sifre: