Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View nkottary's full-sized avatar

Nishanth H. Kottary nkottary

  • Julia Computing, Inc.
  • Bangalore, India
View GitHub Profile
@nkottary
nkottary / fix.jl
Created November 27, 2015 09:24
My fix for number test failure on ARM.
function getexponent(x::Float32)
rep = reinterpret(UInt32, x)
rawexp = ((rep & reinterpret(UInt32, Float32(Inf))) >> 23)
exp = convert(Int, rawexp) - 127 # 127 is bias
return exp
end
function getexponent(x::Float64)
rep = reinterpret(UInt64, x)
rawexp = ((rep & reinterpret(UInt64, Inf)) >> 52)
@nkottary
nkottary / test.jl
Created February 22, 2016 04:28
ODBC jq/remodel branch testing for various database backends
using ODBC
using DataFrames
@linux_only const TEMP_FILE = "/tmp/tmp.csv"
@windows_only const TEMP_FILE = "tmp.csv"
const MYSQL_DSN = "UbuntuMySQL"
const MSSQL_DSN = "MSSQL_Server"
function test_mysql()
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <assert.h>
#include "zmq.h"
#include <string.h>
/* Look for leaks when repeatedly binding.
Compile like this: gcc -I/usr/local/include bindtest.c -L/usr/local/lib -lzmq -g -o bt
*/
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include <string.h>
#include <stdint.h>
#include <zmq.h>
/* Look for leaks in while repeatedly sending messages
Compile like this: gcc -I/usr/local/include msgtest.c -L/usr/local/lib -lzmq -g -o mt
*/
@nkottary
nkottary / leaky.jl
Last active February 24, 2016 04:23
const PID = getpid()
const command = "ps -p $PID -o vsz | sed -n 2p"
const NUM_ITER = 10000
const NUM_PRINT = div(NUM_ITER, 10)
# Get virtual memory usage from julia
jvsz() = split(readall(`ps -p $PID -o vsz`),"\n")[2]
# Get virtual memory usage from C
function cvsz()
@nkottary
nkottary / video_script.txt
Created November 13, 2018 06:11
Script for apps video
0:06 = Hello, in this video we will see how to create apps on JuliaBox
0:23 = Click on the "Launch" button to start Jupyter
0:37 = Now we go back to the dashboard and open up the "My Apps" tool
0:42 = The default values describe a built-in example app that you can run. Just hit "Deploy"
1:03 = Now you should see the app on the dashboard. Click on the "Short Link" to connect to the app. This link can also be shared with o
ther users.
1:13 = Lets wait for the app to start up. This app accepts some code on the left box and runs it when you click the button. The results
are on the right.
1:34 = Now lets see the julia code for this app
1:46 = First we copy the file from the default location to our home so that Jupyter can see it.
@nkottary
nkottary / matches.jl
Created July 18, 2020 13:24
mangoicecream
str = "mangoicecream"
options = ["man", "ice", "cream", "go", "icecream", "mango"]
# prints the answer
function domatch(str, options, acc = [])
for op in options
cacc = copy(acc)
if length(op) <= length(str) && str[1:length(op)] == op
push!(cacc, op)
if length(op) == length(str)