Posts

Showing posts from 2016

Guidelines

Setting up environment for MSDProject
For this we need the following software and tools
JDK 1.8Eclipse Neon or OxygenApache TomcatMYSQLSpring LibrariesApache Commons Libraries
Download and Install the latest JDK [http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html]Setup path variables for JAVA_HOME and make sure JAVA is configured properly [https://www.java.com/en/download/help/path.xml]Download Eclipse Installer from [http://www.eclipse.org/downloads/]Once the installer is open, select "Eclipse IDE for Java EE Developers"Download and Extract TOMCAT for windows [https://www.ntu.edu.sg/home/ehchua/programming/howto/Tomcat_HowTo.html]Setup path variables for TOMCATDownload Spring jar files [http://repo.spring.io/release/org/springframework/spring/4.3.4.RELEASE/spring-framework-4.3.4.RELEASE-dist.zip]Download apache commons logging jar [http://commons.apache.org/proper/commons-logging/download_logging.cgi]Create a Github account [www.github.com]Dow…

Installing TOMCAT

Image
Apache Tomcat Web Server
How to Install and Configure?
I had to use Java Spring framework for one of my projects and I needed to install Apache Tomcat Server to run the code I write. I've followed many tutorials but they were all stuck in the middle. Then I thought of writing a tutorial here to help installing it to anyone who needs the great Apache!

The Skyline Problem

Image
Lab3.2 The Skyline Problem
The skyline problem is defined as given n rectangular buildings in a 2-dimensional city, compute the skyline of these buildings, eliminating hidden lines. The main task is to view buildings from a side and remove all sections that are not visible. All buildings share common bottom and every building can be represented by triplet (Left, Height, Right)

As an example, if the buildings array is
[ [1, 11, 5], [2, 6, 7], [3, 13, 9], [12, 7, 16], [14, 3, 25], [19, 18, 22], [23, 13, 29], [24, 4, 28] ] then the skyline is
[[1, 11], [3, 13], [9, 0], [12, 7], [16, 3], [19, 18], [22, 3], [23, 13], [29, 0]]
copyrights

Finding the Odd Occurrences of a Number

Image
Lab3.1 Finding the Odd Number of Occurrence
You are given a sorted list of numbers where one number appears odd number of times. All other numbers appear even number of times. You are required to design an efficient algorithm to find the number that appears odd number of times. I'm using the Use Divide and Conquer method which runs at $\Theta(\log(n))$

As an example, if the sorted list is
[1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 5, 5, 6, 6] then the odd occurrence number is 2

Reverse a Nested List Recursively

Lab2.2 Reverse a Nested List Recursively
You are expected to write a python program to reverse a list which may have nested lists within it. The number of nesting levels is not limited.

As an example, the reversed list of
[1, 2, [31, 32], 4, [51, [521, 522], 53], 6] will be
[6, [53, [522, 521], 51], 4, [32, 31], 2, 1]

Find Maximum Number in a Nested List Recursively

Lab2.1 Find Maximum in a Nested List Recursively
You are expected write a recursive python function to find the largest number within a given list. The list may contain numbers and strings and, you are expected to ignore the strings. In addition, the list may be a nested list with several nesting levels and you are expected to consider the numbers in all the nesting levels.

DDR3 vs. DDR3L RAM

Image
DDR3 and DDR4 RAM???
Once I was wondering what is the difference between DDR3 RAM and DDR3L RAM. Since there is a newer DDR4 RAM available nowadays, why there's another DDR3 RAM? Later I found out that it was designed to overcome performance issues with motherboards and processors.

I was wondering why all the leading memory manufacturing companies came up with a DDR3L. Basically DDR3 and DDR4 RAM notches are not identical. So you can't fit both RAMs in the same motherboard. But hey what if the current RAM you have is not enough or not fast enough? With current motherboard and processor limitations, the maximum speed a DDR3 RAM can work is 1600 MHz. But a DDR4 RAM can work at a speed starting from 2133 MHz.

Ordinary Differential Equations

Ordinary Differential Equations
A differential equation is an equation with $\frac{d^n}{dx^n}$ terms. Let's start with a simple equation with two variables $x$ and $y$.

$y = ae^x + be^{3x}$

If we differentiate this in $x$, a first order differential equation comes as

$\frac{dy}{dx} = ae^x + 3be^{3x}$

If we differentiate it once more in terms of $x$, a second order differential equation is produced as

$\frac{d^2y}{dx^2} = ae^x + 9be^{3x}$

By solving there three equations, we can get an equation without those constant terms $a$ and $b$ and that is called an ordinary differential equation.

Using Pololu - QTR-8RC Reflectance Sensor Array

Image
Pololu - QTR-8RC Reflectance Sensor Array
In line following a sensor array is an essential part in the robot. I have used the QTR-8RC array and it works like a charm. With Arduino libraries it is easy to configure them but with PIC micro-controllers you have to handle the hardware configuration part manually.

Big O Notation

What is Big O???
Big O notation is a technique used to describe the complexity of an algorithm. It is very useful when evaluating performance wise of different algorithms doing the same task. In this post, I'm not going deep into the programming side but let's take a code snippet as an example.

In this code, we are trying to add up all the natural numbers up to 100. There are two algorithms doing the same job but they perform differently.
#***********************## Method 1n=100sum=0foriinrange(0,n+1):sum=sum+int(i)printsum#***********************## Method 2printstr(n*(n+1)/2)#***********************#

Taylor Series

What is Taylor Series???
Taylor Series in simple terms, is a way of finding the value of a function at any point. To calculate and formulate the answer, all we need is the function value at a single point and the values of all its derivatives at that point. The general expression for Taylor Series is expressed as follows.
$$f(x) = \sum_{k = 0}^{\infty}\frac{1}{k!}(x - a)^kf^k(a)$$ Note that we need to know what the function values are at $f(a)$, $f'(a)$, $f''(a)$, ...