Navid Malekghaini's Personal Blog

My personal weblog for sharing and storing some of my activities related to computer science over the internet

Navid Malekghaini's Personal Blog

My personal weblog for sharing and storing some of my activities related to computer science over the internet

Navid Malekghaini's Personal Blog

Navid Malekghaini

Software Engineer @ Intelligent Cloud Infrastructure Laboratory
Prev. ML Researcher @ University of Waterloo x Orange Telecom

University of Waterloo
Department of computer science
200 University Ave W, Waterloo, ON N2L 3G1, Canada
cs.uwaterloo.ca

contact me
navidmalekedu (AT) gmail (DOT) com [ Primary Email ]
nmalekgh (AT) uwaterloo (DOT) ca

Some good notes on indexing i've found in slideshare...

"MySQL users commonly ask: Here's my table, what indexes do I need? Why aren't"



موافقین ۰ مخالفین ۰ 19 February 19 ، 23:41

This is a very straight forward program for someone who wants to learn bash in a matter of hours and also in a efficient way.

the Guide consists of two main steps:

✔ Getting familiar with bash script
✔ Implement a simple bash script program

Motivation (summary) :


Well according to RFC959 FTP does not support search meaning you
have to find your desired files all by yourself.
As a computer programmer this is awful for us, so we have decided
to implement a simple bash script program that is simply FTP
client with search!


YOUR SCRIPT = FTP IN TERMINAL + SEARCH SUPPORT

DOWNLOAD FULL DESCRIPTION HERE

My Approach:

i believe this is the easiest way!
There are ways that you can go on to be able to search in FTP as a file, therefore you must first make a shadow of FTP in your linux native filesystem. I will use curlftpfs inorder to mount the FTP in my /mnt/FTPSearch ( I will simply mount the FTP on my own machine )



Download the Full Implemention From Github With Explanations

موافقین ۰ مخالفین ۰ 29 January 19 ، 12:02

The main project that me and my colleague designed for Operating Systems course ( Spring 2018 ) - TA of OS

Project Description ( summary ):

The goal of this project is to gather information about incoming and outgoing packets in system. ( some kind of packet capturing )

The desired informations are :

  • Lenght of packet
  • Protocols of packet ( in all available layers of network except application layer, for example Ethernet,IP,TCP )
  • Hash value of packet
  • Total Processing time of packet


Phase one :

  1. implement a systemcall with a single integer input indicating what information you desire from packets and single output buffer to copy the data from kernel space to user space.
  2. an interactive user space program that talks to the user and systemcall call above ( clean input and output for user ).

    Phase two :
    1. implement a kernel module with a single proc entry file for input indicating what information you desire from packets and single proc entry file for output and to copy the data from kernel space to user space.
    2. an interactive user space program that talks to the user and kernel module and proc entry files above ( clean input and output for user ).

    Phase three :

    Performance comparsion of kernel module and system call ( the first two phases ).


    DOWNLOAD PROJECT DESCRIPTIONS IN DETAIL

    Approach Taken for answer:

    All of the desired informations are in sk_buff data structure.
    my approach was to clone sk_buff from driver, right before the driver ( here : e1000 ) wants to pass the packet to the next network layer handler ( application or the NIC ). with this approach i will have a clone for each packet.
    now that i have the information the rest is easy, just copy the desired information from the sk_buff to the output buffer and copy from there to user space.




    note: for the LKM you should use extern and export symbol.



    the idea for this approach was from here



    DOWNLOAD THE IMPLEMENTATION OF THIS APPROACH WITH DOCUMENTATION IN PERSIAN FROM STUDENTS ( WITH MY HELP )


    Second approach:

    second approach i believe is based on this idea from IBM.

    Download the Implementation of Second Approach From a Student With Document

موافقین ۰ مخالفین ۰ 27 January 19 ، 02:14

This is a very straight forward guide for someone who wants to get started with linux in a matter of hours.

the Guide consists of three main steps:

  • gathering some basic knowledge
  • gathering some system knowledge
  • gathering some command-line knowledge

------------------------------

Download the Guide here


Download Sample Answer From Students ( there are some mistakes )

موافقین ۰ مخالفین ۰ 26 January 19 ، 22:48

These are the materials for my mini mini DB project course.

My colleague for this project is Reza Rahimi.

the proposal :
http://cdn.persiangig.com/preview/caeR5C3wrE/proposal.pdf

the logical design (table designs):
http://cdn.persiangig.com/preview/nsDrN3R4M9/tables.pdf

unfortunataly we have done this project on my colleagues laptop which broke after the project, so these files are not complete but yet they are better than nothing.

the SQL commands:
http://cdn.persiangig.com/preview/c4W0elqro6/DB_project_sql.sql

the project application (mini backend and mini frontend with database conncetion in python and tkinter):

http://cdn.persiangig.com/preview/itFtDlTow1/DB_project.py



ERD :

موافقین ۰ مخالفین ۰ 14 September 18 ، 05:08

Here are the slides for my lecture at Theory of Management class, from School of Management and Economics, Sharif University of Technology.

One of the best managerial cases i've ever seen, showing how hyundai started from Assimilation of assembly operations till becoming independent.

the table of contents and important topics:

  • Organizational Learning and Innovation
  • Catching-up process
  • Organizational Learning
  • Absorptive Capacity
  • Knowledge and Learning
  • Crisis Construction
  • Organizational Learning in Catching-up
  • at Hyundai
  • Questions
  • Lessons Learned

موافقین ۰ مخالفین ۰ 13 April 18 ، 12:54

 

In this project i have implemented a full website.

the code was written in 12 days so don't expect a fully secured website with clean coding :D

 

Click for quick tour of website (running on localhost and one machine)


