Sunday, July 18, 2010

Something old, something new, Something borrowed, something blue

Two years ago this day, I got married.

It was a ... hmm... a normal day. Everything about it was normal.
I wore a beautiful shari and was not looking my best (sigh), I never look my best when I want to.
Anyway, our house was full with our relatives and my mom was very tensed (as usual :D).
Then Reza (my husband) with his family came at 7 pm, and the electricity went off. That made my mom more tensed, why does the electricity go off every time Reza comes? Does it mean all the "lights" of her daughter's life will go off after the marriage?
Actually, at that time electricity used to go off at 7pm EVERYDAY! But who'd remind her that!

The Kazi came to me to sign the contract. He started saying (very loudly), "ঠাকুরগাঁও নিবাসী জনাব [my father-in-law] এর পুত্র মো আলিমুর রেজা এর পক্ষ হইতে [at this point I started laughing] মোহাম্মদী শরীয়ত মোতাবেক আপনি ঢাকা জেলা নিবাসী জনাব [my father] এর কননা সাদিয়া আফরোজকে বিবাহের প্রস্তাব করিতেসি. আপনি এই বিবাহে সম্মতি থাকিলে আপনের উকিলের মাধ্যমে বলেন Alhumdullillah." (Son of [my father-in-law] is proposing to marry you, daughter of [my dad]. Say Alhumdullillah if you accept the proposal.)

I was trying my best not to laugh. Everyone around me was so serious and expecting me to cry, they would feel weird if they saw me laughing. It was really puzzling, too. In all bengali movies, I heard people say "Kobul" (I agree) three times when they get married, but now I have to say "Alhumdullillah?" Do I have to say both Kobul and Alhumdullillah? Anyway, I said Alhumdullillah once and then signed the contract. Someone from the back said he didn't hear me saying Alhumdullillah, so the Kazi asked me to say it louder. I almost screamed "Alhumdullillah" and this time couldn't suppress my laugh.

Then the Kazi went to Reza and took his sign on the contract. And we got married !!! Just like that! I was still confused if that was all. So I asked my uncle, "Is that all? Am I married now?" I don't know what was wrong with my question or the way I asked it, he started laughing and kept telling everyone my peculiar question. And I was thinking, like 5 days ago, my family was so hush hush about our relationship and we were not allowed to hold hands or go out together and now everything is "legal" and permitted? Who made these rules??? Thanks God, I'm not marrying a stranger.

It took me a while to get used to the fact that we are married and it's OKAY to live with him. There were thousands of moments when I felt "Oh my god, if my mom catches me with Reza now, she is going to get very angry!" and then I remembered "Oh I'm married now!"

I wanted to finish this post with something cool. But I'm pretty slow in coming up with wonderful witty things, so let me finish with whatever in my mind right now.
Marriage is such a huge thing in our society, specially for girls, I never understood why. My parents never allowed my going out alone or hanging out with friends for long and they used to say, "Do all these after you are married." "You can go on tours with your husband." I've seen same things being told to many (all!) bengali girls along with other bullshits like "You can make your hair short if your husband likes, keep it longer till you get married." "You should put on make-ups and wear gold jewelry  after you get married, doing all these before marriage are not signs of a good girl." "Don't make a habit of spending money, what if your future husband doesn't like it?" "Don't be a dancer or singer, your future husband might not like it." "You shouldn't stay out in the sun too much, guys might not choose you to marry if your complexion is dark." As if a girl's life is going to start only after she gets married. And she has to shape herself so that society thinks she is going to be a "good" bride. Is a guy growing up shaping himself so that he can be a "good" husband? Society fills up our head with these fairy tales about a prince who marries a beautiful poor girl and makes her a queen. Is there any fairy tale about a queen marrying a poor boy and making him just her husband? There are many in real life but not in fairy tales. And also every time these stories are about "someone else will come to your life and make you happy," why don't they teach us that no one can make you happy unless you learn to make yourself happy?

May be they do, may be we need to grow up to realize the true meanings of those stories.

After my two years of married life, I think marriage is a wonderful experience that makes us grow up in many ways and teaches us to appreciate life. So, cheers to the constitution of marriage and cheers to whoever established this rule.

