Archive

Archive for the ‘Computer Techie’ Category

Image capture using Webcam in Matlab

March 23, 2007 256 comments

Have you ever wanted to process your image and then do some processing and then move your robot?

well this can be easily done through MATLAB. Get Matlab 7.You must check if you have the data acquisition toolbox in your version. that you have installed.

TO FIND IF YOU HAVE DATA ACQUISITION

Just get to the Matlab Start menu

That shows that the toolbox exixts.

Want more?
Type “imaqhinfo” in command window to see this

Notice that the adaptor is ‘Winvideo’

Any webcam you connect is accessed through this adaptor. Now the main part
1)Connect your webcam to the computer through the USB.
vid = videoinput(‘winvideo’, 1, ‘RGB24_320x240′);

Specify the adaptor name and resolution

2) Open Preview window to view video at runtime
preview(vid);

This will open a window similar to yahoo messenger Webcam interface. And you will be able to view the video demo the webcam at runtime

3) Capture
data = getsnapshot(vid);

This command will store the image of that instant into the variable data in a matrix of 320X240.

That’s it , now that you have the image of what your robot is looking at or probably the desired object, you may carry on processing and provide proper control signals to your Parallel Ports . If You are new to parallel ports read here.

comment your thoughts, don’t keep them to yourself!!!

Madan – Your host :)

Categories: Computer Techie

C Program based Airtel Tune

March 13, 2007 5 comments

This program gives you a C code. Once you compile it and run you will hear the airtel tune coming out of your computer’s inbuilt speaker. i wonder, its so sweet.

NOTE:The code is long so click “Read the rest of the post and catch the full code”

