Sunday, February 24, 2008

Struts2: dynamic file download

(there is a better method for this at the end of this post)

In struts2, file is downloaded as stream using StreamResult class.
To download file of dynamic name, size or type we need to extend this StreamResult class.

StreamResult result type takes the following parameters:

* contentType - the stream mime-type as sent to the web browser (default = text/plain).
* contentLength - the stream length in bytes (the browser displays a progress bar).
* contentDispostion - the content disposition header value for specifing the file name (default = inline, values are typically filename="document.pdf".
* inputName - the name of the InputStream property from the chained action (default = inputStream).
* bufferSize - the size of the buffer to copy from input to output (default = 1024).

Example:

<result name="success" type="stream">
<param name="contentType">image/jpeg</param>
<param name="inputName">imageStream</param>
<param name="contentDisposition">filename="document.pdf"</param>

<param name="bufferSize">1024</param>
</result>


So in the extended StreamResult class we need to set these parameters dynamically.
You could download source code from here, its same as following:

package downloadexample;
import org.apache.struts2.dispatcher.StreamResult;

import com.opensymphony.xwork2.ActionInvocation;

/**
* This class for result-type="myStream"

*
* <result-types> <result-type name="myStream" default="false"
* class="downloadexample.DynamicStreamResult"/>
*
* </result-types>

*
* It extends StreamResult Used to download file as a stream.
*
* @author sheetal
*
*/


public class DynamicStreamResult extends StreamResult{
@Override

protected void doExecute(String finalLocation,
ActionInvocation invocation)
throws Exception {

//get name of downloaded file
String downloadedFileName = invocation.getStack().
findValue(conditionalParse
("name", invocation));

contentDisposition = "filename=\""

+downloadedFileName + "\"";

//get file size
contentLength = ""+ invocation.getStack().findValue(
conditionalParse("size", invocation));
// get type of file
contentType = ""+ invocation.getStack().
findValue(
conditionalParse("description", invocation));
/*
Executes the result given a final location
(jsp page, action, etc) and
the action invocation (the state in which
the action was executed).
*/

super.doExecute(finalLocation, invocation);

}

}



Let, our site is a search site where user inputs name of a file. our system searches the file in server's local directory and lets the user download it if found.

To do this, .jsp file should be include the following:


<s:form action="downloadFile" validate="true">

<s:textfield label="Search file"

name="name" required="true"/>

<s:textfield label="Define file type (image/jpeg, text/plain, application/pdf)"
name="description" required="true"/>

<s:submit value="Find file"/>

</s:form>


where downloadFile is the action for downloading file.

In your action class, add the following lines:

private String name;
//holds name of downloaded file

private InputStream inputStream;
//holds stream of downloaded file
private String description;
//holds the content type of the downloaded file

private long size;
//holds the content size of the downloaded file


//method for downloading file
public String downloadFile()
{

/*
let, method searchFile(String fileName)
does the searching for us
& returns InputStream of the file if found
and null otherwise.
*/

this.inputStream = searchFile(name);

if(inputStream !=null)
{

return Action.SUCCESS;

}
else
{
//handle error
return Action.ERROR;

}


}

//write setter getter methods
public InputStream getInputStream() throws Exception

{
return inputStream;

}

public String getName()

{
return name;
}
public void setName(String name)

{
this.name = name;
}
public String getDescription()

{
return this.description;
}
public void setDescription(String description)

{
this.description = description;
}
// write getter setter for attribute size


Now, edit your struts.xml file:


<!-- custom result type for file download -->
<result-types>
<result-type name="myStream"

default="false"
class="downloadexample.DynamicStreamResult"/>

</result-types>
<!-- action for downloading file-->
<action name="downloadFile"

method="downloadFile"
class="<action-class-name>
">

<result type="myStream"/>
<result name="error">jsps/your_error_page.jsp</result>


</action>



syntax highlighted by Code2HTML, v. 0.9.1

& we are done :D.

...................................................
May be a Better method:
the time i wrote this post i was too naive to find other solution for this. One person commented a quick solution on the blog.... thank you again. i haven't tried it, so i'm not sure if it works, check yourself...here is the comment.........

Actually, there's no need to extend the StreamResult class. You can dynamically pass the contentType (and other Stream parameters) by using parameter substitution in your Action mapping, like so:


<result name="success" type="stream">

<param name="contentType">${contentType}</param>
<param name="inputName">imageStream</param>

<param name="contentDisposition">filename="${fileName}"</param>

<param name="bufferSize">${bufferSize}</param>

</result>



You then add methods set/getContentType(), set/getFileName() and set/getBufferSize() to your Action class. In the Action method which handles your business logic, all you have to do is call this.setContentType(), this.setFileName() and this.setBufferSize() and supply whatever values you like.

---------------------------------------

Upload data to oracle using sql loader

Let,
I have a table named user in my oracle database.
Table creation commands:

create table user
(
id number,
name varchar(10)
);


To insert large amount of data (e.g. 1 million) row into that table, we could use sql loader. This utility (SQL LOADER)is used to load data from other data source into Oracle.

Steps for doing this:

1. write .csv file user.csv. Its a simple text file with comma separated data.
data are written in the following way:

1,"user1"
2,"user2"


2. copy user.csv file to the server where oracle is running. You could use ftp or ssh for this.

Let, user.csv is copied in /root/mycsv folder

3. write user.ctl file


LOAD DATA
INFILE '/root/mycsv/user.csv'
append into table user
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
(id,
name
)


Notes:


  • The LOAD DATA statement is required at the beginning of the control file.
  • The INFILE option specifies where the input file is located
  • Specifying BADFILE is optional. If you specify, then bad records found during loading will be stored in this file.
  • Specifying DISCARDFILE is optional. If you specify, then records which do not meet a WHEN condition will be written to this file.
  • You can use any of the following loading option

a. INSERT : Loads rows only if the target table is empty

b. APPEND: Load rows if the target table is empty or not.

c. REPLACE: First deletes all the rows in the existing table and then, load rows.

d. TRUNCATE: First truncates the table and then load rows.



FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'

This line indicates how the fields are separated in input file. Since in our case the fields are separated by “,” so we have specified “,” as the terminating char for fields. You can replace this by any char which is used to terminate fields. Some of the popularly use terminating characters are semicolon “;”, colon “:”, pipe “|” etc. TRAILING NULLCOLS means if the last column is null then treat this as null value, otherwise, SQL LOADER will treat the record as bad if the last column is null.
  • (id,
    name
    )
  • In this line specify the columns of the target table. Note how do you specify format for Date columns

4. execute the following command to load data from user.csv file to your database.

sqlldr userid=username/password@SIDname control='user.ctl' log='user.log'


5. If you don't know the SID name for oracle server, you can find it using following command:

echo $ORACLE_SID


if sid name was wrong, you'll get following error:

SQL*Loader-704: Internal error: ulconnect: OCIServerAttach [0]
ORA-12154: TNS:could not resolve the connect identifier specified


If the csv file is too large and tablespace is full, you'll get following error:



SQL*Loader-605: Non-data dependent ORACLE error occurred -- load discontinued.



Check your .log file and if you find the following if tablespace is full

ORA-01653: unable to extend table username.tablename by X in tablespace yourtablespace


To resolve this, you need to add another table space. Execute the following command to see current status of your tablespace:


select * from dba_data_files where tablespace_name = 'yourtablespace;


You'll find current something like the following:

FILE_NAME
----------------------------------------------
/usr/local/oracle/oradata/webct/yourtablespace01.dbf

FILE_ID TABLESPACE_NAME BYTES BLOCKS STATUS
---------- ------------------------------ ---------- ---------- ---------
11 yourtablespace 4294967296 524288 AVAILABLE

RELATIVE_FNO AUT MAXBYTES MAXBLOCKS INCREMENT_BY USER_BYTES USER_BLOCKS
------------ --- ---------- ---------- ------------ ---------- -----------
11 YES 4294967296 524288 65536 4294443008 524224



Now you have to add more table space using following command:


alter tablespace USERS add datafile '/usr/local/oracle/oradata/webct/yourtablespace02.dbf' size 1024M autoextend on next 512M maxsize 4096M;




See details solution here.

Wednesday, February 20, 2008

Lights Up


Lights Up, originally uploaded by Inside_man.

Friday, February 15, 2008

30 Largest Social Bookmarking Sites

30 Largest Social Bookmarking Sites | Updated 10/14/2007 | eBizMBA
Here are the 30 Largest Social Bookmarking Sites ranked by a combination of Inbound Links, Google Page Rank, Alexa Rank, and U.S. traffic data from Compete and Quantcast. Although no traffic metrics are completely accurate we do believe the data below to be useful for gauging relative audience size.


1 | digg.com

117,796,083 - Inbound Links | 16,964,445 - Compete Monthly Visitors | 8,700,000 - Quantcast Monthly Visitors | 98 - Alexa Ranking. | Page Rank: 8



2 | Technorati.com

75,306,437 - Inbound Links | 3,231,709 - Compete Monthly Visitors | 1,400,000 - Quantcast Monthly Visitors | 216 - Alexa Ranking. | Page Rank: 8




3 | del.icio.us

171,593,051 - Inbound Links | 1,699,128 - Compete Monthly Visitors | 1,300,000 - Quantcast Monthly Visitors | 248 - Alexa Ranking. | Page Rank: 8




4 | Propeller.com

997,000 - Inbound Links | 1,454,912 - Compete Monthly Visitors | 2,180,176 - Quantcast Monthly Visitors | 2,308 - Alexa Ranking. | Page Rank: 7



5 | StumbleUpon.com

19,050,177 - Inbound Links | 1,313,586 - Compete Monthly Visitors | 695,239 - Quantcast Monthly Visitors | 300 - Alexa Ranking. | Page Rank: 8



6 | reddit.com

45,307,577 - Inbound Links | 1,226,467 - Compete Monthly Visitors | 344,383 - Quantcast Monthly Visitors | 852 - Alexa Ranking. | Page Rank: 7



7 | Fark.com

11,438,723 - Inbound Links | 306,597 - Compete Monthly Visitors | 1,767,165 - Quantcast Monthly Visitors | 1,958 - Alexa Ranking. | Page Rank: 7



8 | MyBlogLog.com

1,742,265 - Inbound Links | 1,972,847 - Compete Monthly Visitors | 84,922 - Quantcast Monthly Visitors | 432 - Alexa Ranking. | Page Rank: 7



9 | Slashdot.org

13,555,035 - Inbound Links | 724,424 - Compete Monthly Visitors | 269,884 - Quantcast Monthly Visitors | 579 - Alexa Ranking. | Page Rank: 9



10 | kaboodle.com

100,266 - Inbound Links | 1,751,763 - Compete Monthly Visitors | 851,858 - Quantcast Monthly Visitors | 9,125 - Alexa Ranking. | Page Rank: 6



11 | Bloglines.com

50,717,948 - Inbound Links | 382,663 - Compete Monthly Visitors | 103,711 - Quantcast Monthly Visitors | 853 - Alexa Ranking. | Page Rank: 9



12 | newsvine.com

24,200,775 - Inbound Links | 315,857 - Compete Monthly Visitors | 203,761 - Quantcast Monthly Visitors | 3,977 - Alexa Ranking. | Page Rank: 7



13 | blinklist.com

23,770,576 - Inbound Links | 243,277 - Compete Monthly Visitors | 165,306 - Quantcast Monthly Visitors | 4,647 - Alexa Ranking. | Page Rank: 6



14 | netvouz.com

8,112,272 - Inbound Links | 75,507 - Compete Monthly Visitors | 54,325 - Quantcast Monthly Visitors | 15,048 - Alexa Ranking. | Page Rank: 6



15 | clipmarks.com

164,419 - Inbound Links | 196,107 - Compete Monthly Visitors | 147,131 - Quantcast Monthly Visitors | 6,740 - Alexa Ranking. | Page Rank: 6



16 | Furl.net

49,595,144 - Inbound Links | 148,975 - Compete Monthly Visitors | 57,547 - Quantcast Monthly Visitors | 4,112 - Alexa Ranking. | Page Rank: 8



17 | Mister-Wong

13,214,146 - Inbound Links | 25,416 - Compete Monthly Visitors | 3,432 - Quantcast Monthly Visitors | 1,889 - Alexa Ranking. | Page Rank: 7



18 | dzone.com

1,065,009 - Inbound Links | 100,784 - Compete Monthly Visitors | 117,897 - Quantcast Monthly Visitors | 5,187 - Alexa Ranking. | Page Rank: 6



19 | ma.gnolia.com

13,701,444 - Inbound Links | 110,662 - Compete Monthly Visitors | 32,363 - Quantcast Monthly Visitors | 7,454 - Alexa Ranking. | Page Rank: 7



20 | Tailrank.com

5,320,211 - Inbound Links | 71,563 - Compete Monthly Visitors | 35,783 - Quantcast Monthly Visitors | 28,920 - Alexa Ranking. | Page Rank: 7



21 | ShoutWire.com

168,480 - Inbound Links | 101,738 - Compete Monthly Visitors | 55,337 - Quantcast Monthly Visitors | 10,552 - Alexa Ranking. | Page Rank: 6



22 | simpy.com

13,107,730 - Inbound Links | 62,645 - Compete Monthly Visitors | 49,205 - Quantcast Monthly Visitors | 10,948 - Alexa Ranking. | Page Rank: 7



23 | BlogMarks.net

9,748,453 - Inbound Links | 61,740 - Compete Monthly Visitors | 28,075 - Quantcast Monthly Visitors | 11,880 - Alexa Ranking. | Page Rank: 6



24 | BlueDot.us

1,159,780 - Inbound Links | 107,717 - Compete Monthly Visitors | 60,045 - Quantcast Monthly Visitors | 12,072 - Alexa Ranking. | Page Rank: 6



25 | Spurl.net

18,628,253 - Inbound Links | 42,300 - Compete Monthly Visitors | 3,483 - Quantcast Monthly Visitors | 14,300 - Alexa Ranking. | Page Rank: 6



26 | Spotplex.com

541,599 - Inbound Links | 52,176 - Compete Monthly Visitors | 15,106 - Quantcast Monthly Visitors | 42,809 - Alexa Ranking. | Page Rank: 6



27 | linkswarm.com

150,842 - Inbound Links | 14,504 - Compete Monthly Visitors | 10,476 - Quantcast Monthly Visitors | 47,267 - Alexa Ranking. | Page Rank: 5



28 | Spotback.com

97,564 - Inbound Links | 42,838 - Compete Monthly Visitors | 5,037 - Quantcast Monthly Visitors | 42,015 - Alexa Ranking. | Page Rank: 5




29 | PlugIm.com

161,039 - Inbound Links | 48,078 - Compete Monthly Visitors | 2,000 - Quantcast Monthly Visitors | 13,133 - Alexa Ranking. | Page Rank: 5



30 | MyBookmarks.com


25,191 - Inbound Links | 10,934 - Compete Monthly Visitors | 7,727 - Quantcast Monthly Visitors | 108,226 - Alexa Ranking. | Page Rank: 5

Wednesday, February 13, 2008

Free bangla books download

/********************************

I will keep adding more books. stay tuned !!!

Meanwhile, think about those less fortunate people and donate

/**********************************

Books that are really free:

Begum Roquia:


Rabindranath Tagor:
Taslima Nasreen:


      Tuesday, February 12, 2008

      Thursday, January 17, 2008

      Nature's Marbles


      Nature's Marbles, originally uploaded by Matt Hughes.

      Sunday, January 13, 2008

      Favorite photos


      , originally uploaded by zebaislam.

      Saturday, January 12, 2008

      with your feet in the air
      and your head on the ground
      try this trick & spin it ... ... ...
      your head will collapse
      if theres nothing in it
      you will ask yourself where is my mind?

      Thursday, January 10, 2008

      Regular expression in java

      http://java.sun.com/developer/technicalArticles/releases/1.4regex/

      String input = "something";

      1. write a regular expression
      String regex="your_reg_ex"; 


      2. create a pattern object compiling your regex


      Pattern p = Pattern.compile(regex);


      3. create a matcher object that will match input string with the compiled regex

      Matcher m = p.matcher(input);


      4. check whether any matching found

      if (m.find())
      {
      //5. if found, the matched portion will be available at m.group()
      String found = m.group();
      // do whatever u like
       }
      

      let, input = "fjkl;pokjhA123ss456Apghkit"
      u want to read block between 2 A's
      regex = (?<=X).*?(?=X) where X = "A" here output = "123ss456" u can only use fixed length string in (?<=X), never use .*? or + in X otherwise u'll get exception
      Look-behind group does not have an obvious maximum length near index ..
      
      


      Java code for this:
       1 
       2   String regularExp = "(?<=A).*?(?=A)";
      
       3 
       4   String input = "fjkl;pokjhA123ss456Apghkit";
       5 
      
       6   Pattern pattern = Pattern.compile(regularExp);
      
       7   
       8   Matcher matcher =  pattern.matcher(input);
      
       9      
      10      if(matcher.find())
      11         {
      
      12         String parsedData = matcher.group();
      13                 System.out.println(" Output ->"+parsedData);
      
      14          }
      15        
      
      

      SSHClient in java

      http://www.docjar.com/docs/api/com/sshtools/j2ssh/SshClient.html

      Saturday, December 22, 2007

      struts2+Spring workflow

      1. An initial request goes to the Servlet container (such as Jetty or Resin) which is passed through a standard filter chain.

      2. the required FilterDispatcher is called, which in turn consults the ActionMapper to determine if the request should invoke an action.


      3. The ActionMapper interface provides a mapping between HTTP requests and action invocation requests and vice-versa.

      When given an HttpServletRequest, the ActionMapper may return null if no action invocation request matches, or it may return an ActionMapping that describes an action invocation for the framework to try.

      If the ActionMapper determines that an Action should be invoked, the FilterDispatcher delegates control to the ActionProxy.

      4. The ActionProxy consults the framework Configuration Files manager (initialized from the struts.xml file).

      5. the ActionProxy creates an ActionInvocation, which is responsible for the command pattern implementation. This includes invoking any Interceptors (the before clause) in advance of invoking the Action itself.

      6. Once the Action returns, the ActionInvocation is responsible for looking up the proper result associated with the Action result code mapped in struts.xml.

      7. The result is then executed, which often (but not always, as is the case for Action Chaining) involves a template written in JSP or FreeMarker to be rendered.


      8. While rendering, the templates can use the Struts Tags provided by the framework.

      9. All objects in this architecture (Actions, Results, Interceptors, and so forth) are created by an ObjectFactory.

      This ObjectFactory is pluggable. We can provide our own ObjectFactory
      A popular ObjectFactory implementation uses Spring as provided by the Spring Plugin.

      Normally, in struts.xml you specify the class for each Action. When using the default SpringObjectFactory, the framework will ask Spring to create the Action and wire up dependencies as specified by the default auto-wire behavior.


      10. Interceptors are executed again (in reverse order, calling the after clause).


      11. Finally, the response returns through the filters configured in the web.xml.


      N.B:
      don't know how to setup simple struts2 project? see simple setup

      Monday, December 10, 2007

      The 5 stages of grief


      1. Denial: The initial stage: "It can't be happening."
      2. Anger: "Why ME? It's not fair!" (either referring to God, oneself, or anybody perceived, rightly or wrongly, as "responsible")
      3. Bargaining: Now the grieving person may make bargains with God, asking, "If I do this, will you take away the loss?"
      4. Depression: "I'm so sad, why bother with anything?"
      5. Acceptance: "It's going to be OK."


      Kübler-Ross model

      Wednesday, December 05, 2007

      SCP using java api

      same as SFTP example except use ScpClient in place of SFTPClient


      ScpClient client = ssh.openScpClient();

      // Open the SCP channel
      String localFile = "localPath";
      String remoteFile = "remotePath";

      //
      //get method signature
      //public void get(java.lang.String localFile,
      // java.lang.String remoteFile,
      // boolean recursive,
      // FileTransferProgress progress)
      // throws SshException,
      // ChannelOpenException
      //

      client.get(localFile,remoteFile,true);




      syntax highlighted by Code2HTML, v. 0.9.1

      SFTP using java api

      Librery used SSHTools-J2SSH
      Tutorial help from David Hayes

      1
      2 String userName = "someuser";

      3 String password = "somepwd";
      4
      5 String host = "host_ip";

      6 int port = 22;
      7
      8 String destinationPath = "<your_dest>";

      9 String sourcePath = "<your_src>";
      10
      11 SshClient ssh = new SshClient();

      12
      13 try{
      14 ssh.connect(host, port);

      15
      16 // Authenticate
      17 PasswordAuthenticationClient passwordAuthenticationClient =
      18 new PasswordAuthenticationClient();

      19
      20 passwordAuthenticationClient.setUsername(userName);
      21 passwordAuthenticationClient.setPassword(password);

      22
      23 int result = ssh.authenticate(passwordAuthenticationClient);

      24 if(result != AuthenticationProtocolState.COMPLETE){
      25

      26 throw new FTPException("Login to " + host + ":"

      27 + port + " " + userName + "/" + password + " failed");

      28
      29 }
      30
      31 // Open the SFTP channel
      32 SftpClient client = ssh.openSftpClient();

      33 //change local directory where file would be copied
      34 client.lcd(destination);
      35 // download file

      36 client.get(sourceFilePath);
      37
      38 client.quit();

      39 ssh.disconnect();
      40
      41 }
      42 catch(IOException e)

      43 {
      44
      45 // file transfer failed
      46 e.printStackTrace();

      47 }




      syntax highlighted by Code2HTML, v. 0.9.1

      Tuesday, December 04, 2007

      Writing pdf file using java

      Librery used iText

      // Step 1: Create an instance of com.lowagie.text.Document:

      Document document = new Document();

      //Step 2: Create a Writer (for instance com.lowagie.text.pdf.PdfWriter)
      //that listens to this document and
      //writes the document to the OutputStream of your choice:

      PdfWriter.getInstance(document, new FileOutputStream("HelloWorld.pdf"));

      //Step 3: Open the document:

      document.open();

      //Step 4: Add content to the document:

      document.add(new Paragraph("Hello World"));

      //Step 5: Closes the document:

      document.close();



      syntax highlighted by Code2HTML, v. 0.9.1

      check other tutorials

      Thursday, November 22, 2007

      Help Sidr affected people

      1. Type 'save' in your cell and send it to 5455
      . your 1 single sms will give 15 tk to the cyclone
      affected people. it's a joint project of "save the
      children" and somewhereinblog.

      2. You can also write “help” and send to “1010” from any mobile in Bangladesh.
      It’s a joint initiative taken by all the mobile operator in Bangladesh and fully reliable.For each sms taka 10 will be deducted from your account and the total money will be donated for the SIDR affected people.

      3. Directly to the Chief Adviser's Relief and Welfare Fund:
      Current Account No.33004093 with Sonali Bank, Prime Minister's Office
      Branch, Tejgaon, Dhaka, Bangladesh

      4. Bangladesh Red Crescent Society
      A/C No. 01-1336274-01
      Standard Chartered Bank
      Dhaka Bangladesh
      SWIFT Code: SCBLBDDX

      Here is a list of organizations we can send our contributions to:

      UNICEF
      Save the Children – US

      International Federation of Red Cross and Red Crescent Societies

      World Vision Web

      World Vision Web
      BY PHONE 1-888-562-4453 (888-56-CHILD) and donating with the “giving
      code” of Bangladesh Cyclone Relief.

      CARE Responds to Bangladesh Cyclone - Donate Now

      Islamic Relief

      Catholic Relief Services

      Food for the Hungry

      How to donate to "Chief Advisor's Relief and Welfare"
      # Method 1
      Check/money order/bank draft
      Payable to : "Bangladesh Consulate General in New
      York"
      Memo: For Chief Advisor's Relief and Welfare Fund
      Address to send:
      211 East 43rd Street, Suite 502
      NY 10017

      *You will get an acknowledgment receipt from
      Bangladesh Consulate General

      # Method 2

      Money Transfer via Sonali Exchange Co. Inc
      Check payable to "Sonali Exchange Co. Inc. USA"
      Memo: For chief advisor's relief and welfare fund
      Address to send:
      211 East 43rd St,
      Suite # 1503
      NY 10017
      Tel: 212-808-0790/212-808-4085

      Friday, November 16, 2007

      1,100 reported killed in Bangladesh cyclone






      Death toll may cross 1,000; all communications, utility services snapped; thousands missing; houses, crops, trees destroyed; lakhs homeless


      Bangladesh dated with a nightmare as cyclone Sidr ripped through the southwestern coast late Thursday, killing over 700 people and demolishing houses, crops, vegetables and trees alike along its trail of devastation over an area of thousands of square kilometers.

      Packing winds over 220km an hour, the fierce tropical storm roared across the shoreline after it hit landfall at the Khulna-Barisal coast at 7:30pm Thursday, cutting off all communications and utility services across the country.


      One of the fiercest cyclones in the history of the land, the Sidr rode on wailing winds, driving rains and tidal surges to wreak havoc for over 14 hours before moving to Asam and Tripura through the Sylhet border, turning into a well-marked low yesterday.

      Despite having carried out a commendable evacuation effort, the government last night found itself reeling from shock as the number of deaths and extent of damage continued to increase with every passing hour.

      In a rather awkward manner, the food and disaster management ministry told the press in the afternoon that about 233 people were killed but left out death tolls in two most-affected districts--- Borguna and Jhalakathi. However, the same briefing stated that Red Crescent found 118 dead so far in Barguna alone.

      But within hours at 12 midnight, an official at the food and disaster management ministry's control room raised the death figure to 700, with maximum 177 killed in Patuakhali. However, quoting unofficial sources, Our Correspondent in Patuakhali, reported death of 490 people.

      But finds of newsmen and different private sources till filing of this report early morning today revealed that the death toll is destined to climb up to 1,000 as rescuers and volunteers could not yet reach most of the worst-hit areas.

      Meanwhile, no information on causalities could be gathered from numerous remote islands (chars), residents of which mostly turned a deaf ear to government's evacuation alert.

      “Tidal waves swept away many people from Dublar Char in Bagerhat”, Red Crescent worker Abul Kashem Dulal told our correspondent in Barisal. Of them, bodies of 17 people could be recovered.

      The government could provide shelter for around 15 lakh people in 2168 shelter houses, leaving around 33 lakh people in the coastal areas in vulnerable situation.

      Casualties apart, the Patuakhali district also suffered most in the farm sector. “The crop loss should be no less than Tk 497 crore in the seven upazilas,” he said, quoting a rough estimate of a deputy director of agriculture extension department in Patuakhali.

      The Patuakhali town went under knee-deep waters as tidal surges 6-7 feet higher than normal ones sped through the locality. At least seven other southern districtsBarguna, Jhalakathi, Pirojpur, Bhola, Madaripur, Barisal and Bagerhat suffered nearly the same fate of Patuakhali.

      However, the actual extent of destruction in Bagerhat could not be known till filing of this report as a very few could reach areas like Sharankhola near the worst-hit Sundarbans, the world's largest mangrove forest.

      “Hundreds of trees lying on the roads and fields give a picture of massive damage,” said Raphael Palma, communications manager of World Vision Bangladesh, a non-government organisation.

      Palma, who yesterday visited Mongla, said the locals are saying they lived through the cyclone of 1988 but it was no match to this cyclone. “The roaring wind was not as devastating as this one.”

      The casualties could be much higher if not the local administration warned people about the imminent disaster, he observed.

      As per the government count, 44 people died in Bagerhat. But unofficial sources put the number at 133, of which 90 were killed in Sharankhola upazila alone.

      The volunteers and rescuers painted an even grimmer picture of the shocking event, which also left thousands injured. Chief Adviser Fakhruddin Ahmed too rushed to some southern districts in an effort to buck up the spirit of cyclone-victims.

      But it will take weeks to assess the actual death toll, financial loss and days to reach relief to people who are forced to live overnight under the open sky, rescuers and volunteers said, almost in identical words.

      People in lakhs are staying under the open sky with hardly any foods in their possession, thousand remained missing, embankments broke down in many areas, scores of livestock killed, and unknown number of persons was swept away by tidal surges.

      However, the devastation could have been much higher if the cyclone, originally predicted to be heading for the shores of Orissa near Paradip, made landfall during the high tide hours at around 3:00am on Friday.

      “Had the high tide and cyclone taken place at the same time the damage would have tripled,” said an expert.

      According to the midnight update of the government, 177 were killed in Patuakhali, 134 in Pirojpur, 133 in Bagerhat, 78 in Barisal, 35 in Barguna, 32 in Jhlakathi, 25 in Gopalganj, 20 in Bhola, 15 in Shariatpur,12 in Khulna, 10 in Faridpur, four each in Chandpur and Dhaka, three in Sathkhira, one each in Laxmipur, Chittagong, and Jessore.

      However, the government briefing in the afternoon stated 19 people were killed in Madaripur, two in Narayanganj, and one each in Noakhali and Chandpur.

      full news

      Monday, November 12, 2007

      Free Rice: Web game provides rice for hunger



      WFP food aid being distributed in Somalia - 26/09/2007
      The WFP says hunger is the world's number one emergency
      An internet word game has generated enough rice to feed 50,000 people for one day, the UN's World Food Programme (WFP) has said.

      The game, FreeRice, tests the vocabulary of participants. For each click on a correct answer, the website donates money to buy 10 grains of rice.

      Companies advertising on the website provide the money to the WFP to buy and distribute the rice.

      FreeRice went online in early October and has now raised 1bn grains of rice.

      That is enough rice to feed 50,000 people for one day, the WFP said on Friday.

      Read the whole news here
      and another here

      & keep playing :)

      Thursday, September 27, 2007

      In Love, if Love be Love, if Love be ours,
      Faith and unfaith can ne'er be equal powers:
      Unfaith in aught is want of faith in all.

      "It is the little rift within the lute,
      That by and by will make the music mute,
      And ever widening slowly silence all.

      "The little rift within the lover's lute
      Or little pitted speck in garnered fruit,
      That rotting inward slowly moulders all.

      "It is not worth the keeping: let it go:
      But shall it? answer, darling, answer, no.
      And trust me not at all or all in all."

      Tuesday, September 25, 2007

      Why we hiccup

      A little history:
      the day i posted this, ridwan was hiccup-ing :D... as the only thing i used to do in office was chatting with ridwan and/or shimi, i felt the strong urge to know why we hiccup :D.
      ----------------------------------------------------------------------------------


      I found this interesting post in bbc news


      --------------------------------------------------------------------------
      Scientists believe they may be able to explain why people hiccup.

      Researchers in France have suggested that it may be linked to evolution and the fact that our ancient ancestors lived in the sea.

      They believe it may be a throwback to a time when our ancestors had gills to help them breathe.

      The reason why humans hiccup has baffled scientists for hundreds of years, not least because it does not seem to serve any useful purpose.

      Sudden contractions
      Hiccups are sudden contractions of the muscles used for breathing in.

      Just after the muscles start to move, the glottis shuts off the windpipe to produce the characteristic "hic" sound.


      Ultrasound scans show that two-month-old babies hiccup in the womb, before any breathing movements appear.

      One theory is that the contractions prepare the unborn baby's respiratory muscles for breathing after birth.

      Another is that they stop amniotic fluid entering the lungs.

      But neither of these ideas fully stands up.

      For instance, if hiccups were supposed to keep fluid out of the lungs, it would make more sense for them to involve a cough-like response, not a breath inwards.

      This latest theory, originally published in the journal BioEssays and reported in New Scientist magazine, says the key to hiccupping lies in a group of animals for whom combining closure of the glottis and contraction of the "breathing in" muscles does serve a clear purpose.

      They are the primitive air breathers, such as lungfish, gar and many amphibians that still possess gills.

      These creatures push water across their gills by squeezing their mouth cavity while closing the glottis to stop water getting into their lungs.

      A group of scientists led by Christian Straus, at Pitie-Saltpetriere Hospital in Paris believes the brain circuitry controlling gill ventilation has persisted into modern mammals, including humans.

      The researchers point to many similarities between hiccupping and gill ventilation in animals such as tadpoles.

      Both are inhibited when the lungs are inflated, for example, and by high carbon dioxide levels in air or water.

      There must, however, be a reason why hiccupping persists 370 million years after animals started hauling themselves onto the land.

      Suckling

      Straus and his colleagues suspect the habit has been adapted to a new use - helping mammals learn to suckle.

      The sequence of movements during suckling is similar to hiccupping, with the glottis closing to prevent milk entering the lungs.

      Allan Pack, an expert in respiratory neurobiology at the University of Pennsylvania, said it was a plausible theory.

      But he added: "It's going to be very tough to prove."

      The real test will be to look at the specific areas of the brain that control hiccups and suckling, says Straus.

      If the theory is correct, most of the nerves cells that are active during suckling should also fire during hiccupping.

      ---------------------------------------------------------------



      And u know, there is a hiccup lovers site :|:|:| , full of memorable (!?!?) hiccup stories

      And a band called Hiccup THe Band


      And ...... last but not the least, there is a patented device, called "Hic-Cup" for curing hiccups :D

      Wednesday, September 12, 2007

      here is the deepest secret nobody knows
      (here is the root of the root and the bud of the bud
      and the sky of the sky of a tree called life;which grows
      higher than the soul can hope or mind can hide)
      and this is the wonder that's keeping the stars apart

      i carry your heart(i carry it in my heart)