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
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 / 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 / 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

@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"
import logging
log_format = (
"%(asctime)s - %(levelname)s [%(filename)s:%(lineno)d] : %(message)s"
)
logger = logging.getLogger(__name__)
s = logging.StreamHandler()
f = logging.Formatter(log_format)
s.setFormatter(f)
@kdheepak
kdheepak / pireceiver.py
Created August 24, 2018 17:01
ComboFederate Pi Exchange example
import helics as h
fedinitstring = "--federates=1"
deltat = 0.01
helicsversion = h.helicsGetVersion()
print("PI RECEIVER: Helics version = {}".format(helicsversion))
# Create Federate Info object that describes the federate properties */