Wednesday, January 31, 2007

Shayari

safar kii had hai vahaa.N tak ke kuchh nishaan rahe
chale chalo ke jahaa.N tak ye aasmaan rahe

ye kyaa uThaaye qadam aur aa ga_ii manzil
mazaa to jab hai ke pairo.n me.n kuchh thakan rahe

vo shaKhs mujh ko ko_ii jaal_saaz lagataa hai
tum us ko dost samajhate ho phir bhii dhyaan rahe

mujhe zamiin kii geharaa_iio.n ne daab liyaa
mai.n chaahataa thaa mere sar pe aasmaan rahe

ab apane biich maraasim nahii.n adaavat hai
magar ye baat hamaare hii darmiyaan rahe

sitaaro.n kii faslen ugaa sakaa na ko_ii
merii zamiin pe kitane hii Kisaaan rahe

vo ek savaal hai phir us kaa saamanaa hogaa
duaa karo ke salaamat merii zabaan rahe

tujh par bhii ko_ii ilzaam sahii

ye husn teraa ye ishq meraa
rangiin to hai bad_naam sahii
mujh par to ka_ii ilzaam lage
tujh par bhii ko_ii ilzaam sahii

is raat kii nikharii rangat ko
kuchh aur nikhar jaane de zaraa
nazaro.n ko bahak jaane de zaraa
zulfo.n ko bikhar jaane de zaraa
kuchh der kii hii taskiin sahii
kuchh der kaa hii aaraam sahii

jazbaat kii kaliyaa.N chunanaa hai
aur pyaar kaa tohfaa denaa hai
logo.n kii nigaahe.n kuchh bhii kahe.n
logo.n se hame.n kyaa lenaa hai
ye Khaas ta'alluq aapas kaa
duniyaa kii nazar me.n aam sahii

rusavaa_ii ke Dar se ghabaraa kar
ham tark-e-vafaa kab karate hai.n
jis dil ko basaa le.n pahaluu me.n
us dil ko judaa kab karate hai.n
jo hashr huaa hai laakho.n kaa
apanaa bhii vahii anjaam sahii

ye husn teraa ye ishq meraa
rangiin to hai bad_naam sahii
mujh par to ka_ii ilzaam lage
tujh par bhii ko_ii ilzaam sahii

Analyzing IIS logs ...

Well...since we are talking about logs, lets talk abt how to analyze the IIS logs...\


If your IIS is even half as busy as mine, you must wanna know whats cooking on the server...

Here is how you can analyze the logs for IIS

Report Generation for the live server

1. The applications used for log analysis are the freewares, Analog and Reportmagic. The softwares are stored in the “install” directory of the IAI machines.

2. *:\Apps\Website Statistics is the directory where the softwares were installed by me. After the install (which is basically unzipping of the files), modify the following files.
a. analog.cfg – this is the configuration file for the analog software. We are modifying it to provide the software with the path of the log files. Back up the original file and then, change the following lines to make them appear something like this -

# If you need a LOGFORMAT command (most people don't -- try it without first!),
# it must go here, above the LOGFILE commands.
# LOGFILE logfile.log
LOGFILE **************\ex*.log
OUTPUT COMPUTER
OUTFILE Report.dat
HOSTNAME "************** WEBSERVER"
#
b. rmagic.ini - This is the configuration needed in the file –
#
# iTransfer.org Report Magic settings file.
# Created by Abhilasha Sharma - Dec 20, 2006
#
[statistics]
File_In = **************\Report.dat
Frame_File_Out = index.html
Format= XHTML 1.0
[reports]
Active_Column=R
File_Out = reports\
Title_Font = Helvetica,Arial,sans-serif
Title_BG_Color = #000000
Title_Font_Color = #FFCC00
Data_Font = Helvetica,Arial,sans-serif
Data_Color_1 = #D0FFD0
Data_Color_2 = #F0FFF0
Data_Total_Color = #FFCC66
Data_Header_Color = #9999CC
[QUICK]
Rows = ALL
[graphs]
BG_Color = #FFFFCC

[navigation]
File_Out = nav.html
[website]
Title = Web Statistics for ******* Website
Webmaster = asharm4@**************
Base_URL = http://**************
3. Now, first run the analog.exe. This would take atleast 3-5 mins depending on the number of log files to be analyzed.

