Skip to content

Instantly share code, notes, and snippets.

@ibmua
ibmua / coinlist.py
Created September 3, 2021 15:21 — forked from badmofo/coinlist.py
CoinList Pro Python3 API
'''
Copyright (c) 2020 Lucas Ryan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so.
@ibmua
ibmua / gist:7e6c3cd365eefc64fb562f2ae354de31
Last active November 11, 2020 17:28
3080 ai-benchmark.com [run under NGC 20.10-tf1]
First goes 3080 Gigabyte Gaming OC, then 3080 MSI Gaming X Trio
>> AI-Benchmark-v.0.1.2
>> Let the AI Games begin..
2020-11-11 17:04:23.002305: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2599990000 Hz
2020-11-11 17:04:23.003399: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x5b4a090 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-11-11 17:04:23.003415: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
2020-11-11 17:04:23.005150: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcuda.so.1
2020-11-11 17:04:23.108471: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x5b4c500 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices:
@ibmua
ibmua / gist:bfa8d64afb303500f0bcad7589803db8
Last active November 11, 2020 17:16
3090 ai-benchmark.com [run under NGC 20.10-tf1]
>> AI-Benchmark-v.0.1.2
>> Let the AI Games begin..
2020-11-11 16:50:17.642293: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2599990000 Hz
2020-11-11 16:50:17.643424: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x560d110 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-11-11 16:50:17.643440: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
2020-11-11 16:50:17.645168: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcuda.so.1
2020-11-11 16:50:17.767055: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x560f580 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices:
2020-11-11 16:50:17.767084: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): GeForce RTX 3090, Compute Capability 8.6
2020-11-11 16:50:17.768002: I tensorflow/core/common_ru
@ibmua
ibmua / face-crop-extractor.py
Last active February 22, 2021 14:17
extract-1adrianb-crop-face-alignment
# for use with https://github.com/1adrianb/face-alignment
import cv2
import numpy as np
import face_alignment
imread = cv2.imread
_DEAFAULT_JPG_QUALITY = 99
imwrite = partial(cv2.imwrite, params=[int(cv2.IMWRITE_JPEG_QUALITY), _DEAFAULT_JPG_QUALITY])
fa = face_alignment.FaceAlignment(face_alignment.LandmarksType._3D, device='cuda')
@ibmua
ibmua / topcoder-MM116-final.stats
Created March 31, 2020 19:28
Topcoder Marathon Match 116 final test results
1 0.36563468414359174
2 0.17885260845064882
3 0.28852262366620873
4 0.2514404966692652
5 0.06748542738613812
244169730541 0.23256174721268402
244169730542 0.26269463658657066
244169730543 0.22041798309044436
244169730544 0.16611180158391606
244169730545 0.23481191179623626
@ibmua
ibmua / vis.py
Created March 26, 2020 08:59
TopCoder Marathon Match 116 statistics visualizer for my solution
# python3 vis.py or use a jupyter notebook
import os
import json
import random
import string
import time
import subprocess
from pathlib import Path
directory = '/home/i/C/marathon/116/outs/'
@ibmua
ibmua / launcher.py
Last active March 26, 2020 08:49
Bulk-run TopCoder Marathon Match 116 solution
# python3 launcher.py 0 parallel 4 name
# DO CHANGE THE DIRECTORIES TO YOURS
# ALSO, in ' /home/i/C/marathon/116/stats" -seed '
# /home/i/C/marathon/116/stats can be removed -- it's just for storing some additional statistics.
from multiprocessing.pool import ThreadPool
import os
import sys
import json
import random
import string
@ibmua
ibmua / Lossy2dCompression.cpp
Last active March 28, 2020 11:38
TopCoder Marathon Match 116 solution
/*
g++ -std=gnu++11 -fsanitize=address -O3 Lossy2dCompression.cpp -o Lossy2dCompression &&
java -jar tester.jar -exec "./Lossy2dCompression" -seed 9 -debug
g++ -std=gnu++11 -include bits/stdc++.h -O3 Lossy2dCompression.cpp -o Lossy2dCompression &&
java -jar tester.jar -exec "./Lossy2dCompression /path/to/store_result_for_seed_9 9" -seed 9 -novis
g++ -std=gnu++11 -include bits/stdc++.h -O3 Lossy2dCompression.cpp -o Lossy2dCompression &&
java -jar tester.jar -exec "./Lossy2dCompression /home/i/C/marathon/116/outs/a 9" -seed 9 -novis
@ibmua
ibmua / sol.cpp
Created March 10, 2020 17:52
Code Jam "Costume Change" problem solution
/*
// By Ihor Menshykov, MIT license
g++ sol.cpp -fsanitize=address -include bits/stdc++.h -O3 -pthread -lm -std=c++14 -o executables/executable && ulimit -Sv 1000000000000 && time ./executables/executable < ./ins/a
time g++ sol.cpp -O3 -pthread -lm -std=c++14 -o executables/executable && ./executables/executable < ./ins/a
time taskset --cpu-list 0 g++ sol.cpp -include bits/stdc++.h -O3 -pthread -lm -std=c++14 -o executables/executable && ulimit -Sv 1000000 &&
time ./executables/executable < ./ins/a
@ibmua
ibmua / country_codes.js
Created August 13, 2019 21:21
Codes and names of world's countries per iso-3166 + Kosovo
var country_codes = [
{ code: 'AF', name: 'Afghanistan' },
{ code: 'AX', name: 'Åland Islands' },
{ code: 'AL', name: 'Albania' },
{ code: 'DZ', name: 'Algeria' },
{ code: 'AS', name: 'American Samoa' },
{ code: 'AD', name: 'Andorra' },
{ code: 'AO', name: 'Angola' },
{ code: 'AI', name: 'Anguilla' },
{ code: 'AQ', name: 'Antarctica' },