Skip to content

Instantly share code, notes, and snippets.

View MhdSyrwan's full-sized avatar

Muhammad Seyrawan MhdSyrwan

  • Istanbul, Turkey
View GitHub Profile
@MhdSyrwan
MhdSyrwan / RoR_installer.sh
Created March 5, 2012 21:36
RubyOnRails installer
#!/bin/bash
wget https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer
sudo /usr/bin/apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion coffeescript node
chmod +x rvm-installer
./rvm-installer
source ~/.rvm/scripts/rvm
@MhdSyrwan
MhdSyrwan / Bonian_hm.asm
Created May 13, 2012 18:59 — forked from eyadof/Bonian_hm.s
bonian home work
.data
wmsg : .asciiz "welcome \nstudent : Mohmmad Eyad Arnabeh \nNum : 345 \n"
getmsg : .asciiz "Please Enter a statment : \n"
msg0 : .asciiz "your sentence is : "
msg1 : .asciiz "Please Enter a character :\n"
msg2 : .asciiz "your char is :\n"
msg3 : .asciiz "not found \n"
str : .space 256
chr : .space 1
@MhdSyrwan
MhdSyrwan / Connect 4
Created May 21, 2012 18:17 — forked from MhdAljuboori/Connect 4
AI homework
initializeColumn(Column) :-
Column >0,
% create empty table
assert(top(Column, 1)),
Column1 is Column-1,
initializeColumn(Column1).
initializeColumn(0).
% Create Game with Row equal to row and column equal to column
createGame(Row, Column) :-
@MhdSyrwan
MhdSyrwan / s.py
Created May 25, 2012 12:16
Sublime Process Launcher
#!/usr/bin/env python
# The following code is taken from 'Gmate script' of GMATE package
# sublime script
# Original Author: Alexandre da Silva
# This script allows users to use sublime text editor
# without interrupting the current terminal session (opens in a new process)
import gconf
import sys
import urllib
@MhdSyrwan
MhdSyrwan / properties.cpp
Created June 1, 2012 23:49
C++ Properties Test
#include <iostream>
using namespace std;
#define PROPERTY_AUTO(name,type,Name) type name; type get ## Name () { return name; } void set ## Name ( type value ) { this-> name ; }
#define READONLY(name,type,Name) type name; type get ## Name () { return name; }
#define PROPERTY(name,type,Name,block) type name; type get ## Name () { return name; } void set ## Name (type value) { block }
class Person {
var server=require('./server')
server.start();
threshold= 0.5;
learning_rate = 0.1;
weights = [0, 0, 0];
training_set = [[[1, 0, 0], 1], [[1, 0, 1], 1], [[1, 1, 0], 1], [[1, 1, 1], 0]];
P = [1,0,0; 1,0,1; 1,1,0; 1,1,1]';
T = [1,1,1,0];
while true
error_count = 0;
for input_index=1:size(P,1)
@MhdSyrwan
MhdSyrwan / neural_network.rb
Created December 2, 2012 14:53
customized neural network class
# original code is taken from
# https://github.com/SergioFierens
class NeuralNetwork
# creates an empty neural network
# @options
# => structure network structure
# => learning_rate
# => momentum
# => propagation_function
@MhdSyrwan
MhdSyrwan / Image Processing Helper
Created April 14, 2013 12:12
An Image Processing Helper
using System;
namespace System
{
namespace Drawing
{
public static class Processing
{
public static void Process (this Bitmap img, Func<int,int,Color,Color> action)
{
#!ruby
#encoding: utf-8
require 'csv'
col_data = []
CSV.foreach './posts-new.csv' do |row|
col_data << row[0] # getting the first one
end