Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import signal
import zmq
interrupted = False
[user]
email = xx@xx.com
name = User
[sendemail]
smtpserver = /usr/bin/msmtp
smtpserveroption = -a
smtpserveroption = work
from = xx@xx.com
smtpUser = xx@xx.com
public class Ogrenci
{
private string isim;
private int yas;
private int not;
public string Isim { get => isim; set => isim = value; }
public int Yas { get => yas; set => yas = value; }
public int Not { get => not; set => not = value; }
from collections import defaultdict
class Graph():
def __init__(self, edges, n):
self.n = n
self.componentc = 0
self.landc = 0
self.G = defaultdict(list)
for i in edges:
self.G[i[0]].append(i[1])
self.G[i[1]].append(i[0])
arr = [0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1]
fw = bw = 0
forward, backward = [0] * len(arr), [0] * len(arr)
for i in range(len(arr)):
fw = max(arr[i], fw)
forward[i] = fw
bw = max(arr[len(arr) - i - 1], bw)
backward[len(arr) - i - 1] = bw
@Noord
Noord / q.py
Created November 15, 2018 20:58
from collections import defaultdict
class Pair(object):
def __init__(self,a,b):
self.a = a
self.b = b
self.s = a + b
self.p = a * b
def __str__(self):
@Noord
Noord / numbers.cpp
Last active October 28, 2018 23:01
#include <stdio.h>
int sumOfDigits(int t){
int s = 0;
while (t != 0) {
s += t % 10;
t /= 10;
}
return s;
@Noord
Noord / q.py
Last active October 25, 2018 23:14
from collections import defaultdict
class Pair(object):
def __init__(self,a,b):
self.a = a
self.b = b
self.s = a+b
self.p = a*b
def __str__(self):
[
{
"age": "21",
"id": 1,
"name": "Arthur"
},
{
"age": "32",
"id": 2.0,
"name": "Richard"
(ns deneme.core)
(defmacro infix
[infixed]
(list (second infixed) (first infixed) (last infixed)))