Skip to content

Instantly share code, notes, and snippets.

View dan0nchik's full-sized avatar
🎧
Always focused

Daniel Khromov dan0nchik

🎧
Always focused
View GitHub Profile
addi x17, x0, 5 # read a (a is put in x10)
ecall
add x6, x0, x10 # store "a" in x6
srli x5, x10, 31 # store sign of "a" in x5
ecall
add x29, x0, x10 # store "b" in x29
srli x28, x10, 31 # store sign of "b" in x28
beq x6, x0, if_a_zero # branch if a is zero (???)
beq x29, x0, if_b_zero #branch if b is zero (???)
beq x5, x0, if_a_less_0 # branch if "a" < 0 then inverse it
@dan0nchik
dan0nchik / main.cpp
Created May 10, 2023 08:14
'23 HSE Course Contest 5 task 1
#include <algorithm>
#include <iostream>
#include <map>
#include <vector>
typedef unsigned int UInt;
struct Date
{
UInt day;
@dan0nchik
dan0nchik / downloads.py
Created April 7, 2023 17:21
[EXPERIMENTAL] Download files in parallel from S3 Storage using boto3
from asyncio import as_completed
from functools import partial
import os
import boto3
import tqdm
from concurrent.futures.thread import ThreadPoolExecutor
from dotenv import load_dotenv
load_dotenv()
LOCAL_WEIGHTS_DIR = 'model-weights-skills'
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
struct Employee {
std::string name;
std::vector<int> salaries;
};
@dan0nchik
dan0nchik / main.py
Created April 14, 2022 22:30
Engineering exam practice, code from MIT affiliate in Russia (MIREA)
def add_pupil(name, birth_year, cs_score, math_score, physics_score, data):
data[name] = (name, birth_year, cs_score, math_score, physics_score) #
def show_pupil(name, data):
print(*data[name])
def del_pupil(name, data):
del data[name]
FAILED [100%]Recreating table test_cls with data from file
Done
Task: cls
| iter | target | algo_i... | prepro... |
-------------------------------------------------
Child Iteration accuracy: 0.884955
Child Iteration accuracy: 0.862831
| 1 | 0.885 | 2.063 | 1.061 |
Child Iteration accuracy: 0.871681
Child Iteration accuracy: 0.865044
FAILED [100%]Recreating table test_when_clean with data from file
Done
Task: cls
| iter | target | algo_i... | prepro... |
-------------------------------------------------
Child Iteration accuracy: 0.77528
Child Iteration accuracy: 0.786516
| 1 | 0.7865 | 2.063 | 1.061 |
Child Iteration accuracy: 0.786516
Child Iteration accuracy: 0.808988
@dan0nchik
dan0nchik / ImagePicker.swift
Created March 2, 2021 20:22
Gist for opening photos in SwifUI
//
// ImagePicker.swift
//
// Created by Daniel Khromov on 3/2/21.
//
import SwiftUI
import UIKit
struct ImagePicker: UIViewControllerRepresentable{
@dan0nchik
dan0nchik / feature_selection.py
Created December 12, 2020 11:41
Script for showing optimal features for classifying
from sklearn.ensemble import ExtraTreesClassifier
import matplotlib.pyplot as plt
model = ExtraTreesClassifier()
model.fit(X,y)
f = plt.figure(figsize=(10, 10))
print(model.feature_importances_) #use inbuilt class feature_importances of tree based classifiers
#plot graph of feature importances for better visualization
feat_importances = pd.Series(model.feature_importances_, index=X.columns)
feat_importances.nlargest(30).plot(kind='barh')
plt.show()
<?php
function equation($a, $b, $c){
if ($a != 0){
$D = $b*$b - 4*$a*$c;
if($D < 0){
return "No roots";
}
if($D == 0){
return -$b/(2*$a);
}