Skip to content

Instantly share code, notes, and snippets.

# Enable mouse scrolling
set -g mouse on
# Change prefix from C-b to C-h
unbind C-b
set-option -g prefix C-h
bind-key C-h send-prefix
# split panes using h and v
bind-key h split-window -v
bind-key v split-window -h
import logging
import pymc4 as pm
import numpy as np
import arviz as az
import tensorflow as tf
import tensorflow_probability as tfp
print(pm.__version__)
print(tf.__version__)
$ python ./pymc_trial.py
2020-07-02 20:44:13.600428: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'libcudart.so.10.1'; dlerror: libcudart.so.10.1: cannot open shared object file: No such file or directory
2020-07-02 20:44:13.601242: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
4.0a2
2.4.0-dev20200701
0.11.0-dev20200702
2020-07-02 20:44:20.525474: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory
2020-07-02 20:44:20.526310: W tensorflow/stream_executor/cuda/cuda_driver.cc:312] failed call to cuInit: UNKNOWN ERROR (303)
2020-07-02 20:44:20.527459: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (HND-1800149369): /proc/driver/nvidia/version does not exist
2020-07-02 20:44:
@Isa-rentacs
Isa-rentacs / main.cpp
Created February 19, 2019 12:12
C++ string encoding 1
#include <iostream>
#include <cstring>
using namespace std;
void print_bytes(unsigned char* ptr, unsigned char* end)
{
while(ptr != end)
{
printf("%x, %02x\n", ptr, *ptr);
@Isa-rentacs
Isa-rentacs / main.cpp
Last active February 10, 2019 14:26
Alias method example
#include <iostream>
#include <random>
#include <deque>
#include <algorithm>
#include <cassert>
using namespace std;
int main() {
std::srand(42);
#include <iostream>
#include <random>
#include <ctime>
#include <x86intrin.h>
#include "expected.h"
// Intel MKL header
#ifdef USE_MKL
#include "mkl.h"
#elif USE_OPEN_BLAS
#include "cblas.h"
@Isa-rentacs
Isa-rentacs / code.java
Created January 17, 2019 06:06
code used to load Keras model
package org.deeplearning4j.examples.modelimport.keras;
import org.deeplearning4j.nn.graph.ComputationGraph;
import org.deeplearning4j.nn.modelimport.keras.KerasModelImport;
import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.linalg.factory.Nd4j;
import java.util.Arrays;
# your code goes here
def getSetDifference(setA, setB):
count = {}
setC = set()
for element in setA:
if(count.get(element) == None):
count[element] = 1
else:
count[element] = count[element] + 1
#include <stdio.h>
#include <stdlib.h>
void diffOfSets(char* setA, int lenA, char* setB, int lenB, char** setDiff, int* lenDiff)
{
int *countDiff = malloc(sizeof(int) * 26);
int *isIncludedArray = malloc(sizeof(int) * lenA);
int includedItemCount = 0;
for(int i=0;i<26;++i)
@Isa-rentacs
Isa-rentacs / prac.py
Last active December 12, 2015 08:39
Python Practice
#for(i=0;i<10;i++)
for i in range(10)
#str->int
int(str_var)
#int->str
str(int_var)
#while(getline(cin,str))