Programing লেবেলটি সহ পোস্টগুলি দেখানো হচ্ছে৷ সকল পোস্ট দেখান
Programing লেবেলটি সহ পোস্টগুলি দেখানো হচ্ছে৷ সকল পোস্ট দেখান

Tips for Beginners: Programming Tips

১১/১৫/২০১১ ০১:২৭:০০ AM | , | 0 comments »

Programming Tip for you fresh noobs out there. Only programmers will benefit from this random blurb post:

1.) Outline and sketch everything out first. With a good plan you can start working.

2.) If you are repeating the same code over and over, make a function. Replace the numbers that you change each time with a single variable. Then you can run the function name(variable). Saves typing.

3.) If you have an alphabetical list of data, do not show a numbered page list.

4.) If you have a numerical list of data, do not use alphabetical page lists.

5.) If you are looking at alphabetical results, and you want geographical results, make that a variable so you can switch between the two.

6.) Make your sort order a variable so you can sort descending or ascending order.

7.) Make comments so you know what you were thinking when you programmed that code at 3am last night.

8.) Make successive backups of your code so you can go back -- if you realize later you made a critical low-level error that requires a rewrite. Backup only your modified files or use an appended RAR archive file.

9.) Take a break. Relax! Do something else.

Creating IM Bot

৮/২৮/২০১১ ০৫:৩৮:০০ PM | | 0 comments »

This quick tutorial will show you how to develop your own functional IM bot that works with Google Talk, Yahoo! Messenger, Windows Live and all other popular instant messaging clients.
To get started, all you need to know are some very basic programming skills (any language would do) and web space to host your “bot”.
For this example, I have created a dummy bot called “insecure” that listens to your IM messages. To see this live, add insecure@bot.im to your GTalk buddy list and start chatting.

IM Bot

If you like to write a personal IM bot, just follow these simple steps:-
Step 1: Go to www.imified.com and register a new account with a bot.
Step 2: Now it’s time to create a bot which is actually a simple script that resides on your public web server.
It could be in PHP, Perl, Python or any other language.
Example Hello World bot:
The example below illustrates just how easy it is to create a bot.
This example is coded in PHP.
<?php
switch ($_REQUEST['step']) {
case 1:
echo "Hi, what's your name?";
break;
case 2:
echo "Hi " . $_REQUEST['value1'] . ", where do you live?";
break;
case 3:
echo "Well, welcome to this hello world bot, " . $_REQUEST['value1'] . "<br>from " . $_REQUEST['value2'] . ".<reset>";
break;
}
?>
Step 3: Once your script is ready, put it somewhere on your web server and copy the full URL to the clipboard.
Step 4: Now login to your imified account, paste the script URL

Screen Name: insecure@bot.im
Bot Script URL: http://www.insecure.in/imbot.php

Step 5: Add that im bot your friends list. That’s it.
This is a very basic bot but the possibilities are endless.
For instance, you could write a bot that will send an email to all your close friends via a simple IM message. Or you could write one that will does currency conversion.