4. Once the log analysis is complete, run “rmagic.exe”. This would take the results generated by analog.exe and present them in a more readable format.

Creating Logs for the IMail server

Well, it has been 7 months since I first installed the Mail server on my machine and so, out of curosity I decided to see what was cooking on the mail server...

Here is how you create the logs for the IMail colaboration suite...

1. Connect to the remote server.. [:p]
2. Now, go to Start > Programms > Ipswitch Collaboration Suite > IMail Server > IMail Log Analyzer
3. Now choose the logs using select log.
4. It helps to arrange the logs by date modified to facilitate the log choosing for a perticular month
5. I like to select all the options to analyze the logs on...Why not !! We got the logs here..right ?
6. Save the file on the webserver in the secret folder.
7. Analyze the results...

This reminds me...

If you want to block a perticular IP address on the server, you need to do the following
1. Login on to the IAdmin section of the website
2. GO to Services > SMTP > Control Access
3. Enter the IP address here...

If you want to block an entire DNS, add it to the black list instead..its eazier that way...

Tuesday, January 30, 2007




Hmmmm one of the biggest gems out of Neeraj's treasure of peoms...

And this happens to be my dad's fav one too...

The poem is pretty depressing ..but the entire picture it draws and the deftness with which it makes you feel the pain...remarkable...Perfect !!

Shayari

aa chaa.Ndanii bhii merii tarah jaag rahii hai
palako.n pe sitaaro.n ko liye raat kha.Dii hai

> The moonlight stays awake with me
> The night stands around with the stars in her eyes

ye baat ki suurat ke bhale dil ke bure ho.n
allaah kare jhuuTh ho bahuto.n se suunii hai

> you are great to look at but evil at heart
> Allah wishing, it be false, but heard it multiple times

vo maathe kaa matalaa ho ki ho.nTho.n ke do misare
bachapan kii Gazal hii merii mahabuub rahii hai

>Be it the couplets making the pretty head or poems designed as lips
>Poetry has been my lover since my childhood

Gazalo.n ne vahii.n zulfo.n ke phailaa diye saaye
jin raaho.n pe dekhaa hai bahut dhuup ka.Dii hai

> Poetry has given me the shade
> at the places in my life where the times were though

ham dillii bhii ho aaye hai.n laahaur bhii ghume
ai yaar magar terii galii terii galii hai
[laahaur =Lahore]

> I went to Dilli and i went to lauhaur
> But, my sweetheart, your place still is your place

