Skip to content

Instantly share code, notes, and snippets.

View snakers4's full-sized avatar
🚀
It is by will alone I set my mind in motion.

Alexander Veysov snakers4

🚀
It is by will alone I set my mind in motion.
View GitHub Profile
@snakers4
snakers4 / analyzeSocialGraph
Last active January 15, 2017 10:49
DoubleData illustration
SELECT DISTINCT
count (DISTINCT rl.afisha_rest_id) as distinct_rest_count,
count (DISTINCT r2u.afisha_user_id) as review_user_count,
count (DISTINCT r2u.*) as review_count,
count (DISTINCT a2n.social_network_id) as social_network_users,
count (DISTINCT vsoc.social_network_id) as social_graph_data_count
FROM
rest_list rl
import React from 'react';
import {render} from 'react-dom';
import $ from 'jquery';
class ApiConnectors extends React.Component {
constructor (props){
super(props);
this.state = {
apiParams: props.apiParams,
apiUrl: props.apiUrl,
@snakers4
snakers4 / pipeline_calc_v1
Last active March 3, 2017 12:03
Client pipeline example
-- using multiple subqueries to ensure no mistakes
SELECT
average2.weekly as week,
ROUND(AVG(average2.backlog),1) as backlog
FROM
(
SELECT
SUM(average.is_backlog) as backlog,
average.weekly,
average.current_day
@snakers4
snakers4 / View_1
Created March 6, 2017 10:08
Ultimate example
SELECT
a.order_id as order_id,
a.creation_time,
a.finalize_time,
a.c_user_id,
a.ug_id,
a.sales_type,
a.payment_type,
a.delivery_date,
a.ag_type_name,
import matplotlib.pyplot as plt
import numpy as np
plt.figure()
languages =['Python', 'SQL', 'Java', 'C++', 'JavaScript']
pos = np.arange(len(languages))
popularity = [56, 39, 34, 34, 29]
# change the bar colors to be less bright blue
# update reps
sudo apt-get update
# installation of the key software
# SOFTWARE
# server monitoring tool
sudo apt-get install glances
# just invoke glances to monitor the system
# FIREWALL
SELECT
TO_JSON(ARRAY_AGG(a))
FROM (
SELECT
raw_data.*,
'http://spark-in.me/post/'||raw_data.slug as disqus_article_url,
(SELECT to_json(array_agg(e)) FROM (
SELECT DISTINCT
at.\"id\" as tag_id,
at.title as tag_title,
.find('[name="articleText"]')
.summernote({
ace: {
aceTheme: 'ace/theme/dawn',
aceMode: 'c_cpp',
aceLineHeight: '32px',
aceFontSize: '16px',
aceModeSelectorLabel: 'select your language',
aceCodeInputAreaLabel: 'input your code',
aceCodeSubmitBtnLabel: 'Insert',
<p></p><p><img src="https://pics.spark-in.me/upload/7b09411ab7b91bc8da7e79c763311795.jpg" style="width: 700px;"></p><p><span style="font-style: italic;">Как всегда надо начать с заманчивой картинки, но не пояснять ее смысл!</span></p><hr><p></p><p style="text-align: justify; ">Пару дней назад ко мне обратился далекий знакомый, мол у нас политесы в компании и мы не можем никак выбрать направление развития. Ситуация типичная - <span style="font-weight: bold;">лебедь, рак и щука</span> и надо бы очень быстро <span style="font-weight: bold;">проанализировать сайты его конкурентов</span>, вот держи картинку со списком самых крупных компаний в этой сфере. Оказалось, что конкуренты из сферы форекса. Это меня смутило, но не остановило. Я посмотрел на их сайты (а, забегая вперед, некоторые из них просто огромны - миллионы страниц) и тут у меня родилась гениальная идея.</p><p style="text-align: justify; ">Я занимался ей пару суток почти без остановки и накопал относительно интересные результаты, которыми и хочу поделит
from keras.models import Model
from keras.layers import Input, concatenate, Conv2D, MaxPooling2D, Activation, UpSampling2D, BatchNormalization,multiply
from keras.optimizers import RMSprop
from model.losses import bce_dice_loss, dice_loss, weighted_bce_dice_loss, weighted_dice_loss, dice_coeff
import params
orig_width = 1918
orig_height = 1280