Skip to content

Instantly share code, notes, and snippets.

View magnusja's full-sized avatar
👨‍💻
..

magnus magnusja

👨‍💻
..
View GitHub Profile
@magnusja
magnusja / CMakeLists.txt
Created November 2, 2015 23:07
Arduino CMake example (CLion)
cmake_minimum_required(VERSION 2.8.4)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/ArduinoToolchain.cmake)
set(PROJECT_NAME ard)
project(${PROJECT_NAME})
set(ARDUINO_DEFAULT_PORT /dev/cu.usbmodemfd121)
set(${CMAKE_PROJECT_NAME}_SKETCH ard.ino)
generate_arduino_firmware(${CMAKE_PROJECT_NAME})
@magnusja
magnusja / gen_mongooseim_scram.py
Last active February 26, 2016 19:15
This code snippet is able to generate a scram salted password 'hash' in the format and with the necessary information mongooseim expects when using http auth and scram. See http://stackoverflow.com/questions/35652435/mongooseim-ejabberd-http-auth-using-scram and http://mongooseim.readthedocs.org/en/1.6.1/advanced-configuration/HTTP-authenticatio…
# https://tools.ietf.org/html/rfc5802
import base64
import hashlib
import hmac
import sys
from passlib.hash import scram
@magnusja
magnusja / rank_metrics.py
Created July 17, 2017 23:46 — forked from bwhite/rank_metrics.py
Ranking Metrics
"""Information Retrieval metrics
Useful Resources:
http://www.cs.utexas.edu/~mooney/ir-course/slides/Evaluation.ppt
http://www.nii.ac.jp/TechReports/05-014E.pdf
http://www.stanford.edu/class/cs276/handouts/EvaluationNew-handout-6-per.pdf
http://hal.archives-ouvertes.fr/docs/00/72/67/60/PDF/07-busa-fekete.pdf
Learning to Rank for Information Retrieval (Tie-Yan Liu)
"""
import numpy as np

Keybase proof

I hereby claim:

  • I am magnusja on github.
  • I am magnusja (https://keybase.io/magnusja) on keybase.
  • I have a public key ASB98UhZ7Xgqqp8_V2fNkKifhvQ8aVh39rGH5xtjhc0T1wo

To claim this, I am signing this object:

[tool.poetry]
name = "document_classification"
version = "0.1.0"
description = "Generic (scanned) document classification"
authors = ["magnus <magnus@mgns.tech >"]
[tool.poetry.dependencies]
python = "^3.7"
jupyterlab = "^0.35.4"
click = "^7.0"
[tool.poetry]
name = "ocr"
version = "0.1.0"
description = ""
authors = ["Magnus <magnus@jahnen.me>"]
[tool.poetry.dependencies]
python = "3.8.6"
pyocr = "^0.7.2"
Pillow = "^8.0.1"
root@training-document-classification-4tvkc:/training# ray memory
2020-11-19 19:51:53,430 INFO scripts.py:1317 -- Connecting to Ray instance at 10.42.0.108:6379.
2020-11-19 19:51:53,431 INFO worker.py:633 -- Connecting to existing Ray cluster at address: 10.42.0.108:6379
-----------------------------------------------------------------------------------------------------
Object ID Reference Type Object Size Reference Creation Site
=====================================================================================================
; worker pid=136679
ffffffffffffffffffffffff0100000001000000 PINNED_IN_MEMORY 18808561 (deserialize actor creation task arg) abc.DynamicTrainable.__init__
ffffffffffffffffffffffff0100000002000000 PINNED_IN_MEMORY 5988152 (deserialize actor creation task arg) abc.DynamicTrainable.__init__
ffffffffffffffffffffffff0100000003000000 LOCAL_REFERENCE 15 (deserialize actor creation task arg) abc.DynamicTrainable._
root@training-document-classification-wdgc2:/training# ray memory
2020-11-20 15:09:56,419 INFO scripts.py:1340 -- Connecting to Ray instance at 10.42.0.130:6379.
2020-11-20 15:09:56,420 INFO worker.py:650 -- Connecting to existing Ray cluster at address: 10.42.0.130:6379
-----------------------------------------------------------------------------------------------------
Object ID Reference Type Object Size Reference Creation Site
=====================================================================================================
; worker pid=144014
ffffffffffffffffffffffff0100000002000000 PINNED_IN_MEMORY 5988152 (deserialize actor creation task arg) abc.DynamicTrainable.__init__
ffffffffffffffffffffffff0100000003000000 LOCAL_REFERENCE 15 (deserialize actor creation task arg) abc.DynamicTrainable.__init__
ffffffffffffffffffffffff0100000001000000 PINNED_IN_MEMORY 18808561 (deserialize actor creation task arg) abc.DynamicTrainable._
root@training-document-classification-8vdnj:/training# ray memory
2020-11-21 12:54:39,332 INFO scripts.py:1317 -- Connecting to Ray instance at 10.42.0.143:6379.
2020-11-21 12:54:39,332 INFO worker.py:633 -- Connecting to existing Ray cluster at address: 10.42.0.143:6379
-----------------------------------------------------------------------------------------------------
Object ID Reference Type Object Size Reference Creation Site
=====================================================================================================
; worker pid=200348
ffffffffffffffffffffffff0100000002000000 PINNED_IN_MEMORY 5988276 (deserialize actor creation task arg) abc.DynamicTrainable.__init__
ffffffffffffffffffffffff0100000003000000 LOCAL_REFERENCE 15 (deserialize actor creation task arg) abc.DynamicTrainable.__init__
ffffffffffffffffffffffff0100000001000000 PINNED_IN_MEMORY 18808997 (deserialize actor creation task arg) abc.DynamicTrainable._
root@training-document-classification-ls7b5:/training# ray memory
2020-11-23 06:27:45,222 INFO scripts.py:1042 -- Connecting to Ray instance at 10.42.0.147:6379.
WARNING: Logging before InitGoogleLogging() is written to STDERR
I1123 06:27:45.224284 114449 114449 global_state_accessor.cc:25] Redis server address = 10.42.0.147:6379, is test flag = 0
I1123 06:27:45.225081 114449 114449 redis_client.cc:141] RedisClient connected.
I1123 06:27:45.225144 114449 114449 redis_gcs_client.cc:88] RedisGcsClient Connected.
I1123 06:27:45.226150 114449 114449 service_based_gcs_client.cc:75] ServiceBasedGcsClient Connected.
-----------------------------------------------------------------------------------------------------
Object ID Reference Type Object Size Reference Creation Site
=====================================================================================================