Day of nightmares, part two`

OKie...now with CSS set...

I make the website live and volha...it crashes within first few secs...Lots of log analysis...lots of thinking...cannot put a fingure on why !!1

Then, i realize something...The mail client on my server IClient runs the asp.net 1.1 while New website uses asp.net2.0 and so, when the server was parsing the pages, it would detect two different versions of .net in same application pool and disable the version it was not serving..So, if we checked IClient first, website was disabled and vise versa....

Oh well...am just a mortal after all..fallible...

Anyways..Just created two application pools and things have never been better...

Day of nightmares ...

Ohokie...my new website went live yesterday...and that was 1 day that taught me so much...

IE 6 is definately not standards complient...it takes a perfectly fine CSS and makes a mockery of it...

So, here is a little trick ..

Take a standard CSS...and put some custom tags in for IE6..
/*Standard Tags*/
padding-left:205px; /*left + margin of 10*/
margin-left:25px;
text-align:justify;
/*IE 6 Tags*/
_width:100%;
/*_border:thin solid green;*/
_margin-left:-100px;
_padding-left:0px;

So, when the page is parsed by standard browsers ..(FF, Opera, IE7 etc) they parse the right tags and then give you the pretty page..

IE6 on the other hand would read the tags with underscores and create an acceptable version of the page.....

IE6 and IE7 are very different browsers...No doubts abt it..

Wednesday, January 24, 2007

The itransfer website progress

Well here is what I have basically accomplished till now...
1. created the layout which changes according to the screen resolution
2. layout changes by seasons
3. For no javascript person, there is only one standard layout...

A new lesson every day

Well today's lesson is that you cannot span document.write over mutliple lines while coding javascript...

If you do, javascript keeps on showing weird errors without actually pointing the current error...

Tuesday, January 23, 2007

DIVS browsers and pain.....

Well, why cannot microsoft be more like the rest of the world...

When you put padding in the DIVs ...the world adds...IE substracts....

Ah well....here is a little hack i wrote to get a very stupid background image on this page to align ...

http://dev.itransfer.org/abhilasha/Original%20Illustrator%20File/final_html/new.html

which is going to be www.itransfer.org...

So, here is the stupid hack ...

<script type="text/javascript">

<!--

if (is_ie5up)

{

if (screen.width <= 640)

{document.write("<link rel=\"stylesheet\" href=\"css/ie/640.css\"
type=\"text/css\" />")}

if (screen.width == 800)

{document.write("<link rel=\"stylesheet\" href=\"css/ie/800.css\"
type=\"text/css\" />")}


if (screen.width == 1024)

{document.write("<link rel=\"stylesheet\" href=\"css/ie/1024.css\"
type=\"text/css\" />")}


if (screen.width >=1280)

{document.write("<link rel=\"stylesheet\" href=\"css/ie/1280.css\"
type=\"text/css\" />")}

}

else //the rest of the world falls in this category

{


if (screen.width <= 640)

{document.write("<link rel=\"stylesheet\" href=\"css/ff/640.css\"
type=\"text/css\" />")}


if (screen.width == 800)

{document.write("<link rel=\"stylesheet\" href=\"css/ff/800.css\"
type=\"text/css\" />")}


if (screen.width == 1024)

{document.write("<link rel=\"stylesheet\" href=\"css/ff/1024.css\"
type=\"text/css\" />")}


if (screen.width >=1280)

{document.write("<link rel=\"stylesheet\" href=\"css/ff/1280.css\"
type=\"text/css\" />")}

}

// -->

</SCRIPT>


So, if you are IE, you get special sheets...

BE HAPPY !!!

Reminds me of a joke, though...

How many hours will it take bill gates to screw in a light bulb ?
None..he would just declare the darkness as industry standard..

And when you are as big and powerful as billy you can do that...right ?

Bow to the king !!!!

Friday, January 19, 2007

Dont you hate the annoying music directors

Himesh Reshammiya was picked up by the cops late last night. The famous ‘Aashiq Banaya Aapne’ singer has been reported for singing in a very irritating voice and causing disturbances for innocent children who are already suffering from examination fever.

Himesh was kept at the central police station for the entire night and was made to hear his own music in a closed room at full volume. He apparently broke down and swore not to sing again. People have been making allegations against him for generating fear amongst small children who were being made to watch him in every next music video on national television.

His habit of not bathing and using the same cap, clothes and an unshaven look has been scaring women off television. The district magistrate has ordered a probe into the allegations and if the charges are proved, Himesh might have to go through a horrifying death penalty. (I wish I wish I wish)

Get off the TV now!

Thursday, January 18, 2007

Difference between DIv and Span

copied this post from here


What’s the difference between <span> and <div> tags?


<span> and <div> tags both allow a Web designer to style text
and add other formatting attributes to their Web page. They are not interchangeable
tags, though. <div> tags are block-level elements, whereas <span>
tags are not. This article explains this, and other differences, between <span>
and <div> tags.

Both <span> and <div> tags allow you to apply CSS styles


<span> and <div> tags are both fine for applying inline CSS formatting.
Consider the following code:


<div style="color:#000000;font-weight:bold;font-size:14px">Here’s
some text in between div tags</div>


The output of this code is the same as:


<span style="color:#000000;font-weight:bold;font-size:14px">Here’s
some text in between span tags</span>

<div> tags are block elements that allow you to position elements contained
within them


<div> tags are block elements. This means they can "hold"
other HTML elements, and they can be positioned anywhere on the screen. For
this reason, <div> tags can be used for replacing table-based Web designs.

<span> tags are NOT block elements


Unlike <div> tags, <span> tags cannot hold other HTML tags. They
should only be used for inline styling of text. Consider the following code:


<span style="font-size:14px">

<p>This is some text sized at 14 pixels.</p>

</span>


This code will probably render OK in most browsers, but it is actually incorrect.
Remember, since the <span> tag is not a block-level element, it cannot
contain other HTML tags. The correct way to write this code would be:


<p><span style="font-size:14px">

This is some text sized at 14 pixels.

</span></p>


While this code is correct, it can be written more efficiently by removing
the <span> tag altogether:


<p style="font-size:14px">

This is some text sized at 14 pixels.

</p>

<div> tags create line breaks, <span> tags do not


Since <div> tags are block elements, they create line breaks. This
is the same effect as a <p> tag. <span> tags do not create line
breaks, which makes them perfect for styling text in the middle of a sentence.
Here’s an example of a <span> tag used to style text in the middle
of a sentence. The same code using <div> instead of <span> would
produce undesired results.


<p>It's snowing in the Northeast today. Some towns received as much
as <span style="font-size:18px;font-style:italic;font-weight:bold;">6
inches</span> of snow.</p>

Summary of <span> vs. <div> tags


<span> tags are useful if you need to apply specific formatting styles
to text in the middle of a sentence, or in one place on your Web page. They
are far less powerful than <div> tags, though, as a <div> will
allow you to create blocks of content (like table-based Web designs) and position
elements on the screen.

This article was written by Christopher Jason and published on Sunday, January
15th, 2006. You can follow any responses to this entry through the RSS 2.0
feed.

Friday, January 12, 2007

IPod troubles..the shuffle made me shuffle

Okie..this morning i installed the new itunes on my work computer and guess what...the machine started freaking out...I have a robust system with 4 Gig RAM...and 2 dual Xenon processors....and it could not update the iPod...Oh well...

I went on google...after all, if internet begins with google...right.....I asked God..i mean google and here are some of the ways i found...


Below are a list of way people have attempted to fix their iPods who have had some level of success. Please note should you experience any negative results or no results at all, we cannot take responsibility. We’re hoping something below may help you. Likewise if it works we can’t responsibility either

The ‘Beat the Shit Out Of It’ Technique
Just give your Shuffle a few good wacks on your desk. Once while holding the play button, the other time without.

Then, simply press the battery button.

Replug the shuffle

The ‘Ditch iTunes’ Approach
After talking with some techno geeks I was told about another open source program that is capable of preforming all the same tasks as itunes and is capable of giving us back the product we paid for.

It’s called MediaMonkey http://www.mediamonkey.com/ . It’s completely free although there is an option to upgrade to a gold membership which just unlocks a few more features. Definately something I’d recommend until Apple gets its act together and fixes this major screw up.

The ‘We’ve Got All Day’ Method
DO NOT HAVE YOUR IPOD SHUFFLE connected to your USB connection to your computer until mentioned below:

1) Uninstall both Itunes and IPOD for Windows 2006-03-23.
Go to My Computer, Control Panel, Add or Remove Programs, locate ITunes 6.0.4.2 (or the version you have) click on it and then click on the ‘Change/Remove’ button. Then follow the same steps to uninstall IPOD for Windows 2006-0323.

2) Restart your computer. Then reinstall your IPOD & Itunes software (CD that came with IPOD.

3) Then go to apple.com, click on the IPOD+ ITunes tab on top, click on the DOWNLOAD tab on top of screen, then select your Operating System (Windows or MAC OS), then click on DOWNLOAD Itunes 7.0.1 - Free button.

4) Once this is all done RESTART your computer again.

5) Now click on the Itunes ICON that is on your DESKTOP.

6) Now connect your IPOD Shuffle to your USB (to your computer) make sure that your IPOD Shuffle is OFF (on the back of it slide it until no Green is showing).

7) WAIT until it prompts you and on the it top gives you a “Settings” tab.

8) CLICK on the Settings tab and RESTORE your IPOD Shuffle from Itunes (Note: I tried restoring my IPOD from the IPOD software & it kept failing & was not successful)

9) WAIT until it says that the RESTORE was successful.

10) ****IMPORTANT INFORMATION **** By your IPOD Name (the name you gave it) on the right side there is an arrow that goes up & down that when you place your cursor over it (reads EJECT). You MUST CLICK on this to EJECT (closeout) your IPOD Hardware “BEFORE” you take out your IPOD Shuffle.

11) Now Closeout Itunes and then reopen it up.

12) Once Itunes is OPEN then get your IPOD Shuffle & now slide the back down so now you can see the Green & IPOD is on.

13) Connect your IPOD shuffle to your USB (your computer).
Wait a little while, you will get some prompts with some questions you need to answer and then it should automatically begin to load any music that you had save in your Music Library. Wait UNTIL it says that its Complete on the middle top of the page.

14) Now disconnect your IPOD Shuffle and press the middle button on the front (hold it down for about 1 second) and the green light should stay on and music should start playing.

‘Unleash Your Shuffle’
1. Uninstall Itunes completely
2. Format shuffle using Windows with fat 32
3. Download iPod shuffle unleashed from here: http://agoraphobeus.free.fr/iShuffle/index.html
4. Unzip and install this to the root folder of your shuffle
5. Copied the music you want to the music folder
6. Double clicked the iShuffle icon and hope for the best.

Thursday, January 11, 2007

DIVs and Background Images...

So, basically, they give you this really cool feature in DIVs which lets you put any image in the background so that your page could look exactly how you wanted it...

But then, that would be too eazy right ??

So, here is the catch - THE BACKGROUND IMAGES OF THE DIVs ARE NOT PRINTABLE.

Oh YES !! Exactly the nightmares I used to have....!!!!

Here is this heavenly perfect page I made and woopsie..the header and the footer of the page dont show up in the printouts...because by default, the browsers have the print feature disabled for the background images....

Not a very fun feeling, trust me...

So how to fix the problem ....I am still trying to work out a perfect solution but here are some of my attempts...
  • Using the print style sheet -

@media print {

#title { letter-spacing:-1000px; }

#title:before { content: url(banner.jpg); }

}

  • Using the DIV layering in the page


<div id="Body" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px;
PADDING-BOTTOM: 0px; PADDING-TOP: 0px; HEIGHT: 800px" align="center"><p></p><p><img
height="100%" src="images1/background_image.jpg" width="1014"
border="0" /></p><p><div id="LeftNevigation"
align="left">Menu goes here</div><p></p><p><div
id="TopBanner" align="left">Banner goes here</div><p></p><p><div
id="CenterBody" align="left">Main Text Goes Here</div><p></p><p></p></div><p></p><p></p>

  • Using the Line-Style Hack

I found another, non-HTML based solution (example) though, and list-style-image is the keyword. I explain.Instead of including our banner graphic via the background-image hook, we use CSS' "lists" functionality instead.Suppose you want the browser to print an image in the place of an h1 with id="title", then the following piece of print CSS does the trick:

#ti\tle {
/* 6. */display: list-item; /*
1. */list-style-image: url(banner.jpg);
/* 2. */list-style-position: inside;
/* 3. */letter-spacing: -1000em;
/* 4. */font-size: 1pt;
/* 5. */color: #fff;
/* 5. */}

Some annotations:
We give our h1 the characteristics of a list-item.
We pretend our banner image is a list-style-image.
Firefox wants you to put the image inside.
We make the text disappear into a black hole by means of Malarkey's Image Replacement (MIR).
As MIR doesn't work in Opera, we set the font-size to 1pt and make the text white. This works fine with Opera's default print settings. Other image replacement techniques rely on moving or hiding mechanisms, all of which would also hide our image. Hence small, white text.
As list-style-image is not supported in IE5 and IE5.5, we exclude these browsers with a simple escaping hack.

When the things are different from what they seem

In PHP, there is this handy feature called array_unique which creates an array of unique values, as the name indicates...

I sure was glad to see the function and decided to use it in my code while parsing some really big and dirty arrays...and sure enough, I had Unique values in the resulting Arrays...

here is how i used it -

$agency = array_unique($agency); //where agency is the array having the redundant values...
$count_agency = count($agency); //total number of distinct values
asort($agency); //to sort the values in acending order...

And sure enough, there was this little catch...-

The array preserved the location of the unique values...And I had the unique array with lots of null values...

There are two possible workarounds to this -

1. The quick and dirty way - Create a new array and use it
$count = 0;
foreach($agency as $var)
{
if($var!=NULL)
{
$new_agency[$count] = $var;
$count++;
}
}
$agency = $new_agency;
2. Use foreach in every calling of the array
Or you could just use foreach to loop through the array and use it that way...

But always remember, the comparison of any string to NULL in PHP is a bad idea. It not only slows your code down but also, leads to some false positives in matching the data.

So, the lesson for the day -
Clear the NULLs before you use the array_unique results.

Cheers