Skip to content

Instantly share code, notes, and snippets.

View mfrazi's full-sized avatar
😼
...

Fahrul Razi mfrazi

😼
...
View GitHub Profile
#include <stdio.h>
#include <string.h>
int main(){
char data[100];
scanf("%s", data);
int Q=0, W=0, E=0, i, awal=0;
for(i=0; i<strlen(data); i++){
//printf("%c %d %d %d %d\n", data[i], Q, W, E, awal);
if(data[i]=='R'){
@mfrazi
mfrazi / K-Means.c
Last active December 16, 2015 01:09
V 0.1
#include <stdio.h>
#include <math.h>
const int data_total=6;
const int max_data=3;
/*double data_training[data_total][max_data]={
{1,1,0,0},
{0,0,0,1},
{1,0,0,0},
{0,0,1,1}
@mfrazi
mfrazi / DEL.py
Last active December 2, 2015 12:54
import os
def DEL(path)
os.remove(path)
# manggil fungsi DEL, cara ngeceknya
DEL("/ini/yang/dihapus.txt")
# Kalau yang di atas itu cuma buat ngapus file, gak bisa folder.
# Jadi nanti di dalam fungsi DEL itu bisa ngapus buat file sama folder.
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#define garis printf("---------------------------------------------------------\n")
#define garis2 printf("|=======================================================|\n")
struct hasil_jarak{
int index;
double jaraknya;
};
import socket, select, sys, os
if __name__ == "__main__":
# list to keep track of socket descriptors
CONNECTION_LIST = []
# list to keep clint id
CLIENT_ID = {}
total_client = 0
@mfrazi
mfrazi / .vimrc
Created September 23, 2015 03:50
vim configuration
" This line should not be removed as it ensures that various options are
" properly set to work with the Vim-related packages available in Debian.
runtime! debian.vim
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin('~/.vim/bundle/Vundle.vim')
@mfrazi
mfrazi / gcd.c
Last active September 23, 2015 08:55
Find GCD (Greatest Common Divisor) of two integer
// Source : http://www.math.wustl.edu/~victor/mfmm/compaa/gcd.c
/* Standard C Function: Greatest Common Divisor */
int
gcd ( int a, int b )
{
int c;
while ( a != 0 ) {
c = a; a = b%a; b = c;
}