#include<dos.h>
#include<stdio.h>
float main(void)
{
float A,Bb,D,G,F;
A = 440;
G = 780;
Bb = 461;
D = 586;
F = 687;
sound(G);
delay(500);
nosound();
sound(G);

Read more…

Categories: Computer Techie

SPOT UR PLACE!!! Anywhere in the world!!

August 17, 2006 3 comments

Just came across a classic website, that made me roam around the world thru satelite.Yeah.. i got my place marked there! you can also spot ur place in your city.

my place is here

http://wikimapia.org/#y=13103571&x=80200136&z=18&l=0&m=a

The site consist of pictorial info on all over the world places taken from the satellite.and they are organised and managed using javascript programs – am sure this s a splendid job.The main features on this site is that u can mark ur place using the tools available in the menu at the top right.u can also search places if they are marked by somebody else before.

The other features are the zoom level, that can be adjusted for our convenience and the scale at the bottom that differs according to the places we drag on the page.All these works are done using java scripting.

Now link to www.wikimapia.org and have fun!

-Praveen

SMS GATEWAY!!

July 8, 2006 4 comments

My mobile used to warn me for ” No space for new messages” often , as i used get many forwarded messages very often from my friend!.Wondering about the traffic in my single mobile ,I started comparing it with the companies conducting sms contests!.Definitely they would end up with a crash,I thought.But that was not true,with the Sms Gateways , provided for this purpose.

SMS GATEWAY

sms gateway

A technology that routes all the messages to thier destination, making sure that none go missing on the way – sms gateway!.This technology helps to effectively manage large number of messages in the network.

How Does This Work?

A SMS Gateway routes all the incoming messages from various mobile phone operators to the client’s server.It can also send bulk SMSs to many mobile numbers from the server.All these works are one by a customised software program.This technology is use by many number of businesses to manage thier business and generate revenue.

The SMSC(Short Message Service Centre)is used by the mobile operators for peer to peer messaging.When a user sends a message , it is first recieved by the SMSC that is located on the mobile operator’s location and then sent to the desired number.

On the other hand, An SMS Gateway acts as a open interface between various mobile operators and the client’s application.When a person wants to participate in a sms contest, he sends a message to the desired number , which is first recieved by the SMSC and then the message reaches the SMS Gateway at the service provider’s end.The service provider then routes all the messages through its gateway to the company’s application.This could be an FTP.HTTP,or SMPP protocol.The server automatically responds to the queries and no manual intervention is needed.The server actually transfers the SMS protocol to Html format , which is then send to the web server or companies sms application.Finally they use the same technolegy to inform u about the results!

So, with this gateway 3 sms based solutions are possible,

Outbound campaign
- sends bulk sms to all costemers in the database of the company.

Inbound campaigns - allows companies to recieve messages from subscribers.

SMS solutions for business processes - They also helps the companies in various business processes like marketing, database updates, virus alerts etc by integrating with the back-end applications like intranet, database, ERP solutions etc

This is the latest technolgy , fetching more revenue for SMS based businesses.

- Praveen

Difference on the web!!

July 6, 2006 3 comments

Static Sites vs Dynamic Pages

Many people who are unfamiliar with web content management systems wonder what the benefits of such a system over traditional static HTML and server page languages like ASP, JSP, and PHP. Well lemme explain that first!

A website is collection of documents written in the HTML language. When a user looks at a website with a browser , the browser is able to follow the instructions presented to it in HTML to make a website look a certain way. Click Here to open a new browser window which will show you an average website. If you were to look at the HTML code for this site, you would see the following:

<html>
<title>An html Website</title>
<body bgcolor="#003399" text="#ffcc33">
<h1>An html Website</h1>
<p>This is an average website.
this html page will show same content forever.
</html>

The above HTML code for “the html website” is static. That is, if the user were to reload a static website, they would see the exact same content every time. Its content was written directly by an author, and when the user goes to the site, that code is downloaded into a browser and interpreted.

In contrast to a static website, a dynamic website is one whose content is regenerated every time a user visits or reloads the site. Click Here to open a new browser window to a dynamic page( here i hav used PHP code) which tells the time at the particular second that it was accessed. If you click on the “Reload” button several times, you should notice that the time will change.

If u try to get the code of this page from the html source you will get the following:

<html>
<title>Today's Date & Time:</title>
<h1>Today's Date & Time:</h1>
<p>Wednesday 05th of July 2006 11:30:36 AM
the time will change when the page is refreshed. try it!!
</html>

But the actual code was:

<html>
<h3>The Date & Time: </h3>
  <? echo (date ("l dS of F Y h:i:s A")); ?>
<p>the time will change when the page is refreshed. try it!!
</html>

This is the difference between a static page and a dynamic page! got it!!

In common , the html page is run on ur system as such, but the dynamic pages( server pages) will send the file to the particular server engine from ur system browser and then will be published back on ur browser after processing the dynamic codes.When you create a static web page, you simply write HTML code. Writing a dynamic page with PHP(or any other) is similar, except you embed the PHP(or any other) code inside of the HTML code.

The Server Pages Commonly used in Web management are ASP , PHP , JSP,XSP,perl Cold fusion etc. We will see them in detail now.

ASP vs. PHP vs JSP

Today’s world is flooded with technologies , especially in the web genre, Ofcourse, it’s difficult to keep track of the new (or old for that matter) technologies.But there are two acronym that stand strong in today’s web design vernacular! than any other do.ASP and PHP are different approaches to building dynamic Web sites that can incorporate database interactivity and other application server uses into your Web site.

ASP stands for Active Server Pages and PHP stands for Hypertext Preprocessor.

asp

ASP is a product from the Microsoft and is used with “Internet Information Server” (IIS) which is a program that runs on Microsoft servers. ASP is generally not supported beyond Microsoft servers. However, there are 3rd party applications that can make it compatible with a few other servers. ASP is widely used for large companies Web needs.

php

PHP is a parsing language. The major NT and UNIX Web servers support it and it is widely used with the mySQL database. Small and medium Web developers use it religiously. Independent Web developers as well as a growing number of small and medium sized businesses love PHP.

 

JSP – Java Server Page is an extension to the Java servlet technology pioneered by Sun. Like ASP and PHP it provides a simple programming vehicle for displaying dynamic Web content. JSP is the Sun/Java attempt to compete with Microsoft’s ASP. JSP is not widely used however it has a small core of enthusiasts who are claiming it to be as powerful and dynamic as ASP. These patrons usually fail to even acknowledge the PHP genres existence (probably because PHP is far more popular than JSP).

There are many other too.. for an instance Coldfusion a product from Macromedia.

Why do we need these server pages??

The need for either of these Web development tools is derived from the inability to control the end-users computer(the site visitor’s computer). In other words Web developers don’t have control over what applications their site traffic may or may not have on their user system.For example, whether the client uses MS access or MYSQL. for database? or MS word or Corel word perfect for word processing? ans so.. If your site is going to incorporate a Web page design that will include database, word-processing and other application data, a developer has to know exactly what apps will be used to generate Web content. The best way to control this is to have all content generated on the Server instead of the client.

Sever Side Scripting is the way today’s Web pages are run. Static Web sites (no dynamics) that just have information and no interactivity with server programs are becoming less . It is no longer a huge financial burden to pull off dynamic content. There are many free servers that allow you to write scripts to the server and you can run a full throttle business class site with just a small financial contribution each month using some of the more sophisticated Web hosting packages.

Now the problem is to decide which dynamic program to use for the web design? is it!! Lets see that now.

Designers Choice

ASP is not a straightforward program that can be picked up from scratch easily. However this is typical of a Microsoft application. The major reasons that large companies are running it instead of PHP include the following 3 important factors.

- Microsoft products are all over the globe and it makes their site compatible with a significant number of other big businesses sites. This makes business to business transactions easier because everyone involved is running the same platforms and applications. (this is microsoft’s market bang!!)

- Large companies already have their computers running Microsoft products and their employees are trained in the Microsoft program environment. This keeps training investments down to a minimum and keeps companies from investing in new equipment and software.

- If a large company wants to take over another (an acquisition or merger) or is bought out themselves, the ability to easily integrate systems (databases, document processing, spread sheet and accounting applications) is invaluable and can make a company appear to be a much more attractive prospect to potential benefactors. Therefore keeping your business dressed up in MS clothing can have a certain appeal.

Trying to incorporate existing Microsoft application data into a PHP run Web site would require starting from scratch with a great deal of headaches including purchasing new programs. Therefore some small and medium sized businesses that already are hooked on Microsoft products may opt for ASP as well.

However PHP is the developers tool that has gained the most respect amongst Web gurus. Most describe it as an easy to use and feature packed program that allows you to create dynamic and database driven Web sites effortlessly. It is a free program that is open source so it can be modified to fit developers needs. Most developers who like Linux and mySQL are also fans of PHP. ( Setting up server with PHP and MYSQL is provided in the previous post by madan)

But , there is a rapid growth on the usage of PHP among most independent developers. The reasons behind its rapid growth are:

- It’s easy to learn and the available support for it is through the roof. The Web has always been about individuals banding together to create resources for one another. PHP is loved by the Web community and you will find and abundance of tutorials, tools, Web sites and other online support ready and available to guide you from your Web sites conception to it’s launch.

- More and more host servers are supporting PHP; chances are you can find a good free or cheap host for your site that will allow you to run a dynamic PHP site.

- ASP is supported by Microsoft servers only (unless you use a 3rd party utility that facilitates support); however, PHP is supported by many different “html” servers.

Conclusion !!!!!

Choosing the products for ur page is based on many variables but none more important than preference. No one visiting your site would says that ur page is designed in php or asp , as he never bothers about them. What they will do is evaluate the site’s usefulness based on design and content. Therefore as long as your site follows the good design and also provides the content that the client was looking for any of these dynamic content tools will work just fine, so take your pick.

- Praveen

Microsoft Bot Contest!! “Now Create Robots with Microsoft”

June 27, 2006 1 comment

Well Gates doesn’t want you to make any bot to count his money nor his associates around the world. The contest is to make a bot for MSN messenger. Hey wait did MSN sound to you like an internet messaging service.. yeah you are right. Then what Bot to make??well you’l understand if you do this.


–>Open you msn messenger: all window versions will have one installed.
–> now if you donot have a hotmail id get it registered (you’l need it anyway to comtest) then once you have signid in into MSN messenger with your Id just add these contacts:
samplebot@hotmail.com
secretarybot@hotmail.com
alice@worldofalice.com
cox@mamute.org
recipesfinder@hotmail.com
processbot@hotmail.com
xboxRobot@hotmail.com
santa.robot@hotmail.com
dubyabot@hotmail.com
chat@insidemessenger.com
and talk to them!!!

–>Hi, found them talking stange?? Well don’t get surprised , They are the robots microsoft wants us to make.

I wondered if this was about robots at all ?? do you. (leave a comment about this. A topic to be diuscussed) . Wellthis is a contest that can fetchyou upto 20 laks in INR and $40,000 if you win. Microsoft gives lnk to three robot builders to write up you code. suggestions of the extent to which they would want that robot to work for you to make your winning chance better is all discussed in their webpage. Link upto them here

http://www.robotinvaders.com/main/default.aspx

Try it out. I found that the best part in creating it is to decide your response for various question. I wrote up one to make the user say “sorry” before the bot ever responded to him, he he he… it was FUN. i crated and tested it only on my computer and not on the network. i downloaded the ‘Conversagent™ BuddyScript SDK‘. but will soon download Akonix® L7 Builder™ SDK but its about a 102Mb :( .

You’l have to download the IDE’s and create your bot and set it up in a place which they provide at http://www.improvcenter.com/ and then submit to the contest. Registration essentiually means submiting your dfinished robot.

Try it out . Its open for students an professionals and just about anybody, Who knows you can chill out with some cash at the end of it.

Madan
P.S:-
–>
In case you are contestint pls comment it here so that you can help people who do not know what to do further once they are stuck somewhere!!

–>I personally have nothing with MSN or microsoft but i think this contest is just about a great stategy to get more people sign up with MSN and popularise the IDE’s.Hey don’t get suspicious, do try it.

Setup MySQL : Apache2

Once you have done with php as i explained here you would want to use SQL database through your PHP to mke your programming more sophisticated. Well this post will help you setup your own SQL on your computer. Apache2 , Php , and now MySQL will give you a complete test environmment for your codes on your desktop.

Setting up MySQL is relatively much easier than the other two but then you'l find no reason for installing MySQL not having Apache and PHP . Well in short let me tell yowhat MySQL is. It is just another database system where you can run a database server on your computer (or online) . You can use this databse system to help you store username/passwords , comments, scrapbooks etc. You may store and retrieve data from these tables. You may do it from your PHP page itself presenting to the user a very dynamic page.

INSTALLATION

1) Download : goto http://dev.mysql.com/downloads/mysql/4.1.html and get a Windows 95/98/NT/2000/XP/2003 (x86) binary "Windows Essentials (x86)" version
My file was named : mysql-essential-4.1.20-win32.msi actually there will be too many options , make sure you download the right one .U may see it in the pic below

2) Instal :

