Skip to content

Instantly share code, notes, and snippets.

View oguzcan-yavuz's full-sized avatar

Oguzcan Yavuz oguzcan-yavuz

View GitHub Profile
*** 1-100
11
22
33
44
55
66
77
88
# Kod kismi
class StatisticalSummary(object):
def __init__(self, seq):
self.seq = seq
def five_figure_summary(self, precision=None):
return ("N", "extreme_lower", "extreme_upper", "lower_quartile", "median", "upper_quartile")
# Test kismi
def gcd(a, b):
"""Calculate the Greatest Common Divisor of a and b.
Unless b==0, the result will have the same sign as b (so that when
b is divided by it, the result comes out positive).
"""
while b:
a, b = b, a%b
return a
@oguzcan-yavuz
oguzcan-yavuz / vize.py
Last active November 1, 2017 06:51
gecen seneden bir sonraki senenin vizesinin cozumleri
# 1
def random_yuz_sayi():
import random
a, b = [], []
[(a if i % 2 == 0 else b).append(i) for i in random.sample(xrange(0, 500), 100)]
print("A listesindeki elemanlar toplami: %d" % (sum(a)))
print("B listesindeki elemanlar toplami: %d" % (sum(b)))
random_yuz_sayi()
@oguzcan-yavuz
oguzcan-yavuz / kamui.py
Last active December 1, 2017 19:43
surekli left click yaparak milleti birbirine dusuren program
#!/usr/bin/python3
import pyautogui
import time
coordinates = pyautogui.position()
while True:
pyautogui.click(coordinates)
time.sleep(0.01)
@oguzcan-yavuz
oguzcan-yavuz / asker.rb
Last active May 14, 2018 16:52
ruby-final
=begin
antik cagda yasayan bir sultanin 1000 askeri vardir. askerler halka seklinde
siralaniyor. her asker sagindaki askeri kilicla yaraliyor ve yaralanan asker oyundan cikiyor.
oyun siradaki askere geciyor. yani halkanin ilk hali (1,2,3,4,5,6,7,8,9) iken sonraki hali
(1,3,5,7,9) oluyor.
yarismayi hangi asker kazanir? oyunu nesne tabanli programlama mantigi ile kodlayiniz.
NOT: kac asker oyuna dahil olacak ve oyunun kacinci askerden baslayacagini kullanici
belirleyecektir.
=end
@oguzcan-yavuz
oguzcan-yavuz / server.js
Created June 3, 2018 13:27
simple cors example
const express = require('express');
const cors = require('cors');
let app = express();
const corsOptions = {
credentials: true,
origin: true,
methods: ['GET', 'HEAD', 'PUT', 'PATCH', 'POST', 'DELETE'],
exposedHeaders: ['x-auth-token']
};
@oguzcan-yavuz
oguzcan-yavuz / Dockerfile
Created June 5, 2018 16:07
kws Dockerfile
FROM nvidia/cuda:7.5-runtime-ubuntu14.04
LABEL maintainer "NVIDIA CORPORATION <[email protected]>"
RUN echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1404/x86_64 /" > /etc/apt/sources.list.d/nvidia-ml.list
ENV CUDNN_VERSION 4.0.8
LABEL com.nvidia.cudnn.version="${CUDNN_VERSION}"
RUN apt-get update && apt-get install -y --no-install-recommends \
libcudnn4=$CUDNN_VERSION && \