Monday, December 14, 2015

How to install Apache server on Ubuntu 15.04

Hello, everybody today I am gonna show the procedure to  install apache server on ubuntu 15.04.
so lets get started.

step - o1:

Open terminal and type  sudo apt-get install apache2 

step - 02:

after completing installation type sudo /etc/init.d/apache2 start for start server.
Here is some useful apache command

sudo /etc/init.d/apache2 start   #start apache
sudo /etc/init.d/apache2 stop   #stop apache
sudo /etc/init.d/apache2 restart   #restart apache

# prevent auto-start when booting up
sudo update-rc.d -f apache2 remove

step - 03:

Open your browser and type localhost then you should see a page like this.

the default server directory is /var/www/html  inside this folder you can place you html files, But if you want to change the default root directory then follow few more steps with me.

step - Changing default root directory :

open a new terminal and paste this sudo gedit /etc/apache2/sites-available/000-default.conf  then it open a file in gedit find the line DocumentRoot /var/www/html and replace it with DocumentRoot /home/your_username/public_html here /.../public_html is  custom folder directory you are free to give any directory but at first make sure you created the directory before doing this. 

here is my public_html tree.

and your are done ! open browser and type your file url (use your own) http://localhost/jolly-jumper/index.html then you should see the result.

Thanks,hope I helped you someway, feel free to comments.

Wednesday, December 9, 2015

Jolly Jumper

Jolly Jumper (version - 1.0.0) is infinite jumping style game, highly inspired by Doodle jump.
This game is made in Phaserjs and it also open-sourced you can fork it here jolly-jumper
Supported Browser - Opera 33.0, Chrome - Version 47.0.2526.73, Firefox Version - 40.0.2.
Its my very first approach to be an indie game developer, hope you enjoyed this game.

Saturday, November 14, 2015

ACM-ICPC Dhaka - 2015 Onsite Contest

With Coach and Team Members
We have successfully participated ACM-ICPC contest though it was our first contest we have solved two problems. it was a great event for me I will never forget it. our team formation was, coach Md Safaet Hossain other team members are Reduan Rafi, Rayhan Shihab and me. So its just a 
beginning we are getting prepare for the next SUST contest.

Saturday, November 7, 2015

Wednesday, November 4, 2015

Sunday, November 1, 2015

Participating My First ACM-ICPC Onsite Contest !!

At last my dream comes true :),when I got started programming I have always dream to at least one time I have to participate ACM contest, so its really a memorable day in my life. My team (CU_Dot ZeRo) solved 3 problem in preliminary contest and we are going to participate the onsite contest, we hope we do better.

Friday, October 2, 2015

Basic Math for Game Developers- (How to find the nearest object to point) -- Part 01

Hello devs today I going to explain some very basic math for game developers. So lets get started at first we view a very basic game scenario .

Here is a player P and enemy e1 and e2  we have to determine the which enemy is closer to the player respect to the origin and y. So that we have to do some basic math and it’s the famous Pythagorean formula, a quick review - The sum of the areas of the two squares on the legs (a and b) equals the area of the square on the hypotenuse (c).  a^2+b^2 = c^2.

So what we have we the coordinates of e1(x,y) and e2(x,y), we draw triangle with these coordinates respect to the player like this.

We have to find out the hypotenuse (? marked) assume that the hypotenuse for e2 is H1 and for e2 is H2. Now according to the Pythagorean formula,

H1^2 =  x1^2 +  y1^2 ;
H1 = sqrt (x1^2 +  y1^2 );
And , H2 = sqrt (x2^2 +  y2^2 );

Lest have some simple calculation assume that x1=4, y1=5 and x2=3, y2=4.
So H1 =  sqrt(41) = 6 (absolute value)  and H2 = sqrt(25) = 5.

So now we know that H2<H1 that means e2(enemy2) is closer to the player.

But there is a performance issue if you noticed the calculation above, we have sqrt() twice the values.  The sqrt() is very expensive operation just think a game scenario we have players and enemies, they are moving and in our update() function calculating sqrt continuously and as a result our game will be slowing down.
But you can easily efficient the calculation ,

H1^2 =  x1^2 +  y1^2 ;
H2^2 =  x2^2 +  y2^2 ;
Forget about the sqrt we just do the following way,
x1^2 +  y1^2 = 41
x2^2 +  y2^2 = 25
at this moment 25<41,now we have our desired enemy and that’s it.

Thanks for reading.

Wednesday, September 30, 2015