Juat run through the options during installation as below

  • Typical Setup
  • Skip Sign-Up
  • make sure "Configure the MySQL Server now" is checked
  • "Detailed Configuration"
  • "Developer Machine"
  • "Multifunctional Database"
  • "InnoDB Tablespace Settings" – leave everything default
  • "Decision Support (DSS)/OLAP"
  • make sure "Enable TCP/IP Networking" is checked and leave the port number at 3306 (at this point, if you have a firewall, it will usually try to access itself on the localhost)
  • "Standard Character Set"
  • check "Install As Windows Service"
  • I recommend leaving "Include Bin Directory in Windows PATH" unchecked
  • enter your root password and I would recommend checking "Root may only connect from localhost" most importantly remember your password!!
  • then hit "execute" and it'll install and set it up.

3) openning and checking it installed :
go: Start –> programs –>MySQL–> MySQL saerver 4.1–>MySQL Command Line Client

You should be able to see his:

just enter your password and then press"enter" which should show you this

Hey good work. job done. This is is , now get to work man. One site that particularly hellped me learn sql propely was 'php-mysql-tutorial.com' i guess you'l also find it usefull.

—-Madan 

P.S :- First get to learn how to manually create, edit ,delete dabases and tables and then step into doing all this using PHP pages.That'l take you through easily.