Wednesday, June 23, 2010

Attitude is Altitude

Meet Nick Vujicic, one of the most motivational speaker who has no arms and legs.

Sunday, May 30, 2010

Saturday, May 22, 2010

Resource 'tokenizers/punkt/english.pickle' not found.

Full solution is in here
For Mac, do this
sudo python -m nltk.downloader -d /usr/share/nltk_data all

Friday, May 21, 2010

Picture driven computing: Sikuli

Sikuli project
Watch their awesome demo

Be thankful for the thorns

To my friends out there.

Saturday, May 08, 2010

Friday, May 07, 2010

Saturday, April 24, 2010

Wireless Smart Rabbit

CHECK THIS OUT !
From Sheetal (sheetal57@gmail.com)

Check this out! this is so cool !!

Want to know more ? Go to www.nabaztag.com !

Friday, April 23, 2010

The perfect time

For me, the perfect time to do something is when I have no time at all to do it.
Is this for everyone or just for me?
Just take blogging for example, it seems to be the perfect thing to do only during exams or the night before assignment's due date. And when that's over, the moment seems to be gone and blogging doesn't feel that fun any more :(.

Saturday, April 17, 2010

smile


smile, originally uploaded by benalive.

Saturday, April 03, 2010

Extended Kalman Filter algorithm implementation

