Skip to content

Instantly share code, notes, and snippets.

@anton-matosov
anton-matosov / README.md
Created April 25, 2019 05:43 — forked from jnovack/README.md
Using Linux Display on OSX in docker
@anton-matosov
anton-matosov / pg-pong.py
Created April 16, 2019 20:48 — forked from karpathy/pg-pong.py
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
I've tested it on Fedora 23 and Ubuntu 16.04. I'm using gcc-5.3.1, python-3.4, VS Code-1.14.0
You can debug mixed Python/C++ in the same GUI. It also works for MPI applications. You can switch between the debuggers and corresponding call stacks.
1. Packages needed
1) Visual Studio Code
2) Extensions for VS Code:
"Python" from Don Jayamanne (I'm using 0.6.7)
This allows VS Code act as the front end to debug python.
This gives VS Code ability to attach to a python script that uses module "ptvsd".
$ pandoc -s -f markdown -t man README.md | man -l -
$ pandoc -s -f markdown -t html README.md |lynx -dump -stdin | less -
@anton-matosov
anton-matosov / use-local-sh.sh
Created February 18, 2018 06:51 — forked from dtaskoff/use-local-sh.sh
A script used for modifying the ghc's scripts installed by stack, so that they use a local sh executable
stackargs=$@
shbin="$(which sh)"
if [ -z "$shbin" ] || [[ "$shbin" =~ "not found" ]]; then
echo "Couldn't find sh, exiting."
exit 1
else
echo "Found sh: $shbin"
fi
@anton-matosov
anton-matosov / React Native Easings
Last active February 1, 2023 13:07 — forked from dabit3/React Native Easings
React Native Easing animations
// https://snack.expo.io/HynFGjcyf
import React, { Component } from 'react';
import {
StyleSheet,
Text,
View,
Easing,
Animated,
// Button,
@anton-matosov
anton-matosov / synchronizing-rotation-animation-part-2.m
Created July 6, 2016 00:37 — forked from smnh/synchronizing-rotation-animation-part-2.m
Synchronizing rotation animation between the keyboard and the attached view - Part 2
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(keyboardWillChangeFrame:)
name:UIKeyboardWillChangeFrameNotification object:nil];
}
- (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
@anton-matosov
anton-matosov / HashFromCGRect.m
Last active February 10, 2016 15:25 — forked from steipete/gist:6133152
Create a hash from a CGRect
NSUInteger PSPDFHashFromCGRect(CGRect rect) {
return (*(NSUInteger *)&rect.origin.x << 10 ^ *(NSUInteger *)&rect.origin.y) + (*(NSUInteger *)&rect.size.width << 10 ^ *(NSUInteger *)&rect.size.height);
}