Setup PHP : Apache2

June 21, 2006 7 comments

I had explained about setting up apache2 server on your own desktop here
Once you had done that the setting up php is just a step away.

Php these days have become the apt programming language for web hobbyists.It includes wnough programing varience to make your page very user interactive. Php pages cannot be run on your normal browsers.Php are a claaof server programs and can be executed only on a web server. So it nessesitates for us to either upload our "Trial.php" pageto a remote server that assists php or make our own computer a server.Resorting to the second option seems most fesible. Well just set itup once you have set up your APACHE2

Let me start with the procedure :

1)Download :

goto —-> http://www.php.net/downloads.php

download this binary —> PHP 5.1.4 zip package [8,919Kb] – 04 May 2006

unzip it on your computer C:\php\ and it'l have lot og DLLS.Dontget worried.There's nothing much to do with any of them.They are all intelligent fellows he he… :)

2) Renaming Rename C:\php\php.ini-dist it to php.ini

3)Edit your php.ini

–>Open php.ini in a text editor.find the term doc_root ( simple 'find' search can take you there) then change it to point to whatever your Apache DocumentRoot is set to. In my case: doc_root = "C:/Program Files/Apache Group/Apache2/htdocs"

NOTE: If you had followed mypost to install APACHE2 then the locations will be the same as i have suggsted.

