See My Simple Image Thumbnailer

June 30, 2007

Last week when I noticed the MYRUET members could not upload proper sized image to their profile page, I prepared a simple image thumbnailer. I donno if it helped them a lot but I noticed few members used it. Here is the demo:

http://www.rupom.com/myruet/

It is very simple one to prepare. It manipulates the would-be scale size using this formula:

——————————————————–

function imageScale($image, $newWidth, $newHeight)
{

if(!$size = @getimagesize($image))
{
die("Unable to get info on image $image");
}

$ratio = ($size[0] / $size[1]);

if($newWidth == -1)
{
$ret[1] = $newHeight;
$ret[0] = round(($newHeight * $ratio));
}
else if($newHeight == -1)
{
$ret[0] = $newWidth;
$ret[1] = round(($newWidth / $ratio));

}
else
{
die("Scale Error");
}

return $ret;
}

—————————————————

Please check the thumbnailer and let me know if some changes can make this more strong.

Best regards.

Rupom


Grand Opening of MYRUET Community Website (Beta Version)

June 24, 2007

Today we (Lemon, Arif & Me) released a beta version of MYRUET (http://www.myruet.com). MYRUET is the community website aimed for all ex and current students of Rajshahi University of Engineering & Technology (RUET), Bangladesh. We released this version as a testing version. Upon members’ feedbacks on testing this website, we will change/modify the interface, functionalities & fix bugs. We would like to receive suggestions from the members who joined and tested.

We were targetting to launch this community website from many months. But everyone was busy with works. Finally we seated together, managed time and after few days’ hard work we got an initial version to release.

MYRUET is available in four domains:

- www.myruet.com
- www.myruet.net
- www.myruet.org
- www.myruet.info

[All domains contain same contents.]

We started thinking about this website one year back and booked the domains later. But it took almost one year to prepare a version. Lemon and Arif did a lot on this website. I enjoyed working with them.

If you are an ex OR current students of RUET, please join MYRUET and start testing to help us improve the usability & quality of this site.

Please feel free to send me your suggestions on the current version.

Best regards.

Rupom


Happy Birthday to Shimul

June 16, 2007

Today, June 16th, is the 2Xth birthday of my friend Shimul. I wish many many returns of this day in his life. May God bless him over the life.

HAPPY BIRTHDAY TO YOU SHIMUL

Happy Birthday to Shimul

Enjoy your day.

Take care.

Rupom


Easy Way to Install FFMPEG with PHP

June 15, 2007

Audio/Video streaming is very popular today. Recently I have worked on such streaming for one of my projects. My server OS is Fedora Core 6. I found a great help to install FFMPEG (with PHP) that I want to share:

http://vexxhost.com/blog/category/ffmpeg/

I followed it line by line and got FFMPEG done. Obviously you will face some problems (depending on your OS and current status of the server). I had to do a few configuration stuffs that my server required during the installation.

I hope you will find the above link as a great help when needed.

Regards.

$Rupom


Gmail Address Book Grabber :: New Update

June 14, 2007

Please check the updated version of my class “Gmail Address Book Grabber”:

http://www.phpclasses.org/browse/package/3170.html

This update is because Gmail changed few display & URL styles in the recent days. I have modified the data parser and a request URL in this change. It’s working now. See demo here:

http://rupom.osclicks.com/demos/grab_gmail/

Please feel free to share your experience with my class.

Enjoy PHPing!

$Rupom


Important Issues in Sending HTML Email

June 14, 2007

If you want your HTML email to put into recipient’s INBOX, you have to follow some rules.
Following are some important issues for sending HTML email:

1. Remove unnecessary HTML tags:

Remove these tags from your mail content:
- DOCTYPE
- <html>, </html>
- META Tag
- HEAD
- BASE
- LINK
- TITLE
- Comments

2. Use table for layout

Because of the very limited support of style sheets in webmail clients, the best and safe way to layout your html e-mail is to use tables.

3. Use Online Image

4. Hide Image Toolbar

5. Use Shortcut URLs:
URLs of email should be short/small.

6. Dont Use Anchors

7. Use Simple Inline Stylesheet

For example:
<td style=”font-family: Verdana, Arial, Helvetica, sans-serif; font-size:
10px;” >Vivamus ut sem. Fusce aliquam nunc vitae purus. </td >

8. Create your design with a white background color

Most webmail and e-mail clients use a white background color to display messages.

<td bgcolor=”#FF0000″>

9. Use the title attribute instead of alt

The alt attribute for images doesn’t work in Gecko-based browsers such as Firefox and Mozilla

10. Use <br /> instead of <p>

11. Don’t use forms

12. Don’t use _JavaScript:
_JavaScript in HTML e-mail is never a good idea because of all the dangerous scripting (for example XSS attacks) that can be executed. For this reason most webmail and e-mail clients disable _JavaScript by removing or ignoring it.

13. Provide a link for display in the browser

14. Keep Your Subject Short and Informative

15. Don’t Use DHTML and Flash

16. Send your e-mail as multipart/alternative

If you send a HTML e-mail to people with a webmail or e-mail client who can’t read HTML e-mail, they will only see the HTML code. If you don’t know what your recipients use, send your e-mail as multipart/alternative. This is the HTML version and the plain text version.

These issues greatly affect the HTML email. Currently I am working on a project where the emails must have to be sent to INBOX. I got success following these issues. I am researching more on that.

Regards,
$Rupom


Browser Detection by PERL

June 14, 2007

I am enjoying PERL a lot. I am seeing everything new in PERL. I want to share interesting and important PERL stuffs through my blog.

Here is a PERL subroutine that detects whether the browser is Firefox or NOT.

sub is_firefox {
my $agent = ‘’;
$agent = $ENV{”HTTP_USER_AGENT”} || ‘’;
if (length($agent) && $agent =~ m/firefox/si) {
return 1;
}
return 0;
}

Enjoy PERL, the scripting pioneer.

$Rupom


Fastest Solution to Count Number of Lines Inside a File

June 14, 2007

Here is another PERL stuff to share.

Many systems have a wc program to count lines in a file:
——————————-
$count = `wc -l
die “wc failed: $?” if $?;
chomp($count);
——————————-

You could also open the file and read line-by-line until the end, counting lines as you go:

open(FILE, “
$count++ while ;
# $count now holds the number of lines read

Here’s the fastest solution, assuming your line terminator really is “\n”:

$count += tr/\n/\n/ while sysread(FILE, $_, 2 ** 16);

Enjoy PERL. Enjoy Programming.


Tell A Friend (TAF) System With Gmail, Yahoo, MSN, AOL Contact List Grabbers

June 14, 2007

Recently I prepared a simple Tell A Friend (TAF) System with Gmail, Yahoo, MSN, AOL contact list grabbers. We all know that Tell A Friend (TAF) is a very important part now-a-days for any well-organized/planned website. Also many sites (especially social networking sites) facilitates TAF with contact list importing from major email providers (Gmail, Yahoo, MSN, AOL). From that needs, I tried to implement a simple TAF system with contact list importing facility from major email address providers. Here is my live demo:

http://www.rupom.com/demos/grabbers/

During this work, I got helps from my friends especially Shimul, Ehsan, Arif and Riyadh. My special thanks and gratitude to them. They inspired me a lot to do such work.

Tell A Friend System with Gmail, Yahoo, MSN, AOL Contact List Grabbers

Please see my demo and send comments so that I can release a better version of this system. Also feel free to contact me if you want this TAF integrated into your website.

I am hoping to release a better and stable version of this work in the near future.

$Rupom


A Nice Article about Love by Swami Vivekananda

June 13, 2007

My friend Tuhin shares a post with us about LOVE. You can see it here:

http://aminonline.wordpress.com/2007/02/

I hope you will enjoy it and learn some more about LOVE.

Regards.

Rupom