- 1997 - Dave Winer develops scriptingNews. RSS was born.
- 1999 - Netscape develops RSS 0.90 (which supported scriptingNews). This was simply XML with an RDF Header.
- 1999 - Dave Winer at UserLand develops scriptingNews 2.0b1 (This included Netscape’s RSS 0.90 features)
- 1999 - Netscape develops RSS 0.91. In this version they removed the RDF header, but included most features from scriptingNews 2.0b1.
- 1999 - UserLand gets rid of scriptingNews and uses only RSS 0.91
- Netscape stops their RSS development
- 2000 - UserLand releases the official RSS 0.91 specification
- 2000 - A group lead by Rael Dornfest at O’Reilly develops RSS 1.0. This format uses RDF and namespaces. This version is often confused as being a new version of 0.91, but this is a completely new format with no ties to RSS 0.91
- 2000 - Dave Winer at UserLand develops RSS 0.92
- 2002 - Dave Winer develops RSS 2.0 after leaving Userland
- 2003 - The official RSS 2.0 specification is released
The History of RSS
July 23, 2008 · No Comments
→ No CommentsCategories: rss feed
BARCODE Reader and JavaScript
June 19, 2008 · 3 Comments
Barcode reader is a common tool used for different type of authentication. Recently I worked in Event management software for a local community. They are going to provide a membership card with a barcode and on the Event venue they want to use it for authentication.
There are some interactive barcode reader that can read the code and put it where your computer is focused and interesting thing is the barcode reader add an ENTER KEY STROCK after putting the coderin the focused field.
I completed the work really in an easy way. I used HTML, JAVASCRIPT and XML . But there are some small issues I want to share with you because first time I fall in a trap with JavaScript. When barcode scanner reader the code and put it in the focused input box then it become difficult to track it with JavaScript event tracker like “onblur”, “onchage” , “onfocus” etc.
It is easy to solve the problem if we put input box in a <form> element because barcode press an enter after reading the code i.e. it submit the form after retrieving the code. See the following code.
<form onsubmit = “return ini()”>
<input type=”text” id=”code_read_box” value=”" />
</form>
So, each time function “ini()” got called when the barcode complete the scan and put the code. Now we can use the following JavaScript function to get the code:
function ini()
{// Retrieve the code
var code =document.getElementById (’code_read_box’).value;// Return false to prevent the form to submit
return false;}
I used MOTOROLA LS-2208 as a barcode scanner and it worked fine.
→ 3 CommentsCategories: Barcode
Tagged: Barcoder, Javascript
Website dummy text
April 9, 2008 · 2 Comments
Well, May be I am trying to re-invent a wheel because this is a popular term. But this is really an exciting news who did not hear about “lorem-ipsum”.
Some time we face problem to get dummy text for a demo presentation. We don’t find suitable text or we just waste our time to generate dummy text.
There is a common term “Lorem ipsum”. This is a great concept to generate dummy text. Some popular website to generate dummy text are www.lipsum.com www.lorem-ipsum.info .
So no more frustration just go can use dummy text.
→ 2 CommentsCategories: lorem-ipsum
Convert a Non-flash movie to FLVideo
January 24, 2008 · 13 Comments
In my last post about Flash Video I gave a gross idea. But now it seems too brief as some of my friends facing problem on the total process.
To convert a Non-Flash Movie file to flash generally we follow two steps. First we convert the file to flash video and then we optimize it to make it compatible for all flash players for good streaming. FFMpeg, MPlayer & MEncoder, Flix Engine are popular converter for Flash Video. I used Mplayer for one of my project. It is an open source LAMP based Project. You can download it from following links:
http://www.mplayerhq.hu/design7/news.html
http://www.mplayerhq.hu/design7/dload.html
We use FLVTool2 to optimize the video. We can download it form here
https://rubyforge.org/projects/flvtool2/
Basically we execute some shell command with php to do all stuff. To convert the file to flash video we have to set Mncoder ( Available in Mpalyer Package )path, source media file and output media file( with .FLV extension). I compiled it with following code
<?php
// Media source path
$src = ‘video/src/abc.avi’;// Flv file path
$des = ‘video/compiled/abc.flv’;// This is the Mencoder Path
$midea_converter_path = ‘/home/mpleyer/mencoder’;exec(”$midea_converter_path $src -o $des -of lavf -oac mp3lame -lameopts abr:br=56 -ovc lavc -lavcopts vcodec=flv:vbitrate=9600:mbd=2:mv0:trell:v4mv:cbp:last_pred=0 -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames -srate 22050″);
?>
After finishing the process we can generate a flv easily. After first compilation generally file size become larger and we faced some problem in streaming. We can optimize the file by Flvtool2. See the following code
<?php
$metainject_converter_path =’/home/mplayer/flvetool2
$flv_src1 =’video/compile/abc.flv’;
$flv_src2 =’video/archive/abc.flv’;
$s = exec(”$metainject_converter_path $flv_src1 $flv_src2″);
?>
Now our flash video is ready to use. Then I like to do something more like generate thumbnails, video runtime etc. MPlayer can analyze video to get this information. See the following code to get runtime
<?php
//Mplayer path
$mplayer_path = ‘/home/mplayer/mplayer;// Media source path
$src = ‘video/src/abc.avi’;exec(”$mplayer_path -vo null -ao null -frames 0 -identify $src”, $p);
while(list($k,$v)=each($p))
{if($length=strstr($v,’ID_LENGTH=’)) break;
}
$data = explode(”=”,$length);
$duration = $data [1];
?>
After executing this command we get several information in ‘$p’. Here I picked the duration of the video.
Generating thumbnails is another one interesting task. We can take snap after specific time duration. This segment of code generates tow thumbnails for each 10 different snaps.
<?php
//MPlayer Path
$mplayer_path = ‘/home/mplayer/mplayer;// Temp directory to where mplayer create thumbnails ( .jpeg format)
$src_temp = ‘video/temp’;// Media source path
$src = ‘video/src/abc.avi’;$total_thumb = 10;
$frame_rate = floor($duration/$total_thumb);
for($i=1;$i<$ total_thumb;$i+=$frame_rate)
{$cmd = “$mplayer_path $src -ss ” . $i . ” -nosound -vo jpeg:outdir=$src_temp” . ” -frames 2″;
exec($cmd);
}?>
I think you guys will understand the minimum process to convert a non-flash movie file to flash and will enjoy it.
→ 13 CommentsCategories: video & PHP
Easy way to generate thumbnails with GD library on runtime
January 23, 2008 · 4 Comments
It is really a panic work with image when we need to make several thumbnails. We can do it directly from Photoshop or with GD library. Generally when we upload an image we make two copies. One is for thumbnail view and another for large view.
It would be an inefficient idea to make 4 or 5 copies of image. This technique is wasting of space as well as time. Let’s say if you have to change the size of the thumbs then either you have to do it manually or you have to say not possible.
What if we don’t generate any thumbnail?!!
Actually it is very easy to write some line of code to resize your image runtime. To get ride of this panic situation. I just wrote a simple function. It receive file path and new size and return image object. And IMG tag can render it easily. So i can resize image in any size with it.
Lets we have a look in following information
<?php
$image_file_path = ‘img/my_image.jpg’; // File path of the image
$resize_to = ‘100′; //100 pixel?>
Now we have to set an URL in image tag from where my server side langue pick the image file path and width. Then we have to generate the image again and return the image object. To send the image file path I like to make it base64_encode otherwise it will edit the image base URL. Now let’s see how I called the image ULR from image tag.
For CakePHP we can do it.
<?php
echo ‘<img ” src=”‘ . $html->url(’/') . ‘common/get_image/’ . base64_encode($image_file_path) . ‘/100/fix” />’;
?>
Here we have a controller named “Common” and from where we calling “get_image” function.
For general use. We can write is like this.
<?php
echo ‘<img ” src=”http://www.abc.com/resize_my_image.php? file=’ . base64_encode($image_file_path) . ‘&size=100& resize_flag=fix” />’;
?>
Now we have to execute the function. This function receive three parameter. First parameter is encode file path of the image. Second one is the new size of the image. If you sent third parameter in percentage or keep it blank then you have to set size like .5 for 50%, .25 or 25% or 1 for 100%. And if you keep third parameter “Fix” then you have to set size in pixel.
For cakePHP simply we have to place the function in “Common” controller.
<?php
class CommonController extends AppController {
var $name = ‘Common’;
var $uses = array(”);
var $layout =’blunk’;
var $pageTitle = ‘Process Image’;// Resize image
function get_image( $file = NULL, $size = NULL,$resize_flag = ‘Percentage’ )
{
// Image resize code here
}
}for simple implementation we can do following process
$image_path = $_GET['file'];
$size = $_GET['size'];
$resize_flag = $_GET['resize_flag'];// Call the function from here
get_image($image_path, $size, $resize_flag )// Declaration of the resize image function
function get_image( $file = NULL, $size = NULL,$resize_flag = ‘Percentage’ )
{
// Image resize code here
}This is the final step of the process. New here is the source of the get_image function.
// Resize image
function get_image( $file = NULL, $size = NULL,$resize_flag = ‘Percentage’ )
{//Set the layout to ajax
$this->layout=’ajax’;// Decode the image path
$file = base64_decode($file);
// This sets it to a .jpg, but you can change this to png or gif
header(’Content-type: image/jpeg’);// Setting the resize parameters
list($width, $height) = getimagesize($file);if( $resize_flag == ‘Percentage’)
{
$modwidth = $width * $size;
$modheight = $height * $size;
}
else
{
$modwidth = $size;
$modheight = ( $height * $size ) / $width;
}// Resizing the Image
$tn = imagecreatetruecolor($modwidth, $modheight);
$image = imagecreatefromjpeg($file);
imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height);// Outputting a .jpg, you can make this gif or png if you want
//notice we set the quality (third value) to 100
imagejpeg($tn, null, 100);
}//function get_image()?>
Once you have set total process then you need not to think about resize. Just change the size from image source. Then image will resize proportionally. I got a good advantage from this function. Hope you guys will enjoy it.
→ 4 CommentsCategories: CakePHP · GD-Library · PHP
I was sucked with “Fatal error: Cannot redeclare class DateTime”
January 8, 2008 · 1 Comment
Installing CRM at SIEMENS Bangladesh corporate office was my last task in AC (Alliance Creation) after preparing it . Everything was fine after 2 times try at SIEMENS office to make the software feasible for their environment with windows 2003, IIS, PHP, MySQL.
But I was sucked when I got the error “Fatal error: Cannot redeclare class DateTime”. This is a basic class of sugar to manager calendar, Schedule etc. But the software was running fine in my office both in APACHE and IIS. Grrrrrrr.. I remove my hand from keyboard and was thinking what to do. First I tried to block my PEAR library but got same result. Then we took a break to our office and said them we were returning after half an hour.
At office I installed my XAMPP and try to run again the software on LAMP platform. Ohh shit getting the same error but in WAMP it is running fine. After tow hour of try I got a simple solution from sugar forum. That I have to rename all “DateTime” class. Then simply I remanded it to “DateTiems”
The changes affected the following 5 files,
modules\Calendar\DateTime.php
modules\Calendar\Calendar.php
modules\Calls\Call.php
modules\Meetings\Meeting.php
modules\vCals\vCal.php
Then we ran to SIMENS office again and replace all files.
So Buddies not to give up solution is not too far if we keep trying. ![]()
→ 1 CommentCategories: Sugar CEM
EXT JS a JAVA SCRIPT library
December 28, 2007 · 2 Comments
In EID vacation I decided to study on some JavaScript library. After finishing DOJO I started ext JS. I was really excited when I have started it.
They have vast collections of tools like Grids, Trees, From, Tab etc. And implementation is not so difficult if we have little bit knowledge in DOM and HTML.
There is a layout manager to place the contents in exact place.
Their API documentations are good for advance development. But for newbie better first finish the tutorials.
Examples: http://extjs.com/deploy/dev/examples/feed-viewer/view.html
Documentations: http://extjs.com/learn
Download: http://extjs.com/download
Hope you guys will enjoy EXT JS ![]()
→ 2 CommentsCategories: AJAX
DOJO a great AJAX based library
December 22, 2007 · No Comments
Last few days I was studying on an AJAX library call DOJO. This is really a fantastic lib. We already know about the new email interface in YAHOO. What you feel if we need to write a script like that or like GOOGLE reader. This really time consume to bring a professional look. Actually this is why we use Frame work or tools. DOJO is such a tool to make some thing professional in AJAX.
Dojo is an Open Source DHTML toolkit written in JavaScript. It builds on several contributed code bases (nWidgets, Burstlib, f(m)), which is why we refer to it sometimes as a “unified” toolkit. Dojo aims to solve some long-standing historical problems with DHTML which prevented mass adoption of dynamic web application development.
Dojo does all of these things by layering capabilities onto a very small core which provides the package system and little else. When you write scripts with Dojo, you can include as little or as much of the available APIs as you need to suit your needs. Dojo provides multiple points of entry, interpreter independence, forward looking APIs, and focuses on reducing barriers to adoption.
→ No CommentsCategories: AJAX
Basically what is AJAX?
December 6, 2007 · 5 Comments
BACKGROUND
Few days back I had to face a question, Could AJAX reduce page loading time?
Since then I have been thinking to write something on it. The term “AJAX” is not
new in web application. Google has been using it since 2005.
INTRODUCTION
We all know AJAX process one kind of HTTP request for us. Always we are using
HTTP request in web browser. When a request appears to web server in the
response it returns some content. Generally it is a bundle of html codes. After
getting this bundle, the web browser load the new content and we loss previously
loaded page. On this context AJAX can play an excellent rule.
WHAT IS AJAX
AJAX = Asynchronous JavaScript and XML.
The mechanism of AJAX is very simple. JavaScript send a xmlHTTP request to
server and preserve the returned content in a variable. So it is not affecting
currently loaded page.
CONFIGURE AJAX
CPain, JQuery, Prototype are famous libraries for AJAX and pretty easy to
use. And writing an AJAX function is also not a big deal. First need an xmlHTTP
reference to process.// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
// Internet Explorer
xmlHttp=new ActiveXObject(”Msxml2.XMLHTTP”);
xmlHttp=new ActiveXObject(”Microsoft.XMLHTTP”);
When xmlHttp object is ready then we can send request to server. There are tow
basic function “open” and “send” to process request. First one set the
properties and second one send the request.
xmlHttp.open (”GET”,” abc.php”, true);
xmlHttp.send();
xmlHttp.onreadystatechange is a special instruction to set a “function” or
“function name” to catch the response. After sending request successfully the
return content store in a variable called “xmlHttp.responseText”. We can trace
the success rate of the request from some status flags (Loading-1, Loaded-2,
Interactive-3, and Complete-4). These status flags stored in “xmlHttp.readyState”.
xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState==4)
{
Alert(xmlHttp.responseText );
}
}
So AJAX is nothing but browsing a specific URL from a JavaScript document
keeping the existing page loaded as it is. This is so far what AJAX is.
AJAX & PAGE LOADING TIME:
First of all AJAX is not a tool to reduce the system press. It can do nothing
except fetching content from server. But if we can use AJAX in such a way that
first time we will load small amount of data and the rest data will fetch if
user request for it. In that case AJAX can reduce the page loading time
drastically.Let’s say we are showing 10 pictures in a page. If one image needs
‘X’ amount of time, then total time is
T = 10X
Now if we decide to load one image first time and rest 9 images will load if
user clicks on first loaded image. Then first loading time of the page is
T = 1X
So it will reduce the system press by 9 times. This is actually how AJAX can
reduce the page loading time.
REFERENCE:
http://www.w3schools.com/ajax/default.asp
http://www.prototypejs.org/api/ajax
http://cpaint.sourceforge.net/
http://docs.jquery.com/Ajax
EXAMPLE
See the following example to see how AJAX works.
<html>
<head>
<script type=”text/javascript”>
function ajax ()
{
var xmlHttp;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject(”Msxml2.XMLHTTP”);
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject(”Microsoft.XMLHTTP”);
}
catch (e)
{
alert(”Your browser does not support AJAX!”);
return false;
}
}
}
return xmlHttp;
}
function ajaxFunction()
{
var xmlHttp;
xmlHttp = ajax();
xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState==4)
{
document.myForm.time.value=xmlHttp.responseText;
}
}
xmlHttp.open(”GET”,”time.php”,true);
xmlHttp.send(null);
}
</script>
</head>
</body>
<form name=”myForm”>
<input type=”button” onclick=”ajaxFunction();” value=”Click Me” />
Time: <input type=”text” name=”time” />
</form>
</body>
</html>
<?php
//time.php
// Save in same Directory
echo date(’H a’);
?>
Well, I tried to make this example easy to all. Hopefully everybody will enjoy it.
→ 5 CommentsCategories: AJAX
The closing meeting of GPCIC project with Grameen phone,KATALYST and Grameen Telecom
November 20, 2007 · 5 Comments
Recently I got a meeting with Grameenphone, KATALYST and GrameenTelecom. This was closing meeting of my GPCIC project. I informed to face the meeting alone. Really it was a big deal for me.
In the morning when I was preparing myself for the meeting got little bit nervous. I arrived when it was just 15 minutes to start the meeting. In the waiting room my anxiousness just reached the peak position then Mr. Mejba (Representative of GP) called me in the conference room.
When meeting started I was really strange because they were very frank and jolly with all topics. The overall environment increased my productivity. At the end of the meeting some seniors joined with us. They were making jokes with us.
![]()
→ 5 CommentsCategories: Meeting & Conference