–>extension_dir = "./" to the location of the ext directory after you unzipped PHP.in my case: extension_dir = "C:\php\ext" (tht's there will be a folder called 'ext' ok!!)

–>Search for: session.save_path and uncomment (remove the ; mark) and change it to session.save_path = "c:/windows/temp"

4)Editing httpd file This is the file in your apache2–>conf folder

Add these three lines to the beggining ot the file

LoadModule php5_module "C:/php/php5apache2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/php"

5)Testing

–>Restart apache2 . If it shows no errors then you are on track.In case it shows errors then run "Test Configuration" and see which line show the error.

–>Open "Notepad" and enter this code

<?php phpinfo(); ?> and save it as try.php in the location "C:/Program Files/Apache Group/Apache2/htdocs"

–> goto your browser and test it "http://localhost/test.php

hey do you see this???

Hurray you have done it. its all set!! startwriting your PHP code. I found this site very good to learn php try it too..

-Madan

P.S:- I had almost installed this thing many times and finally found out the best possible shortcut steps to end up with proper installations .In case of any glitch pls comment and otherwise also!!

Any php you wite must be in the local directory of "HTDOCS" in apache2 folder.Make a folder there and keep it in quicklaunch i do it that way!!

you may add subfolders to view your page as "http://localhost/folder1/folder2/page.php"

Setup APACHE2 – “localhost”

June 18, 2006 7 comments

Well i had developed a curiosity these days on server scripts especially PHP & MySQL. I coded them and essentially had to transfer them to a remote server and test it online. I found this way of testing really long and torturous. There i decided to make a server out of my own computer and setup a "localhost". Apache provides a very handy software to setup your own personal localhost sever. It essentially means that you have made a server out of your computer. Point to note is that it will not work like the orthodox servers that are available on the internet. It will just locally enable you to run your server scripts (scripts that will work only on server and not on your normal computer).

Apache2 gives away a smooth running software to set your localhost.You will understand it better if i say that, once you setup your local host you will see a valid page if you type "http://localhost/" even when your internet connection is off. well and the localhost will point to many directories within its root directory and you can address a file namesd TEST.HTML within the local directory as "http://localhost/test.html" . Well this is it about html which will run on a normal computer imagine it being test.php instead of test.html then the php will not run on your computer before you setup apache.. Once you setup apache then you be able to run the PHP(WIth few more aditional changes beyond just apache) in your computer a s "http://localhost/test.php" !!

HERE IS THE EXACT WAY YOU DO IT
Please download the exat version i suggest to keep all possible mistakes off. I had struggles with various version available on the internet finally to end up finding one perfect method to set it up. i had almost spent a week analysing most available methods to find the best and the easiest way to set it up.

1) INSTALL :

http://httpd.apache.org/download.cgi

Download under the option "Apache HTTP Server 2.0.58 is also available" and download the fourth option

"Win32 Binary (MSI Installer): apache_2.2.2-win32-x86-no_ssl.msi"

2) Install

When you install Apache, you'll get a prompt for "Server Information." Here is the settings I used:

Network Domain: localhost
Server Name: localhost
Admin Email: (your any email)

Recommend checking: "for All Users, on Port 80, as a Service"

Note where it is installng say "C:\Program Files\Apache Group\Apache2"

3) After installing, Apache2 automatically starts. The icon in the System Tray means it started. The icon means the "Monitor Apache Servers" is running, but Apache2 isn't started.

You can easily start/stop/restart Apache and Apache2 via that icon in your System Tray. If you get "The requested operation has failed!" error while starting apache use the "Test Configuration" shortcut in the Start Menu to find the error (if the text window pops up then closes before you can read it, your config file is fine).

