Skip to content

Instantly share code, notes, and snippets.

View kdheepak's full-sized avatar

Dheepak Krishnamurthy kdheepak

View GitHub Profile
// Hello
using Pkg
cd(mktempdir()) do
Pkg.activate(".")
Pkg.add(PackageSpec(name="JuMP", version="1.13.0"))
Pkg.add(PackageSpec(name="GLPK", version="1.1.2"),
preserve=PRESERVE_DIRECT)
Pkg.status()
end
@kdheepak
kdheepak / paramiko_runner.py
Created January 2, 2019 21:01
paramiko non blocking example
import sys
import paramiko
import os
import select
import getpass
import time
rpi = {
"username": getpass.getuser(),
"hostname": "hostname.of.server.here"
def get_state(fed):
f = h.loadSym("helicsFederateGetState")
err = h.helicsErrorInitialize()
r = f(fed.handle, err)
return r
Error executing vim.schedule lua callback: vim/shared.lua:0: after the second argument: expected table, got nil
stack traceback:
[C]: in function 'error'
vim/shared.lua: in function 'validate'
vim/shared.lua: in function 'tbl_deep_extend'
.../packer/start/cmp-treesitter/lua/cmp_treesitter/init.lua:19: in function 'get_keyword_pattern'
.../nvim/site/pack/packer/start/nvim-cmp/lua/cmp/source.lua:163: in function 'callback'
.../site/pack/packer/start/nvim-cmp/lua/cmp/utils/cache.lua:36: in function 'get_default_replace_range'
...e/nvim/site/pack/packer/start/nvim-cmp/lua/cmp/entry.lua:45: in function 'new'
@kdheepak
kdheepak / zmq_server.m
Created June 29, 2016 14:32
MATLAB ZMQ Server
% Author : Dheepak Krishnamurthy
% License : BSD 3 Clause
import org.zeromq.ZMQ;
ctx = zmq.Ctx();
socket = ctx.createSocket(ZMQ.REP);
socket.bind('tcp://127.0.0.1:7575');
@kdheepak
kdheepak / documentation.jl
Last active May 27, 2020 21:38
generate helics documentation using libclang
using Clang
using HELICS
const HELICS_jll = HELICS.Lib.HELICS_jll
# LIBCLANG_HEADERS are those headers to be wrapped.
const LIBHELICS_INCLUDE = [
normpath(joinpath(HELICS_jll.artifact_dir, "include", "helics", "shared_api_library")),
normpath(joinpath(HELICS_jll.artifact_dir, "include", "helics")),
import helics as h
print("""## Enum""")
print("")
enum_blacklist = [
"helics_true",
"helics_false",
"helics_message",
@kdheepak
kdheepak / plot.py
Created September 2, 2016 15:51
Thread Safe Matplotlib
from matplotlib.figure import Figure
fig = Figure(figsize = (3, 3))
canvas = FigureCanvas(fig)
ax = fig.add_subplot(111)
@kdheepak
kdheepak / HELICS_GridLAB-D_GCC.md
Created January 17, 2019 21:20
Build GridLAB-D with HELICS, Boost and ZeroMQ using GCC on MacOSX

Install gcc

Install gcc using brew

brew install gcc

Install Boost