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 / 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 / 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 / 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 / sekant.py
Created March 27, 2012 17:34
yeni pc ubuntu yokken :(
# -*- coding: cp1254 -*-
import math
import time
# bu fonksiyon yardımıyla köke yaklaşımı gözleyebiliyoruz.
def analiz(liste):
for ind, i in enumerate(liste):
if i != 0:
print "x[%s] = %s" %(ind, i)
@gceylan
gceylan / lineer_denklem_sistemlerinin_cozumu.py
Created March 27, 2012 17:36
10 x 10 lineer denklem sisteminin çözümü...
# bu fonksiyon girilen denklemi (ör = 2x + 3y - 1z = 5) matris formuna dönüştürür. ([0, 2, 3, -1, 5])
def denklemGirisi(satir = 3, sutun = 4):
satir += 1
sutun += 1
# bu liste yardımıyla herbir denklem için bir matris oluşturduk.
liste = []
#girilen denklemlerin matris şeklinde bu listede tutuk.
@gceylan
gceylan / sinav.py
Created March 28, 2012 17:10
1-3 fonksiyonlarında ufak düzeltmeler...
# -*- coding: cp1254 -*-
def en_buyuk_ardil_toplam(dizi):
print "girilen dizi:", dizi
for ind, i in enumerate(dizi):
if ind == 0:
continue
dizi[ind] = dizi[ind] + dizi[ind - 1]
print "Ardıl dizi:", dizi
@gceylan
gceylan / t.rb
Created May 24, 2012 21:33 — forked from roktas/t.rb
#!/usr/bin/ruby
# encoding: utf-8
# DİKKAT! Fazla test edilmemiştir. İki çay/sigara arası yazılmıştır. Daha
# iyisini siz yazın. -- roktas
class Arac
attr_reader :hiz, :vites_konumu, :yolcu_sayisi
def initialize(yolcu=1)
@gceylan
gceylan / cpu.v
Created May 26, 2012 13:38
Basit bir işlemci
module cpu (KEY, SW, LEDR);
input [1:0] KEY;
input [17:0] SW;
output [17:0] LEDR;
wire Resetn, Manual_Clock, Run, Done;
wire [15:0] DIN, Bus;
assign Resetn = KEY[0];
assign Manual_Clock = KEY[1];
@gceylan
gceylan / Duzeltme3.java
Created July 17, 2012 07:51
ahmet salih' e sevgilerle...
package com.ykb.eulerDüzeltme;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Date;
@gceylan
gceylan / SetIpAddres.java
Created October 6, 2012 09:05
ağ yapılandırması
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
public class SetIPAddres {
String ip = null;
String netmask = null;