4) TESTING
Now the ultimate test. To see if it's serving. Open your browser and head to: http://127.0.0.1/ or http://localhost/

If it shows the Test Page for Apache Installation you have your server software installed and running.

If YOU SEE THIS AS BELOW THEN YOU HAVE SUCCSFULLY SET THINGS UP

Note that this is the index file in the location "C:\Program Files\Apache Group\Apache2\htdocs". Goto this location and change the "index.html"to the one of your wish and see it reflect when you goto "http://localhost/"

5) TIPS
If you create a folder say "TEST" inside the htdoc then you create "server.html" insode that folder then you can access the server.html by the address "http://localhost/TEST/server.html"

I guess you got the whole concept of it and get goint o set up your own server.THe most important utility if setting up a server is to set it up compatible to PHP,CGI,MySQL and other server scripts. I will soon follow about how to set those onto your server. Keep a watch at this space

P.S:- Please not that you still are not configures to run server scripts. I'l teake you through that a bit later. As of noe you can test HTML by addressing like "http://localhost/" or "http://127.0.0.1/"

Next step: Go install PHP 

—- Madan

FTP – The Feel Free Factor!!

June 7, 2006 2 comments

Are you one of those who is crazy about web hosting. Do you search around for free web hosts who give you good services and yet do not charge a penny.Well i can understand, you are already tired searching for a host that balances all odds and evens. guys with more MB and less bandwidth/month hmmm…Few offer good BW and space but jack you with a whole lot of ads… Well in all these odds you might eventually find one that would just about satisfy your ego of havin a site free of cost yet not much ads on it and just enough to promote your small online digital storage over the net!!

Well here i’m not givin or suggestin a web host.Rather I felt most of you might find it so irritating using the web building support that they offer. U would rather build it on your comp and someway transport it to their server…Aha precisely what i’m goin to tell you.

Heard about FTP?? Well its File Transfer Protocol. You do not need to be a genius to know that. Well this post features on my page (robotics) for the very simple fact that I own this site and i’m one of those i refered in the first para of this post!! :)

Well now to start with. Its like this, You make the web page on your comp and then you transfer that file to that server using a FTP program.In that program you just need to give your host address and the password and username. So instead of you going page by page through their ill designed website and slow speed support you can always directly throw in the file into the basket from whereever you are.

Alritght,now that you know what it is i will just explain you 5 steps . Just do that and you will get to know what it is and start using it.

STEP 1: Take up an account with a free provider who supports FTP transfer. To learn I suggest http://www.bravenet.com . Just sign up and get account name. Do confirm mail and then login and select a free domain name from the site.

STEP 2: After you have been given a domain name you will be in this page of theirs.just track the red markings that i have put…

then

here you will see this in the middle of the page

cool now these are three parameters which u needed to know.

STEP 3: now to get the FTP software(3Mb) download smart FTP from http://www.download.com/SmartFTP-Client/3000-2160_4-10543387.html

then install it and enter the three paraemeters in the space given and just Connect. You may see the detailed description of download it and installation in the link below. It will also give you locations to enter the three things that you have got from your servide provider.This is my site and note that though you will register to bravenet your domain will be bravehost okie . Don jus get confused!!!

http://www.siliconvalley.bravehost.com/smartftp.swf

STEP 4: Well this is the best part of the whole lot. Now just drag and drop any file into the place that i have shown . You can create,delete folders/files as you do on a normal comp and it will get updated in their server. NOTE: Do you see the file smartftp.swf. Because i have put it in the folder http://siliconvalley.bravehost.com/ it thus gets the location of the video you all saw. and the index too. Well this way you can jus feel like working on your own hard disk still get things updated on the server.

STEP 5: This is just to disconnect.. just right click the red region in the above picture and select “close” which puts an end to your session with that server. You man open sessions with any number of servers at a time.

Point to note is,every other time you need to update it you just have to delete(one click) and drag a new copy into it. and that saves you from going page by page and doin all these work on the host’s website..

Anybody who has a fair idea about http can undestand this post so clearly.In case you have a prob or basic doubt jus drop in a comment and otherwise also!!! enjoy making your site.

—Madan

Categories: Computer Techie
Follow

Get every new post delivered to your Inbox.