Skip to content

Instantly share code, notes, and snippets.

View dbulgakov's full-sized avatar
🤙

Dmytro Bulhakov dbulgakov

🤙
View GitHub Profile
import copy
import csv
import json
import socket
import time
import urllib.request
socket.setdefaulttimeout(30)
id_file = '1.csv' #insert your input filename
clientid = '' #insert your actual Facebook app client id
<?xml version='1.0' encoding='utf-8'?>
<realty-feed xmlns="http://webmaster.yandex.ru/schemas/feed/realty/2010-06">
<generation-date>2019-06-06T11:18:43.2790075Z</generation-date>
<offer internal-id="11754908512">
<type>продажа</type>
<property-type>жилая</property-type>
<category>cottage</category>
<url>https://www.avito.ru/perm/doma_dachi_kottedzhi/dacha_80_m_na_uchastke_5_sot._1175490857</url>
<creation-date>2019-06-03 21:02:21</creation-date>
<location>
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
#include <iostream>
#include <fstream>
#include <sstream>
#include <string.h>
#include <chrono>
#include <math.h>
#ifdef __APPLE__
#include <OpenCL/cl.h>
#else
@dbulgakov
dbulgakov / t8.py
Created December 9, 2017 11:56
160
import itertools
hh = list(itertools.product([0, 1], repeat=9))
a = "101101101"
b = "001011001"
@dbulgakov
dbulgakov / ott_task.py
Last active August 31, 2017 17:56
This code prints a given matrix in spiral form
import numpy as np
import traceback
def is_odd(number):
return number % 2 == 0
def check_input(number):
if number <= 0:
@dbulgakov
dbulgakov / some
Last active April 8, 2017 16:58
JSON example
Request
POST api/registration
json body:
{
user_name : "Ivan",
user_email : "[email protected]",
user_password : "1234qwerQWER"
}
Response
from sklearn.naive_bayes import GaussianNB
cv = CountVectorizer(ngram_range=(1, 5))
X = cv.fit_transform(X_train)
X_t = cv.transform(X_test)
clf = GaussianNB()
clf.fit(X.toarray(), y_train)
y_pred = clf.predict(X_t.toarray())
@dbulgakov
dbulgakov / gist:a5006074b62dca83c9723d5b78a48e70
Created August 29, 2016 12:15
onMeasure log for CustomViewGroup
08-29 15:12:31.569 29551-29551/com.dbulgakov.task1 D/Measuring info: onMeasure in CustomViewGroup call
08-29 15:12:31.570 29551-29551/com.dbulgakov.task1 D/Measuring info: onMeasure call for 1
08-29 15:12:31.570 29551-29551/com.dbulgakov.task1 D/Measuring info: onMeasure call for 3
08-29 15:12:31.571 29551-29551/com.dbulgakov.task1 D/Measuring info: onMeasure call for 2
08-29 15:12:31.607 29551-29551/com.dbulgakov.task1 D/Measuring info: onMeasure in CustomViewGroup call
@dbulgakov
dbulgakov / gist:2c98f2c155821fb99b2fffe96d14f3fa
Created August 24, 2016 06:56
ClassCastException at measureChildwithMargin
8-24 09:55:11.460 9696-9696/com.dbulgakov.task1 E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.dbulgakov.task1, PID: 9696
java.lang.ClassCastException: android.view.ViewGroup$LayoutParams cannot be cast to android.view.ViewGroup$MarginLayoutParams
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6111)
at com.dbulgakov.task1.CustomViewGroup.onMeasure(CustomViewGroup.java:66)
at android.view.View.measure(View.java:19730)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6120)
at android.widget.F