The project did not end up working the way i expected :(, I tried really hard :((
Anyway (sigh), it might give you some initial ideas about where to start.

Project Description

Check out other interesting projects people did

Grad school survival guide

Very interesting :D
Read it here

Sunday, March 14, 2010

who should we love

we all hate Pakistanis because of what they did to us during 1971.
then we should hate US too because without US support and help the war atrocities might not be so bad. (another link)
then we should hate India too because how they have been treating us since 1971.
And last but obviously not the least, we should hate ourselves for what the BDRs did to the army families because all the bdrs were bangladeshi.

Now, if we keep hating everyone in the world, who should we love?

Saturday, March 13, 2010

Vincent

i've been listening to this song for 4 days now, wonderful song!!
Its about Vincent Van Gogh and the words "starry starry night" refers to his painting the starry night
here is the original version with van gogh's paintings

Friday, March 05, 2010

Kalman filter for dummies

Awesome explanation of the kalman filter Kalman filter for dummies

c++ library for kalman filter

simplest java implementation here

A nice example of using it for 3rd order kinematics.

Monday, February 15, 2010

Prime sieve

A prime sieve or prime number sieve is a fast type of algorithm for finding primes.

some cool prime sieves:

1. Sieve of Sundaram

2. Sieve of Eratosthenes

Saturday, February 06, 2010

more poems

its like 10 inches snow outside and i'm in the mood of reading poems again :D
read the full version here.


তোমার আমার মাঝখানেতে

একটি বহে নদী ,

দুই তটেরে একই গান সে

শোনায় নিরবধি ।

Thursday, February 04, 2010

Khonek dekha by Rabindranath Tagor


যেমন ঢাকা ছিলে তুমি

তেমনি রইলে ঢাকা ,

তোমার কাছে যেমন ছিনু

তেমনি রইনু ফাঁকা !

তবে কিসের তরে

থামলে লীলাভরে

যেতে যেতে পাড়ার পথে

কলস লয়ে কাঁখে ?

একটুখানি ফিরে কেন

দেখলে ঘোমটা - ফাঁকে ?


if you are interested, read the full poem here

Wednesday, February 03, 2010

mac svn commands


#-----------------
# start svn server
#-----------------
sudo -u www /sw/bin/svnserve -d -r /Users/al/svnrepo

#-------------------
# checkout a project
#-------------------
svn checkout svn://localhost/project1

Tuesday, February 02, 2010

libpng.so.2 error

***: error while loading shared libraries: libpng.so.2:
cannot open shared object file: No such file or directory

To avoid this error:

1. Install libpn3:

sudo apt-get install libpng3


2. And rename it to libpng2:

sudo ln -s /usr/lib/libpng.so.3 /usr/lib/libpng.so.2


Thanks to Jacques for the solution.

Friday, January 29, 2010

Search for Extra-Terrestrial Intelligence (SETI) project

SETI@home is a scientific experiment that uses Internet-connected computers in the Search for Extraterrestrial Intelligence (SETI). You can participate by running a free program that downloads and analyzes radio telescope data.

Learn about the SETI project->wiki, SETI@home

Tuesday, January 26, 2010

player/stage/gazebo help

http://yorkroboticist.blogspot.com/2009_11_01_archive.html


and a tutorial Player/stage tutorial

SLAM tutorial : SLAM
Excellent slam example: slam for dummies

didn't find any example for player/stage 3.*, so i installed player 2.0.5, and stage 2.0.3

got the following error

unable to open color database /usr/X11R6/lib/X11/rgb.txt :
No such file or directory (stage.c stg_lookup_color)

To correct this problem, player/stage needs a link to the X11 color map in the place it expects:

sudo ln -s /usr/X11/share/X11/rgb.txt /usr/X11R6/lib/X11/rgb.txt


detailed solution: here

Java client for player/stage: here

--
Sheetal

Saturday, December 05, 2009

Super cool panaromas!!!

Click on the pictures to see the 360 degree views.
the moon
seven wonders

DNS security flaws




full story


In practice the DNS service behaves very much like the /etc/hosts file on your computer, which is where the system initially looks up name resolutions before relying on the DNS system. The file is basically a list of IP addresses followed by the name you've associated with those IP addresses. For example, if you edit the file you can associate any domain name with any IP address of your choosing.

1. Open Terminal and enter the following command to edit the hosts file

sudo pico /etc/hosts

2. Go to the bottom of the file and enter the following:

74.125.19.106 www.apple.com

3. Press control-o followed by the return key to save the file

Sunday, November 08, 2009

How to do print screen in Mac OS X

see here

full screen: command key + Shift + 3
selected screen: command key + Shift + 4, then mouse will look like "+" sign, then choose selected region.

Thursday, October 08, 2009

Google Honors Anniversary of Bar Code Patent Awarded to Drexel Alumnus, Faculty Member

On Wednesday, October 8, 2009, Google celebrated the 57th anniversary of the first bar code patent by changing the logo on its Web site with a black and white bar code design.

Drexel alumnus Norman Woodland (above) CoE '47, Hon. '98, and faculty member Bernard Silver received the first patent (U.S. Patent # 2,612,994) for their bar code on October 7, 1952. The bar code created by Woodland and Silver was comprised of a series of concentric circles, not the black and white vertical lines used currently.

Wednesday, August 12, 2009

Read bangla newpaper on mac

This firefox extension converts  some Old Bangla Newspaper Website to Unicode 4.2.
You need unicode installed on you machine. Download unicode for mac here
It was for old firefox versions.
To make it run on your new firefox, you can download the xpi file------>rename it to zip ----> unzip it ----> change maxVersion attribute in the install.rdf file to 3.* ----> then again zip it ----> rename to xpi.

OR

just download and install this 


--
Sheetal

--A journey of a thousand miles begins with a single step --

Install windows on mac

This one is on sun virtual box
http://www.youtube.com/watch?v=YhTb_7TSDXQ&feature=related

Tuesday, August 04, 2009

Wednesday, April 01, 2009

Counting in for loop in dos batch

This is the default behaviour of a FOR loop:



@echo off
setlocal
:: count to 5 storing the results in a variable
set _tst=0
FOR /l %%G in (1,1,5) Do (echo [%_tst%] & set /a _tst+=1)
echo Total = %_tst%
C:>demo_batch.cmd
[0]
[0]
[0]
[0]
[0]
Total = 5

Notice that when the FOR loop finishes we get the correct total, so the variable correctly increments, but during each iteration of the loop the variable is stuck at it's initial value of 0

The same script with EnableDelayedExpansion, gives the same final result but also displays the intermediate values:



@echo off
setlocal EnableDelayedExpansion
:: count to 5 storing the results in a variable
set _tst=0
FOR /l %%G in (1,1,5) Do (echo [!_tst!] & set /a _tst+=1)
echo Total = !_tst!
C:\>demo_batch.cmd
[0]
[1]
[2]
[3]
[4]
Total = 5

Notice that instead of %variable% we use !variable!


http://www.ss64.com/nt/setlocal.html

Thursday, February 26, 2009

The gate of death

http://www.thedailystar.net/newDesign/news-details.php?nid=77648

--
Sheetal

--A journey of a thousand mile begins with a single step --

vista "configuring updates step 3 of 3" continous loop solution

I stepped into this mess today and finally got out of it. what i did-

1. when you see the “Microsoft (C)” with the moving lines, hold the power button until it shuts down.

2. then start it again, you will find a window asking for "launch automatic repair". choose this option.

3. i didn't have to do anything else. if you are still stuck, follow these instructions.

Monday, January 12, 2009

Sunday, January 11, 2009

Download entire website using wget

wget-tircks-and-tips

If want you save the website exactly the same way a web-browser do, use the following command

wget --no-check-certificate -nd -pHEK -erobots=off  http://www.example.com
    


--
Sheetal

--A journey of a thousand mile begins with a single step --

Friday, November 21, 2008

Creating mozilla extension

http://www.borngeek.com/firefox/toolbar-tutorial/chapter-1/
http://ancaluca.blogspot.com/2007/10/java-firefox-extension.html
http://groups.google.com/group/mozilla.dev.tech.java/browse_thread/thread/41a2db6eb748e6f6

File i/o:
https://developer.mozilla.org/En/Code_snippets:File_I/O#Writing_to_a_file

Thursday, October 23, 2008

Art of mathematics or mathematics of art!



my friend sopan posted this awesome link on facebook. its about the art work, mathematical art actually, of Maurits Cornelis Escher who explored many cool mathematical ideas through his works.

Monday, September 29, 2008

Interesting CS project

These projects a really interesting.
1. swarm-bots project. watch the video. paper about swarm-bots
2. head tracking for VR displays using WiiRemote. watch the video.

Saturday, September 27, 2008

Wednesday, June 25, 2008

Happiness


Happiness, originally uploaded by medieval panda.

The art of being happy lies in the power of extracting happiness from common things.

~Henry Ward Beecher

Thursday, May 22, 2008

Grad Student Comic Strip

Your friend (sheetal) sent the following message to you:



(no image? copy and paste the link below)
http://www.phdcomics.com/comics/archive.php?comicid=562


signed by sheetal

'Piled Higher and Deeper' by Jorge Cham is the popular comic strip about life, or the lack thereof, in grad school. Check it out by going to www.phdcomics.com


drop all constraints

To drop all constraints on a table "sampleTable", use the following commands:


CREATE TABLE temp AS SELECT * FROM sampleTable;
DROP TABLE sampleTable;
CREATE TABLE sampleTable AS SELECT * FROM temp;
DROP TABLE temp;


source
reference

Thursday, April 17, 2008

osgi tutorial

Installation:
If you have eclipse 3.3, you don't need any extra plugin.

OSGi tutorial

after building your bundle do the following to make jar:

* Right click on your bundle and select Export. Choose “Plug-in Development->Deployable Plugins and Fragments”.
* Select destination folder (for example /home/pc/Desktop)
* Click “Finish”

complete your plug-in:

somedir/
configuration/
config.ini
eclipse.exe
plugins/
org.eclipse.equinox.common_3.3.0.jar
org.eclipse.equinox.launcher.win32.win32.x86_1.0.0/
eclipse_1017a.dll
[other launcher fragment content]
org.eclipse.equinox.launcher_1.0.0.jar
org.eclipse.osgi_3.3.0.jar
org.eclipse.update.configurator_3.2.100.jar
< your_bundle1 >.jar
< your_bundle2 >.jar

write config.ini->>

osgi.bundles=< your_bundle1 >.jar@start,< your_bundle2 >.jar@start
osgi.bundles=org.eclipse.equinox.common@2:start, org.eclipse.update.configurator@3:start
eclipse.ignoreApp=true
osgi.noShutdown=true


for linux, set up is same, just change the eclipse.exe, org.eclipse.equinox.launcher,org.eclipse.equinox.launcher.win32 with their linux version.

Now, execute the following command:


eclipse -console


A new console will appear.
do the following:
osgi>
osgi>ss


all the bundle will appear.

write

start < bundle id >

this will start your plugin.

example 1
example 2

Tuesday, April 15, 2008

Monday, March 24, 2008

Two Days We Should Not Worry

(Author Unknown)

There are two days in every week about which we should not worry, two days which should be kept free from fear and apprehension.

One of these days is Yesterday with all its mistakes and cares,
its faults and blunders, its aches and pains.

Yesterday has passed forever beyond our control.
All the money in the world cannot bring back Yesterday.

We cannot undo a single act we performed;
we cannot erase a single word we said.
Yesterday is gone forever.

The other day we should not worry about is Tomorrow
with all its possible adversities, its burdens,
its large promise and its poor performance;
Tomorrow is also beyond our immediate control.

Tomorrow's sun will rise,
either in splendor or behind a mask of clouds, but it will rise.
Until it does, we have no stake in Tomorrow,
for it is yet to be born.

This leaves only one day, Today.
Any person can fight the battle of just one day.
It is when you and I add the burdens of those two awful eternities Yesterday and Tomorrow that we break down.

It is not the experience of Today that drives a person mad,
it is the remorse or bitterness of something which happened Yesterday and the dread of what Tomorrow may bring.

Let us, therefore, Live but one day at a time.

Happy Clown


Happy Clown, originally uploaded by technicolortype_a.

Wednesday, March 12, 2008

Doc Edgerton: the man who made time stand still



It was the title of an National Geographic Magazine article in October 1987 that featured Edgerton's work. While seeking for high speed photography technique I found out about Harold Eugene "Doc" Edgerton who invented ultra-high-speed and stop-action photography.

Edgerton, an electrical engineer and professor at MIT, was a pioneer in the field of high-speed photography, exploring the effects of the stroboscope and electronic flash when directed at moving objects. His subjects ranged from birds in flight to the first millionth of a second of an atomic blast. Some of his more famous images include the compression of a tennis ball against a racquet, the multiple movements of a golfer's swing, a speeding bullet as it passes through an apple, and the coronet formed by a milk drop as it splashes into a saucer. The exhibition contains many of these stop-motion images, which, in addition to being scientific evidence, are considered objects of art.

Milkdrop Coronet, 1957
Find more about his life and work at MIT museum website

Some of his interesting quotes i found in internet:

"Don't make me out to be an artist. I am an engineer. I am after the facts, only the facts."
"In many ways, unexpected results are what have most inspired my photography."

By the way, 1st image is "milk meets coffee" by Irene Müller.

More awesome photos are available here.

Monday, March 10, 2008

Ruby crown


Ruby crown, originally uploaded by Luis Eduardo.

Thursday, March 06, 2008

Ghost ship


Ghost ship, originally uploaded by Creative.i.

Wednesday, March 05, 2008

admission er tension e otishto hoye ki korbo bujhte na pere amar oti favorite kaaj shuru korlam- google search. ekta lekha pore monta bhalo hoye gelo bi-deshir deshi wedding.
mon bhalo korte asholei karon lage na :)

Tuesday, February 26, 2008

Ugly duckling


A mother duck hatches her eggs and, while most of her ducklings are normal, one is grey, too large, and too clumsy to fit in among the others. Though she tries to accept him, the entire barnyard realizes that he simply does not belong and after a period of harassment he leaves to fend for himself. He is sheltered by an old woman in her poor cottage, but her cat and her hen will not accept him and he is forced to set off once again on his own. He wanders for the entire summer and fall, for no one will take him in, and he nearly freezes to death in an icy pond. Though he is rescued by a human, he cannot live in captivity, and he returns to the wild.

By the end of winter, he is miraculously still alive. He comes to a pond in a park or garden, where beautiful white swans are swimming. He is drawn to their beauty, though he has no reason to think that they will treat him better than anyone else has. Still, he thinks, even if they kill him, he must approach them. To his surprise, the beautiful creatures welcome and accept him; gazing at his reflection, he sees that he too is a swan. The children declare that he is the most beautiful swan of them all, yet he is not proud, for a good heart is never proud. Because of all that he suffered he now appreciates his happiness so much more.

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