Skip to content

Instantly share code, notes, and snippets.

@vmaks
vmaks / gcc 5 on ubuntu 14.04
Created August 8, 2016 16:44 — forked from beci/gcc 5 on ubuntu 14.04
use gcc 5.x on ubuntu 14.04
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-5 g++-5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5
@vmaks
vmaks / latency.txt
Created July 20, 2016 12:50 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@vmaks
vmaks / d.md
Last active March 3, 2016 14:34
  1. Main loop

    while (true) {
    	for (unsigned int i = 0; i < N; i++) {
    	}
    }
@vmaks
vmaks / Unreal_Engine_Visual_Studio_2015.md
Last active April 16, 2017 10:53
Unreal Engine Visual Studio 2015

Visual Studio 2015 template

There is no template for a game after intalling Unreal Engine from Visual Studio 2015. The plugin simple install "Epic Games Launcher".

You should run "Epic Games Launcher", then sign up or log in, then choose "Unreal Engine / Library / Engine Versions / Add Versions", then click install.

After installing Unreal Engine click choose "Unreal Engine / Launch / New Project / C++ / Basic Code / Create project.

@vmaks
vmaks / djini_windows.md
Last active April 26, 2016 18:53
djini_windows

For windows only!

Install guide

  1. Install MinGW (http://www.mingw.org/) or Git (https://git-scm.com/). That is you will get "sh.exe".

  2. Add path to the system variables: System / Advanced System Settings / Enviroment Variables.

@vmaks
vmaks / gist:7b33267a28010dc10c1a
Created March 1, 2015 12:40
Python __debug__
__debug__
# This constant is true if Python was not started with an -O option. See also the assert statement.
# link: https://docs.python.org/2/library/constants.html
@vmaks
vmaks / gist:79fac700f429dc4294a3
Created February 28, 2015 19:19
Python class property([fget[, fset[, fdel[, doc]]]])
# link: https://docs.python.org/2/library/functions.html
class C(object):
def __init__(self):
self._x = None
@property
def x(self):
"""I'm the 'x' property."""
return self._x
@vmaks
vmaks / gist:17ab06089186d5c1b3bf
Last active August 26, 2018 18:45
python super TypeError: must be type, not classobj
If you face with an error like this while use "super":
"TypeError: must be type, not classobj"
link:
http://stackoverflow.com/questions/489269/python-super-raises-typeerror-why
Solution: add inheratence from the "object" class in the base class.
class Class1(object):
def __init__(self):
@vmaks
vmaks / gist:f1a541bf9bb9c7ff5229
Created February 14, 2015 18:31
PyCharm debug show frame
http://forum.jetbrains.com/thread/PyCharm-1675
http://blog.jetbrains.com/pycharm/2012/08/gevent-debug-support/
Enable Gevent support.
In recent versions of PyCharm, the option has moved to the main settings dialog. You can enable it under Settings | Python Debugger | Gevent compatible debugging.
@vmaks
vmaks / test_graphviz
Last active August 29, 2015 14:14
install "PlantUML" for PyCharm Community Edition
# Due to lack support of "Class Diagram/View" in the PyCharm Community Edition you could install "PlantUML integration" plugin to create a # class diagram by yourself.
# https://www.jetbrains.com/pycharm/features/editions_comparison_matrix.html
# Install "PlantUML integration" plugin for PyCharm Community Edition through "Settings/Plugins"
https://plugins.jetbrains.com/plugin/7017
# Install "graphviz" and "libgraphviz4", that requires for "graphviz"
# Add repository for "libgraphviz4"
http://www.graphviz.org/Download..php