Skip to content

Instantly share code, notes, and snippets.

View roman-smirnov's full-sized avatar
🚀
Inverting Singularities

Roman Smirnov roman-smirnov

🚀
Inverting Singularities
View GitHub Profile
CREATE TABLE Lawyer(
lname varchar(40),
sdate date,
hbilling int,
partner date,
primary key (lname)
);
CREATE TABLE Client(
cname varchar(40),
@roman-smirnov
roman-smirnov / sol.java
Created August 13, 2016 20:55
secret sauce solution
package com.company;
import com.sun.xml.internal.bind.v2.runtime.unmarshaller.XsiNilLoader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class Main {
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
/**
/* button and background animation gist */
package roman.com.cryptobox.activities;
import android.animation.Animator;
import android.animation.ArgbEvaluator;
import android.animation.ValueAnimator;
import android.content.Intent;
import android.content.res.ColorStateList;
import android.graphics.drawable.ColorDrawable;
package com.example.roman.echoparkrecorder;
import android.Manifest;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
@roman-smirnov
roman-smirnov / main.py
Created October 25, 2017 19:24
python opencv remove alternating rows and display image
import cv2
import numpy as np
from skimage.viewer import ImageViewer
def remove_rows(image, rows, cols):
newrows = int(rows / 2)
newimg = np.zeros((newrows, cols), np.uint8)
for r in range(1, newrows+1):
newimg[r-1:r, :] = image[r*2-1:r*2, :]
@roman-smirnov
roman-smirnov / python_markdown_browser_render_test.py
Created December 6, 2017 13:42
some test code to see if python can render markdown to html and have the page auto refresh
"""
some test code to see if python can render markdown to html and have the page auto refresh
"""
import markdown # python module to render markdown to html
import webbrowser # python module to open browser tabs and windows
import os # python module to get absolute paths for browser rendering
MARKDOWN_FILE_NAME = "markdown_test.md"
HTML_FILE_NAME = "markdown_test.html"
@roman-smirnov
roman-smirnov / prolog_cannibals_missionaries
Last active September 9, 2018 02:30
Cannibals and missionaries problem solution in prolog. In this variation we must avoid the missionaries converting the cannibals. Both depth first and breadth first versions.
start([3, 3, 0]).
goal([0, 0, 1]).
valid_state(CL, ML, B) :-
% check values are integers in range
(CL is 0 ; CL is 1 ; CL is 2 ; CL is 3),
(ML is 0 ; ML is 1 ; ML is 2 ; ML is 3),
(B is 0 ; B is 1),
% check cannibals not converted
cat install_manifest.txt | sudo xargs rm
cat install_manifest.txt | xargs -L1 dirname | sudo xargs rmdir -p

Jupyter Remote Cheatsheet

Connect to Server as Admin

  1. find the server admin key file stav-key-pair.pem