I hereby claim:
- I am klgraham on github.
- I am klogram (https://keybase.io/klogram) on keybase.
- I have a public key ASAH4w1M6pKVqmDTyHCQruuuVovVviDurs9-P8DblNSP7Qo
To claim this, I am signing this object:
| # Modified example from: https://huggingface.co/facebook/detr-resnet-50 | |
| from transformers import DetrFeatureExtractor, DetrForObjectDetection | |
| from PIL import Image | |
| import requests | |
| import torch | |
| print("GPU is available:", torch.cuda.is_available()) | |
| #device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") |
I hereby claim:
To claim this, I am signing this object:
| // Usage: | |
| /* | |
| if let aStreamReader = StreamReader(path: "/path/to/file") { | |
| defer { | |
| aStreamReader.close() | |
| } | |
| while let line = aStreamReader.nextLine() { | |
| print(line) | |
| } | |
| } |
| #! /bin/bash | |
| GCC_VERSION="5.2.0" | |
| WORKDIR="$HOME/src/" | |
| INSTALLDIR="/platform" | |
| ## NOTE: XCode must be installed (through App Store) and the following run to install command-line tools. | |
| ## THIS IS IMPORTANT! Among other things, it creates '/usr/include' and installs the system header files. | |
| # xcode-select --install |
| (defn zipIndex [coll] | |
| (loop [list coll | |
| n 0 | |
| result []] | |
| (if (empty? list) | |
| result | |
| (recur (rest list) (inc n) (conj result [n (first list)]))))) |
| def factorial(n: BigInt): BigInt = { | |
| def fact(n: BigInt, result: BigInt): BigInt = { | |
| if (n == 0) return result | |
| else return fact(n - 1, result * n) | |
| } | |
| return fact(n, 1) | |
| } |
| // Scala analog to Clojure's loop-recur construct | |
| def loopRecur[A](index: Int, coll: Seq[A], zippedList: List[(Int, A)]): List[(Int, A)] = { | |
| if (coll.isEmpty) return zippedList | |
| else return loopRecur(index + 1, coll.tail, zippedList ++ List((index, coll.head))) | |
| } | |
| // Given a sequecne of items, returns a List of tuples of the form (item index, item) | |
| def zipIndex[A](coll: Seq[A]): List[(Int, A)] = { | |
| return loopRecur(0, coll, List.empty[(Int, A)]) | |
| } |
| package org.klgraham; | |
| /** | |
| * Created by klogram on 8/5/16. | |
| */ | |
| public class StringReversal { | |
| public static String reverseStringIterative(final String s) { | |
| StringBuilder sb = new StringBuilder(); |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <lua.h> | |
| #include <lualib.h> | |
| #include <lauxlib.h> | |
| #include "luajit.h" | |
| int main(int argc, char *argv[]) | |
| { | |
| lua_State *L; |
| #include <stdio.h> | |
| #include <lua.h> | |
| #include <lualib.h> | |
| #include <lauxlib.h> | |
| #include "luajit.h" | |
| int main(int argc, char *argv[]) | |
| { | |
| int status; | |
| lua_State *L; |