View a_rabbitmq_clone_in_100_lines_of_python_called_pique_enjoy.py
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 |
View ali_nesin_cevap.py
""" | |
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 |
View eca_fluid_sim.py
#!/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 |
View fener.json
{"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}, {" |
View data.json
{"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}, {" |
View holyshit.sql
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 |
View async_keyboard_example.py
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) |
View raspivid service
#!/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 |
View art.sql
select | |
i | |
, c | |
, g | |
, gi | |
, sum(1) over (partition by g) gn | |
from ( | |
select | |
i | |
, c |
View Gemfile
source "https://rubygems.org" | |
gem "csp-solver" | |
gem "terminal-table" |
NewerOlder