Skip to content

Instantly share code, notes, and snippets.

View sneg55's full-sized avatar
👨‍💻
Focusing

Nick Sawinyh sneg55

👨‍💻
Focusing
View GitHub Profile
from collections import defaultdict
#declare the dictionary in dictionary for names counting in accordance to tld
counter = defaultdict(lambda: defaultdict(int))
#fetching the data about all domain names and counting the number of names in accordance with names lenghts
with open('gtld.csv','rb') as f:
for x in f:
#to exclude more than second level domains like co.uk and so on, just because we can
if x.count('.') == 1:
fname = x.split(".",1)[1].rstrip('\r\n')
counter[fname][x.rfind('.')] += 1
#let's count the number of possible combinations
import string
#domain names can consist of letters, numbers plus dash https://en.wikipedia.org/wiki/Punycode
chars = list(string.lowercase + string.digits + '-')
#count che number of possible symbols
tt = len(chars)
from collections import defaultdict
maxcombinations = defaultdict(int)
for i in range (1,15):
maxcombinations[i] = (tt ** i)
for tld, counters in counter.items():
if sum(counter[tld].values()) > 1000000:
v=list(counter[tld].values())
vm = max(v)
k=list(counter[tld].keys())[v.index(vm)]
print('{}:most frequiently ({} domains) domain name has {} symbols in a name'.format(tld,vm,k))
fill_ratio_1 = defaultdict(lambda: defaultdict(int))
fill_ratio = 0
for col in count_df.columns:
if count_df[col].max() > 100000:
a = count_df[col]
for length, count in maxcombinations.items():
fill_ratio = float(a[length])/float(count)
fill_ratio_1[col][length] = fill_ratio
%matplotlib inline
import matplotlib
fill_ratio_com = defaultdict(lambda: defaultdict(int))
fill_ratio = 0
for col in count_df.columns:
s = 1
if count_df[col].max() > 100000:
a = count_df[col]
for count in list(count_df['com']):
fill_ratio = float(a[s])/float(count)
fill_ratio_com[col][s] = fill_ratio
if s < 15:
#including all required GEMs
require 'rubygems'
require 'mechanize'
require 'csv'
require 'net/http/persistent'
#getting input and output CSV files from command line &checking the arguments
input, output = ARGV
unless input && output
$stderr.puts "Error: you must specify both --input and --output options."
exit 1

Keybase proof

I hereby claim:

  • I am sneg55 on github.
  • I am sawinyh (https://keybase.io/sawinyh) on keybase.
  • I have a public key ASBG9_nOTx7HyOZTg_nmg8MH9eFr9N4BnzfOFhU9-8BsRwo

To claim this, I am signing this object:

<link rel="canonical" href="http://evokeme.io/coin-listing">
<link rel="alternate" hreflang="x-default" href="http://evokeme.io/coin-listing">
<link rel="alternate" hreflang="ru" href="http://evokeme.io/ru/coin-listing"/>
<link rel="alternate" hreflang="en" href="http://evokeme.io/coin-listing"/>
Verifying my identity on Peepeth.com 0x71ce21a0776df966052cac4fe98d18313dd3c214
<!-- Event snippet for sent conversion page
In your html page, add the snippet and call gtag_report_conversion when someone clicks on the chosen link or button. -->
<script>
function gtag_report_conversion(url) {
var callback = function () {
if (typeof(url) != 'undefined') {
window.location = url;