Skip to content

Instantly share code, notes, and snippets.

💭
"AppxManifest.xml failed with error: The operation completed successfully."

Sasha Nik venik

💭
"AppxManifest.xml failed with error: The operation completed successfully."
Block or report user

Report or block venik

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View MMDS module 5
Question 1
https://raw.githubusercontent.com/jameslafa/mining-massive-datasets/master/Week%202%20-%20Frequent%20Itemsets.ipynb
arr = [(20000, 60000000), (20000, 80000000), (100000, 40000000), (100000, 100000000)]
hash = lambda n, m: (1000000 + m*3) * 4
triangular = lambda n, m: (1000000 + (n**2) / 2.0) * 4
[triangular(v[0], v[1]) for v in arr]
[hash(v[0], v[1]) for v in arr]
@venik
venik / build_tf.sh
Last active Apr 23, 2019
Bash script for local building TensorFlow on Mac/Linux with all CPU optimizations (default pip package has only SSE)
View build_tf.sh
#!/usr/bin/env bash
# Author: Sasha Nikiforov
# source of inspiration
# https://stackoverflow.com/questions/41293077/how-to-compile-tensorflow-with-sse4-2-and-avx-instructions
# Detect platform
if [ "$(uname)" == "Darwin" ]; then
# MacOS
View PokemonVM.kt
data class PokemonVM(
val app: Application,
val name: String,
val origin: String,
val avatar: Drawable
) {
val showDetails: ObservableBoolean = ObservableBoolean(false)
val description: ObservableField<String> = ObservableField("description placeholder")
fun onClick() {
View CommentsRecyclerViewAdapter.kt
class CommentsRecyclerViewAdapter : ListAdapter<PokemonVM, CommentsRecyclerViewAdapter.ViewHolder>(PokeDiff()) {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
return ViewHolder(
ListViewItemPokemonBinding.inflate(
LayoutInflater.from(parent.context), parent, false))
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val item = getItem(position)
holder.apply {
View list_view_item_pokemon.xml
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<import type="android.view.View"/>
<variable
name="viewmodel"
type="com.example.gql1.viewmodels.PokemonVM"/>
</data>
View ch9_helper.r
x = rbind(mvrnorm(50, rep(0,10), diag(10)), mvrnorm(50, rep(c(1, 0), c(5, 5)), diag(10)))
y = rep(c(0, 1), c(50, 50))
dat = data.frame(x, y=as.factor(y))
svmfit = svm(y~., data=dat)
ex1 = function (times, svmfit) {
errate = rep(0, times)
test_size = 500
for (i in 1:times) {
View ForKonstantin.py
import numpy as np
import numpy.linalg as linalg
import matplotlib.pyplot as plt
corpus = []
corpus.append('I like deep learning')
corpus.append('I like NLP')
corpus.append('I enjoy flying')
word_index = {}
View ForAlex.py
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import sys
import time
from datetime import datetime
keyString = u'купить'
goodString = u'купюра'
timeThreshold = 90 # seconds timescale
View svd-img-compression.py
#!/bin/env python3
from scipy.ndimage.io import imread
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
# Load the picture
img = imread('./lenin.jpg', flatten=True, mode=None)
# decompose the picture matrix
View latex
S_{N} = S_{N-2} + S_{N-1}
A = \left[\begin{array}{cc} 0 & 1\\ 1 & 1 \end{array}\right]
A \left[\begin{array}{cc} S_{N-2} \\S_{N-1} \end{array}\right] =
\left[\begin{array}{cc} 0 & 1\\ 1 & 1 \end{array}\right] \left[\begin{array}{cc} S_{N-2} \\S_{N-1} \end{array}\right] =
\left[\begin{array}{cc} S_{N-1} \\ S_{N} \end{array}\right]
\left[\begin{array}{cc} 0 & 1\\ 1 & 1 \end{array}\right] \left[\begin{array}{cc} 0 & 1\\ 1 & 1 \end{array}\right] \left[\begin{array}{cc} S_{0} \\S_{1} \end{array}\right] =
You can’t perform that action at this time.