Skip to content

Instantly share code, notes, and snippets.

@coderistan
coderistan / tictactoe.cpp
Last active November 21, 2020 18:25
Tic Tac Toe game in C++ with minmax tree
#include <iostream>
#include <vector>
#include <map>
#include <math.h>
#define ROW 3
#define COL 3
#define PLAYER_X "x"
#define PLAYER_O "o"
#define E "-" // empty
# coding: utf-8
ifade = "a+b*c-d*e"
stack = list()
operator = {
"+":1,
"-":1,
"/":2,
"*":2,
"(":3,
@coderistan
coderistan / ProxyParser.java
Created November 5, 2020 12:19
Proxy parser
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.*;
import java.io.IOException;
import java.io.InputStream;
@coderistan
coderistan / index.html
Last active November 5, 2020 12:17
Javascript ile yüzde grafiği çizimi. Test: https://coderistan.github.io/public/percent_drawer
<html>
<head>
<title>Yüzde Tablosu</title>
<script src="table.js"></script>
<script type="text/javascript">
function random_add(table,array){
var r = (Math.floor(Math.random()*100));
array.reverse().pop()
array.reverse().push(r);
# coding: utf-8
class Parser:
def __init__(self):
self.string = ""
self.token = None
def get_token(self):
if(len(self.string)):
@coderistan
coderistan / determinant.py
Created September 17, 2020 18:32
Determinant for NxN matrices
# coding: utf-8
# delete row and columns from matris
def delete_from(matris,x,y):
result = []
for i in range(len(matris)):
if(i==x):continue
result.append([])
for k in range(len(matris[i])):
@coderistan
coderistan / watchprocess.py
Created August 18, 2020 19:08
Programların çalışma sürelerin takip eden python programı
# -*- coding: cp1254 -*-
import win32con
import win32api
import win32security
import wmi,time,threading
import pythoncom
sozluk = {}
class Process(object):
@coderistan
coderistan / 1.py
Last active October 14, 2022 19:18
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
ayar = Options()
ayar.add_argument("--headless")
browser = webdriver.Firefox(options=ayar,executable_path="Driver Dizini")
@coderistan
coderistan / Program.java
Last active July 9, 2020 11:33
İki dizinin eşit olup olmadığını böl yönet algoritması ile bulan Java programı
public class Program {
public static void main(String[] args) {
int[] dizi1 = {1,2,3,4};
int[] dizi2 = {1,2,3,4};
if(dizi1.length == dizi2.length){
int bas = 0;
int son = dizi1.length-1;
String mesaj = esitmi(dizi1,dizi2,bas,son)?"Diziler eşit":"Diziler eşit değil";
System.out.println(mesaj);
function [] = taksi_sistemi(n)
% n sayisi, sistemin kaç kez simule edilecegini bildirir
fprintf('Sistem %d kez simule edilecek\n',n);
gunluk_musteri_sayisi = [];
gunluk_kuyruk_sayisi = [];
for gun=1:n
fprintf('\n\n%d. gün\n',gun);