Skip to content

Instantly share code, notes, and snippets.

View nickovchinnikov's full-sized avatar

Nick Ovchinnikov nickovchinnikov

View GitHub Profile
@nickovchinnikov
nickovchinnikov / imagenet1000_clsidx_to_labels.txt
Created March 9, 2023 14:37 — forked from yrevar/imagenet1000_clsidx_to_labels.txt
text: imagenet 1000 class idx to human readable labels (Fox, E., & Guestrin, C. (n.d.). Coursera Machine Learning Specialization.)
{0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8: 'hen',
9: 'ostrich, Struthio camelus',
@nickovchinnikov
nickovchinnikov / MySQL_practice_problems.md
Created August 16, 2022 15:48 — forked from wgopar/MySQL_practice_problems.md
MySQL Employees Sample Database exercise problems + solutions.

MySQL practice problems using the Employees Sample Database along with my solutions. See here for database installation details.

Problem 1

Find the number of Male (M) and Female (F) employees in the database and order the counts in descending order.

SELECT gender, COUNT(*) AS total_count
FROM employees 
GROUP BY gender
@nickovchinnikov
nickovchinnikov / f35-nvidia-cuda.md
Created June 27, 2022 19:55 — forked from p-karanthaker/f35-nvidia-cuda.md
Fedora 35 NVIDIA/CUDA Installation for TensorFlow

Fedora 35 NVIDIA/CUDA Installation for TensorFlow

These are the steps I took for the installation of the NVIDIA drivers and CUDA toolkit for use with TensorFlow on Fedora 35. I have documented them since I had a lot of difficulty getting it to work and couldn't boot to a graphical desktop a few times. These steps worked for me, hopefully they do for others.

Assumptions

I am running on a 64 bit system and used KDE Plasma with X11 so these instructions may differ for people using GNOME, Wayland and any other combinations.

Pre-requisites

  • If you have installed any NVIDIA drivers other than the akmod-nvidia drivers from the @rpmfusion-nonfree repo, remove them completely.
  • Remove any other NVIDIA/CUDA installations. Find them with sudo dnf list installed | egrep '(nvidia|cuda)'
  • If the nvidia-driver module is enabled, disable it - sudo dnf module disable nvidia-driver - this caused me issues when trying to install the akmod drivers
@nickovchinnikov
nickovchinnikov / launch.json
Last active November 15, 2022 05:47
vscode jest debug config
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Jest single run all tests",
"program": "${workspaceRoot}/node_modules/jest/bin/jest.js",
"args": [
"--verbose",
@nickovchinnikov
nickovchinnikov / History|-14a6bd0a|entries.json
Last active November 3, 2022 13:23
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///media/Data/Projects/pytorch-tutorial/udemy/analys.py","entries":[{"id":"Owdk.py","timestamp":1665577929873},{"id":"NKvF.py","timestamp":1665577953119},{"id":"jCjq.py","timestamp":1665577976723},{"id":"Dmrq.py","timestamp":1665578052538},{"id":"1zqY.py","timestamp":1665578075067},{"id":"qzA0.py","timestamp":1665578086865},{"id":"cMRX.py","timestamp":1665578117117},{"id":"2VE2.py","timestamp":1665578131814},{"id":"FALi.py","timestamp":1665578164632},{"id":"1xAk.py","timestamp":1665578794209},{"id":"karU.py","timestamp":1665584521411}]}
/*
Write a function
function solution(A);
that, given an array A consisting of N integers, returns the number of distinct values in array A.
Assume that:
N is an integer within the range [0..100,000];
const MockData = require('./MockData')
const formatColumns = (data, columnLength = 6) => {
const pushItem = ({ boardMatrix = [], columnCursor = 0, rowCursor = 0, currentItem }) => {
const currentArrayItem = boardMatrix[columnCursor]
if (!currentArrayItem) {
boardMatrix[columnCursor] = [currentItem]
} else {
boardMatrix[columnCursor][rowCursor] = currentItem
}
const itemsToTable = items => {
return items.reduce((prevItem, currentItem) => {
const cursor = prevItem.length > 0 ? prevItem.length - 1 : 0
if (!Array.isArray(prevItem[cursor])) {
prevItem[cursor] = []
}
const currentColumn = cursor >= 0 ? prevItem[cursor] : []
//implement missing "Parallel" please
//try to do so with a minimal amount of code
function Parallel (options) {
var parallelJob = options.parallelJob || 1;
var jobs = [];
var result = [];
function runJobs() {
return new Promise(function(resolve) {
@nickovchinnikov
nickovchinnikov / iban-validator.js
Created December 8, 2016 12:56
IBAN validator
function ibanValidate(input) {
function mod97(string) {
var checksum = string.slice(0, 2), fragment;
for (var offset = 2; offset < string.length; offset += 7) {
fragment = String(checksum) + string.substring(offset, offset + 7);
checksum = parseInt(fragment, 10) % 97;
}
return checksum;
}