Thursday 16 June 2011

Selenium

Integrating Selenium with HTTPFox (Firefox plugin) for HTTP traffic manipulation
http://sejq.blogspot.com/2008/12/automate-httpfoxhttpwatch-test-case-for.html
http://httpfox.googlecode.com/svn/trunk/chrome/content/HttpFox.js

PHPUnit and Selenium
http://www.phpunit.de/manual/current/en/selenium.html

goto, gotoIf and while loop functionality in Selenium IDE.
http://51elliot.blogspot.com/2008/02/selenium-ide-goto.html

Automating Selenium IDE tests : If frames are not workable, use the option &multiWindow=true in the query string. To post the results to a remote url use &resultsUrl=[path]
http://wiki.openqa.org/display/SIDE/Automating+Selenium+IDE+tests

Selenium Core
http://wiki.openqa.org/display/SEL/Home

Selenium RC browser launchers
http://stackoverflow.com/questions/2569977/list-of-selenium-rc-browser-launchers

Tuesday 14 June 2011

Granting Javascript access to clipboard

By default , Firefox don't allow javascript to read or set the clipboard data for privacy and security reasons. But this can be overcome by following the steps given in the below url.
http://kb.mozillazine.org/Granting_JavaScript_access_to_the_clipboard

Monday 13 June 2011

Eclipse is running in a jre, but a jdk is required

We receive this error because the JVM is not specified in the eclipse.ini file. Please see here http://wiki.eclipse.org/Eclipse.ini on how to set it.

Drawing Garph in PHP

Drawing Graph in PHP is made very simple by the following two PHP libraries
http://jpgraph.net/
http://naku.dohcrew.com/libchart/pages/introduction/

Capturing the IP address using SSI and Javascript

Copy to Clipboard using Flash and Javascript

Here is a cool way to provide the "copy to clipboard" functionality using http://code.google.com/p/zeroclipboard/

Aborting a Shell script

To exit the shell script use the option "set -e". It Exits immediately if a simple command exits with a non-zero status, unless the command that fails is part of an until or while loop, part of an if statement, part of a && or || list, or if the command's return status is being inverted using !.
Reference:
http://www.gnu.org/software/bash/manual/bashref.html#The-Set-Builtin
http://ss64.com/bash/set.html

Friday 10 June 2011

CSS: position and float

Invoke javascript from flash

CSS : display and visibility

Letz know the difference between display and visbility property of CSS from the below link.
http://www.devx.com/tips/Tip/13638

IE blocking Iframe Cookies

iFramed content that is hosted in a separate domain from the parent page is regarded as third-party content. So due to security constraints, IE block the cookie in an iframe. To overcome this we need to create a P3P policy file. The below links give more details on this.
http://adamyoung.net/IE-Blocking-iFrame-Cookies
http://msdn.microsoft.com/en-us/library/ms537343.aspx#p3p_and_compact_policies
http://stackoverflow.com/questions/389456/cookie-blocked-not-saved-in-iframe-in-internet-explorer

In Google Analytics, we need to set the P3P header for tracking Iframes hosted in a separate domain from the parent
http://code.google.com/apis/analytics/docs/tracking/gaTrackingSite.html#trackingIFrames

NJ-NY-WDC

If you are in NewJersey or NewYork, the following places are definitely worth visiting
  1. Philadelphia(Liberty bell)
  2. Thomas Edison Center @ Menlo Park
  3. Chinatown
  4. The Metropolitan Museum of Art
  5. Trinity Church
  6. City Hall
  7. BridgeWater and Pittsburgh Venky Temple
  8. Rockfeller Center
  9. Flatiron Building
  10. Brooklyn Bridge
  11. Time Square
  12. Empire State Building Observation Deck
  13. Central Park
  14. American Museum of Natural History
  15. Federal Hall
  16. Madame Tussauds Museum
  17. Niagara Falls
  18. Finger Lake
  19. Statue of Liberty & Ellis Island Immigration Museum
  20. Washington DC(National Air and Space Museum, Capitol hill, Thomas Jefferson,Abraham Lincoln,Vietnam Veterans - Memorial,Washington monument, White House)
  21. Baltimore Harbor
  22. Charging Bull
  23. The New York Stock Exchange
  24. Grand Central Terminal
  25. Ground Zero (World Trade Center)
  26. The remains of "The Sphere", which stood in the fountain that was once the centerpiece of World Trade Center plaza (Near to Charging Bull)
  27. Lincoln center 
  28. United Nations headquarters

MySQL Query log

The server writes information to this log when clients connect or disconnect, and it logs each SQL statement received from clients. The general query log can be very useful when you suspect an error in a client and want to know exactly what the client sent to mysqld.
Reference:
http://dev.mysql.com/doc/refman/5.6/en/query-log.html


Document.close in an iframe

Never call document.close() in an iframe. In IE, this halts all the javascript execution there.
Reference:
http://stackoverflow.com/questions/1736886/why-wont-this-javascript-using-document-open-and-document-write-work-in-intern

prototype js breaks javascript for in loops

The for in statement allows for looping through the names of all of the properties of an object. Unfortunately, it also loops through all of the properties that were inherited through the prototype chain. This has the bad side effect of serving up method functions when the interest is in data properties. If a program is written without awareness of this situation, then it can fail. So always wrap the body of a for loop inside an if statement by adding a hasOwnProperty condition.

