Skip to content

Instantly share code, notes, and snippets.


Sanzhar Askaruly tuttelikz

Block or report user

Report or block tuttelikz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
tuttelikz /
Last active Oct 4, 2019
Naive Bayes From Scratch in Python
#How To Implement Naive Bayes From Scratch in Python
import csv
import math
import random
#Handle data
tuttelikz / Histogram Equalization OpenCV C++
Created Sep 21, 2016
This Gist gives a code snippet for histogram equalization in OpenCV. In line 63, you should enter your source image name
View Histogram Equalization OpenCV C++
#include <iostream>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace std;
using namespace cv;
//function to take histogram of input image
void imageHistogram(Mat image, int histogram[]) {
// initialize all intensity values to 0
tuttelikz / bilateral_filter.m
Created May 6, 2017
Bilateral Filter - MATLAB
View bilateral_filter.m
clc, close all, clear all;
img = imread('puppy.jpg');
A = rgb2gray(img);
[m,n] = size(A);
%Filter Parameters setup
windowSize = input('Enter window size (3/5/7):\n ');
stDevSpace = input('Enter space standard deviation (1-20):\n ');
tuttelikz / Rename_files.txt
Created Jan 4, 2018
Rename filename bash
View Rename_files.txt
num=0; for i in *; do mv "$i" "$(printf '%04d' $num).${i#*.}"; ((num++)); done
tuttelikz / add_prefix_to_filename.txt
Created Jan 18, 2018
Bash command for adding prefix
View add_prefix_to_filename.txt
for f in * ; do mv "$f" "PRE_$f" ; done
tuttelikz /
Created Jan 18, 2018
This is a python script to write list characters into file
thefile = open('train_test_data_labels.txt', 'w')
for item in y_train_test_list:
thefile.write("%s\n" % item)
tuttelikz /
Created Jan 18, 2018
This is a simple script to read labels from file
array = []
with open('train_test_data_labels.txt') as fileobj:
for line in fileobj:
for ch in line:
new_list = [a for a in array if a != '\n']
tuttelikz / copy_folders_without_contents
Created Jan 20, 2018
This is a bash command on windows to copy folders structure without contents
View copy_folders_without_contents
xcopy C:\Folders D:\Folders /t /e
View copy_to_remote_windows
# After installation of PuTTY, open command window prompt and type the following:
//For copying folder:
pscp -r source destination
//For copying file:
pscp source destination
tuttelikz / run_multiple_script_command
Created Jan 20, 2018
For running multiple bash commands
View run_multiple_script_command
#This is an example how to run multiple bash commands together
# Just put && symbol between commands
cd o_cheek/ && num=0; for i in *; do mv "$i" "$(printf 'cheek_old_%04d' $num).${i#*.}"; ((num++)); done && cd .. && mv o_cheek cheek_old && cd o_eye/ && num=0; for i in *; do mv "$i" "$(printf 'eye_old_%04d' $num).${i#*.}"; ((num++)); done && cd .. && mv o_eye eye_old && cd o_forearm/ && num=0; for i in *; do mv "$i" "$(printf 'forearm_old_%04d' $num).${i#*.}"; ((num++)); done && cd .. && mv o_forearm forearm_old && cd y_cheek/ && num=0; for i in *; do mv "$i" "$(printf 'cheek_young_%04d' $num).${i#*.}"; ((num++)); done && cd .. && mv y_cheek cheek_young && cd y_eye/ && num=0; for i in *; do mv "$i" "$(printf 'eye_young_%04d' $num).${i#*.}"; ((num++)); done && cd .. && mv y_eye eye_young && cd y_forearm/ && num=0; for i in *; do mv "$i" "$(printf 'forearm_young_%04d' $num).${i#*.}"; ((num++)); done && cd .. && mv y_forearm forearm_young
You can’t perform that action at this time.