Archive for 2012

Arduino + Ethernet : Web Server

Sunday, October 14, 2012 · Posted in

How to get the WebServer example to work? This is as simple as it gets.

In my case I am using:
Arduino Uno R3
Ethernet Shield (DFRobot)
Operating System : Windows 7
LAN cable (RJ45) and switch

Setup
1. Attach the Arduino Ethernet Sield to the Arduino Uno
2. Connect and power on the Arduino to the PC with the USB
3. Connect the Ethernet board with an LAN cable (RJ45) to the switch (same switch where your PC is connected to).
4. Sensors are optional.


Code
1. Open the Arduino software (Arduino IDE)
2. Go to File > Examples > Ethernet > WebServer
3. Edit or change the ipaddress. The predefined ip 192,168,1,177
  3.1. To change this. Open your command prompt. (Open Run. Type in cmd. Press OK)
  3.2. In command prompt. Type ipconfig. And press enter.
  3.3. Search for your PC IP address. Since the the shield is using IPv4 format. search for IPv4 Address in the command prompt.
  3.4. Change the IP in the example code with the IP you have found.
Although, the last quartet should be slightly different number between 0-254.
example : If your IP is 10.113.18.207, change it to 10.113.18.220. 220 can be change to any number in the range of 0-254. This slightly different IP is the address of the Ethernet Shield.
4. Compile the sketch, there should be no problem. If you have problem resolve it before moving forward
5. Upload the sketch


Testing
1. Open up your internet browser (example : mozilla, chrome)
2. Type in the IP address of the Ethernet Shield in the URL bar.
3. If the page/server is unavailable. You have to change the IP in your Arduino code. Try a different IP address where only differ in the last part (Step : Code 3.4.). This happen when the IP used is already occupied. Thus you have to keep trying until
4. Repeat step 2 and 3, until you able to connect to the your Arduino Server.

The output of the code, which you can see in your browser will be something like this :
analog input 0 is 543
analog input 1 is 423
analog input 2 is 351
analog input 3 is 318
analog input 4 is 276
analog input 5 is 283


Leave a thank you comment if this helps :)

Arduino and C#

Monday, July 9, 2012 · Posted in



Tools : Visual Studio 2010
System : Windows
Language : C#




The LED positive(+) pin connected to pin 13 and the LED negative(-) pin connected to the GND (Ground).

I havent have the time to write the full tutorial yet, but you can make use of the source code available below.

Download the C# and Arduino file, here.

Leave a thank you comment if this helps :)



Update :
17 August 2013 : Thank you for the all thank you comments!

Computer Science Unplugged

Sunday, March 11, 2012 · Posted in

This short course of 12 parts videos could really help to make you understand the basics in computing or in computer science, it does for me. Although the target audience is children, I believe the information delivered in this series is unknown for even college students. I benefited from these series of videos greatly.

PART 1
Title : Computer Science Unplugged: The show. Part 1: Introduction

PART 2
Title : Unplugged: The show. Part 2: Binary - Counting


PART 3
Title : Unplugged: The show. Part 3: Binary numbers - Email


PART 4
Title : Unplugged: The show. Part 4: Binary numbers: other representations


PART 5
Title : Unplugged: The show. Part 5: Image compression - run-length coding


PART 6
Title : Unplugged: The show. Part 6: HCI - The Stroop effect


PART 7
Title : Unplugged: The show. Part 7: Sorting networks


PART 8
Title : Unplugged: The show. Part 8: Cryptographic protocols


PART 9
Title : Unplugged: The show. Part 9: Public key encryption


PART 10
Title : Unplugged: The show. Part 10: Binary search - divide and conquer


PART 11
Title : Unplugged: The show. Part 11: Parity - Error detection


PART 12
Title : Unplugged: The show. Part 12: Summary and credits



Leave a thank you comment if this helps :)

Professional PHP Programming (Wrox Press)

Thursday, March 1, 2012 · Posted in




Title : Professional PHP Programming
Publishers : Wrox Press
Authors : Jesus Castagnetto, Harish Rawat, Sascha Schumann, Chris Scollo, Deepak Veliath
ISBN : 1861002963 (1-861002-96-3)


This is a very good book, it's easy enough for me. This book was introduce by one of my lecturer Encik Marhakim, in web programming class during my diploma study. (I just have to credit him for being a great lecturer).

This book covers middle-tier programming with PHP.

PHP is a server-side, HTML-embedded scripting language. It is an open source technology, rapidly gaining popularity as a scripting language for people running dynamic websites. One of its major attractions over Perl, javascript and other scripting languages is that PHP has a built-in database integration layer and seamless IP connectivity, with LDAP and TCP as well as the IMAP mail interface.

Features
  • Real world, practical experience and techniques
  • From installation and configuration of the PHP engine to advanced dynamic application design
  • Definitive coverage of core PHP language and database addressing
  • MySQL is covered in depth.
  • Practical e-commerce and business scripting including database application development, together with PHP and XML applications.
  • LDAP connectivity addressed.

Links : amazon

Leave a thank you comment if this helps :)

Matrix Chain Multiplication

Sunday, January 29, 2012 · Posted in

Subject : TCS3211 Algorithm Analysis

Coded in : C++
File : Matrix05.cpp | download Matrix05.cpp

Pseudo code :
Pseudo code for finding the minimum cost
Pseudo code for Optimal Parentheses

Screenshot :


Sample table :


Download cpp file : download Matrix05.cpp

reference sources :
(1) http://www.cs.unm.edu/~saia/362-s08/lec/lec7-2x2.pdf
(2) http://www.cs.cmu.edu/afs/cs/academic/class/15451-s04/www/Lectures/CRLS-DynamicProg.pdf

Leave a thank you comment if this helps :)

Process Scheduling Algorithm

Tuesday, January 3, 2012 · Posted in

subject : Operating System (TOS2111)



Here I will discussed only discuss a bit on Process Scheduling Algorithm. I will discuss two types of algorithms that is, Non Preemptive Shortest Job First and Priority Based Pre-emptive Shortest Job First. There are also two animation, in hope will help you to understand the two algorithm better.

------------------------------------------------------------------
First are brief explanation on some terms.
------------------------------------------------------------------
Process Scheduling Algorithm
Is the process of decision making, to select among processes that are ready to be execute, and allocates the CPU to the process.

Shortest Job First (Algorithm)
Shortest Job First or SJF is one of the process scheduling algorithm, which select process based on their burst time. Process (that had arrived at that moment) with the lowest or shortest burstime is allocated to the CPU to be process. If a process having the same burst time, process will be selected by arrival time.

Preemptive
By definition preemptive is, the power to prevent or deter an anticipated situation or occurences. In this case preemptive means, a process can stop another process during its execution. Where Non-preemptive is where a process is executed, it will not stop until it is done.

Priority
By definition priority is, status established in order of importance or urgency.



------------------------------------------------------------------
Non Preemptive Shortest Job First (Algorithm)
------------------------------------------------------------------

Process are selected based on :
1. Process with the shortest or lowest burst time.
and Processes cant be stop when it is executed (Non Preemptive)

[View Animation] [Download Animation]


------------------------------------------------------------------
Priority Based Pre-emptive Shortest Job First (Algorithm)
------------------------------------------------------------------

Process are selected based on :
1. Process with highest priority (1 is the highest priority)
2. Process with shortest or lowest burst time
and process may stop if a higher process fit the 1 and 2 criteria.

[View Animation] [Download Animation]



Animations are free to use, but all copyright and credit goes to the author. Thanks, hope it helps.




Leave a thank you comment if this helps :)

Powered by Blogger.