Reference:
http://www.jslint.com/lint.html
http://zurahn.wordpress.com/2009/01/11/prototypejs-breaks-javascript-foreach-loops/

Thursday 9 June 2011

Tools for Javascript

Here are some of the tools related to Javascript.
  1. Google Closure Compiler 
  2. JSlint - Code quality
  3. JSMIN - JS Minifier
  4. JSdoc - For documentation
  5. JSunit -  Unit testing
  6. JScoverage - Code coverage
  7. Selenium - Testing tool 
  8. http://jsbeautifier.org/ - To unpack the compressed javascript
   

Cookies and localhost

No matter how hard you try, cookies will never be stored in localhost if you explicitly specify the domain parameter as "domain=localhost". Because for the cookie to be stored the domain name must have at least two (2) or three (3) periods in them.
Reference:
You can find here the other conditions for the cookies
http://curl.haxx.se/rfc/cookie_spec.html

Iframe and allowtransparency

For the option allowtransparency="true" to work in an iframe, we need to set the 'style="background-color:transparent"' in the body tag.
Reference:
http://msdn.microsoft.com/en-us/library/ms537627%28VS.85%29.aspx#transparency 

http://www.dynamicdrive.com/forums/showthread.php?t=724

Wednesday 8 June 2011

Detecting undefined object property - Javascript

while checking the top.location.search object against unknown works smoothly in other browsers except Chrome and Safari. Finally found that we need to check the object for undefined also. So to make it work fine for all the browsers check the object always for undefined and unknown.
(typeof top.location.search!='undefined' && typeof top.location.search != 'unknown')

CName Omniture

A CNAME record or Canonical Name record is a type of resource record in the Domain Name System (DNS) that specifies that the domain name is an alias of another, canonical domain name.
Most of the browsers reject third party cookies, so it is difficult for the analytics to collect the data.
So Omniture decided to use first party cookies. For this we need to create CName record and assign it to the
Omniture trackingServer variable.
http://blogs.omniture.com/2009/03/24/under-the-hood-with-visits-and-visitors/
http://stackoverflow.com/questions/2001697/cname-for-omntiure

Assigning PHP array to Javascript array

Create TinyURL with PHP

Creating a tiny url is so simple, we just need to pass the url as a query string to the following tinyurl api url
e.g   -  http://tinyurl.com/api-create.php?url=http://www.google.com, hitting this in the browser address bar will give the result
http://tinyurl.com/1c2. 
To use cURL for this refer the below url
http://davidwalsh.name/create-tiny-url-php 

Tuesday 7 June 2011

PHP : cURL to access secured sites

We can fix this in two ways.The first and quick fix would be the below one
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
The proper fix can be found here:
http://unitstep.net/blog/2009/05/05/using-curl-in-php-to-access-https-ssltls-protected-sites/ 
Reference:
http://www.php.net/manual/en/function.curl-setopt.php
http://curl.haxx.se/docs/faq.html 

Mysore - tourist destinations

Tourist places in Mysore
  1. Mysore Palace
  2. Chamundeswari temple (Chamundi Hills)
  3. Brindavan Gardens (Krishnarajasagara dam)
  4. Lalitha Mahal Palace
  5. Srirangapatna 
  • Ranganathaswamy Temple, 
  • The Mausoleum Of Tipu Sulthan(Gumbaz), 
  • Daria Daulat, The Palace of Tipu Sulthan ,
  • "Sangama" the amalgamation of 3 holy rivers Kaveri River, Kabini River, Hemavati River ,
  • Tipu's Death Place
     6. Karanji Lake
     7. Balmuri and Edmuri Waterfalls
     8. Shravanabelagola
     9. Temples in Somanathapura and Belur

Must see places in Bangalore

Some of  the best places to visit in Bangalore
  1. Vidhana Soudha (old and new)
  2. ISKCON
  3. Lalbagh Garden
  4. Shiva temple @ Kempfort
  5. Bannerghatta Zoo
  6. Hogenakkal Falls
  7. Mekedaatu 
  8. Madikeri


Monday 6 June 2011

Sightseeing - Hyderabad

These are the must visit places in Hyderabad.
  1. NTR garden
  2. Lumbini park - take a boat ride to Buddha statue
  3. Birla Mandir
  4. Prasads IMAX
  5. Ramoji Rao film city
  6. Charminar,Mecca Masjid
  7. Salar Jung Museum
  8. Golkonda Fort

US tours and vacation

If you want to visit tourist places in US at a affordable price and enjoy the tour without any difficulty, the first choice shoud be goto bus. They offer excellent tours and vacation packages at a resonable cost, good accomodation and make the trip so funfilled and enjoyable.
http://www.gotobus.com/

Document write disadvantages

The document.write has the following disadvantages

A few of the more serious problems:
  • document.write (henceforth DW) does not work in XHTML
  • DW executed after the page has finished loading will overwrite the page, or write a new page, or not work
  • DW executes where encountered: it cannot inject at a given node point
  • DW is effectively writing serialised text which is not the way the DOM works conceptually, and is an easy way to create bugs (.innerHTML has the same problem)
    Reference:
    http://stackoverflow.com/questions/802854/why-is-document-write-considered-a-bad-practice

Detect firebug using Javascript


To detect the firebug is enabled in a browser, use the below line
if (window.console && window.console.firebug) {
  //Firebug is enabled
}
Reference:
http://stackoverflow.com/questions/398111/javascript-that-detects-firebug