Skip to content

Instantly share code, notes, and snippets.

@z2s8
z2s8 / radio.py
Created February 21, 2016 19:58
2015 majus emelt prog
import re
from collections import namedtuple
Eszleles = namedtuple('Eszleles', ['nap', 'amator', 'uzenet'])
eszlelesek = [] # ^ ez olyan, mint a class csak nem kell initelni
# 1. feladat
with open('veetel.txt') as be: # becsukja magatol igy a txt-t utana
sorok = be.read().splitlines() # ujsor karakter nelkul
@z2s8
z2s8 / helyjegy.cpp
Last active February 6, 2016 20:47
2010. majus emelt info erettsegi program++
#include <iostream>
#include <sstream>
#include <string>
#include <fstream>
#include <vector>
#include <set>
#include <map>
using namespace std;
@z2s8
z2s8 / v6.cpp
Last active January 14, 2016 11:47
Vigyaz(z) 6!
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cstdlib>
#include <ctime>
#include <functional>
#include <random>
#include <chrono>
#include <thread>
@z2s8
z2s8 / in0.txt
Last active December 16, 2015 22:43
vhs 0.0.1
1530 1600
1555 1645
1600 1630
1635 1715
@z2s8
z2s8 / bce.py
Last active December 10, 2015 02:29
bce
#!/usr/bin/env python3
import sympy
import re
def build_side(side):
r_molec = re.compile(r"([0-9]*)([A-Z][a-z]*[0-9]*)*")
r_item = re.compile(r"(?P<elem>[a-z]+)(?P<num>[0-9]*)", re.IGNORECASE)
elems = set()
#include "creature.h"
#include <iostream>
using namespace std;
/* Default Constructor */
Creature::Creature()
{
Name = "Default";
Health = 0;
@z2s8
z2s8 / asc.rb
Last active November 22, 2015 16:22
asc rb v0.0.1
#!/usr/bin/env ruby
PassEvent = Struct.new(:reg_id, :time_s) # rendszam, ido mp-be
def text_time_to_secs(text)
parts = text.split(':') # feldarabolja egy tombbe a kettospontok menten
parts[0].to_i * 3600 + parts[1].to_i * 60 + parts[2].to_i
# to_i: string -> integer kovertal, es szokasos szorzasok mp-be
end
@z2s8
z2s8 / app.rb
Created June 14, 2015 23:39
katana how to openshift
require 'guillotine'
require 'redis'
module Katana
class App < Guillotine::App
# use redis adapter with redistogo
REDIS = Redis.new(:host => ENV["OPENSHIFT_REDIS_HOST"], :port => ENV["OPENSHIFT_REDIS_PORT"], :password => ENV["REDIS_PASSWORD"])
adapter = Guillotine::Adapters::RedisAdapter.new REDIS
set :service => Guillotine::Service.new(adapter, :strip_query => false,
:strip_anchor => false)
@z2s8
z2s8 / katana-app.rb
Created June 13, 2015 08:57
kana openshift
uri = URI.parse(ENV["REDISTOGO_URL"])
REDIS = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password)
# HELYETT!
REDIS = Redis.new(:host => ENV["OPENSHIFT_REDIS_DB_HOST"], :port => ENV["OPENSHIFT_REDIS_DB_PORT"])
@z2s8
z2s8 / pi-sample.txt
Created April 3, 2015 12:48
2^16 digits of Pi
3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593344612847564823378678316527120190914564856692346034861045432664821339360726024914127372458700660631558817488152092096282925409171536436789259036001133053054882046652138414695194151160943305727036575959195309218611738193261179310511854807446237996274956735188575272489122793818301194912983367336244065664308602139494639522473719070217986094370277053921717629317675238467481846766940513200056812714526356082778577134275778960917363717872146844090122495343014654958537105079227968925892354201995611212902196086403441815981362977477130996051870721134999999837297804995105973173281609631859502445945534690830264252230825334468503526193118817101000313783875288658753320838142061717766914730359825349042875546873115956286388235378759375195778185778053217122680661300192787661119590921642019893809525720106548586327