tag:blogger.com,1999:blog-65023252007665422292024-03-13T08:38:43.369+05:30HEMANT SONKER'S BLOGhemanthttp://www.blogger.com/profile/09617167694071000571noreply@blogger.comBlogger15125tag:blogger.com,1999:blog-6502325200766542229.post-33991429301910902292009-01-13T14:19:00.003+05:302009-01-13T14:23:38.182+05:30Tutorials on php:Day 2<FONT SIZE="2" COLOR="RED"><U><B>BUILDING BLOCKS IN PHP</B></U></FONT><br /><br /><B><U>Variables</U><br /></B>A variable is a special container that you can define, which will then contain a value you specify. For example a number, string, object, array or boolean.<br /><br /><B><U>Constants</U></B><br />If you want to work with a value that needs to remain unchanged, you can define and use a constant variable. This isdifferent to a variable as variables offer a flexible way of storing data as you can change their values and type of data they hold.<br /><br /><B><U>Globals and Superglobals</U></B><br />In addition to global declerations aof your own, PHP has built in predefined variables called superglobals. These are always present and the value they hold can be available in all your scripts.<br /><br /><B><U>Predefined Constants</U></B><br />PHP provides some built in constants for you. For example __FILE__ returns the name of the file that PHP is using. __LINE__ returns the line number that php is running and PHP_VERSION returns what php version your script is being run on.<br /><br /><U><B>Data types</B></U><br />Different types of data will take up different amounts of memory and may then be treated different in the script that you write. PHP will automatically determine the data type for the variable the time data is assigned to it. Some examples of data types are boolean, integer, float, string, object, array, resource, null (an uninitialized value).<br /><br /><U><B>The Assignment operator</B></U><br />The equals sign (=) is an assignment operator and will put the value on the right hand site and assign it to the left hand side.<br /><br /><B><U>Arithmetic Operators</U></B><br />Arithmetic operators perform mathematic operations on the values you want them to (providing they are a number). Some examples are addition (+), subtraction (-), division (/), multiplication (*), modulus (%). You can increment numbers by putting two addition operators nxet to eachother like so: (++). PHP provides combined operators which allow you to transform the left hand operand and return a result, while also modifying the original value of the variable. To return 'x' and and 5 to 'x' on the same line you would use '$x +=5.'<br /><br /><B><U>The Concatanation Operator</U></B><br />The concatanation operator allows you to join strings together. It is represented by a single period (.). Expressions, calculations and variables can also be concataned and the data type returned will aloways be that of a string.<br /><br /><B><U>The Comparison Operator</U></B><br />Comparison operators perform comparative tests using their operands and return the boolean value true if the test is succesful and false if it false. Some examples are Equivalence (==), Non-equivalence (!=), greater than (>), less than or equal to (<=). You can use logical operators such as Or (||), and (&&) and Not (!) to extend comparisons using the if() statement.hemanthttp://www.blogger.com/profile/09617167694071000571noreply@blogger.com3tag:blogger.com,1999:blog-6502325200766542229.post-76603286183233408522009-01-06T14:58:00.003+05:302009-01-13T14:18:31.551+05:30Tutorials on php:Day 1Hi guys, writing after couple of months.This time i am learning php and would like to share what i am learning right now.<br /><br /><U><B>What is PHP? and why PHP?</B></U><br /><br /> *PHP (recursive acronym for "PHP: Hypertext Preprocessor") is a widely-used Open Source general-purpose scripting language that is especially suited for Web development and can be embedded into HTML.<br /><br /> *PHP is mainly focused on server-side scripting, so you can do anything any other CGI program can do, such as collect form data, generate dynamic page content, or send and receive cookies. <br /><br /> *PHP can be used on all major operating systems, including Linux, many Unix variants (including HP-UX, Solaris and OpenBSD), Microsoft Windows, Mac OS X, RISC OS, and probably others.<br /><br /> *PHP has also support for most of the web servers today. This includes Apache, Microsoft Internet Information Server, Personal Web Server, Netscape and iPlanet servers, Oreilly Website Pro server, Caudium, Xitami, OmniHTTPd, and many others.<br /><br /> *PHP supports many databases (MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBC, etc.)<br /> *PHP is free to download and use<br /> <br /><br /><U><B>What is a PHP File?</B></U><br /><br /> *PHP files can contain text, HTML tags and scripts<br /> * PHP files are returned to the browser as plain HTML <br /> * PHP files have a file extension of ".php", ".php3", or ".phtml"<br /><br /><U><B>What is MySQL?</B></U><br /><br /> * MySQL is a database server<br /> * MySQL is ideal for both small and large applications<br /> * MySQL supports standard SQL<br /> * MySQL compiles on a number of platforms<br /> * MySQL is free to download and use<br /><U><B><br />PHP + MySQL</B></U><br /><br /> * PHP combined with MySQL are cross-platform (you can develop in Windows and serve on a Unix platform)<br /><br /><U><B>Where to Start?<br /></B></U><br />To get access to a web server with PHP support, you can:<br /><br /> * Install Apache (or IIS) on your own server, install PHP, and MySQL<br /> * Or find a web hosting plan with PHP and MySQL support<br /><br /><U><B><br />PHP - What's it do?</B><br /></U><br />It is also helpful to think of PHP in terms of what it can do for you. PHP will allow you to:<br /><br /> * Reduce the time to create large websites.<br /> * Create a customized user experience for visitors based on information that you have gathered from them.<br /> * Open up thousands of possibilities for online tools.<br /> * Allow creation of shopping carts for e-commerce websites.<br /><br /><U><B>What You Should Know</B></U><br /><br />Before starting this tutorial it is important that you have a basic understanding and experience in the following:<br /><br /> * HTML - Know the syntax and especially HTML Forms.<br /> * Basic programming knowledge - This isn't required, but if you have any traditional programming experience it will make learning PHP a great deal easier.hemanthttp://www.blogger.com/profile/09617167694071000571noreply@blogger.com0tag:blogger.com,1999:blog-6502325200766542229.post-13444112922529517942008-10-15T02:12:00.001+05:302008-10-15T02:14:40.808+05:30how to change windows command prompt background color1<br />Left click on the Windows start button. Click "Run." Type in the letters "cmd." Right click on the blue bar on the top of the prompt. Click "Properties." To customize a DOS batch file instead of the general command prompt, open the batch file.<br />Step2<br />Choose the "Options" tab. Change the cursor size by selecting the button next to "Small," "Medium" or "Large."<br />Step3<br />Hit the "ALT" key and "U" to display the command prompt in full screen mode. When in full screen mode, hit "ALT," "P" and the spacebar at the same time to bring up the command prompt's properties.<br />Step4<br />Select the "Font" tab. In the "Size" box, choose the characters' pixel width and height Under "Font," choose from available fonts.<br />Step5<br />Change screen buffer and window size on the "Layout" tab. To change the position of the window, uncheck the "Let system position window" box, and select the left and top values. The value "0" displays the window in the top left corner.<br />Step6<br />Move on to the "Colors" tab. Choose colors for screen text, background, popup text and popup background. Customize colors by changing the color values manually, or select from the color palette to choose a standard color.<br />Step7<br />Click "OK" at the bottom of the window. You will be prompted to save properties for all future command prompts. Choose this option to keep the values each time you open a command prompt. For individual batch files that open a DOS prompt, you can choose "Apply properties to current window only."hemanthttp://www.blogger.com/profile/09617167694071000571noreply@blogger.com0tag:blogger.com,1999:blog-6502325200766542229.post-34994680057351801322008-10-15T01:29:00.005+05:302008-10-15T02:05:07.535+05:30Java: Coding Guidelines<style>ul,li,ol{margin:0px;padding:0px;}</style><br />A good start would be to use the following. <br /><br /><ul><li>Readability - Make your program as readable as possible ( good names, spacing, ...).</li><li>Simplicity - Don't add unnecessary complication and duplication. KISS.</li><li>Convention - Use standard conventions and good practices as much as possible</li></ul> <ol><li>Comments, indentation, spacing, braces, ... <ul><li>Comments <ul><li>Header comments at front of each file with purpose, author, date ...</li><li>"Paragraph" comments at beginning of each group of code.</li><li>Document "tricks" -- anything unobvious.</li><li>Avoid useless comments. Don't comment code that is already clear.</li><li>Using javadoc is essential for larger projects.</li></ul> </li><li>Indentation <ul><li>Use either K&R or Allman indentation style. Don't use others.</li><li>Indent size 4 spaces</li><li>Blanks, not tabs</li><li>Use your IDE's indentation tool.</li><li>Continued statements should be indented two indentation levels.</li></ul> </li><li>Spaces and blank lines - Use them to make the source more readable <ul><li>No space between method name and the left parenthesis. <code>f(x)</code>, not <code>f (x)</code>.</li><li>One space between keywords (if, while, for, switch, ...) and the left parenthesis.</li><li>Spaces around assignment and many other operators.</li><li>Space after comma. <code>f(a, b)</code>.</li><li>Put blank lines between elements - methods, inner classes, ....</li></ul> </li></ul> </li><li>Variable (local, instance, class) Declarations <ul><li>One per line. Declare more than one only when there are very closely related (eg, x and y).</li><li>Add // comment if meaning of variable isn't completely clear or if has special range, values, etc.</li><li>Don't reuse variable name for more than one purpose. Variables are cheap.</li><li>Local variables (declared in method) <ul><li>Declare at first use is preferred to declaring at front.</li><li>Give variable the least required scope (without adding extra blocks).</li><li>Declare within for loop header if possible.</li><li>Don't hesitate to create extra local variable if it improved readability.</li></ul> </li><li>Instance variables (fields) <ul><li>Declare them private.</li></ul> </li><li>Static (class) variables <ul><li>Use <i>static final</i> for named constants.</li><li>Static (class) variables are rare.</li></ul> </li></ul> </li><li>Braces <ul><li>Use them, even for single statements.</li><li>K&R or Allman style</li></ul> </li><li>Naming conventions <ul><li>Names must be meaningful if possible.</li><li>Conventional names can be used: i, j, iter.</li><li>Case rules should be followed. class - start upper, vars - start lower, const - all upper).</li><li>Instance variables (fields) may start with prefix (eg, "_", "m", ...).</li><li>Use plural names of mass nouns for arrays and data structures.</li><li>Avoid confusing name duplicates (method same as field, differing only by case, ...).</li><li>Don't use a $ in an identifier name.</li></ul> </li><li>Error Handling <ul><li>"Happy Trails" programming allowed for most student programs.</li><li>Recover from user input errors.</li><li>Crash on programming errors is acceptable. Debugging output is useful.</li><li>Catching exceptions <ul><li>Don't catch an exception if you can't handle it.</li><li>Don't use exceptions to handle normal flow (eg, ArrayIndexOutOfBoundsException).</li><li>Don't use exceptions to hide program errors; fix them.</li><li>Don't silently ignore exceptions, except in those few cases where you can't do anything anyway.</li></ul> </li><li>Throwing exceptions <ul><li>Don't throw <code>Exception</code> - make it more specific.</li><li>Put informative message in exception constructor.</li><li>If you're supplying a class for someone, throw meaningful exceptions.</li></ul> </li></ul> </li><li>Visibility <ul><li>General rule: make data private, methods public.</li><li>Protected - Use only when designing for inheritance.</li></ul> </li><li>Miscellaneous <ul><li>DRY - Don't Repeat Yourself. Repeated code should be replaced with loop/method/...</li><li>No magic numbers - use named constants.</li><li>Avoid premature optimization. Don't worry about optimization unless there's a problem.</li><li>KISS. Keep It Simple, Stupid. Always prefer a simple to a complicated solution.</li><li>Methods <ul><li>Don't assign to parameters; it makes code more difficult to read.</li><li>Consider declaring parameters <i>final</i> to assure the reader they aren't changed.</li><li>Use multiple returns only if it makes the code clearer, otherwise return only at the end.</li><li>Methods should fit on one page/screen. If they're bigger, consider splitting them.</li><li>Avoid recursion unless it's a situation where it's much better (eg, traversing trees).</li></ul> </li><li>Loops <ul><li>Use <i>for</i> instead of <i>while</i> if it groups everything in one statement.</li><li><i>For</i> loop clauses should be <i>coherent</i> -- all related.</li><li>Use the <i>enhanced for</i> (<i>foreach</i>) when possible.</li><li>Don't change a <i>for</i> loop iteration variable in the body of the loop.</li><li>Use <i>break</i> to exit early or to terminate an "infinite" loop.</li><li>The <i>continue</i> statement is rarely used.</li></ul> </li><li>Switch <ul><li>Switch statements should include a <i>default</i> clause.</li><li>Make <i>default</i> the last clause in a <i>switch</i>.</li></ul> </li><li>If <ul><li>Do not write an empty true or else clause.</li><li>Writing positive logical expressions is more readable then negative. Change if easy.</li></ul> </li><li>Data structures <ul><li>Use the generic forms of Java Collections data structures.</li><li>Use newer rather than older versions: HashMap<...> instead of HashTable, ArrayList<...> rather than Vector.</li></ul> </li><li>Methods <ul><li>A method should be small and focused on one task.</li><li>Split a method into several methods if it operates on different levels of data.</li><li>Split a method if it becomes too large (longer than one screen is a common guideline).</li><li>Split a method which does different things.</li><li>Smaller methods are easier to understand, use, and debug.</li><li>It's OK to have utility methods that are only called from one place.</li></ul> </li></ul></li></ol>hemanthttp://www.blogger.com/profile/09617167694071000571noreply@blogger.com0tag:blogger.com,1999:blog-6502325200766542229.post-31821766863376034182008-10-15T01:02:00.005+05:302008-10-15T15:03:00.594+05:30Running a Java Program from Command Prompt<ul><li> Create a temporary folder <code>C:\mywork</code>. Using <i>Notepad</i> or another text editor, create a small Java file <code>Hello.java</code> with the following text: <pre> class Hello<br />{<br />public static void main(String[] args)<br />{<br />System.out.println("Hello, World!");<br />}<br />}</pre> <p>Save your file as <code>Hello.java</code> in <code>C:\mywork</code>. To make sure your file name is <code>Hello.java</code>, (not <code>Hello.java.txt</code>), first choose "Save as file type:" <b>All files</b>, then type in the file name <b>Hello.java</b>.<br /><br /></p></li><li> Run <i>Command Prompt</i> (found under All Programs/Accessories in the Start menu). Type <pre><b>C:\> cd \javaprog</b></pre> This makes C:\mywork the current directory. <pre><b>C:\</b><b><b>javaprog</b></b><b>> dir</b></pre> This displays the directory contents. You should see <code>HelloWorld.java</code> among the files. <pre><b>C:\</b><b><b>javaprog</b></b><b>> set path=%path%;C:\Program Files\Java\jdk1.5.0_09\bin</b></pre> This tells the system where to find JDK programs. <pre><b>C:\</b><b><b>javaprog</b></b><b>> javac Hello.java</b></pre> This runs <code>javac.exe</code>, the compiler. You should see nothing but the next system prompt... <pre><b>C:\</b><b><b>javaprog</b></b><b>> dir</b></pre> <i>javac</i> has created the <code>Hello.class</code> file. You should see <code>Hello.java</code> and <code>HelloWorld.class</code> among the files. <pre><b>C:\</b><b><b>javaprog</b></b><b>> java Hello</b></pre> This runs the Java interpreter. You should see the program output: <pre>Hello, World!</pre> <p>If the system cannot find <i>javac</i>, check the set path command. If <i>javac</i> runs but you get errors, check your Java text. If the program compiles but you get an exception, check the spelling and capitalization in the file name and the class name and the <code>java Hello</code> command. Java is case-sensitive!<br /><br /></p></li><li> It is possible to make the path setting permanent but you have to be very careful because your system might crash if you make a mistake.</li></ul><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0-gn3w5v1mpsDB3qeD2-ndVy1axoTxBTWQU5mjFOrwQ2g_DV6hvi2uNQV1a05UJHVwvlmZPTHVBTJjL_6pIUAJJskfvfccL6yLGr-oxxyJMTZwz2DH5fbFFNaktTqCH6LbvdZOPDrwtk-/s1600-h/dos-1.gif"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0-gn3w5v1mpsDB3qeD2-ndVy1axoTxBTWQU5mjFOrwQ2g_DV6hvi2uNQV1a05UJHVwvlmZPTHVBTJjL_6pIUAJJskfvfccL6yLGr-oxxyJMTZwz2DH5fbFFNaktTqCH6LbvdZOPDrwtk-/s320/dos-1.gif" alt="" id="BLOGGER_PHOTO_ID_5257095879401318418" border="0" /></a><p>Click "Edit" and <strong>at the end append</strong> </p><pre>;C:\Program Files\Java\jdk1.5.0_09\bin</pre> <p>(or the path to the appropriate folder where the latest version of JDK is installed). Do not put spaces before the appended path string. </p><p>Click OK on the path edit box and OK on the Ennvironment Variables box. The new setting will go into effect next time you run <i>Command Prompt</i>. </p>hemanthttp://www.blogger.com/profile/09617167694071000571noreply@blogger.com0tag:blogger.com,1999:blog-6502325200766542229.post-68320777966478715542008-09-27T00:11:00.002+05:302008-09-27T00:13:33.795+05:30Differences Between XHTML and HTMLDifferences Between XHTML and HTML<br />Both HTML 4 and XHTML use precisely the same elements, attributes, and values. The difference between HTML and XHTML is in their respective syntax - the main differences are discussed in this section.<br />• XHTML requires that all Webpages contain the html, head, and body elements, as well as the DOCTYPE declaration, where as in HTML they are not required.<br />• XHTML insists on having closing tags for every element, even empty ones, where as HTML often lets you omit them.<br />• HTML requires that all attributes be enclosed by quotation marks, where as HTML lets you omit quotation marks, but only around attribute values which consist of only letters, numbers and these characters: - (dash), . (period), _ (underscore) and : (colon).<br />• XHTML is case sensitive, where as HTML is not case sensitive. Furthermore XHTML requires that all enumerated attribute values be lower case.<br /><br />The question is why we should use xhtml??<br />By using xhtml ,it has various advantages.Firstly it becomes more consistant ,well structured format, pages can be easily parsed and can be processed by software applications.It helps website much easy to maintain, edit etc.<br />XHTML adopts official XML standards.The best thing about xhtml is that you can view on pda ,computers ,laptops etc with well structured view without any issue.hemanthttp://www.blogger.com/profile/09617167694071000571noreply@blogger.com5tag:blogger.com,1999:blog-6502325200766542229.post-19061652324746511322008-08-29T00:34:00.001+05:302008-08-29T00:38:11.208+05:30Web Standard ChecklistWeb standards checklist <br />The term web standards can mean different things to different people. For some, it is 'table-free sites', for others it is 'using valid code'. However, web standards are much broader than that. A site built to web standards should adhere to standards (HTML, XHTML, XML, CSS, XSLT, DOM etc) and pursue best practices (valid code, accessible code, semantically correct code, user-friendly URLs etc). <br />In other words, a site built to web standards should ideally be lean, clean, CSS-based, accessible, usable and search engine friendly. <br />• Quality of code<br />1. Does the site use a correct Doctype?<br /> A doctype (short for 'document type declaration') informs the validator which version of (X)HTML you're using, and must appear at the very top of every web page. Doctypes are a key component of compliant web pages: your markup and CSS won't validate without them<br />. <br />2. Does the site use a Character set?<br />If a user agent (eg. a browser) is unable to detect the character encoding used in a Web document, the user may be presented with unreadable text. This information is particularly important for those maintaining and extending a multilingual site, but declaring the character encoding of the document is important for anyone producing XHTML/HTML or CSS.<br /><br />3. Does the site use Valid (X)HTML?<br />Valid code will render faster than code with errors. Valid code will render better than invalid code. Browsers are becoming more standards compliant, and it is becoming increasingly necessary to write valid and standards compliant HTML.<br /><br />4. Does the site use Valid CSS? <br />You need to make sure that there aren't any errors in either your HTML or your CSS, since mistakes in either place can result in botched document appearance.<br />5. Does the site use unnecessary classes or ids? <br /><br />6. Is the code well structured? <br /> Semantically correct markup uses html elements for their given purpose. Well structured HTML has semantic meaning for a wide range of user agents (browsers without style sheets, text browsers, PDAs, search engines etc.)<br /><br />7. Does the site have any broken links? <br />Broken links can frustrate users and potentially drive customers away. Broken links can also keep search engines from properly indexing your site.<br /><br />8. How does the site perform in terms of speed/page size? <br /><br />9. Does the site have JavaScript errors?<br /> Internet Explore for Windows allows you to turn on a debugger that will pop up a new window and let you know there are javascript errors on your site. This is available under 'Internet Options' on the Advanced tab. Uncheck 'Disable script debugging'.<br />• Degree of separation between content and presentation <br />1. Does the site use CSS for all presentation aspects (fonts, colour, padding, borders etc)?<br />2. Are all decorative images in the CSS, or do they appear in the (X)HTML?<br />The aim for web developers is to remove all presentation from the html code, leaving it clean and semantically correct.<br /><br />• Accessibility for users <br />1. Are "alt" attributes used for all descriptive images?<br />2. Does the site use relative units rather than absolute units for text size?<br />3. Do any aspects of the layout break if font size is increased?<br />4. Does the site use visible skip menus?<br />5. Does the site use accessible forms?<br />6. Does the site use accessible tables?<br />For data tables, identify row and column headers... For data tables that have two or more logical levels of row or column headers, use markup to associate data cells and header cells.<br />7. Is there sufficient colour brightness/contrasts?<br />8. Is colour alone used for critical information?<br />9. Is there delayed responsiveness for dropdown menus (for users with reduced motor skills)?<br />10. Are all links descriptive (for blind users)?<br /><br />• Accessibility for devices <br />1. Does the site work acceptably across modern and older browsers?<br />2. Is the content accessible with CSS switched off or not supported?<br />3. Is the content accessible with images switched off or not supported?<br />4. Does the site work in text browsers such as Lynx?<br />5. Does the site work well when printed?<br />6. Does the site work well in Hand Held devices?<br />7. Does the site include detailed metadata?<br />8. Does the site work well in a range of browser window sizes?<br />• Basic Usability <br />1. Is there a clear visual hierarchy?<br />2. Are heading levels easy to distinguish?<br />3. Is the site's navigation easy to understand?<br />4. Is the site's navigation consistent?<br />5. Does the site use consistent and appropriate language?<br />6. Does the site have a sitemap page and contact page? Are they easy to find?<br />7. For large sites, is there a search tool?<br />8. Is there a link to the home page on every page in the site?<br />9. Are links underlined?<br />10. Are visited links clearly defined?<br />• Site management <br />1. Does the site have a meaningful and helpful 404 error page that works from any depth in the site?<br />2. Does the site use friendly URLs?<br /><br />3. Do your URLs work without "www"?<br />While this is not critical, and in some cases is not even possible, it is always good to give people the choice of both options. If a user types your domain name without the www and gets no site, this could disadvantage both the user and you.<br /><br /><br /> Benefits of valid XHTML & CSS<br />• Increased interoperability. XHTML pages can easily be viewed on wireless devices like PDA's and cell phones.<br />• Cleaner, more logical markup adding better integration in older existing systems.<br />• Future transition to more advanced technology. Allows future XML technology to be easily integrated in to an existing site.<br />• Greater accessibility, broadening your potential customer base. Pages will work with screen readers for the visually impaired.<br />• Bandwith conservation. Pages are smaller than old HTML designs and will load much faster for slower internet connections.<br />• Increased readability by search engineshemanthttp://www.blogger.com/profile/09617167694071000571noreply@blogger.com0tag:blogger.com,1999:blog-6502325200766542229.post-32877735386583367532008-08-25T00:10:00.002+05:302008-08-25T00:34:20.387+05:30CSSWhat does CSS basically mean??<br /><br />CSS mean Cascading Style Sheet.<br /><br /><span class="txtplain1">Style sheets are a very powerful tool for the Web site developer. They give you the chance to be completely consistent with the look and feel of your pages, while giving you much more control over the layout and design than straight HTML ever did. </span><br /><br /><span class="txtplain1"><br /><p>Style rules are comprised of two things, the <strong>selector</strong> and the <strong>declaration</strong>. </p><p>• <strong>selector</strong> - The HTML tag that will be affected by the rule<br /><br />• <strong>declaration</strong> - The specific style calls that will affect the selector.</p><p>In CSS, <i>selectors</i> are used to declare which elements a style applies to, a kind of match expression. Selectors may apply to all elements of a specific type, or only those elements which match a certain attribute; elements may be matched depending on how they are placed relative to each other in the markup code.</p><p>In addition to these, a set of <i>pseudo-classes</i> can be used to define further behavior.The best-known of these is <code>:hover</code>, which applies a style only when the user 'points to' the visible element, usually by holding the mouse cursor over it. It is appended to a selector as in <code>a:hover</code> or <code>#elementid:hover</code>. Other pseudo-classes and <i>pseudo-elements</i> are, for example, <code>:first-line</code>, <code>:visited</code> or <code>:before</code>.</p><p>A declaration-block consists of a list of semicolon-separated <i>declarations</i> in braces. Each declaration itself consists of a <i>property</i>, a colon (<i>:</i>), a <i>value</i>, then a semi-colon (<i>;</i>).</p><p>But the question is what does cascading mean in CSS.??</p><p><span class="txtplain1"><p>Cascading is something that makes CSS even more powerful. Style sheets cascade when The Web Writer or user (or both) have created an order of precedence for the browser to apply the style rules in multiple sheets. The style rule or sheet that has the highest precedence is the one that is used. The following list is a simplification of how your browser decides precedence for a style: </p><ol><li>Look for the style element that is created, if it is not in the document, use the default rules in the browser.<br /></li><li>Determine if any of the style rules are marked as important and apply those to the appropriate elements.<br /></li><li>Any style rules in the document will have precedence over the default browser settings.<br /></li><li>The more specific the style rule, the higher the precedence it will have.<br /></li><li>Finally, if two rules apply to the same element, the one that was loaded <strong>last</strong> will have the highest precedence.</li></ol><br /></span></p></span>hemanthttp://www.blogger.com/profile/09617167694071000571noreply@blogger.com0tag:blogger.com,1999:blog-6502325200766542229.post-60180332554358282922008-07-05T01:08:00.002+05:302008-07-05T01:48:14.712+05:30OpenIDHi friends,people are more moving towards OpenId.Do you avoid new websites because they come with yet another username and password?<br />There is no need to remember so many passwords for differnt sites.The answer is simple Use OpenID.<br /><br />First let us know that What is OpenID???<br /><br />OpenID is an open standard that lets you sign in to other sites on the Web using any of your openId.It can be of yahoo,livjournal,wordpress,aol,myopenId.com etc.<br />You need to remember only one user name and password.<br /><br />OpenID is an open, decentralized, free framework for user-centric digital identity. OpenID takes advantage of already existing internet technology (URI, HTTP, SSL, Diffie-Hellman) and realizes that people are already creating identities for themselves whether it be at their blog, photostream, profile page, etc. With OpenID you can easily transform one of these existing URIs into an account which can be used at sites which support OpenID logins.<br />OpenID allows anyone who can run a web server to run an identity server. Your identity server is separate from your identity, so you are free to use any identity server that has some ability to validate your identity and you can change between them at will. An identity server is sometimes referred to as an identity provider. If you wish, you can use the services listed below with your own website as your identifier using<span style="text-decoration: underline;"></span> <span style="font-weight: bold;">delegate</span><br /><br />OpenID came from open source community.OpenID is a lightweight method of identifying individuals that uses the same technology framework that is used to identify websites.<br />OpenID is not owned by any one.<br />You can use your OpenID on any one of a growing number of sites which support OpenID<br /><br /><p><strong></strong>You may already have one. If you use any of the following services, you already have your own OpenID:</p> <dl><dt><a href="http://openid.net/redirect.php?site=www.aol.com" onclick="javascript:urchinTracker('/file/redirect.php?site=www.aol.com?ref=/where/');"><img src="http://openid.net/wp-content/uploads/aol.png" class="favicon" /> AOL</a></dt><dd>openid.aol.com/<strong>screenname</strong></dd><dt><a href="http://openid.net/redirect.php?site=www.blogger.com" onclick="javascript:urchinTracker('/file/redirect.php?site=www.blogger.com?ref=/where/');"><img src="http://www.blogger.com/favicon.ico" class="favicon" /> Blogger</a></dt><dd><strong>blogname</strong>.blogspot.com</dd><dt><a href="http://openid.net/redirect.php?site=www.flickr.com" onclick="javascript:urchinTracker('/file/redirect.php?site=www.flickr.com?ref=/where/');"><img src="http://www.flickr.com/favicon.ico" class="favicon" /> Flickr</a></dt><dd>www.flickr.com/photos/<strong>username</strong></dd><dt><a href="http://openid.net/redirect.php?site=www.livedoor.com" onclick="javascript:urchinTracker('/file/redirect.php?site=www.livedoor.com?ref=/where/');"><img src="http://www.livedoor.com/favicon.ico" class="favicon" /> LiveDoor</a></dt><dd>profile.livedoor.com/<strong>username</strong></dd><dt><a href="http://openid.net/redirect.php?site=www.livejournal.com" onclick="javascript:urchinTracker('/file/redirect.php?site=www.livejournal.com?ref=/where/');"><img src="http://www.livejournal.com/favicon.ico" class="favicon" /> LiveJournal</a></dt><dd><strong>username</strong>.livejournal.com</dd><dt><a href="http://www.orange.fr/" class="favicon" onclick="javascript:urchinTracker('/outbound/www.orange.fr?ref=/where/');"><img src="http://www.orange.fr/favicon.ico" class="favicon" /> Orange (France Telecom)</a></dt><dd><a href="http://www.orange.fr/bin/frame.cgi?u=http%3A//openid.orange.fr/" onclick="javascript:urchinTracker('/outbound/www.orange.fr/bin/frame.cgi?u=http_3A//openid.orange.fr/?ref=/where/');">http://openid.orange.fr/</a></dd><dt><a href="http://openid.net/redirect.php?site=www.smugmug.com" class="favicon" onclick="javascript:urchinTracker('/file/redirect.php?site=www.smugmug.com?ref=/where/');"><img src="http://openid.net/wp-content/uploads/smugmug.png" class="favicon" /> SmugMug</a></dt><dd><strong>username</strong>.smugmug.com</dd><dt><a href="http://openid.net/redirect.php?site=www.technorati.com" onclick="javascript:urchinTracker('/file/redirect.php?site=www.technorati.com?ref=/where/');"><img src="http://www.technorati.com/favicon.ico" class="favicon" /> Technorati</a></dt><dd>technorati.com/people/technorati/<strong>username</strong></dd><dt><img src="http://openid.net/wp-content/uploads/vox.png" /><a href="http://openid.net/redirect.php?site=www.vox.com" class="favicon" onclick="javascript:urchinTracker('/file/redirect.php?site=www.vox.com?ref=/where/');">Vox</a></dt><dd><strong>member</strong>.vox.com</dd><dt><a href="http://openid.net/redirect.php?site=www.yahoo.com" onclick="javascript:urchinTracker('/file/redirect.php?site=www.yahoo.com?ref=/where/');"><img src="http://www.yahoo.com/favicon.ico" class="favicon" /> Yahoo</a></dt><dd><a href="http://openid.yahoo.com/" onclick="javascript:urchinTracker('/outbound/openid.yahoo.com/?ref=/where/');">http://openid.yahoo.com</a></dd><dt><a href="http://openid.net/redirect.php?site=www.wordpress.com" onclick="javascript:urchinTracker('/file/redirect.php?site=www.wordpress.com?ref=/where/');"><img src="http://openid.net/wp-content/uploads/wordpress.png" class="favicon" /> WordPress.com</a></dt><dd><strong>username</strong>.wordpress.com</dd></dl><br />The sites where you can get your openId<br /><ol><li><a href="http://myopenid.com/" class="external text" title="https://www.myopenid.com/" rel="nofollow">myOpenID.com</a></li><li><a href="https://claimid.com/">https://claimid.com</a></li><li><a href="http://www.livejournal.com/">http://www.livejournal.com/</a></li><li><a href="http://openid.net/redirect.php?site=myid.net">myID.net</a></li></ol>There are so many sites which provide openid.<br />If you dont have then get it soon :)hemanthttp://www.blogger.com/profile/09617167694071000571noreply@blogger.com0tag:blogger.com,1999:blog-6502325200766542229.post-32160863051930892912007-12-02T02:57:00.000+05:302007-12-02T02:58:58.308+05:30Names in Ruby......<div style="text-align: justify;">1. Names - Ruby names are used to refer to constants, variables, methods, classes, and modules. The first character of a name helps Ruby to distinguish its intended use. Certain names, are reserved words and should not be used as variable, method, class, or module name. Lowercase letter means the characters ''a'' though ''z'', as well as ''_'', the underscore. Uppercase letter means ''A'' though ''Z,'' and digit means ''0'' through ''9.'' A name is an uppercase letter, lowercase letter, or an underscore, followed by Name characters: This is any combination of upper- and lowercase letters, underscore and digits.<br /><br />2. Variables - Variables in Ruby can contain data of any type. You can use variables in your Ruby programs without any declarations. Variable name itself denotes its scope (local, global, instance, etc.).<br /><br />2.1. A local variable name consists of a lowercase letter followed by name characters (sunil, _z, hit_and_run).<br /><br />2.2. An instance variable name starts with an ''at'' sign (''@'') followed by an upper- or lowercase letter, optionally followed by name characters (@sign, @_, @Counter).<br /><br />2.3. A class variable name starts with two ''at'' signs (''@@'') followed by an upper- or lowercase letter, optionally followed by name characters (@@sign, @@_, @@Counter).<br /><br />2.4. A constant name starts with an uppercase letter followed by name characters. Class names and module names are constants, and follow the constant naming conventions. By convention, constant variables are normally spelled using uppercase letters and underscores throughout (module MyMath, PI=3.1416, class MyPune).<br /><br />2.5. Global variables start with a dollar sign (''$'') followed by name characters. A global variable name can be formed using ''$-'' followed by any single character ($counter, $COUNTER, $-x).<br /><br /><br />3. Method names should begin with a lowercase letter. ''?'' and ''!'' are the only weird characters allowed as method name suffixes</div>hemanthttp://www.blogger.com/profile/09617167694071000571noreply@blogger.com0tag:blogger.com,1999:blog-6502325200766542229.post-64407676736743863002007-12-02T02:55:00.000+05:302007-12-02T02:56:51.623+05:30Basic terms in Ruby....• Class: A class is a definition of a concept in an object-oriented language such as<br />Ruby. We created classes called Pet, Dog, Cat, Snake, and Person. Classes can inherit<br />features from other classes, but still have unique features of their own.<br /><br />• Object: An object is a single instance of a class (or, as can be the case, an instance of<br />a class itself). An object of class Person is a single person. An object of class Dog is a<br />single dog. Think of objects as real-life objects. A class is the classification, whereas<br />an object is the actual object or “thing” itself.<br /><br />• Object orientation: Object orientation is the approach of using classes and objects<br />to model real-world concepts in a programming language, such as Ruby.<br /><br />• Variable: In Ruby, a variable is a placeholder for a single object, which may be a<br />number, string, list, or an instance of a class that you have defined, such as, in this<br />chapter, a Pet.<br /><br />• Method: A method represents a set of code (containing multiple commands and<br />statements) within a class and/or an object. For example, our Dog class objects had<br />a bark method that printed “Woof!” to the screen. Methods can also be directly<br />linked to classes, as with fred = Person.new, where new is a method that creates a<br />new object based upon the Person class. Methods can also accept data—known as<br />arguments or parameters—included in parentheses after the method name, as<br />with puts("Test").<br /><br />• Arguments/parameters: The data passed to methods in parentheses (or, as in some<br />cases, following the method name without parentheses, as in puts "Test").<br /><br />• Kernel: Some methods don’t require a class name to be usable, such as puts. These<br />are usually built-in, common methods that don’t have an obvious connection to<br />any classes. Many of these methods are included in Ruby’s Kernel module, a module<br />that provides functions that work from anywhere within Ruby code without<br />being explicitly referred to.hemanthttp://www.blogger.com/profile/09617167694071000571noreply@blogger.com0tag:blogger.com,1999:blog-6502325200766542229.post-89479200972799720822007-12-02T02:51:00.000+05:302007-12-02T02:53:16.342+05:30Ruby Is English for ComputersComputers can understand languages, though in a rather different fashion to how most<br />people do. Being logical devices that cannot understand subtlety or ambiguity, languages<br />such as English and French aren’t appealing to computers. Computers require languages<br />with logical structures and a well-defined syntax so that there’s a logical clarity in what<br />you’re telling the computer to do.<br />Clarity is required because almost everything you relay to the computer while programming<br />is an instruction (or command). Instructions are the basic building blocks of<br />all programs, and for the computer to perform (or execute) them properly, the programmer’s<br />intentions must be clear and precise. Many hundreds of these instructions are tied<br />together into programs that perform certain tasks, which means there’s little room for<br />error.<br />You also need to consider that other programmers might need to maintain computer<br />programs you’ve written. This won’t be the case if you’re just programming for fun, but it’s<br />important that your programs are easy to understand, so you can understand them when<br />you come back to them later on.<br /><br /><span style="font-family: times new roman;">*this thing is gathered from one book named Apress begining ruby form ovice to professional</span>hemanthttp://www.blogger.com/profile/09617167694071000571noreply@blogger.com0tag:blogger.com,1999:blog-6502325200766542229.post-41020218105566615522007-12-02T02:31:00.000+05:302007-12-19T09:13:33.458+05:30Ruby---a programming language<div style="text-align: justify;">Ruby is a cross-platform interpreted language, which has many features in common with other 'scripting' languages such as Perl and Python.<br /><br />It has been desgined on the concept of "Principle of Least Surprise"<br />Yukihiro Matsumoto, commonly known as ‘Matz’ created the Ruby language in 1993.<br /><br />If you are already familiar with object oriented programming, Ruby should quickly become second nature. If you've struggled with learning object-oriented programming or are not familiar with it, Ruby should make more sense to you than other object-oriented languages because Ruby's methods are consistently named, concise, and generally act the way you expect.<br /><br />Ruby differs from most other programming languages not only by syntax, but by culture, grammar,and customs.<br /><br />The Ruby on Rails Web framework is a system for developing Web applications<br />that uses Ruby as its base language, and it powers hundreds of large Web sites.<br />Ruby is also used as a generic language from the command prompt, much like Perl.<br /><br /><span style="font-weight: bold;">Installing Ruby</span><br /><br />Windows users have access to an excellent “one-click installer,” which<br />installs Ruby, a horde of extensions, a source code editor, and various documentation, in<br />“one click.” Ruby on Windows is as reliable and useful as it is on other operating systems,<br />and Windows makes a good environment for developing Ruby programs.<br /><br />To get up and running as quickly as possible, follow these steps:<br />1. Open a Web browser and go to http://www.ruby-lang.org/en/downloads/.<br />2. Scroll down to “Ruby on Windows,” about halfway down the page.<br />3. In the “Ruby on Windows” section, you’ll see a few links for different versions of<br />Ruby you can download for Windows. Ideally you want to download the file at the link that’s highest in the list that’s referred to as a “One-Click Installer.” At the time of writing, this is version 1.8.5.<br />4. Click the link you found in step 3 and save it to your desktop.<br />5. Once download has completed, look on your desktop for the Ruby EXE file you just downloaded, and double-click it to load the installer.<br />6. If Windows gives you a “Security Error” box, click the “Run” button to give your<br />approval.<br />7. A typical installation program appears with some instructions. On the initial<br />screen, click “Next.”<br />8. Work your way through the installation screens. Leave the boxes checked to install<br />the text editors SciTE , and the Ruby package manager RubyGems. Unless you have a specific reason not to, let the installation program install Ruby in its default location of c:\ruby and its default program group.<br />9. Installation takes place when you see a stream of filenames flying up your screen.<br />Wait several minutes for the installation process to complete and enjoy the view.<br />There are a lot of files to install!<br />10. Installation is complete when the installation program says “Installation Complete”<br />and the “Next” button is clickable. Click the “Next” button, then click<br />“Finish” to exit the installation program.<br />If Ruby installed correctly, congratulations! Go to the “Start” menu and then the “Programs”<br />or “All Programs” menu. There should be a Ruby program group that contains<br />icons for SciTE, an uninstaller, and other bits and pieces.<br />To test that your<br />Ruby installation works correctly, you need to load the program listed as<br />“fxri – Interactive Ruby Help & Console,” so click this entry and wait for the program to<br />load.If fxri started properly, then Ruby is installed correctly.<br /><br />Congratulations! Lastly, you need to be familiar with running Ruby and its associated utilities from the command prompt, so go to the “Start” menu, then “Run,” and type cmd into the box and click “OK”.</div>hemanthttp://www.blogger.com/profile/09617167694071000571noreply@blogger.com3tag:blogger.com,1999:blog-6502325200766542229.post-42354649537104859962007-12-02T02:19:00.000+05:302007-12-02T02:26:14.498+05:30What is Open source??<div style="text-align: justify;">Open source is a development method for software that harnesses the power of distributed peer review and transparency of process<br /><br />If you’ve used Linux or downloaded certain types of software, you might be familiar with<br />the term “open source.”<br /> Simply, open source means that the source code to an application<br />or library is made available publicly for other people to look at and use. There might<br />be restrictions on what people can do with the code (generally via a license), but it’s publicly<br />viewable.<br />Open source software needs an open source license—in contrast to, say, Microsoft Windows, whose source code isn’treadily available.<br /><br />Software products such as the popular Apache Web server and the<br />MySQL database system are also available under varying open source licenses and are<br />routinely improved by unpaid coders.<br />The open source community is one of sharing knowledge freely and collaborating to<br />improve the systems and services that most of us use. Although proprietary software will<br />always have its place, open source is rapidly becoming the de facto way to develop programming<br />languages, libraries, and other non-application types of software.<br /><br />Although many developers don’t necessarily open source the code to their<br />applications, they’ll often release the tools and code tricks to the community so that they<br />can benefit from the peer review and popularity that results.<br /><br />Releasing your code as open source isn’t necessarily a bad business decision. It could<br />actually improve the quality of your code and tools, and make you much better known in<br />the industry.</div>hemanthttp://www.blogger.com/profile/09617167694071000571noreply@blogger.com0tag:blogger.com,1999:blog-6502325200766542229.post-72392523247781453642007-09-29T17:47:00.000+05:302007-09-29T18:42:26.177+05:30Cake PHPCake is a rapid development framework for PHP which uses commonly known design patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC. The primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility.<br /><br />Cake is based on an MVC-like architecture that is both powerful and easy to grasp: controllers, models and views guarantee a strict but natural separation of business logic from data and presentation layers.<br /><p style="font-weight: bold;"><span class="smalltitle">System requirements</span></p> <p>Before you begin, you need to have an environment in which you can work. CakePHP has reasonably minimal server requirements:</p><ol><li>An HTTP server that supports sessions (and preferably <code>mod_rewrite</code>). This tutorial was written using Apache V1.3 with <code>mod_rewrite</code> enabled.</li><li>PHP V4.3.2 or later (including PHP V5). This tutorial was written using PHP V5.0.4</li><li>A supported database engine (currently MySQL, PostgreSQL or using a wrapper around ADODB). This tutorial was written using MySQL V4.1.15. </li></ol><p>You'll also need a database ready for your application to use. The tutorial will provide syntax for creating any necessary tables in MySQL.</p><p>The simplest way to download CakePHP is to visit <a href="http://cakeforge.org/projects/cakephp">CakeForge.org</a> and download the latest stable version. This tutorial was written using V1.1.8. (Nightly builds and copies straight from Subversion are also available. Details are in the CakePHP Manual.)</p><br /><p><strong>Controllers</strong> contain the logic of your application. Each controller can offer different functionality; controllers retrieve and modify data by accessing database tables through models; and they register variables and objects, which can be used in views.</p> <p><strong>Models</strong> are active representations of database tables: they can connect to your database, query it (if instructed to do so by a controller) and save data to the database. It is important to note that in order to correctly apply the MVC architecture, there must be no interaction between models and views: all the logic is handled by controllers.</p><p><strong>Views</strong> can be described as template files that present their content to the user: variables, <a href="http://www.sitepoint.com/glossary.php?q=%23#term_72" class="glossary" title="An array is a single variable with compartments, each of which can hold a value. "></a>arrays and objects that are used in views are registered through a controller. Views should not contain complex business logic; only the elementary control structures necessary to perform particular operations, such as the iteration of collected data through a foreach construct, should be contained within a view.</p> <p>This architecture can greatly improve the maintainability and the organization of your site's code: </p> <ul><li>It separates business logic from presentation and data retrieval.</li><li>A site is divided into logical sections, each governed by a particular controller.</li><li>When testing and debugging an application, any developer accustomed to CakePHP's structure will be able to locate and correct errors without knowing all of the details of the code.</li></ul> <p>Controllers, models and views are stored in pre-defined directories within CakePHP's directory structure. Here's the directory structure that's used:</p> <ul><li>app/<ul><li>config/</li><li>controllers/</li><li>models/</li><li>plugins/</li><li>tmp/</li><li>vendors/</li><li>views/</li><li>webroot/</li></ul> </li><li>cake/<ul><li>config/</li><li>docs/</li><li>libs/</li></ul> </li><li>vendors/</li></ul> <p><br /></p>hemanthttp://www.blogger.com/profile/09617167694071000571noreply@blogger.com0