Skip to content

Instantly share code, notes, and snippets.

View jirihnidek's full-sized avatar

Jiri Hnidek jirihnidek

View GitHub Profile
@jirihnidek
jirihnidek / multi_proc.py
Last active August 29, 2015 13:56
Testing of multithreading and multiprocesing in Python interpreters.
#!/usr/bin/env python
"""
Simple module for testing parallel variant of
code using Python multiprocessing
"""
from multiprocessing import Process
import time
@jirihnidek
jirihnidek / Results.md
Last active August 29, 2015 13:56
Simple CTypes example and benchmark.

Results of Benchmark

Python2.6         0.14
Python2.6 CTypes  0.71
Python2.7         0.15
Python2.7 CTypes  0.77
Python3.3         0.14
Python3.3 CTypes 0.71
@jirivrany
jirivrany / Hash
Last active August 29, 2015 13:56
Python - map vs. list generator
'''
@author: Jiri Vrany
'''
import hashlib
def hash_word(word):
'''
returns sha512 hash
'''
@jirihnidek
jirihnidek / README.md
Last active August 29, 2015 14:03
Examples of Python scripts for adding and changing values in Verse layers

Examples of VerseLayer

This gist contains several Python scripts using class VerseLayer from module Verse Entities: https://github.com/verse/verse-entities

Create Verse Layer

The script that is used for creating new layer is called verse_layer_create.py. This script creates new Node, then this node is moved to the parent of scene nodes. Thus this node will not be destroyed after client logout. New layer is created in

@jirihnidek
jirihnidek / webpy_json.py
Last active August 29, 2015 14:08
WebPy JSON Example
"""
This module tries to print JSON from HTTP GET/POST method.
"""
#
# To test the application run application with:
#
# python ./webpy_json.py
#
# and type following URI in browser addres bar:
#!/usr/bin/env python
"""
Simple example of bspline surface created directly (not using Bezier surface)
"""
from OCC.gp import *
from OCC.Geom import *
from OCC.TColGeom import *
from OCC.TColgp import *
"""
This simple example of Blender Python script prints membership of verticies in vertex groups and weights. It uses deform layer.
"""
import bpy
import bmesh
obj = bpy.context.object
# Get the active mesh
@adobkin
adobkin / FindCUnit.cmake
Created July 9, 2011 05:28
Module for CMake to search the CUnit headers and libraries
# Find the CUnit headers and libraries
#
# CUNIT_INCLUDE_DIRS - The CUnit include directory (directory where CUnit/CUnit.h was found)
# CUNIT_LIBRARIES - The libraries needed to use CUnit
# CUNIT_FOUND - True if CUnit found in system
FIND_PATH(CUNIT_INCLUDE_DIR NAMES CUnit/CUnit.h)
MARK_AS_ADVANCED(CUNIT_INCLUDE_DIR)
@qguv
qguv / solarized-dark.css
Last active April 5, 2021 04:50 — forked from nicolashery/solarized-dark.css
Solarized theme for Jekyll, updated to reflect toned-down line numbers
/* Solarized Dark
For use with Jekyll and Pygments
http://ethanschoonover.com/solarized
SOLARIZED HEX ROLE
--------- -------- ------------------------------------------
base03 #002b36 background
base01 #586e75 comments / secondary content
@jirihnidek
jirihnidek / .gitignore
Last active November 17, 2022 20:04
UDP client-server application using random port number with respect to statefull firewalls aka hole punching.
.cproject
.project