Skip to content

Instantly share code, notes, and snippets.

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

Nurettin Onur TUĞCU nurettin

🏠
Working from home
View GitHub Profile
import taichi as ti
ti.init(arch=ti.gpu)
def main():
n = 800
pixels = ti.field(dtype=ti.f32, shape=(n, n))
star_positions = ti.Vector.field(2, dtype=ti.i32, shape=(1000))
from asyncio.tasks import Task
from typing import Dict
import asyncio
from uuid import uuid4
class PiQueConnection:
def __init__(self, pique: 'PiQue', uid: str, reader: asyncio.StreamReader, writer: asyncio.StreamWriter):
self.pique = pique
self.uid = uid
"""
Türkçe kelimeleri hecelemek için yazdığım bir bilgisayar programı
Nurettin Onur TUĞCU - 2020
Geçen gün Türkçe'deki heceleme kurallarını incelerken Ali Nesin'in Matematik ve Sonsuz[1] isimli kitabına denk geldim.
34. sayfadaki açıklamanın sonundaki dip notta 1973 senesinden bahsedildiğine göre yazı epey eski.
Kitaptaki örnekler çok hoşuma gitti ve bütün örneklemleri çözen bir program yazmaya karar verdim.
Not 1: Ali Nesin'in de belirttiği gibi türkçeye ingilizce vb. dillerden gelen kelimelerin (ço-ko-krem, fo-to-star) farsça
kökenli kelimelere (si-lah-şor) göre farklı hecelenmesi konusu için basit bir çözüm yok. Bu türden sözcükler için sözlük
@nurettin
nurettin / eca_fluid_sim.py
Last active August 16, 2020 16:17 — forked from nst/eca_fluid_sim.py
Fluid simulation from 1D cellular automata
#!/usr/bin/env python
# Idea: YankeeMinstrel
# Python code: torstengrust
# Animated GIF: Nicolas Seriot, 2017-07-01
# https://www.reddit.com/r/cellular_automata/comments/6jhdfw/i_used_1dimensional_cellular_automata_to_make_a/
from PIL import Image, ImageDraw
import os
{"nodes": [{"id": "ADBGR", "group": 1}, {"id": "ALARK", "group": 1}, {"id": "AKBNK", "group": 1}, {"id": "AEFES", "group": 1}, {"id": "ADANA", "group": 1}, {"id": "ADEL", "group": 1}, {"id": "ADNAC", "group": 1}, {"id": "ALCAR", "group": 1}, {"id": "AKFGY", "group": 1}, {"id": "AKMGY", "group": 1}, {"id": "AKSEL", "group": 1}, {"id": "ALCTL", "group": 1}, {"id": "ANELE", "group": 1}, {"id": "AKPAZ", "group": 1}, {"id": "AKSGY", "group": 1}, {"id": "ALGYO", "group": 1}, {"id": "AKSUE", "group": 1}, {"id": "ACSEL", "group": 1}, {"id": "ALKIM", "group": 1}, {"id": "ALBRK", "group": 1}, {"id": "AGYO", "group": 1}, {"id": "ALKA", "group": 1}, {"id": "AKCNS", "group": 1}, {"id": "AKSEN", "group": 1}, {"id": "AKSA", "group": 1}, {"id": "AKENR", "group": 1}, {"id": "ALYAG", "group": 1}, {"id": "ADESE", "group": 1}, {"id": "AFYON", "group": 1}, {"id": "ANACM", "group": 1}, {"id": "AKGRT", "group": 1}, {"id": "AKGUV", "group": 1}, {"id": "ANELT", "group": 1}, {"id": "ANSGR", "group": 1}, {"id": "ARMDA", "group": 1}, {"
{"nodes": [{"id": "ADBGR", "group": 1}, {"id": "ALARK", "group": 1}, {"id": "AKBNK", "group": 1}, {"id": "AEFES", "group": 1}, {"id": "ADANA", "group": 1}, {"id": "ADEL", "group": 1}, {"id": "ADNAC", "group": 1}, {"id": "ALCAR", "group": 1}, {"id": "AKFGY", "group": 1}, {"id": "AKMGY", "group": 1}, {"id": "AKSEL", "group": 1}, {"id": "ALCTL", "group": 1}, {"id": "ANELE", "group": 1}, {"id": "AKPAZ", "group": 1}, {"id": "AKSGY", "group": 1}, {"id": "ALGYO", "group": 1}, {"id": "AKSUE", "group": 1}, {"id": "ACSEL", "group": 1}, {"id": "ALKIM", "group": 1}, {"id": "ALBRK", "group": 1}, {"id": "AGYO", "group": 1}, {"id": "ALKA", "group": 1}, {"id": "AKCNS", "group": 1}, {"id": "AKSEN", "group": 1}, {"id": "AKSA", "group": 1}, {"id": "AKENR", "group": 1}, {"id": "ALYAG", "group": 1}, {"id": "ADESE", "group": 1}, {"id": "AFYON", "group": 1}, {"id": "ANACM", "group": 1}, {"id": "AKGRT", "group": 1}, {"id": "AKGUV", "group": 1}, {"id": "ANELT", "group": 1}, {"id": "ANSGR", "group": 1}, {"id": "ARMDA", "group": 1}, {"
@nurettin
nurettin / holyshit.sql
Created April 4, 2020 11:15
declarative json postgresql
select row_to_json(q) from (
select
row_to_json(a) account
, json_agg(t) trades
from pm_account a
left join lateral (
select
row_to_json(t) trade
, json_agg(d) dailies
, json_agg(sf) smartorders
import asyncio
class Prompt:
def __init__(self, loop=None):
self.loop = loop or asyncio.get_event_loop()
self.q = asyncio.Queue(loop=self.loop)
self.loop.add_reader(sys.stdin, self.got_input)
def got_input(self):
asyncio.ensure_future(self.q.put(sys.stdin.readline()), loop=self.loop)
@nurettin
nurettin / raspivid service
Created December 6, 2018 18:58
multiplex raspivid
#!/bin/sh
/usr/bin/raspivid --brightness 65 --saturation 25 -ex auto -n -ih -t 0 -rot 75 -w 1480 -h 1200 -fps 15 -b 1000000 -o - | /usr/bin/ncat -lkv4 5001
@nurettin
nurettin / art.sql
Created May 9, 2018 11:59
group rows by pilot row, show line numbers and line count
select
i
, c
, g
, gi
, sum(1) over (partition by g) gn
from (
select
i
, c