Here are the screens:

 

Core features of website:

  • User
    • User signup and login (checking inputs on client side)
    • User profile view
      • see info and profile pic
    • User profile edit
      • upload files ( profile picture) and data
  • Game
    • playing two players offline
    • playing logged in
      • playing with bot (computer in client side) and earn points 
      • playing online with other users and learn more points
  • Leaderboards
    • top 15 and your rank
      • ranking globally 
      • ranking locally
  • other
    • playing background music
    • supporting browser history
    • using iframe in about panel

UI design:

  • Reactjs framework
    • libraries
      • redux
        • with devtools middleware for browser
      • redux thunk
      • bootstrap ( for responsive design)
      • react-router

Backend:

  • nodejs
    • Expressjs framework
    • Parseplatform opensource
      • query
      • login and signup
      • live query
      • cloud code
      • files (upload and download)

Testing:

  • deploying on seperate machines is more efficient soloution
    • reactjs on one machine
    • nodejs on another machine
  • you can test website on localhost locally with one machine and multple clients ( multiple browsers)
  • can be deployed on local network and test with multiple clients and machines

 

Contributers:

  • navid malek

Code Implemention:

https://github.com/navidpadid/web96RMN/tree/master/Project

 

 

موافقین ۰ مخالفین ۰ 12 April 18 ، 07:27

the goal for this work is getting started with react framework.

implemention of the previous work (fake Firebase) in react framework.

the code is here:

https://github.com/navidpadid/web96RMN/tree/master/hw2

for running the project :

If you want to run it locally, here are the steps to follow:

  1. make sure you have latest  version of node.js installed 
  2. type these commands in the project directory on your computer:
npm install
npm start
موافقین ۰ مخالفین ۰ 12 April 18 ، 06:36

This is clone from Googles Firebase, done purly in HTML and CSS without anything else ( even Javascript).

The goal was to :

  • improve pure HTML CSS capabilities (without frameworks and libraries like bootstrap) 
  • Responsive Design from scratch 
  • Improve inspect element capabilities
  • Read leading website developers UI code (here Google)

Codes:
https://github.com/navidpadid/web96RMN/tree/master/hw1_final

Contributors:
navid malek
reza rahimi

 

 

the Real website:

 

 

 

The Fake:

 

موافقین ۰ مخالفین ۰ 12 April 18 ، 00:37

One of the best refrences in plain english for socket programming in C language.

Download the refrence here
 

موافقین ۰ مخالفین ۰ 12 October 17 ، 03:42

One of the best websites to learn shell scripting, fast, free and up to date.

https://www.shellscript.sh/

 

موافقین ۰ مخالفین ۰ 05 October 17 ، 16:42

Hi, previous semester i was teaching assistant for Computer Architecture, in both Sharif University of Technology and International Campus, the course lecturer was Prof. Hamid Sarbarzi-Azad, one of the best professors in university in hardware field.
 

As a TA, In this course we (TA team) had designed a project for students.

The project is about implemention of a fictional CPU named: azad's fictional cpu

DOWNLOAD PROJECT HERE

Major features of CPU:

  • Pipelined in 5 stages
  • data hazard handling has bonus grade
  • Memory is implemented by TA team to test your CPU (implemented in verilog language)
  • for Control Unit both counter implemention (shematic) or State machine is accepted

Supported Operations:

  • arithmetic and logical
  • immidiate data
  • mov and swap
  • memory access
  • branch

Unfortunately the language of project is persian

DOWNLOAD PROJECT HERE

موافقین ۰ مخالفین ۰ 05 October 17 ، 10:46

Hi, in this post i will upload a pdf file which i have written as a guide to verilog programming.

Note that this guide is useful for a person who has some experience with verilog and wants to remember important functions and techniques in verilog in order to write verilog programs for FPGA and other hardwares.
all of contents include examples.


List of contents:

  • variables
  • concat and replicate
  • operators
  • module and test bench (with examples)
  • port binding
  • blocking and non-blocking assignment
  • clock generate
  • initial and always block (parallel blocks)
  • combinational logic design
  • reduction operators
  • state machines
     

DOWNLOAD FULL VERSION IN PDF FORMAT HERE

DEMO:

============================
VERILOG GUIDE
by NAVID MALEK
nmalek@ce.sharif.edu
============================
 
 
variables in verilog:
-reg (can have vector identity)
-integer
-real
-time,realtime
 
assignment: beceause they are not wires, they should be assigned only in sequential blocks(always,initial,task,funcion)
read: can be read anywhere (i.e. a driver for a wire)
 
--------------------------------------------------------------------------
variables and wires default is X
--------------------------------------------------------------------------
integer : 32bit int-default is X
real : 64bit floating point-default is 0.0
ONLY used in test bench
--------------------------------------------------------------------------
time variable:
time my_time;
my_time =$time;// get current time of simulation
-------------------------------------------------
vector:
e.g. 
reg [3:0]A = 3'b 1001;
array:
e.g.
reg A[3:0] = 3'b 1001;
------------------------------------------------------------
multi-dementional wire and reg:
e.g. 
reg [7:0] var [1:10][1:100];
reg [7:0] mem [1023:0];
--------------------------------------------------
a value is considered as X if all bits are 0 and X or 0 and Z or 0 and x and z
 
موافقین ۰ مخالفین ۰ 03 October 17 ، 04:11

Part 2.3

Implementation of desired kernel module and user program


Download full tutorial from here

Implement the module

?Now What will this module do and how
.tops_init is the first routin that will be runned , the module is well commented so just read the comments to see what happens
 

Implement user program

Just do the writing and reading from file automatically!

 

Download full tutorial from here

موافقین ۰ مخالفین ۰ 29 September 17 ، 08:38