Skip to content

Instantly share code, notes, and snippets.

View pr0n00gler's full-sized avatar

Dev pr0n00gler

  • Cyprus
View GitHub Profile
@pr0n00gler
pr0n00gler / dp.json
Last active September 6, 2018 09:30
Heatmap
[{"lat":55.7587995914345,"lng":37.587302159518},{"lat":55.7587995914345,"lng":37.587302159518},{"lat":55.7587995914345,"lng":37.587302159518},{"lat":55.75877544390817,"lng":37.58734507486225},{"lat":55.75872714881064,"lng":37.58734507486225},{"lat":55.75863055843616,"lng":37.58734507486225},{"lat":55.75853396782245,"lng":37.58734507486225},{"lat":55.75838908145335,"lng":37.58734507486225},{"lat":55.75819589879053,"lng":37.58734507486225},{"lat":55.75797856715105,"lng":37.58734507486225},{"lat":55.75776123430044,"lng":37.58734507486225},{"lat":55.7575680485276,"lng":37.58734507486225},{"lat":55.75737486179779,"lng":37.58734507486225},{"lat":55.75720582262424,"lng":37.587302159518},{"lat":55.75706093132091,"lng":37.587302159518},{"lat":55.75691603947929,"lng":37.587302159518},{"lat":55.756795295866766,"lng":37.58725924417377},{"lat":55.7566021053092,"lng":37.58725924417377},{"lat":55.75638476478806,"lng":37.58721632882953},{"lat":55.75631231767855,"lng":37.58721632882953},{"lat":55.756167423055786,"lng":37.5871
@pr0n00gler
pr0n00gler / dht-walkthrough.md
Created October 14, 2017 13:23 — forked from gubatron/dht-walkthrough.md
DHT walkthrough notes

DHT Walkthrough Notes

I've put together these notes as I read about DHT's in depth and then learned how the libtorrent implementation based on the Kademlia paper actually works.

What problem does this solve?

400,000,000,000 (400 billion stars), that's a 4 followed by 11 zeros. The number of atoms in the universe is estimated to be around 10^82. A DHT with keys of 160 bits, can have 2^160 possible numbers, which is around 10^48

@pr0n00gler
pr0n00gler / gist:372c4f5cf9c7108bae243a743283af41
Created September 20, 2017 19:07 — forked from kingbin/gist:9435292
Manually Start/Stop PostgresSQL on Mac
# Stop PostgreSQL from auto starting
sudo launchctl unload -w /Library/LaunchDaemons/com.edb.launchd.postgresql-9.3.plist
# Enable PostgreSQL to auto start
sudo launchctl load -w /Library/LaunchDaemons/com.edb.launchd.postgresql-9.3.plist
# Start postgres
$ sudo su postgres
Password:
bash-3.2$ pg_ctl -D /Library/PostgreSQL/9.3/data/ start
import matplotlib.pyplot as plt
import vk_api
import time
data = []
login, password = '', ''
vk_session = vk_api.VkApi(login, password)
try:
using System;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
namespace lab5
{
class MainClass
{
private static int Q = 18;
package main
import (
// Things needed by the actual interface.
"golang.org/x/net/proxy"
"net/http"
"net/url"
// Things needed by the example code.
"fmt"
package main
import (
"database/sql"
"errors"
"fmt"
_ "github.com/bmizerany/pq"
"os"
"regexp"
"strings"
# -*- coding: utf-8 -*-
# Портирован с Java по мотивам http://www.algorithmist.ru/2010/12/porter-stemmer-russian.html
import re
class Porter:
PERFECTIVEGROUND = re.compile(u"((ив|ивши|ившись|ыв|ывши|ывшись)|((?<=[ая])(в|вши|вшись)))$")
REFLEXIVE = re.compile(u"(с[яь])$")
ADJECTIVE = re.compile(u"(ее|ие|ые|ое|ими|ыми|ей|ий|ый|ой|ем|им|ым|ом|его|ого|ему|ому|их|ых|ую|юю|ая|яя|ою|ею)$")
PARTICIPLE = re.compile(u"((ивш|ывш|ующ)|((?<=[ая])(ем|нн|вш|ющ|щ)))$")
VERB = re.compile(u"((ила|ыла|ена|ейте|уйте|ите|или|ыли|ей|уй|ил|ыл|им|ым|ен|ило|ыло|ено|ят|ует|уют|ит|ыт|ены|ить|ыть|ишь|ую|ю)|((?<=[ая])(ла|на|ете|йте|ли|й|л|ем|н|ло|но|ет|ют|ны|ть|ешь|нно)))$")