Skip to content

Instantly share code, notes, and snippets.

View gkthiruvathukal's full-sized avatar

George K. Thiruvathukal gkthiruvathukal

  • Loyola University Chicago, Argonne National Laboratory (ALCF)
  • Chicago, IL, USA, North America, Earth, ..., Universe
  • LinkedIn in/gkthiruvathukal
View GitHub Profile
@gkthiruvathukal
gkthiruvathukal / arrays.scala
Created February 24, 2016 05:04
Trying to figure out the best way to create homogenous, n-dimensional arrays in Scala. Array.ofDim() not proving to be ideal.
/ This takes forever and seems to use a lot more memory than expected
Array.ofDim[Double](2048, 2048, 2048)
// This seems to work faster and uses less memory.
def get1d(d1 : Int, init : Double) = Stream.continually(init) take d1 toArray
def get2d(d1 : Int, d2 : Int, init : Double) = Stream.continually( get1d(d2, init) ) take d1 toArray
def get3d(d1 : Int, d2 : Int, d3 : Int, init : Double) = Stream.continually( get2d(d2, d3, init) ) take d1 toArray
// More testing is needed.
pattern = r"\d+"
import re
regex = re.compile(pattern)
regex.match("George")
regex.match("35")
@gkthiruvathukal
gkthiruvathukal / 3_4speed.java
Created February 10, 2017 16:50
Modify 3-4 to set stroke width based on mouse pointer speed
// Learning Processing
// Daniel Shiffman
// http://www.learningprocessing.com
// COMP 125, set stroke width based on speed (modify 3-4)
// Example 3-4: Drawing a continuous line
void setup() {
size(480, 270);
background(255);
Python 2.7.10 (default, Feb 7 2017, 00:08:15)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> print("Hello World")
Hello World
@gkthiruvathukal
gkthiruvathukal / hello.scala
Created June 28, 2017 19:21
How to say Hello in Scala
println("Hello, World")
@gkthiruvathukal
gkthiruvathukal / ClientBenchmark.scala
Created January 31, 2019 16:15 — forked from azinman/ClientBenchmark.scala
Testing 50k+ concurrent connections using netty
package com.mypackage.benchmark
import com.mypackage.util.Logging
import net.lag.configgy.Configgy
import scala.collection.mutable
import scala.collection.JavaConversions._
import java.net.InetSocketAddress
import java.nio.charset.Charset
import java.util.concurrent._
@gkthiruvathukal
gkthiruvathukal / ClientBenchmark.scala
Created January 31, 2019 16:15 — forked from azinman/ClientBenchmark.scala
Testing 50k+ concurrent connections using netty
package com.mypackage.benchmark
import com.mypackage.util.Logging
import net.lag.configgy.Configgy
import scala.collection.mutable
import scala.collection.JavaConversions._
import java.net.InetSocketAddress
import java.nio.charset.Charset
import java.util.concurrent._
@gkthiruvathukal
gkthiruvathukal / .gitignore
Created March 24, 2019 16:56
sample .gitignore from gist client
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
@gkthiruvathukal
gkthiruvathukal / darknet-singularity.recipe
Created March 24, 2019 17:00
container for YOLOv3 with CUDA/OpenCV on CentOS
Bootstrap: docker
From: nvidia/cuda:9.0-cudnn7-devel-centos7
%help
Centos7 with cuda9.0 cudnn7
To start your container simply try
singularity exec THIS_CONTAINER.simg bash
To use GPUs, try
@gkthiruvathukal
gkthiruvathukal / README
Created March 24, 2019 17:06
singularity recipe and how to build/run for YOLOv3/darknet
To run this gist, you need to have the singularity container framework installed on your computer.
The host system must have a GPGPU.