Skip to content

Instantly share code, notes, and snippets.

View hmenn's full-sized avatar
🎧
Focusing

Hasan MEN hmenn

🎧
Focusing
View GitHub Profile
@hmenn
hmenn / encodeChanger.sh
Created January 23, 2017 15:07
This script writed to change encoding type of subtitle files. You can change PATTERN and use with other files. Script takes to parameter. First source encoding type, Second target encoding type
#!/bin/bash
#FROM=ISO-8859-9
#TO=UTF-8
FROM=$1
TO=$2
ICONV="iconv -f $FROM -t $TO"
PATTERN="\.\/[a-zA-Z0-9\.\-\_\ ]*\.srt"
OUTPUT_DIR="./hmenn_OUTPUT/"
@hmenn
hmenn / android-studio.desktop
Last active May 10, 2023 12:27
android studio desktop shortcut file
[Desktop Entry]
Encoding=UTF-8
Version=2.2.3
Type=Application
Terminal=false
Exec="/opt/android-studio/bin/studio.sh"
Name=Android Studio
Comment=Android Studio
Categories=Programming;
Icon=/opt/android-studio/bin/studio.png
@hmenn
hmenn / LICENCE SUBLIME TEXT
Created January 20, 2017 14:38
Sublime Text 3 Serial key build is 3103
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
B085E65E 2F5F5360 8489D422 FB8FC1AA
93F6323C FD7F7544 3F39C318 D95E6480
FCCC7561 8A4A1741 68FA4223 ADCEDE07
@hmenn
hmenn / getCommonAsTemplate.cpp
Last active January 13, 2020 11:12
this function takes 2 array and sizes, then returns common element of this arrays as a template
/*
* File: main.cpp
* Author: hmenn
*
* Created on 12.1.2017
*/
#include <cstdlib>
#include <iostream>
#include <vector>
@hmenn
hmenn / prolog_useful.pl
Created December 13, 2016 09:42
Prolog useful predicates
%append L1 to L2 appendList(L1,L2,Res)
appendList([],L2,L2).
appendList([H|T],L2,[H|L3]):- appendList(T,L2,L3).
@hmenn
hmenn / mux_4x1.v
Created December 10, 2016 21:27
4 bit MUX with structural verilog
module mux_4x1(output out,input c0,input c1,input c2,input c3,input s1,input s0);
wire s0n,s1n; //s0 not, s1 not
wire w1,w2,w3,w4;
not n1(s0n,s0);
not n1(s1n,s1);
and and1(w1,c0,s1n,s0n);
and and2(w2,c1,s1n,s0);
@hmenn
hmenn / maxSquareMatrix.py
Last active December 12, 2016 23:21
find maximum square matrix with dynamic programming in python
#!usr/bin/python
def printArrayToConsole(arr,startX,startY,endX,endY):
#print(startX,startY,endX,endY)
for i in range(startX,startX+endX):
for j in range(startY,startY+endY):
print(arr[i][j],end="")
print("")
print()
@hmenn
hmenn / calcPoly.py
Created December 4, 2016 13:09
Calculate polynomial equations
#!usr/bin/env
## HASAN MEN - Algorithm HW4 - Q1
import math # math.floor and math.ceil
def calcExpo(expo,x):
"Calculates exponential values like x^2 , x^5"
#print("expo:",expo," floor" ,math.floor(expo/2),"ceil" ,math.ceil(expo/2))
if expo==1:
return x
@hmenn
hmenn / .bashrc
Last active January 22, 2017 22:08
My last bashrc file
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@hmenn
hmenn / findEqualIndexVal.cpp
Last active December 4, 2016 13:51
This algorithm finds element in an ordered array which is i=A[i]
#include <stdlib.h>
#include <stdio.h>
int findEqualIndex(int arr[],int start,int end);
int main(){
int arr[6]={-10,-5,-1,0,4,5};
int arr2[5]={0,2,5,8,7};
int res = findEqualIndex(arr,0,5);