Skip to content

Instantly share code, notes, and snippets.

View balamuruganky's full-sized avatar

Balamurugan Kandan balamuruganky

View GitHub Profile
@jyalim
jyalim / build-hdf5.sh
Last active March 7, 2025 16:51
Build HDF5 with Intel Compilers
#!/usr/bin/env bash
# https://software.intel.com/en-us/articles/performance-tools-for-software-developers-building-hdf5-with-intel-compilers
## PREREQS
# 1) szip 2.1
export CC=icc
export CXX=icpc
export FC=ifort
export CFLAGS='-O3 -xHost -ip'
export CXXFLAGS='-O3 -xHost -ip'
@minshallj
minshallj / foo.js
Last active March 13, 2023 18:28
roslibjs example
//* The Ros object, wrapping a web socket connection to rosbridge.
var ros = new ROSLIB.Ros({
url: 'ws://localhost:9090' // url to your rosbridge server
});
//* A topic for messaging.
var exampleTopic = new ROSLIB.Topic({
ros: ros,
name: '/com/endpoint/example', // use a sensible namespace
messageType: 'std_msgs/String'
@140am
140am / ipc_test.py
Last active March 3, 2025 00:59
Simple Python / ØMQ IPC (Inter Process Communication) performance benchmark
""" Simple IPC benchmark test
Test throughput of 512 KB messages sent between two python processes using:
- multiprocessing pipe
- zeroMQ PUSH/PULL
- zeroMQ DEALER/DEALER
Result:
@evands
evands / combine_static_libraries.sh
Created January 14, 2015 20:40
Combine multiple .a static libraries, which may each have multiple architectures, into a single static library
#!/bin/sh
# Combined all static libaries in the current directory into a single static library
# It is hardcoded to use the i386, armv7, and armv7s architectures; this can easily be changed via the 'archs' variable at the top
# The script takes a single argument, which is the name of the final, combined library to be created.
#
# For example:
# => combine_static_libraries.sh combined-library
#
# Script by Evan Schoenberg, Regular Rate and Rhythm Software
@dbehnke
dbehnke / client.py
Created March 18, 2014 19:08
Python AsyncIO Client and Server Example using StreamReader and StreamWriter
"""
client.py - AsyncIO Server using StreamReader and StreamWriter
This will create 200 client connections to a server running server.py
It will handshake and run similar to this:
Server: HELLO
Client: WORLD
@ganine
ganine / Vagrantfile
Last active March 27, 2024 08:19
Basic Vagrantfile with provisioning shell script
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64"
config.vm.provision :shell, :privileged => false, :path => "bootstrap_ubuntu1204.sh"
end
@wonkoderverstaendige
wonkoderverstaendige / ZMQ_DEBUG.props
Created November 18, 2013 02:22
ZeroMQ C++ example server with corresponding Python client. From http://zguide.zeromq.org/page:all
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_PropertySheetDisplayName>ZMQ_DEBUG</_PropertySheetDisplayName>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>%ZMQ_DIR%\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@bistaumanga
bistaumanga / gmm.py
Last active September 26, 2024 10:00
Gaussian Mixture Model using Expectation Maximization algorithm in python
# -*- coding: utf-8 -*-
"""
Created on Sat May 3 10:21:21 2014
@author: umb
"""
import numpy as np
class GMM:
@exaos
exaos / ReadMCA.py
Created January 11, 2013 03:36
ReadMCA: Convert spectra gathered by MCA8000 into ROOT format (http://root.cern.ch/)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Read data acquired by MCA8000A through software "pcma".
File extension: .mca'''
import re
def readmca(fm):
sraw=[l.strip() for l in open(fm,'r').readlines()]
kidx=[]
@jasongrout
jasongrout / run_once.py
Created September 29, 2012 17:46
run once decorator
# from http://stackoverflow.com/questions/4103773/efficient-way-of-having-a-function-only-execute-once-in-a-loop
from functools import wraps
def run_once(f):
"""Runs a function (successfully) only once.
The running can be reset by setting the `has_run` attribute to False
"""
@wraps(f)
def wrapper(*args, **kwargs):
if not wrapper.has_run: