<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8203987105897055974</id><updated>2012-02-16T08:11:33.310-08:00</updated><category term='C ++'/><category term='Microsoft Speach API (SAPI)'/><category term='SCEA'/><category term='JAVA'/><category term='JSP'/><category term='Tomcat 7'/><category term='Maven'/><category term='Javascript'/><category term='Web Services'/><category term='Eclipse'/><category term='SQL Server'/><category term='Hibernate'/><category term='Java Puzzle of the Day'/><category term='MySql'/><category term='SCJP'/><category term='JAVAhttp://www.blogger.com/img/blank.gif'/><category term='C #'/><category term='Oracle'/><category term='Design Patterns'/><category term='DOS'/><title type='text'>MYRS|-|           Programmer's Inn</title><subtitle type='html'>Java, J2EE, IVR, SQL Server, Opensource</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default?start-index=101&amp;max-results=100'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>111</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-3835886353414882391</id><published>2011-12-21T07:32:00.000-08:00</published><updated>2011-12-21T07:34:01.908-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Extract Numbers from a String</title><content type='html'>&lt;code&gt;&lt;br /&gt;public static List&lt;Long&gt; extractNumsFromStr(String line) {&lt;br /&gt;  List&lt;Long&gt; numbers = new ArrayList&lt;Long&gt;();&lt;br /&gt;  Long no;&lt;br /&gt;  String number = null;&lt;br /&gt;  Pattern p = Pattern.compile("\\d+");&lt;br /&gt;  Matcher m = p.matcher(line);&lt;br /&gt;&lt;br /&gt;  while (m.find()) {&lt;br /&gt;   number = m.group();&lt;br /&gt;   no = Long.parseLong(number);&lt;br /&gt;   numbers.add(no);&lt;br /&gt;  }&lt;br /&gt;  return numbers;&lt;br /&gt; }&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-3835886353414882391?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/3835886353414882391/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=3835886353414882391' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/3835886353414882391'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/3835886353414882391'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2011/12/extract-numbers-from-string.html' title='Extract Numbers from a String'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-1363667450287887725</id><published>2011-11-10T02:32:00.000-08:00</published><updated>2011-11-10T02:37:34.948-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Convert XML file To String object</title><content type='html'>The following code will read the XML from file specified as method argument, and will return the String object containing the XML file contents, null otherwise.&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;public static String convertXMLFileToString(String filePath) { &lt;br /&gt;      try { &lt;br /&gt;        DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); &lt;br /&gt;        InputStream inputStream = new FileInputStream(new File(filePath)); &lt;br /&gt;        org.w3c.dom.Document document = documentBuilderFactory.newDocumentBuilder().parse(inputStream); &lt;br /&gt;        StringWriter stwriter = new StringWriter(); &lt;br /&gt;        Transformer serializer = TransformerFactory.newInstance().newTransformer(); &lt;br /&gt;        serializer.transform(new DOMSource(document), new StreamResult(stwriter)); &lt;br /&gt;        return stwriter.toString(); &lt;br /&gt;      } catch (Exception e) { &lt;br /&gt;        e.printStackTrace(); &lt;br /&gt;      } &lt;br /&gt;        return null; &lt;br /&gt;    }&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-1363667450287887725?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/1363667450287887725/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=1363667450287887725' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/1363667450287887725'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/1363667450287887725'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2011/11/convert-xml-file-to-string-object.html' title='Convert XML file To String object'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-5987820144494800907</id><published>2011-09-28T08:29:00.000-07:00</published><updated>2011-09-28T09:08:44.435-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySql'/><title type='text'>MySql LOAD_FILE Function</title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;b&gt;LOAD_FILE(file_name_and_complete_path)&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;It’s built in MySql String function that reads a file from server host and returns the contents of file as string. If file can’t read or doesn’t exist then this function will return NULL.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;b&gt;Important Points:&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpFirst" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span lang="EN-US" style="font-family:Wingdings;mso-fareast-font-family:Wingdings; mso-bidi-font-family:Wingdings;mso-ansi-language:EN-US"&gt;&lt;span&gt;è&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US"&gt;Must pass the full path name to the file as parameter&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span lang="EN-US" style="font-family:Wingdings;mso-fareast-font-family:Wingdings; mso-bidi-font-family:Wingdings;mso-ansi-language:EN-US"&gt;&lt;span&gt;è&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US"&gt;User must have the FILE privilege&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span lang="EN-US" style="font-family:Wingdings;mso-fareast-font-family:Wingdings; mso-bidi-font-family:Wingdings;mso-ansi-language:EN-US"&gt;&lt;span&gt;è&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US"&gt;File must be readable&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span lang="EN-US" style="font-family:Wingdings;mso-fareast-font-family:Wingdings; mso-bidi-font-family:Wingdings;mso-ansi-language:EN-US"&gt;&lt;span&gt;è&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US"&gt;Size of file must be less than &lt;i&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;max_allowed_packet&lt;/span&gt;&lt;/b&gt;&lt;/i&gt; in bytes. Default is (1048576 bytes). Its range is 1024 – 1073741824&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span lang="EN-US" style="font-family:Wingdings;mso-fareast-font-family:Wingdings; mso-bidi-font-family:Wingdings;mso-ansi-language:EN-US"&gt;&lt;span&gt;è&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US"&gt;If system variable named&lt;i&gt;&lt;b&gt; &lt;span class="Apple-style-span"&gt;secure_file_priv&lt;/span&gt;&lt;/b&gt;&lt;/i&gt; is set to a non empty directory, then the file must be located in the directory specified by this system variable. Its advisable to set this variable to the source directory for your file, otherwise there is a risk for LOAD_FILE Injection. If you want to check the current value for this system variable you can simply use the command:  &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;mysql&amp;gt;&lt;/b&gt;&lt;i&gt;&lt;b&gt;SELECT @@secure_file_priv;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt;&lt;p&gt;&lt;/p&gt;          &lt;p class="MsoNormal" style="margin-left:18.0pt"&gt;&lt;span lang="EN-US"&gt;&lt;b&gt;Example:&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left:18.0pt"&gt;&lt;span lang="EN-US"&gt;&lt;b&gt;Mysql&amp;gt;&lt;/b&gt; &lt;span class="Apple-style-span"&gt;UPDATE &lt;/span&gt;&lt;table_name&gt; &lt;span class="Apple-style-span"&gt;SET &lt;/span&gt;blob_column_name = &lt;span class="Apple-style-span"&gt;LOAD_FILE(‘/tmp/picture’)&lt;/span&gt; &lt;span class="Apple-style-span"&gt;WHERE &lt;/span&gt;id = 1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/table_name&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-5987820144494800907?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/5987820144494800907/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=5987820144494800907' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/5987820144494800907'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/5987820144494800907'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2011/09/mysql-loadfile-function.html' title='MySql LOAD_FILE Function'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-5883144465553670117</id><published>2011-09-16T07:56:00.000-07:00</published><updated>2011-09-19T01:19:58.099-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Puzzle of the Day'/><title type='text'>Java Puzzle Animal Farm</title><content type='html'>Readers of George Orwell's Animal Farm may remember old Major's pronouncement that "all animals are equal." The following Java program attempts to test this pronouncement. &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;What does it print? and Why?&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;public class AnimalFarm {&lt;br /&gt;public static void main(String[] args) {&lt;br /&gt;&lt;br /&gt;final String pig = "length: 10";&lt;br /&gt;final String dog = "length: " + pig.length();&lt;br /&gt;&lt;br /&gt;System.out.println("Animals are equal: "+ pig == dog);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, serif; font-size: 24px; font-weight: bold; "&gt;Solution:&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;p&gt;A superficial analysis of the program might suggest that it should print Animals are equal: true. After all, pig and dog are both final String variables initialized to the character sequence "length: 10". In other words, the strings referred to by pig and dog are and will forever remain equal to each other. The == operator, however, does not test whether two objects are equal; it tests whether two object references are identical. In other words, it tests whether they refer to precisely the same object. In this case, they do not. You may be aware that compile-time constants of type String are interned [JLS 15.28]. In other words, any two constant expressions of type String that designate the same character sequence are represented by identical object references. If initialized with constant expressions, both pig and dog would indeed refer to the same object, but dog is not initialized with a constant expression. The language constrains which operations are permitted to appear in a constant expression [JLS 16.28], and method invocation is not among them. Therefore the program should print Animals are equal: false, right?&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Well, no, actually. If you ran the program, you found that it prints false and nothing else. It doesn't print Animals are equal: . How could it not print this string literal, which is right there in black and white? The + operator, whether used for addition or string concatenation, binds more tightly than the == operator. Therefore, the parameter of the println method is evaluated like this:&lt;/p&gt; &lt;code&gt;System.out.println(("Animals are equal: " + pig) == dog);&lt;br /&gt;&lt;code&gt;&lt;p&gt;&lt;br /&gt;The value of the boolean expression is, of course, false, and that is exactly what the program prints. There is one surefire way to avoid this sort of difficulty: When using the string concatenation operator, always parenthesize nontrivial operands. More generally, when you are not sure whether you need parentheses, err on the side of caution and include them. If you parenthesize the comparison in the println statement as follows, it will produce the expected output of Animals are equal: false:&lt;br /&gt;&lt;/p&gt;&lt;code&gt;&lt;br /&gt;System.out.println("Animals are equal: " + (pig == dog));&lt;br /&gt;&lt;/code&gt;&lt;p&gt;&lt;br /&gt;Arguably, the program is still broken. Your code should rarely, if ever, depend on the interning of string constants. Interning was designed solely to reduce the memory footprint of the virtual machine, not as a tool for programmers. As this puzzle demonstrates, it isn't always obvious which expressions will result in string constants. Worse, if your code depends on interning for its correct operation, you must carefully keep track of which fields and parameters must be interned. The compiler can't check these invariants for you, because interned and noninterned strings are represented by the same type (String). The bugs that result from the failure to intern a string are typically quite difficult to detect.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;When comparing object references, you should use the equals method in preference to the == operator unless you need to compare object identity rather than value. Applying this lesson to our program, here is how the println statement should look. It is clear that the program prints True when it is fixed in this fashion:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;System.out.println("Animals are equal: " + pig.equals(dog));&lt;br /&gt;&lt;/code&gt;&lt;p&gt;&lt;br /&gt;This puzzle has two lessons for language designers. The natural precedence of string concatenation might not be the same as that of addition. This implies that it is problematic to overload the + operator to perform string concatenation. Also, reference equality is more confusing than value equality for immutable types, such as String. Perhaps the == operator should perform value comparisons when applied to immutable reference types. One way to achieve this would be to make the == operator a shorthand for the equals method, and to provide a separate method to perform reference identity comparison, akin to System.identityHashCode.&lt;br /&gt;&lt;/p&gt;&lt;/code&gt;&lt;/code&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-5883144465553670117?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/5883144465553670117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=5883144465553670117' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/5883144465553670117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/5883144465553670117'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2011/09/java-puzzle-animal-form.html' title='Java Puzzle Animal Farm'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-3461682916957161412</id><published>2011-09-16T05:19:00.000-07:00</published><updated>2011-09-16T05:25:59.612-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Design Patterns'/><category scheme='http://www.blogger.com/atom/ns#' term='SCEA'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Gang of Four (GOF) Design Patterns</title><content type='html'>&lt;p class="MsoNormal"&gt;The Gang of four (GOF) patterns are categorized into three main categories:&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Creational:-&lt;/b&gt; Deals with the creation of objects. Following are the creational patterns:&lt;/li&gt;&lt;/ul&gt;&lt;ol&gt;&lt;li&gt;Factory&lt;/li&gt;&lt;li&gt;Abstract Factory&lt;/li&gt;&lt;li&gt;Factory Method&lt;/li&gt;&lt;li&gt;Builder&lt;/li&gt;&lt;li&gt;Prototype&lt;/li&gt;&lt;li&gt;Singleton&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Structural:-&lt;/b&gt; Deals with the relationships between portion of your application. Followings are the Structural patterns:&lt;/li&gt;&lt;/ul&gt;&lt;ol&gt;&lt;li&gt;Adapter&lt;/li&gt;&lt;li&gt;Bridge&lt;/li&gt;&lt;li&gt;Composite&lt;/li&gt;&lt;li&gt;Decorator&lt;/li&gt;&lt;li&gt;Facade&lt;/li&gt;&lt;li&gt;Flyweight&lt;/li&gt;&lt;li&gt;Proxy&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Behavioural:-&lt;/b&gt; Deals with the state and behaviour flow through the system. Followings are the behavioural patterns:&lt;/li&gt;&lt;/ul&gt;&lt;ol&gt;&lt;li&gt;Chain of Responsibility&lt;/li&gt;&lt;li&gt;Command&lt;/li&gt;&lt;li&gt;Interpreter&lt;/li&gt;&lt;li&gt;Iterator&lt;/li&gt;&lt;li&gt;Mediator&lt;/li&gt;&lt;li&gt;Memento&lt;/li&gt;&lt;li&gt;Observer&lt;/li&gt;&lt;li&gt;State&lt;/li&gt;&lt;li&gt;Strategy&lt;/li&gt;&lt;li&gt;Template Method&lt;/li&gt;&lt;li&gt;Visitor&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-3461682916957161412?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/3461682916957161412/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=3461682916957161412' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/3461682916957161412'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/3461682916957161412'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2011/09/gang-of-four-gof-design-patterns.html' title='Gang of Four (GOF) Design Patterns'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-7418555918300124274</id><published>2011-09-15T02:00:00.000-07:00</published><updated>2011-09-15T02:06:47.813-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVAhttp://www.blogger.com/img/blank.gif'/><title type='text'>New Features in Java version 7</title><content type='html'>The new release of Java 7 introduced exciting new features in the language; following is the list of these features:&lt;br /&gt;&lt;br /&gt;&lt;ul style="font-weight: bold;"&gt;&lt;li&gt; Strings in the Switch Statement&lt;/li&gt;&lt;/ul&gt;For details please visit: &lt;a href="http://download.oracle.com/javase/7/docs/technotes/guides/language/strings-switch.html"&gt;http://download.oracle.com/javase/7/docs/technotes/guides/language/strings-switch.html&lt;/a&gt;&lt;br /&gt;&lt;ul style="font-weight: bold;"&gt;&lt;li&gt;Type Inference for Generic Instance Creation (diamond symbol &amp;lt;&amp;gt;)&lt;/li&gt;&lt;/ul&gt;For details please visit:&lt;br /&gt;&lt;a href="http://download.oracle.com/javase/7/docs/technotes/guides/language/type-inference-generic-instance-creation.html"&gt;http://download.oracle.com/javase/7/docs/technotes/guides/language/type-inference-generic-instance-creation.html&lt;/a&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;The try-with-resources Statement&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;For details please visit:&lt;br /&gt;&lt;a href="http://download.oracle.com/javase/7/docs/technotes/guides/language/try-with-resources.html"&gt;http://download.oracle.com/javase/7/docs/technotes/guides/language/try-with-resources.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Catching multiple Exception Types and Rethrowing Exception with Improved Type Checking&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;For details please visit:&lt;br /&gt;&lt;a href="http://download.oracle.com/javase/7/docs/technotes/guides/language/catch-multiple.html"&gt;http://download.oracle.com/javase/7/docs/technotes/guides/language/catch-multiple.html&lt;/a&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Enhancements in Java I/O (new package named java.nio)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;For details please visit:&lt;br /&gt;&lt;a href="http://download.oracle.com/javase/7/docs/technotes/guides/io/enhancements.html#7"&gt;http://download.oracle.com/javase/7/docs/technotes/guides/io/enhancements.html#7&lt;/a&gt;&lt;br /&gt;&lt;a href="http://download.oracle.com/javase/tutorial/essential/io/notification.html"&gt;http://download.oracle.com/javase/tutorial/essential/io/notification.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Java Virtual Machine Support for Non-Java Languages&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;For details please visit:&lt;br /&gt;&lt;a href="http://download.oracle.com/javase/7/docs/technotes/guides/vm/multiple-language-support.html"&gt;http://download.oracle.com/javase/7/docs/technotes/guides/vm/multiple-language-support.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;JLayer Pane to Decorate Components with JLayer Class&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;For details please visit:&lt;br /&gt;&lt;a href="http://download.oracle.com/javase/tutorial/uiswing/misc/jlayer.html"&gt;http://download.oracle.com/javase/tutorial/uiswing/misc/jlayer.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-7418555918300124274?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/7418555918300124274/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=7418555918300124274' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/7418555918300124274'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/7418555918300124274'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2011/09/new-features-in-java-version-7.html' title='New Features in Java version 7'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-4280156872366015069</id><published>2011-08-10T03:24:00.000-07:00</published><updated>2011-08-10T03:26:10.662-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>To Check Internet Explorer (IE) version</title><content type='html'>&lt;br /&gt;Little helper function to return details about IE 8 and its various compatibility settings either use as it is or incorporate into a browser object. Remember browser sniffing is not the best way to detect user-settings as spoofing is very common so use with caution.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;function IEVersion(){&lt;br /&gt;    var _n=navigator,_w=window,_d=document;&lt;br /&gt;    var version="NA";&lt;br /&gt;    var na=_n.userAgent;&lt;br /&gt;    var ieDocMode="NA";&lt;br /&gt;    var ie8BrowserMode="NA";&lt;br /&gt;    // Look for msie and make sure its not opera in disguise&lt;br /&gt;    if(/msie/i.test(na) &amp;&amp; (!_w.opera)){&lt;br /&gt;        // also check for spoofers by checking known IE objects&lt;br /&gt;        if(_w.attachEvent &amp;&amp; _w.ActiveXObject){        &lt;br /&gt;            // Get version displayed in UA although if its IE 8 running in 7 or compat mode it will appear as 7&lt;br /&gt;            version = (na.match( /.+ie\s([\d.]+)/i ) || [])[1];&lt;br /&gt;            // Its IE 8 pretending to be IE 7 or in compat mode        &lt;br /&gt;            if(parseInt(version)==7){                &lt;br /&gt;                // documentMode is only supported in IE 8 so we know if its here its really IE 8&lt;br /&gt;                if(_d.documentMode){&lt;br /&gt;                    version = 8; //reset? change if you need to&lt;br /&gt;                    // IE in Compat mode will mention Trident in the useragent&lt;br /&gt;                    if(/trident\/\d/i.test(na)){&lt;br /&gt;                        ie8BrowserMode = "Compat Mode";&lt;br /&gt;                    // if it doesn't then its running in IE 7 mode&lt;br /&gt;                    }else{&lt;br /&gt;                        ie8BrowserMode = "IE 7 Mode";&lt;br /&gt;                    }&lt;br /&gt;                }&lt;br /&gt;            }else if(parseInt(version)==8){&lt;br /&gt;                // IE 8 will always have documentMode available&lt;br /&gt;                if(_d.documentMode){ ie8BrowserMode = "IE 8 Mode";}&lt;br /&gt;            }&lt;br /&gt;            // If we are in IE 8 (any mode) or previous versions of IE we check for the documentMode or compatMode for pre 8 versions            &lt;br /&gt;            ieDocMode = (_d.documentMode) ? _d.documentMode : (_d.compatMode &amp;&amp; _d.compatMode=="CSS1Compat") ? 7 : 5;//default to quirks mode IE5                               &lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    return {&lt;br /&gt;        "UserAgent" : na,&lt;br /&gt;        "Version" : version,&lt;br /&gt;        "BrowserMode" : ie8BrowserMode,&lt;br /&gt;        "DocMode": ieDocMode&lt;br /&gt;    }            &lt;br /&gt;}&lt;br /&gt;var ieVersion = IEVersion();&lt;br /&gt;var IsIE8 = ieVersion.Version != "NA" &amp;&amp; ieVersion.Version &gt;= 8;&lt;br /&gt;&lt;br /&gt;if (!IsIE8) {&lt;br /&gt;	alert("Please upgrade to Internet Explorer 8 or better!" ) ;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-4280156872366015069?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/4280156872366015069/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=4280156872366015069' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/4280156872366015069'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/4280156872366015069'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2011/08/to-check-internet-explorer-ie-version.html' title='To Check Internet Explorer (IE) version'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-2827843884833605716</id><published>2011-07-13T14:19:00.000-07:00</published><updated>2011-07-13T14:26:51.042-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Masking a HTML TextField as Numeric or Float</title><content type='html'>&lt;p class="MsoNormal" style=""&gt;&lt;span class="Apple-style-span"   &gt;Add these functions to your JavaScript code under &amp;lt;script&amp;gt; tag.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(127, 0, 85);"&gt;function &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;getKey(evt) &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(127, 0, 85);"&gt;{ &lt;/span&gt; &lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(63, 95, 191);"&gt;// works for IE, Netscape, Firefox, Opera, Chrome&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(63, 95, 191);"&gt;  &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(127, 0, 85);"&gt;var &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;theEvent = evt || window.event;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;  &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(127, 0, 85);"&gt;var &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;key = theEvent.keyCode || theEvent.which;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;  &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(127, 0, 85);"&gt;return &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;key;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(127, 0, 85);"&gt;}&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(127, 0, 85);"&gt;function &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;MaskNumeric(evt) &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(127, 0, 85);"&gt;{&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(63, 95, 191);"&gt;//8 Delete, 39 left cursor, 37 right cursor, 35 end, 36 home, 9 tab, 116 f5&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(63, 95, 191);"&gt;//127 Backspace 48-57 0-9&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(63, 95, 191);"&gt;      &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(127, 0, 85);"&gt;var &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;key = getKey(evt);&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;      &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(127, 0, 85);"&gt;if&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;( (key == 116 || key == 8 || key == 9 || key == 39 || key == 37 || key == 35 || &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;       key == 36 || key == 189 || key == 109 || key == 127 || key == 46) ||&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;      (key &amp;gt;= 48 &amp;amp;&amp;amp; key &amp;lt;= 57) || &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;      (key &amp;gt;= 96 &amp;amp;&amp;amp; key &amp;lt;= 105) ) &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(127, 0, 85);"&gt;{&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(127, 0, 85);"&gt;      return true&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;; &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;    &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(127, 0, 85);"&gt;} else {&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(127, 0, 85);"&gt;      return false&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;      &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(127, 0, 85);"&gt;}&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(127, 0, 85);"&gt;}&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(127, 0, 85);"&gt;function &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;MaskFloat(evt) &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(127, 0, 85);"&gt;{&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(127, 0, 85);"&gt;      &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(63, 95, 191);"&gt;//8 Delete, 39 left cursor, 37 right cursor, 35 end, 36 home, 9 tab, 116 f5&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(63, 95, 191);"&gt;      //127 Backspace 48-57 0-9&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(63, 95, 191);"&gt;      &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(127, 0, 85);"&gt;var &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;key = getKey(evt);&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;      &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(127, 0, 85);"&gt;if&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;( (key == 116 || key == 8 || key == 9 || key == 39 || key == 37 || key == 35 || &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;             key == 36 || key == 189 || key == 109 || key == 127 || key == 46 || key == 110 || key == 190) ||&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;            (key &amp;gt;= 48 &amp;amp;&amp;amp; key &amp;lt;= 57) || &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;            (key &amp;gt;= 96 &amp;amp;&amp;amp; key &amp;lt;= 105) ) &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(127, 0, 85);"&gt;{&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(127, 0, 85);"&gt;            return true&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;; &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;      &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(127, 0, 85);"&gt;} else {&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(127, 0, 85);"&gt;          return false&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;"&gt;      &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(127, 0, 85);"&gt;}&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(127, 0, 85);"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(127, 0, 85);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(127, 0, 85);"&gt;Then use the following code in your HTML form.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(127, 0, 85);"&gt;For Numeric Masked Field:&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(127, 0, 85);"&gt;&amp;lt;input type="text" &lt;/span&gt;&lt;span style="color: rgb(127, 0, 85); font-size: 12px; line-height: 18px; white-space: pre;"&gt;&lt;span class="Apple-style-span" &gt;onkeypress="return MaskNumeric(event);&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(127, 0, 85); font-family: 'courier new', monospace; font-size: 12px; line-height: 18px; white-space: pre; "&gt;" /&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="color: rgb(127, 0, 85); font-family: 'courier new', monospace; font-size: 12px; line-height: 18px; white-space: pre; "&gt;For Float Masked Field.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'; color: rgb(127, 0, 85); "&gt;&amp;lt;input type="text" &lt;/span&gt;&lt;span style="color: rgb(127, 0, 85); font-size: 12px; line-height: 18px; white-space: pre; "&gt;&lt;span class="Apple-style-span" &gt;onkeypress="return MaskNumeric(event);&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(127, 0, 85); font-family: 'courier new', monospace; font-size: 12px; line-height: 18px; white-space: pre; "&gt;" /&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="color: rgb(127, 0, 85); font-family: 'courier new', monospace; font-size: 12px; line-height: 18px; white-space: pre; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-2827843884833605716?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/2827843884833605716/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=2827843884833605716' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/2827843884833605716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/2827843884833605716'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2011/07/masking-html-textfield-as-numeric-or.html' title='Masking a HTML TextField as Numeric or Float'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-4098754250707231568</id><published>2011-02-16T14:34:00.000-08:00</published><updated>2011-02-16T14:41:30.745-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Passing Variable No of Arguments to Oracle Stored Procedure</title><content type='html'>&lt;p&gt;&lt;span&gt;If you want to pass variable number of arguments in a Oracle stored procedure, you can use array Type as stored procedure's parameter to accomplish this. Like in Java you can pass varargs as an array. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;1- C&lt;/span&gt;reate an Oracle nested table type in the database&lt;/p&gt;&lt;p&gt;&lt;span&gt;CREATE OR REPLACE TYPE nt_type IS TABLE OF VARCHAR2(30);     &lt;/span&gt;&lt;/p&gt; &lt;p&gt;2- Create a procedure in the database&lt;/p&gt;&lt;p&gt;CREATE OR REPLACE PROCEDURE nt_proc (nt nt_type) IS           &lt;/p&gt; &lt;p&gt;&lt;span&gt;  i  NUMBER;  &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span&gt;BEGIN  &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span&gt;  FOR i IN nt.FIRST .. nt.LAST  &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span&gt;  LOOP  &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span&gt;    INSERT INTO nt_test(id, description) VALUES (i, nt(i));  &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span&gt;  END LOOP;  &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span&gt;END nt_proc;  &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span&gt;/  &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span&gt;   &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;3- Create a test table, T&lt;/span&gt;his is just for test purposes.&lt;/p&gt;&lt;p&gt;&lt;span&gt;CREATE TABLE nt_test (id NUMBER, description VARCHAR2(30)); &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;span&gt;4- Create a module which defines the array of values  &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span&gt;DECLARE  &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span&gt;  nt nt_type := nt_type(); -- nested table variable initialized to empty  &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span&gt;BEGIN  &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span&gt;  nt := nt_type('Chester','Swindon','Corby','London','Swansea','Cardiff'); -- create your string of variables here  &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span&gt;  nt_proc(nt);  &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span&gt;END;  &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span&gt;/  &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span&gt;   &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span&gt;SELECT * FROM nt_test;  &lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-4098754250707231568?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/4098754250707231568/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=4098754250707231568' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/4098754250707231568'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/4098754250707231568'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2011/02/passing-variable-no-of-arguments-to.html' title='Passing Variable No of Arguments to Oracle Stored Procedure'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-7352563890911754896</id><published>2011-02-14T10:09:00.000-08:00</published><updated>2011-02-14T10:19:27.462-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Renaming Foreign Keys</title><content type='html'>&lt;pre wrap=""&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, serif; font-size: 16px; white-space: normal; "&gt;&lt;pre wrap=""&gt;&lt;pre wrap=""&gt;There is an Oracle DDL command which will rename a Foreign Key constraint:&lt;/pre&gt;&lt;pre wrap=""&gt;SQL&gt;ALTER TABLE &amp;lt;tablename&amp;gt; RENAME CONSTRAINT &amp;lt;foreign_key&amp;gt; TO &amp;lt;foreign_key_new_name&amp;gt;;&lt;/pre&gt;&lt;pre wrap=""&gt;eg&lt;/pre&gt;&lt;pre wrap=""&gt;SQL&gt;ALTER TABLE emp RENAME CONSTRAINT SYS_C0017017 TO FK_EMP_DEPT;&lt;/pre&gt;&lt;pre wrap=""&gt;I have written an Oracle stored procedure which shows how this can be done:&lt;/pre&gt;&lt;pre wrap=""&gt;1)&lt;/pre&gt;&lt;pre wrap=""&gt;CREATE OR REPLACE PROCEDURE rename_foreign_key(p_table_name IN VARCHAR2, p_foreign_key IN VARCHAR2, p_foreign_key_new VARCHAR2)&lt;/pre&gt;&lt;pre wrap=""&gt;IS&lt;/pre&gt;&lt;pre wrap=""&gt;l_action VARCHAR2(2000) := NULL;&lt;/pre&gt;&lt;pre wrap=""&gt;  &lt;/pre&gt;&lt;pre wrap=""&gt;  CURSOR c_uc(p_table_name VARCHAR2, p_fk VARCHAR2, p_fk_new VARCHAR2)&lt;/pre&gt;&lt;pre wrap=""&gt;  IS&lt;/pre&gt;&lt;pre wrap=""&gt;    SELECT 'ALTER TABLE ' || uc.table_name || ' RENAME CONSTRAINT ' || uc.constraint_name || ' TO ' || p_fk_new&lt;/pre&gt;&lt;pre wrap=""&gt;    FROM  user_constraints uc &lt;/pre&gt;&lt;pre wrap=""&gt;    WHERE uc.table_name = p_table_name&lt;/pre&gt;&lt;pre wrap=""&gt;    AND   uc.constraint_name = p_fk&lt;/pre&gt;&lt;pre wrap=""&gt;    AND   uc.constraint_type = 'R';&lt;/pre&gt;&lt;pre wrap=""&gt;BEGIN NULL;&lt;/pre&gt;&lt;pre wrap=""&gt;  OPEN c_uc(p_table_name, p_foreign_key, p_foreign_key_new);&lt;/pre&gt;&lt;pre wrap=""&gt;  FETCH c_uc INTO l_action;&lt;/pre&gt;&lt;pre wrap=""&gt;  CLOSE c_uc;&lt;/pre&gt;&lt;pre wrap=""&gt;  EXECUTE IMMEDIATE l_action;&lt;/pre&gt;&lt;pre wrap=""&gt;END;&lt;/pre&gt;&lt;pre wrap=""&gt;/&lt;/pre&gt;&lt;pre wrap=""&gt;2) Example: create a master table DEPT and a child table EMP&lt;/pre&gt;&lt;pre wrap=""&gt;CREATE TABLE dept (&lt;/pre&gt;&lt;pre wrap=""&gt;deptno NUMBER(4) PRIMARY KEY,&lt;/pre&gt;&lt;pre wrap=""&gt;dname VARCHAR2(14),&lt;/pre&gt;&lt;pre wrap=""&gt;loc VARCHAR2(13));&lt;/pre&gt;&lt;pre wrap=""&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre wrap=""&gt;CREATE TABLE emp (&lt;/pre&gt;&lt;pre wrap=""&gt;empno NUMBER(4) PRIMARY KEY,&lt;/pre&gt;&lt;pre wrap=""&gt;ename VARCHAR2(10),&lt;/pre&gt;&lt;pre wrap=""&gt;deptno NUMBER(2),&lt;/pre&gt;&lt;pre wrap=""&gt;FOREIGN KEY (DEPTNO) REFERENCES DEPT(DEPTNO));&lt;/pre&gt;&lt;pre wrap=""&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre wrap=""&gt;3) Find the generated name for the foreign key in the EMP table&lt;/pre&gt;&lt;pre wrap=""&gt;SELECT constraint_name FROM user_constraints WHERE table_name = 'EMP' AND constraint_type = 'R' AND generated = 'GENERATED NAME';&lt;/pre&gt;&lt;pre wrap=""&gt;  --&gt; SYS_C0017017&lt;/pre&gt;&lt;pre wrap=""&gt;4) Rename SYS_C0017017 to FK_EMP_DEPT&lt;/pre&gt;&lt;pre wrap=""&gt;SQL&gt; EXEC rename_foreign_key('EMP','SYS_C0017017','FK_EMP_DEPT')&lt;/pre&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-7352563890911754896?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/7352563890911754896/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=7352563890911754896' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/7352563890911754896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/7352563890911754896'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2011/02/renaming-foreign-keys.html' title='Renaming Foreign Keys'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-5299082210831583219</id><published>2010-12-05T03:52:00.000-08:00</published><updated>2010-12-05T03:55:48.358-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DOS'/><title type='text'>DOS Script to detect Windows/OS Version</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; color: rgb(51, 51, 51); "&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;Simply save the following script in a .bat file and run, it will detect the OS version and will give you the results.&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;#----------------------------------------&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;# detectOS.bat&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;#----------------------------------------&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;@echo off&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;ver | find "2003" &gt; nul&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;if %ERRORLEVEL% == 0 goto ver_2003&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;ver | find "XP" &gt; nul&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;if %ERRORLEVEL% == 0 goto ver_xp&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;ver | find "2000" &gt; nul&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;if %ERRORLEVEL% == 0 goto ver_2000&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;ver | find "NT" &gt; nul&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;if %ERRORLEVEL% == 0 goto ver_nt&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;if not exist %SystemRoot%\system32\&lt;wbr&gt;systeminfo.exe goto warnthenexit&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;systeminfo | find "OS Name" &gt; %TEMP%\osname.txt&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;FOR /F "usebackq delims=: tokens=2" %%i IN (%TEMP%\osname.txt) DO set vers=%%i&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;echo %vers% | find "Windows 7" &gt; nul&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;if %ERRORLEVEL% == 0 goto ver_7&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;echo %vers% | find "Windows Server 2008" &gt; nul&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;if %ERRORLEVEL% == 0 goto ver_2008&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;echo %vers% | find "Windows Vista" &gt; nul&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;if %ERRORLEVEL% == 0 goto ver_vista&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;goto warnthenexit&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;:ver_7&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;:Run Windows 7 specific commands here.&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;echo Windows 7&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;goto exit&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;:ver_2008&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;:Run Windows Server 2008 specific commands here.&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;echo Windows Server 2008&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;goto exit&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;:ver_vista&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;:Run Windows Vista specific commands here.&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;echo Windows Vista&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;goto exit&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;:ver_2003&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;:Run Windows Server 2003 specific commands here.&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;echo Windows Server 2003&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;goto exit&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;:ver_xp&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;:Run Windows XP specific commands here.&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;echo Windows XP&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;goto exit&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;:ver_2000&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;:Run Windows 2000 specific commands here.&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;echo Windows 2000&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;goto exit&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;:ver_nt&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;:Run Windows NT specific commands here.&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;echo Windows NT&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;goto exit&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;:warnthenexit&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;echo Machine undetermined.&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;:exit&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;#----------------------------------------&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-5299082210831583219?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/5299082210831583219/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=5299082210831583219' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/5299082210831583219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/5299082210831583219'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2010/12/dos-script-to-detect-windowsos-version.html' title='DOS Script to detect Windows/OS Version'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-480581340100987665</id><published>2010-11-18T13:26:00.000-08:00</published><updated>2010-11-18T13:27:22.973-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Oracle: Rename a column in a table</title><content type='html'>Oracle provides "alter table" syntax to rename data columns in-place in this form:&lt;div&gt;&lt;br /&gt;ALTER TABLE&lt;br /&gt;  table_name&lt;br /&gt;RENAME COLUMN&lt;br /&gt;  old_column_name &lt;br /&gt;TO&lt;br /&gt;  new_column_name;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here are the example of Oracle "alter table" syntax to rename data columns:&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;ALTER TABLE&lt;br /&gt;  pick_line&lt;br /&gt;RENAME COLUMN&lt;br /&gt;  "VOLUME"&lt;br /&gt;TO&lt;br /&gt;  "volume";&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-480581340100987665?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/480581340100987665/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=480581340100987665' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/480581340100987665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/480581340100987665'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2010/11/oracle-rename-column-in-table.html' title='Oracle: Rename a column in a table'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-2680689617733409803</id><published>2010-11-13T01:31:00.000-08:00</published><updated>2010-11-18T13:29:17.943-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DOS'/><title type='text'>Dos Command to read JDK Path from registry</title><content type='html'>These lines of code will get the JDK path from registry:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;set KeyName=HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit&lt;br /&gt;set Cmd=reg query "%KeyName%" /s&lt;br /&gt;for /f "tokens=2*" %%i in ('%Cmd% ^| find "JavaHome"') do set JVM_HOME=%%j&lt;br /&gt;echo Path is : %JVM_HOM&lt;a href="javascript:void(0)"&gt;Publish Post&lt;/a&gt;E%&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-2680689617733409803?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/2680689617733409803/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=2680689617733409803' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/2680689617733409803'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/2680689617733409803'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2010/11/read-jdk-path-from-registry.html' title='Dos Command to read JDK Path from registry'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-8661391561198425435</id><published>2010-11-10T15:05:00.000-08:00</published><updated>2010-11-10T15:06:40.164-08:00</updated><title type='text'>Create Dependencies between Windows Services</title><content type='html'>The following steps need to be performed in order to create a dependency.&lt;br /&gt;&lt;br /&gt;1-Backup your current registry settings.&lt;br /&gt;&lt;br /&gt;2-Run 'regedit' to open your registry.&lt;br /&gt;&lt;br /&gt;3-Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services and locate the &lt;br /&gt;service that you need to set a dependency for.&lt;br /&gt;&lt;br /&gt;4-Open the 'DependOnService' key on the right side. If the selected service does not have a 'DependOnService' key, then create one by right-clicking and selecting New &gt; Multi-String Value.&lt;br /&gt;&lt;br /&gt;5-In the value field, enter the names of all services that the current service will depend on. Each service name must be entered properly and on a separate line.&lt;br /&gt;&lt;br /&gt;6-Click OK, close your registry and restart your machine.&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-8661391561198425435?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/8661391561198425435/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=8661391561198425435' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/8661391561198425435'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/8661391561198425435'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2010/11/create-dependencies-between-windows.html' title='Create Dependencies between Windows Services'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-5718208104520429025</id><published>2010-09-30T00:03:00.000-07:00</published><updated>2010-09-30T00:07:35.069-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maven'/><title type='text'>Create Zip file of resources using Maven Assembly Plugin</title><content type='html'>If you have some resources (xml files, properties files etc) that contains project properties to be substituted before generating the zip package of those resources. Probably Maven is pretty helpful to create it. For example you have some paths of DTD schema in your xml files that you need to resolve before generating the deployable resource package.&lt;br /&gt;You need to use Maven Assembly plugin to generate a zip file. You have to create an assembly descriptor file that you will include in your POM file.&lt;br /&gt;The assembly descriptor will look like. you can save it as (zip-descriptor.xml)&lt;br /&gt; &lt;br /&gt;   &lt;br /&gt; &amp;lt;assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 " xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance "&lt;br /&gt;  xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0  http://maven.apache.org/xsd/assembly-1.1.0.xsd " &amp;gt;&lt;br /&gt; &lt;br /&gt;   &amp;lt;includeBaseDirectory &amp;gt;false &amp;lt;/includeBaseDirectory &amp;gt;&lt;br /&gt;   &amp;lt;formats &amp;gt;&lt;br /&gt;     &amp;lt;format &amp;gt;zip &amp;lt;/format &amp;gt;&lt;br /&gt;   &amp;lt;/formats &amp;gt;&lt;br /&gt;   &amp;lt;fileSets &amp;gt;&lt;br /&gt;     &amp;lt;fileSet &amp;gt;&lt;br /&gt;       &amp;lt;directory &amp;gt;directory-name &amp;lt;/directory &amp;gt;&lt;br /&gt;       &amp;lt;outputDirectory &amp;gt; &amp;lt;/outputDirectory &amp;gt;&lt;br /&gt;       &amp;lt;filtered &amp;gt;true &amp;lt;/filtered &amp;gt;&lt;br /&gt;     &amp;lt;/fileSet &amp;gt;&lt;br /&gt;   &amp;lt;/fileSets &amp;gt;&lt;br /&gt; &amp;lt;/assembly &amp;gt;&lt;br /&gt;   &lt;br /&gt;your POM file will look like. (POM.xml)&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &amp;lt;project xmlns="http://maven.apache.org/POM/4.0.0 " xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance "&lt;br /&gt;         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0  http://maven.apache.org/maven-v4_0_0.xsd " &amp;gt;&lt;br /&gt; &lt;br /&gt;     &amp;lt;modelVersion &amp;gt;4.0.0 &amp;lt;/modelVersion &amp;gt;&lt;br /&gt;     &amp;lt;groupId &amp;gt;iceland-picking &amp;lt;/groupId &amp;gt;&lt;br /&gt;     &amp;lt;artifactId &amp;gt;iceland-picking &amp;lt;/artifactId &amp;gt;&lt;br /&gt;     &amp;lt;version &amp;gt;0.0.1-SNAPSHOT &amp;lt;/version &amp;gt;&lt;br /&gt;     &amp;lt;packaging &amp;gt;pom &amp;lt;/packaging &amp;gt;&lt;br /&gt;     &amp;lt;name &amp;gt;iceland-picking &amp;lt;/name &amp;gt;&lt;br /&gt; &lt;br /&gt;     &amp;lt;prerequisites &amp;gt;&lt;br /&gt;         &amp;lt;maven &amp;gt;2.2.0 &amp;lt;/maven &amp;gt;&lt;br /&gt;     &amp;lt;/prerequisites &amp;gt;&lt;br /&gt; &lt;br /&gt;     &amp;lt;properties &amp;gt;                                &lt;br /&gt;                 &amp;lt;product.codename &amp;gt;codename &amp;lt;/product.codename &amp;gt;&lt;br /&gt;                 &amp;lt;product.name  &amp;gt;product name &amp;lt;/product.name  &amp;gt;&lt;br /&gt;                 &amp;lt;product.version &amp;gt;${project.version} &amp;lt;/product.version &amp;gt;&lt;br /&gt;               &lt;br /&gt;                 &amp;lt;model.codename &amp;gt;${product.codename} &amp;lt;/model.codename &amp;gt;&lt;br /&gt;                 &amp;lt;model.name  &amp;gt;${product.name } &amp;lt;/model.name  &amp;gt;&lt;br /&gt;                 &amp;lt;model.version &amp;gt;${project.version} &amp;lt;/model.version &amp;gt;&lt;br /&gt;               &lt;br /&gt;                 &amp;lt;metabase.version &amp;gt;1 &amp;lt;/metabase.version &amp;gt;&lt;br /&gt;                 &amp;lt;database.version &amp;gt;1 &amp;lt;/database.version &amp;gt;&lt;br /&gt;     &amp;lt;/properties &amp;gt;&lt;br /&gt; &lt;br /&gt;     &amp;lt;build &amp;gt;   &lt;br /&gt;         &amp;lt;plugins &amp;gt;&lt;br /&gt;             &amp;lt;plugin &amp;gt;&lt;br /&gt;                &amp;lt;groupId &amp;gt;org.apache.maven.plugins &amp;lt;/groupId &amp;gt;&lt;br /&gt;                &amp;lt;artifactId &amp;gt;maven-assembly-plugin &amp;lt;/artifactId &amp;gt;&lt;br /&gt;                                                 &amp;lt;configuration &amp;gt;   &lt;br /&gt;                                                                 &amp;lt;descriptors &amp;gt;&lt;br /&gt;                                                                                 &amp;lt;descriptor &amp;gt;zip-descriptor.xml &amp;lt;/descriptor &amp;gt;&lt;br /&gt;                                                                 &amp;lt;/descriptors &amp;gt;&lt;br /&gt;                                                                 &amp;lt;finalName &amp;gt;this will be the name of the output zip file &amp;lt;/finalName &amp;gt;&lt;br /&gt;                                                                 &amp;lt;appendAssemblyId &amp;gt;false &amp;lt;/appendAssemblyId &amp;gt;                                                            &lt;br /&gt;                                                   &amp;lt;/configuration &amp;gt;&lt;br /&gt;                        &amp;lt;executions &amp;gt;&lt;br /&gt;                            &amp;lt;execution &amp;gt;&lt;br /&gt;                                &amp;lt;id &amp;gt;make-assembly &amp;lt;/id &amp;gt;&lt;br /&gt;                                &amp;lt;phase &amp;gt;package &amp;lt;/phase &amp;gt;&lt;br /&gt;                                &amp;lt;goals &amp;gt;&lt;br /&gt;                                    &amp;lt;goal &amp;gt;single &amp;lt;/goal &amp;gt;   &lt;br /&gt;                                &amp;lt;/goals &amp;gt;&lt;br /&gt;                            &amp;lt;/execution &amp;gt;&lt;br /&gt;                        &amp;lt;/executions &amp;gt;&lt;br /&gt;            &amp;lt;/plugin &amp;gt;&lt;br /&gt;         &amp;lt;/plugins &amp;gt;&lt;br /&gt;     &amp;lt;/build &amp;gt;&lt;br /&gt; &amp;lt;/project &amp;gt;&lt;br /&gt;  &lt;br /&gt;For more details please visit the following Maven link:&lt;br /&gt;1)      http://maven.apache.org/guides/mini/guide-assemblies.html &lt;br /&gt;2)      http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.html&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-5718208104520429025?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/5718208104520429025/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=5718208104520429025' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/5718208104520429025'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/5718208104520429025'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2010/09/create-zip-file-of-resources-using.html' title='Create Zip file of resources using Maven Assembly Plugin'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-7845706256346697985</id><published>2010-09-24T11:52:00.000-07:00</published><updated>2010-09-24T11:54:22.118-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>ORA-01000: maximum open cursors limit exceeded</title><content type='html'>If you are getting ORA-01000 exception, it means you need to review your design or you need to optimize your code. You need to make sure that all the open cursors are being closed after they are finished being used in application.&lt;br /&gt;&lt;br /&gt;To check amount of open cursors in Oracle simple run this query:&lt;br /&gt; &lt;br /&gt;select count(*) from v$open_cursor;&lt;br /&gt; &lt;br /&gt;To increase/decrease the amount of open cursors limit run the following query:&lt;br /&gt; &lt;br /&gt;ALTER SYSTEM SET open_cursors = 1000 SCOPE=BOTH;&lt;br /&gt; &lt;br /&gt;OPEN_CURSORS sets the maximum number of cursors each session can have open, per session. For example, if OPEN_CURSORS is set to 1000, then each session can have up to 1000 cursors open at one time. If a single session has OPEN_CURSORS # of cursors open, it will get an ora-1000 error when it tries to open one more cursor.&lt;br /&gt; &lt;br /&gt;The default value for OPEN_CURSORS is 50, but Oracle recommends that you set this to at least 500 for most applications. Some applications may need more, eg. High volume web applications.&lt;br /&gt; &lt;br /&gt;Only increase the OPEN CURSOR limit if your application really needs it, otherwise focus on releasing the unused cursors in your code. For example, In Java close ResultSet or Statement or Connection object as soon as you are finished with them.&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-7845706256346697985?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/7845706256346697985/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=7845706256346697985' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/7845706256346697985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/7845706256346697985'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2010/09/ora-01000-maximum-open-cursors-limit.html' title='ORA-01000: maximum open cursors limit exceeded'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-4399001110719608191</id><published>2010-09-03T02:59:00.000-07:00</published><updated>2010-09-03T03:08:08.085-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Default Argument Value for Methods</title><content type='html'>Like in C++, C#, PHP or SQL we can provide the default value for the argument that will be used in case when value is not supplied during method/function call. For example the following function declaration in C++:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;void int someFun(int a, int b =0) {&lt;br /&gt;      // some implementation here...&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt; In the above function the last argument has a default value of 0, and it will be used when we will call this function by providing only one parameter, like;&lt;br /&gt; &lt;code&gt; someFun(5); &lt;/code&gt;&lt;br /&gt; The above function call will give value 5 to argument “a” and 0 for argument “b”.&lt;br /&gt;The same function can be called to provide both of the values, like:&lt;br /&gt;&lt;code&gt; someFun(5,10); &lt;/code&gt;&lt;br /&gt;Fortunately/Unfortunately you can not declare a function/constructor with default values for arguments because experts say this is a bad implementation design. If you have to achieve the same kind of functionality the better way is to declare overloaded methods and call one with default value in other. For example:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;void int someMethod(int a, int b ) {&lt;br /&gt;      // some implementation here...&lt;br /&gt;}&lt;br /&gt;void int someMethod(int a) {&lt;br /&gt;     // call overloaded method with default value of the argument&lt;br /&gt;     someMethod(a, 0);&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-4399001110719608191?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/4399001110719608191/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=4399001110719608191' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/4399001110719608191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/4399001110719608191'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2010/09/default-argument-value-for-methods.html' title='Default Argument Value for Methods'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-8254156547995800275</id><published>2010-08-12T08:07:00.001-07:00</published><updated>2010-08-25T05:26:38.180-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL SERVER: Creating Comma Separate Values List from Table Column</title><content type='html'>There are two ways to generate a comma separated list from a table column. First is to manually concatenate the result and the second that is more sophisticated is to use the built-in function COALESCE of SQL Server.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Example Problem:&lt;/span&gt;&lt;br /&gt;For example you have a table named COUNTRY that has a column named NAME, and you want to generate a comma separated list for countries.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution 1:&lt;/span&gt;&lt;br /&gt;This is the simple but not the smartest way to implement it:&lt;br /&gt;&lt;br /&gt;DECLARE @listStr VARCHAR(MAX)&lt;br /&gt;SET @listStr = ''&lt;br /&gt;SELECT @listStr = @listStr + ISNULL(NAME,'') + ','&lt;br /&gt;FROM COUNTRIES&lt;br /&gt;SELECT SUBSTRING(@listStr , 1, LEN(@listStr)-1)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution 2:&lt;/span&gt;&lt;br /&gt;This is the smartest way:&lt;br /&gt;&lt;br /&gt;DECLARE @listStr VARCHAR(MAX)&lt;br /&gt;SELECT @listStr = COALESCE(@listStr+',' , '') + NAME&lt;br /&gt;FROM COUNTRIES&lt;br /&gt;SELECT @listStr&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-8254156547995800275?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/8254156547995800275/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=8254156547995800275' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/8254156547995800275'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/8254156547995800275'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2010/08/sql-server-creating-comma-separate.html' title='SQL SERVER: Creating Comma Separate Values List from Table Column'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-1847669102763169751</id><published>2010-08-02T01:27:00.000-07:00</published><updated>2010-08-25T06:49:57.046-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript: Checkall/Uncheckall feature in the enclosing Form</title><content type='html'>on the web page dynamically generated, I am having different number fo forms and in each form I have a list of checkboxes genererated dynamically.&lt;br /&gt;The number of textboxes in a form may varry, but in each form the checkbox Id/name will have a certain prefix to identify.&lt;br /&gt;The following piece of Java Script code can be used to checkall/uncheckall the checkboxes in a specific form on some event(button, checkbox or any other javascript event)&lt;br /&gt;&lt;br /&gt;Simply place the following piece of code in the head section of your web page:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;   *Prototypes for JS functions&lt;br /&gt;   */&lt;br /&gt;  String.prototype.startsWith = function(str){return (this.match("^"+str)==str)}&lt;br /&gt;  String.prototype.endsWith = function(str){return (this.match(str+"$")==str)}&lt;br /&gt;  &lt;br /&gt;  /**&lt;br /&gt;   *START SEGMENT: &lt;br /&gt;   *Check/Uncheck all the checkboxes in the selector column of a report.&lt;br /&gt;   */&lt;br /&gt;  function getArray(formName,inputtype, prefix)&lt;br /&gt;  {&lt;br /&gt;&lt;br /&gt;   var checkBoxesArray=new Array();&lt;br /&gt;    var count = 0;&lt;br /&gt;   for(i=0; i &lt; formName.elements.length ; i++)&lt;br /&gt;   {&lt;br /&gt;    var elmNameStr = formName.elements[i].name.toString(); &lt;br /&gt;    var elmName =formName.elements[i];&lt;br /&gt;    &lt;br /&gt;    //alert (elmName+ " :: elementName (startsWith): "+ elmNameStr.startsWith(prefix));&lt;br /&gt;    &lt;br /&gt;    if(formName.elements[i].type==inputtype  &amp;&amp;  elmNameStr.startsWith(prefix))&lt;br /&gt;    {   &lt;br /&gt;     checkBoxesArray[count++] = elmName;        &lt;br /&gt;    }&lt;br /&gt;   } &lt;br /&gt;   //alert(checkBoxesArray.length + " checkboxes found");&lt;br /&gt;   return checkBoxesArray;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  function checkall(elem,flag,pattren)&lt;br /&gt;  {&lt;br /&gt;   var form = findParentForm(elem);&lt;br /&gt;    &lt;br /&gt;   var arrayCheckboxes = getArray(form,"checkbox", pattren);&lt;br /&gt;   &lt;br /&gt;   for ( i = 0 ; i &lt; arrayCheckboxes.length ; i++) {                &lt;br /&gt;     arrayCheckboxes[i].checked = flag;      &lt;br /&gt;   } &lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;     function findParentForm(elem){   &lt;br /&gt;   var parent = elem.parentNode;  &lt;br /&gt;   if(parent  &amp;&amp; parent.tagName != 'FORM'){&lt;br /&gt;    parent = findParentForm(parent);&lt;br /&gt;   }&lt;br /&gt;   return parent;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;   *END SEGMENT:&lt;br /&gt;   */&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;To call the checkall functionality, simply call "checkall" function as:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;onclick="javascript:checkall(this, this.checked,'butt-');" &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;@param1: &lt;/b&gt;Element Id you are calling on the function, usually a checkbox &lt;br /&gt;&lt;b&gt;@param2: &lt;/b&gt;Current state of check box, whether the checkbox state is checked or unchecked. If this checkbox is checked then all the associated checkboxes should also be checkd and vice versa&lt;br /&gt;&lt;b&gt;@param3: &lt;/b&gt;String prefix for the checkbox Id/name pattern to identify the appropriate list.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt; &lt;code&gt;&lt;br /&gt; &lt;br /&gt; &amp;lt;form name ="formName0"&amp;gt;&lt;br /&gt; &lt;br /&gt;   check/uncheck all:   &amp;lt;input type ="checkbox" name ="test"  onclick="javascript:checkall(this, this.checked,'butt-');"/&amp;gt; &amp;lt;br/&amp;gt; &lt;br /&gt;   &amp;lt;hr/&amp;gt;&lt;br /&gt;  Must Change State: &amp;lt;br/&amp;gt;&lt;br /&gt;   &amp;lt;input type ="checkbox" name ="butt-1234"/&amp;gt;&lt;br /&gt;   &amp;lt;input type ="checkbox" name ="butt-2141"/&amp;gt;&lt;br /&gt;   &amp;lt;input type ="checkbox" name ="butt-3_abh"/&amp;gt;&lt;br /&gt;   &amp;lt;input type ="checkbox" name ="butt-asgas"/&amp;gt;&lt;br /&gt;   &amp;lt;input type ="checkbox" name ="butt-0"/&amp;gt;&lt;br /&gt;   &amp;lt;hr/&amp;gt;&lt;br /&gt;   Must have ignored:&amp;lt;br/&amp;gt;&lt;br /&gt;   &amp;lt;input type ="checkbox" name ="abc"/&amp;gt;&lt;br /&gt;   &amp;lt;input type ="checkbox" name ="def"/&amp;gt;&lt;br /&gt;   &lt;br /&gt; &amp;lt;/form&amp;gt;&lt;br /&gt; &amp;lt;hr/&amp;gt;&lt;br /&gt; &amp;lt;h3&amp;gt;  Form 2 &amp;lt;/h3&amp;gt; &lt;br /&gt; &amp;lt;form  name ="FormName1"&amp;gt;&lt;br /&gt; &amp;lt;span&amp;gt;&lt;br /&gt;  &amp;lt;div id ="asda" name ="divName"&amp;gt;&lt;br /&gt;   check/uncheck all:   &amp;lt;input type ="checkbox" name ="test"  onclick="javascript:checkall(this, this.checked,'selected-');"/&amp;gt; &amp;lt;br/&amp;gt; &lt;br /&gt;   &amp;lt;hr/&amp;gt;&lt;br /&gt;    Must Change State: &amp;lt;br/&amp;gt;&lt;br /&gt;   &amp;lt;input type ="checkbox" name ="selected-1af"/&amp;gt;&lt;br /&gt;   &amp;lt;input type ="checkbox" name ="selected-wf2"/&amp;gt;&lt;br /&gt;   &amp;lt;input type ="checkbox" name ="selected-3_abh"/&amp;gt;&lt;br /&gt;   &amp;lt;input type ="checkbox" name ="selected-asgas"/&amp;gt;&lt;br /&gt;   &amp;lt;input type ="checkbox" name ="selected-0"/&amp;gt;&lt;br /&gt;   &amp;lt;hr/&amp;gt;&lt;br /&gt;   Must have ignored:&amp;lt;br/&amp;gt;&lt;br /&gt;   &amp;lt;input type ="checkbox" name ="selected_sabah"/&amp;gt;&lt;br /&gt;   &amp;lt;input type ="checkbox" name ="abnsd"/&amp;gt;&lt;br /&gt; &lt;br /&gt;  &amp;lt;/div&amp;gt;&lt;br /&gt;  &amp;lt;/span&amp;gt;&lt;br /&gt; &amp;lt;/form&amp;gt;&lt;br /&gt; &lt;/code&amp;gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-1847669102763169751?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/1847669102763169751/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=1847669102763169751' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/1847669102763169751'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/1847669102763169751'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2010/08/javascript-checkalluncheckall-feature.html' title='Javascript: Checkall/Uncheckall feature in the enclosing Form'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-3991447751553921544</id><published>2010-07-30T09:08:00.000-07:00</published><updated>2010-08-25T05:26:48.391-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL Server: To check all the advanced configuration of the SQL Server</title><content type='html'>Run the following database script to check all the advanced configuration options&lt;br /&gt;&lt;br /&gt;EXEC sp_configure 'Show Advanced Options', 1;&lt;br /&gt;GO&lt;br /&gt;RECONFIGURE;&lt;br /&gt;GO&lt;br /&gt;EXEC sp_configure;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-3991447751553921544?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/3991447751553921544/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=3991447751553921544' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/3991447751553921544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/3991447751553921544'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2010/07/sql-server-to-check-all-advanced.html' title='SQL Server: To check all the advanced configuration of the SQL Server'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-7960234897732814859</id><published>2010-07-29T03:17:00.000-07:00</published><updated>2010-08-25T06:50:07.729-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript: How to Find the enclosing/parent FORM Element</title><content type='html'>I was working on a project and came across a situation where we have more than one forms being generated dynamically in one page. And each form contains lots of input fields. To identify the enclosing/parent form element on some action of input tags, I used the following code:&lt;br /&gt;&lt;br /&gt;Put these two javascript functions in script tag under head section of your page:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt; function findParentForm(elem){   &lt;br /&gt;   var parent = elem.parentNode;  &lt;br /&gt;   if(parent  &amp;&amp; parent.tagName != 'FORM'){&lt;br /&gt;    parent = findParentForm(parent);&lt;br /&gt;   }&lt;br /&gt;   return parent;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;  function getParentForm( elem )&lt;br /&gt;  {&lt;br /&gt;     var parentForm = findParentForm(elem);&lt;br /&gt;     if(parentForm){&lt;br /&gt;    alert("Form found: ID = " + parentForm.id + " &amp; Name = " +parentForm.name);&lt;br /&gt;     }else{&lt;br /&gt;    alert("unable to locate parent Form");&lt;br /&gt;     }&lt;br /&gt;      &lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Here is the example to call  this code:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;  &amp;lt;h3&amp;gt;  Form 1 &amp;lt;/h3&amp;gt;&lt;br /&gt; &amp;lt;form name ="formName1"  id ="formId1"&amp;gt;&lt;br /&gt;   &amp;lt;span&amp;gt;&lt;br /&gt;    &amp;lt;div&amp;gt;&lt;br /&gt;   &amp;lt;input type ="button" name ="button1" value="button1" onclick="javascript:getParentForm(this);"/&amp;gt; &amp;lt;br/&amp;gt; &lt;br /&gt;    &amp;lt;/div&amp;gt;&lt;br /&gt;   &amp;lt;/span&amp;gt;&lt;br /&gt;   &lt;br /&gt; &amp;lt;/form&amp;gt;&lt;br /&gt; &amp;lt;hr/&amp;gt;&lt;br /&gt; &amp;lt;h3&amp;gt;  Form 2 &amp;lt;/h3&amp;gt; &lt;br /&gt; &amp;lt;form  name ="FormName2" id ="formId2"&amp;gt;&lt;br /&gt; &amp;lt;span&amp;gt;&lt;br /&gt;  &amp;lt;div id ="asda" name ="divName"&amp;gt;&lt;br /&gt; &amp;lt;input type ="button" name ="button1" value="button2" onclick="javascript:getParentForm(this);"/&amp;gt; &amp;lt;br/&amp;gt; &lt;br /&gt;  &amp;lt;/div&amp;gt;&lt;br /&gt;  &amp;lt;/span&amp;gt;&lt;br /&gt; &amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-7960234897732814859?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/7960234897732814859/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=7960234897732814859' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/7960234897732814859'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/7960234897732814859'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2010/07/javascript-how-to-find-enclosingparent.html' title='Javascript: How to Find the enclosing/parent FORM Element'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-1055581153042499550</id><published>2010-07-23T05:41:00.001-07:00</published><updated>2010-07-23T05:41:50.639-07:00</updated><title type='text'>Oracle: Generate SQL script to drop all tables of any database</title><content type='html'>In oracle there is no option to drop all the user tables, but you can achieve this by generating a scrip and run that script. &lt;br /&gt;To generate a script for dropping all the user tables, simply run this query and then run the result/output of this query.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;SELECT 'DROP TABLE '||table_name|| '  CASCADE CONSTRAINTS;'&lt;br /&gt;FROM user_tables;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-1055581153042499550?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/1055581153042499550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=1055581153042499550' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/1055581153042499550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/1055581153042499550'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2010/07/oracle-generate-sql-script-to-drop-all.html' title='Oracle: Generate SQL script to drop all tables of any database'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-6384931706000943879</id><published>2010-07-21T03:08:00.000-07:00</published><updated>2010-08-25T07:21:29.411-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>Eclipse getting Out of Memory</title><content type='html'>I installed latest version of JDK 1.6.21 and latest eclipse Halilos version to Windows 7 (32bit). Eclipse started crashing again and again after few minutes, giving me the out of Memory issue in logs.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_4f1LhtA4Gj0/TEbIN-c_9RI/AAAAAAAAAMs/AAk0xz4yjPo/s1600/eclipse_error_2.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 132px;" src="http://3.bp.blogspot.com/_4f1LhtA4Gj0/TEbIN-c_9RI/AAAAAAAAAMs/AAk0xz4yjPo/s320/eclipse_error_2.jpg" alt="" id="BLOGGER_PHOTO_ID_5496300537680753938" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_4f1LhtA4Gj0/TEbIKXzHgdI/AAAAAAAAAMk/zV4q86LhknM/s1600/eclipse_error_1.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 137px;" src="http://1.bp.blogspot.com/_4f1LhtA4Gj0/TEbIKXzHgdI/AAAAAAAAAMk/zV4q86LhknM/s320/eclipse_error_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5496300475764933074" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here is the exception log:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande;font-size:100%;" &gt;!ENTRY org.eclipse.ui 4 0 2010-07-21 09:08:30.662&lt;br /&gt;!MESSAGE Unhandled event loop exception&lt;br /&gt;!STACK 0&lt;br /&gt;java.lang.OutOfMemoryError: PermGen space&lt;br /&gt;  at java.lang.ClassLoader.defineClass1(Native Method)&lt;br /&gt;  at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)&lt;br /&gt;  at java.lang.ClassLoader.defineClass(ClassLoader.java:616)&lt;br /&gt;  at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:165)&lt;br /&gt;  at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:554)&lt;br /&gt;  at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:524)&lt;br /&gt;  at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:455)&lt;br /&gt;  at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass_LockClassLoader(ClasspathManager.java:443)&lt;br /&gt;  at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:423)&lt;br /&gt;  at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:193)&lt;br /&gt;  at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:370)&lt;br /&gt;  at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:446)&lt;br /&gt;  at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:399)&lt;br /&gt;  at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:387)&lt;br /&gt;  at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:87)&lt;br /&gt;  at java.lang.ClassLoader.loadClass(ClassLoader.java:248)&lt;br /&gt;  at org.eclipse.wst.sse.ui.StructuredTextEditor.createActions(StructuredTextEditor.java:1277)&lt;br /&gt;  at org.eclipse.ui.texteditor.AbstractTextEditor.createPartControl(AbstractTextEditor.java:3362)&lt;br /&gt;  at org.eclipse.ui.texteditor.StatusTextEditor.createPartControl(StatusTextEditor.java:53)&lt;br /&gt;  at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.createPartControl(AbstractDecoratedTextEditor.java:394)&lt;br /&gt;  at org.eclipse.wst.sse.ui.StructuredTextEditor.createPartControl(StructuredTextEditor.java:1362)&lt;br /&gt;  at org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:217)&lt;br /&gt;  at org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:187)&lt;br /&gt;  at org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart.addSourcePage(XMLMultiPageEditorPart.java:435)&lt;br /&gt;  at org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart.createPages(XMLMultiPageEditorPart.java:605)&lt;br /&gt;  at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:310)&lt;br /&gt;  at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:661)&lt;br /&gt;  at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:428)&lt;br /&gt;  at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:594)&lt;br /&gt;  at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:306)&lt;br /&gt;  at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180)&lt;br /&gt;  at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:270)&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;After struggling with this, I found this issue is due to the latest JDK v1.6.21. Best is to use  the stable version of JDK that is: JDK v 1.6.20 and configure it accordingly.&lt;br /&gt;Hopefully it will resolve the issue, if still getting the issue add following line after "-vmargs" to your eclipse.ini file:&lt;br /&gt;-XX:MaxPermSize=256m&lt;br /&gt;The eclipse.ini file can be found under eclipse directory. It will be someting like this:&lt;br /&gt;&lt;br /&gt;eclipse.ini &lt;br /&gt;--------------- &lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;-showsplash&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;org.eclipse.platform&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;--launcher.XXMaxPermSize&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;512M&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;-framework&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;plugins\org.eclipse.osgi_3.4.3.R34x_v20081215-1030.jar&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;-vm&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;C:\Program Files\Java\jdk1.5.0_22\bin&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;-vmargs&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;-XX:MaxPermSize=512m&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;-Dosgi.requiredJavaVersion=1.5&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;-Xms128m&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;-Xmx1024m&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;---------------&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-6384931706000943879?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/6384931706000943879/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=6384931706000943879' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/6384931706000943879'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/6384931706000943879'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2010/07/eclipse-getting-out-of-memory.html' title='Eclipse getting Out of Memory'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_4f1LhtA4Gj0/TEbIN-c_9RI/AAAAAAAAAMs/AAk0xz4yjPo/s72-c/eclipse_error_2.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-4460112130129768456</id><published>2010-07-14T08:28:00.001-07:00</published><updated>2010-08-25T05:27:11.183-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web Services'/><title type='text'>Java Web Service: Developing SOAP Based Web Service via Apache Axis2</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Introduction:&lt;/span&gt;&lt;br /&gt;Web service is a distribution software/application component that communicates using open protocols is self contained, self describing and can be discovered by UDDI (Universal Description, Discovery and Integration). Web Services can be used by other applications, or you can say other applications consume the web services. XML is the basis of the web services. XML is a language used to communicate between the different languages. Web Services are language independent and platform independent because all the vendors are agreed to use the common protocols and common way of communication using XML.&lt;br /&gt;There are two main models for web services development in Java, REST based web services and SOAP/WSDL based web services.&lt;div&gt;&lt;br /&gt;&lt;b&gt;REST based Web Services:-&lt;/b&gt; REST (REpresentational State Transfer) are resources in which every process is modeled as a unique URI. The protocol used in REST based web services is HTTP. These are not as secure, as flexible, as SOAP based web services. And only supports HTTP protocol.&lt;br /&gt;&lt;b&gt;SOAP/WSDL based Web Services:-&lt;/b&gt;  SOAP/WSDL-based web services uses Java utilities create a WSDL file based on the Java code in the web service. The WSDL is exposed on the net. Parties interested in using the web service create a Java client based on the WSDL. Messages are exchanged in SOAP format. The range of operations that can be passed in SOAP is much broader than what is available in REST, especially in security. SOAP-based web services are suitable for heavyweight applications using complicated operations and for applications requiring sophisticated security, reliability or other standards-supported features. They are also suitable when a transport protocol other than HTTP has to be used.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Apache Axis2 is an open-source implementation of the SOAP (Simple Object-Access Protocol) submission to the W3C. Axis2 not only supports SOAP 1.1 and SOAP 1.2, but it also has integrated support for RESTful web services.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;We are going to develop a simple web service using Apache Axis2 using eclipse and Tomcat 6 as server.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Setting up the Environment:&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Get Eclipse latest version from &lt;a href="http://www.eclipse.org/downloads/"&gt;http://www.eclipse.org/downloads/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Download and install Tomcat 6.0 from the following location: &lt;a href="http://tomcat.apache.org/download-60.cgi"&gt;http://tomcat.apache.org/download-60.cgi&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Install Tomcat Plug-in for eclipse. Check the following post to get and configure the plugin: &lt;a href="http://sabahmyrsh.blogspot.com/2010/07/sysdeo-eclipse-tomcat-launcher-plugin.html"&gt;http://sabahmyrsh.blogspot.com/2010/07/sysdeo-eclipse-tomcat-launcher-plugin.html&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Get the latest Apache Axis2 from the following location: &lt;a href="http://ws.apache.org/axis2/download.cgi"&gt;http://ws.apache.org/axis2/download.cgi&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-size:large;"&gt;Creating a Bottom up Java Bean Web Service:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Step 1:&lt;/b&gt;&lt;br /&gt;First step is to configure the Axis2 with tomcat. To accomplish this unzip/extract the downloaded Axis version at any location of your hard drive. I am using this path for this example: C:\axis2\axis2-1.5&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Then Open Eclipse and open:&lt;br /&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;b&gt;Window -&gt; Preferences -&gt; Web Services -&gt; Axis2 Preferences&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_4f1LhtA4Gj0/TD3ZWx1UK0I/AAAAAAAAAJk/57_AA2wGyB0/s1600/1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 277px;" src="http://3.bp.blogspot.com/_4f1LhtA4Gj0/TD3ZWx1UK0I/AAAAAAAAAJk/57_AA2wGyB0/s320/1.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5493786105819179842" /&gt;&lt;/a&gt;&lt;div&gt;Select the Axis2 Runtime tab and point to the correct Axis2 runtime location and click Apply and then Ok.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Step 2:&lt;/b&gt; &lt;/div&gt;&lt;div&gt;Now we need to create a project with the support of Axis2 features. Open &lt;b&gt;File -&gt; New -&gt; Other... -&gt; Web -&gt; Dynamic Web Project &lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_4f1LhtA4Gj0/TD3ZuAcCp8I/AAAAAAAAAJs/pVqlBRfpRPQ/s1600/2.JPG"&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_4f1LhtA4Gj0/TD3ZuAcCp8I/AAAAAAAAAJs/pVqlBRfpRPQ/s1600/2.JPG"&gt;&lt;img style="text-align: left;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; cursor: pointer; width: 320px; height: 320px; " src="http://2.bp.blogspot.com/_4f1LhtA4Gj0/TD3ZuAcCp8I/AAAAAAAAAJs/pVqlBRfpRPQ/s320/2.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5493786504876697538" /&gt;&lt;/a&gt;&lt;div&gt;Click Next and provide project name as CalculatorWebService (you can use any name). Please select the following configurations:&lt;/div&gt;&lt;div&gt;•&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;“Apache Tomcat v6.0” as Select Target runtime.&lt;/div&gt;&lt;div&gt;•&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;“2.5” as Dynamic web module version &lt;/div&gt;&lt;div&gt;•&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;For Configuration, Press the Modify button.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_4f1LhtA4Gj0/TD3aK7GWSPI/AAAAAAAAAJ0/HALmc-UgaQg/s1600/3.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 239px; height: 320px;" src="http://1.bp.blogspot.com/_4f1LhtA4Gj0/TD3aK7GWSPI/AAAAAAAAAJ0/HALmc-UgaQg/s320/3.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5493787001659738354" /&gt;&lt;/a&gt;Now tick the check boxes named as “Axis2 Web Services” and select OK.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_4f1LhtA4Gj0/TD3cH0ibAvI/AAAAAAAAAJ8/HO8pgtbVeSk/s1600/4.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 287px;" src="http://2.bp.blogspot.com/_4f1LhtA4Gj0/TD3cH0ibAvI/AAAAAAAAAJ8/HO8pgtbVeSk/s320/4.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5493789147382088434" /&gt;&lt;/a&gt;After this you will be back on the New Dynamic Web Project. Click Finish. A new project will be created.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_4f1LhtA4Gj0/TD3cYWbMjbI/AAAAAAAAAKE/Zz3A6JFc-sU/s1600/5.JPG"&gt;&lt;img style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; cursor: pointer; width: 320px; height: 195px; text-align: center; " src="http://1.bp.blogspot.com/_4f1LhtA4Gj0/TD3cYWbMjbI/AAAAAAAAAKE/Zz3A6JFc-sU/s320/5.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5493789431356493234" /&gt;&lt;/a&gt;&lt;div&gt;&lt;b&gt;Step 3:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Now add a new package (myservices) and a plain Java class (Calculator). This Calculator class will contain methods that we will expose as web service. The methods we want to expose as web service must have public access.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_4f1LhtA4Gj0/TD3cpyhgQVI/AAAAAAAAAKM/z08yPooCfBU/s1600/6.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 290px; height: 313px;" src="http://3.bp.blogspot.com/_4f1LhtA4Gj0/TD3cpyhgQVI/AAAAAAAAAKM/z08yPooCfBU/s320/6.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5493789730956919122" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_4f1LhtA4Gj0/TD3c2MOSxGI/AAAAAAAAAKU/f-vutJ1zbKE/s1600/7.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 195px;" src="http://2.bp.blogspot.com/_4f1LhtA4Gj0/TD3c2MOSxGI/AAAAAAAAAKU/f-vutJ1zbKE/s320/7.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5493789944014095458" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;b&gt;Step 4:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Now Select Calculator.java, open&lt;b&gt; File -&gt; New -&gt; Other... -&gt; Web Services -&gt; Web Service &lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_4f1LhtA4Gj0/TD3dGQI1DtI/AAAAAAAAAKc/CF6nYDO0Wb8/s1600/8.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 320px;" src="http://2.bp.blogspot.com/_4f1LhtA4Gj0/TD3dGQI1DtI/AAAAAAAAAKc/CF6nYDO0Wb8/s320/8.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5493790219942825682" /&gt;&lt;/a&gt;&lt;br /&gt;Click Next and you will be on the following screen. And make sure you Server rumtine is Tomcat v6.0 Server and Web Service Runtime should be Apache Axis2, if not you can configure these by clicking on the hyperlinks. For example to configure Web Service Runtime, click on the hyperlink highlighted as following.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_4f1LhtA4Gj0/TD3dVJmF9rI/AAAAAAAAAKk/w4dOEXlS-YA/s1600/9.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 237px; height: 320px;" src="http://1.bp.blogspot.com/_4f1LhtA4Gj0/TD3dVJmF9rI/AAAAAAAAAKk/w4dOEXlS-YA/s320/9.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5493790475884558002" /&gt;&lt;/a&gt;And it will open a new screen to configure Apache Axis 2 runtime for you. Select Apache Axis2 from the list and click ok.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_4f1LhtA4Gj0/TD3dlhmsmyI/AAAAAAAAAKs/ssl4hF3120k/s1600/10.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 273px;" src="http://2.bp.blogspot.com/_4f1LhtA4Gj0/TD3dlhmsmyI/AAAAAAAAAKs/ssl4hF3120k/s320/10.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5493790757207448354" /&gt;&lt;/a&gt;You will be back on Web Service Screen, click Next.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_4f1LhtA4Gj0/TD3dzbR9P7I/AAAAAAAAAK0/v7OzDku_NhU/s1600/11.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 237px; height: 320px;" src="http://2.bp.blogspot.com/_4f1LhtA4Gj0/TD3dzbR9P7I/AAAAAAAAAK0/v7OzDku_NhU/s320/11.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5493790996028014514" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Again click Next.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_4f1LhtA4Gj0/TD3eAxmZhGI/AAAAAAAAAK8/E9rgMhThO-o/s1600/12.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 237px; height: 320px;" src="http://4.bp.blogspot.com/_4f1LhtA4Gj0/TD3eAxmZhGI/AAAAAAAAAK8/E9rgMhThO-o/s320/12.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5493791225357632610" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;Now Click Start Server button.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_4f1LhtA4Gj0/TD3epvQN5EI/AAAAAAAAALE/Wpk6teAkoyg/s1600/13.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 237px; height: 320px;" src="http://3.bp.blogspot.com/_4f1LhtA4Gj0/TD3epvQN5EI/AAAAAAAAALE/Wpk6teAkoyg/s320/13.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5493791929102361666" /&gt;&lt;/a&gt;&lt;div&gt;Now Click Finish. Your web service is created for your Calculator class and it is published to your Tomcat Server.&lt;/div&gt;&lt;div&gt;&lt;b&gt;Step 5:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Right Click on the web service project and run as server.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_4f1LhtA4Gj0/TD3e6NjIxrI/AAAAAAAAALM/1sdz_edLxdw/s1600/14.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 259px;" src="http://4.bp.blogspot.com/_4f1LhtA4Gj0/TD3e6NjIxrI/AAAAAAAAALM/1sdz_edLxdw/s320/14.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5493792212112688818" /&gt;&lt;/a&gt;Choose the server and click Finish.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_4f1LhtA4Gj0/TD3fJTLdcuI/AAAAAAAAALU/hblck1kP_lk/s1600/15.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 254px; height: 320px;" src="http://2.bp.blogspot.com/_4f1LhtA4Gj0/TD3fJTLdcuI/AAAAAAAAALU/hblck1kP_lk/s320/15.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5493792471322030818" /&gt;&lt;/a&gt;You will see the following page in your integrated browser of eclipse.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_4f1LhtA4Gj0/TD3fcFZ1znI/AAAAAAAAALc/Zvgz-w07XUw/s1600/16.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 195px;" src="http://1.bp.blogspot.com/_4f1LhtA4Gj0/TD3fcFZ1znI/AAAAAAAAALc/Zvgz-w07XUw/s320/16.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5493792794041765490" /&gt;&lt;/a&gt;Click on the services link encircled above and you can see your calculator service as following.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_4f1LhtA4Gj0/TD3fxt0hsZI/AAAAAAAAALk/2B69ctjmiZI/s1600/17.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 195px;" src="http://3.bp.blogspot.com/_4f1LhtA4Gj0/TD3fxt0hsZI/AAAAAAAAALk/2B69ctjmiZI/s320/17.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5493793165668364690" /&gt;&lt;/a&gt;&lt;div&gt;If you click on the Calculator link encircled above, you can see the WSDL generated by your web service. This WSDL you will use to create a wb service client. Please copy the link of WSDL:&lt;/div&gt;&lt;div&gt;&lt;a href="http://localhost:8080/CalculatorWebService/services/Calculator?wsdl"&gt;http://localhost:8080/CalculatorWebService/services/Calculator?wsdl&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_4f1LhtA4Gj0/TD3gBnfp-kI/AAAAAAAAALs/2ca7ae1i_po/s1600/18.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 195px;" src="http://3.bp.blogspot.com/_4f1LhtA4Gj0/TD3gBnfp-kI/AAAAAAAAALs/2ca7ae1i_po/s320/18.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5493793438848121410" /&gt;&lt;/a&gt;&lt;br /&gt;The next step is to create a Web Service Client to test this web service.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:large;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:large;"&gt;Create a Web Service Client:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;To create a web service client and test the web service, we will create a new project and will test this web service. Open &lt;b&gt;&lt;i&gt;File -&gt; New -&gt; Other... -&gt; Web Services -&gt; Web ServiceClient &lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_4f1LhtA4Gj0/TD3gg5V4p-I/AAAAAAAAAL0/F6qCdAQPlKE/s1600/19.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 320px;" src="http://3.bp.blogspot.com/_4f1LhtA4Gj0/TD3gg5V4p-I/AAAAAAAAAL0/F6qCdAQPlKE/s320/19.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5493793976214923234" /&gt;&lt;/a&gt;Click Next.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_4f1LhtA4Gj0/TD3guNMWb1I/AAAAAAAAAL8/XtNOh0XGa6U/s1600/20.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 314px;" src="http://2.bp.blogspot.com/_4f1LhtA4Gj0/TD3guNMWb1I/AAAAAAAAAL8/XtNOh0XGa6U/s320/20.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5493794204881940306" /&gt;&lt;/a&gt;Paste the WSDL path in the service definition box and make sure you have the correct configurations as displayed in above snapshot. And click Next.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_4f1LhtA4Gj0/TD3g-V9c13I/AAAAAAAAAME/gZKRWjB8jd4/s1600/21.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 302px; height: 320px;" src="http://1.bp.blogspot.com/_4f1LhtA4Gj0/TD3g-V9c13I/AAAAAAAAAME/gZKRWjB8jd4/s320/21.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5493794482113271666" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;Now leave the default configurations on this screen and click Finish. I will generate a new project that will contain the Stub class that we can use to call the methods of web service.&lt;/div&gt;&lt;div&gt;Add a new class in the client project to test the web service methods like shown in the following snapshot. &lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_4f1LhtA4Gj0/TD3h9XJtaaI/AAAAAAAAAMM/Mbujroju9rI/s1600/22.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 186px;" src="http://2.bp.blogspot.com/_4f1LhtA4Gj0/TD3h9XJtaaI/AAAAAAAAAMM/Mbujroju9rI/s320/22.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5493795564764883362" /&gt;&lt;/a&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;package myservices;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;import java.rmi.RemoteException;&lt;/div&gt;&lt;div&gt;import org.apache.axis2.AxisFault;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;public class CalculatorTestClient {&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;/**&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * @param args&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * @throws RemoteException &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; */&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;public static void main(String[] args) throws RemoteException {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;//Step 1: create an object of Stub class that is generated.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;CalculatorStub stub = new CalculatorStub();&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;//Step 2: Web Service Client has created inner classes in CalculatorStub for each of the web service method.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;//        We need to create the object of these classes to utilize the web service method.  &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;CalculatorStub.Add add = new CalculatorStub.Add();&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;// Step 3: set the values for parameters for the web service method to call&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;add.setA(45.67);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;add.setB(12.34);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;// Step 4: Now call the web service method using the stub object and assign it to specific response variable.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;CalculatorStub.AddResponse resp  = stub.add(add);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;// Step 5: Finally call the get_return method to retrieve the final result from response object.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;System.out.println(" Result for 45.78 + 12.34 = "+resp.get_return());&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}// end main&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;} // end class&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;Now finally, run this client as plain java program.  Right Click inside the Java class--&gt;Run as--&gt;Java Application. You can see the results on the console.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_4f1LhtA4Gj0/TD3ksGCsS6I/AAAAAAAAAMU/ZugQI_d3GwY/s1600/23.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 288px; height: 320px;" src="http://4.bp.blogspot.com/_4f1LhtA4Gj0/TD3ksGCsS6I/AAAAAAAAAMU/ZugQI_d3GwY/s320/23.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5493798566649154466" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_4f1LhtA4Gj0/TD3k56fYTLI/AAAAAAAAAMc/WlbSPvesxUg/s1600/24.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 186px;" src="http://3.bp.blogspot.com/_4f1LhtA4Gj0/TD3k56fYTLI/AAAAAAAAAMc/WlbSPvesxUg/s320/24.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5493798804066421938" /&gt;&lt;/a&gt;&lt;div&gt;&lt;b&gt;NOTE:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;You can also use Netbeans to create SOAP based Apache Axis2 Web Services. For this please visit the following tutorial.&lt;/div&gt;&lt;div&gt;&lt;a href="http://netbeans.org/kb/docs/websvc/gs-axis.html"&gt;http://netbeans.org/kb/docs/websvc/gs-axis.html&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-4460112130129768456?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/4460112130129768456/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=4460112130129768456' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/4460112130129768456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/4460112130129768456'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2010/07/java-web-service-developing-soap-based.html' title='Java Web Service: Developing SOAP Based Web Service via Apache Axis2'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_4f1LhtA4Gj0/TD3ZWx1UK0I/AAAAAAAAAJk/57_AA2wGyB0/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-4422531235494140987</id><published>2010-07-08T02:13:00.000-07:00</published><updated>2010-08-25T07:19:26.021-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>Installation of Subclipse and Connecting to Repository</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Installation of Subclipse:&lt;/span&gt;&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;This blog will describe the installation of Subclipse directly through Eclipse.  Please note, for safety purposes, a separate instance of eclipse should be installed prior to installation of the repository.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Information on Subclipse can be found here:&lt;br /&gt;&lt;a href="http://subclipse.tigris.org/"&gt;http://subclipse.tigris.org/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And new versions of Eclipse can be founder here:&lt;br /&gt;&lt;a href="http://www.eclipse.org/"&gt;http://www.eclipse.org&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;At the writing of this document, I am using Galileo release of Eclipse (Version 3.5.2).&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Step 1&lt;/b&gt;&lt;br /&gt;Goto Help menu, and select Install New Software...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_4f1LhtA4Gj0/TDWwE7Os8RI/AAAAAAAAAH8/wCBO5sTZnYo/s1600/1.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 296px;" src="http://3.bp.blogspot.com/_4f1LhtA4Gj0/TDWwE7Os8RI/AAAAAAAAAH8/wCBO5sTZnYo/s320/1.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5491488919313510674" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;Step 2&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Add the site where Subclipse can be downloaded from.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_4f1LhtA4Gj0/TDWwhmAekWI/AAAAAAAAAIE/5XHXc4kFc1w/s1600/2.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 137px;" src="http://4.bp.blogspot.com/_4f1LhtA4Gj0/TDWwhmAekWI/AAAAAAAAAIE/5XHXc4kFc1w/s320/2.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5491489411832910178" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;Step 3&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Select the checkbox that is next to the Subclipse name.  This will install all items required for Subclipse, and an additional merge utility. &lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_4f1LhtA4Gj0/TDWwwcnT-FI/AAAAAAAAAIM/JlTzBl-5rAs/s1600/3.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 272px;" src="http://4.bp.blogspot.com/_4f1LhtA4Gj0/TDWwwcnT-FI/AAAAAAAAAIM/JlTzBl-5rAs/s320/3.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5491489667009476690" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;Step 4&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Review the install details, and click next.  Then accept the license agreement presented after reviewing the install details.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_4f1LhtA4Gj0/TDWw-J4QovI/AAAAAAAAAIU/ZkaXWKN2eVw/s1600/4.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 269px;" src="http://4.bp.blogspot.com/_4f1LhtA4Gj0/TDWw-J4QovI/AAAAAAAAAIU/ZkaXWKN2eVw/s320/4.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5491489902498456306" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_4f1LhtA4Gj0/TDWxOoj0C6I/AAAAAAAAAIk/Qxt8Eg83a00/s1600/5.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 269px;" src="http://2.bp.blogspot.com/_4f1LhtA4Gj0/TDWxOoj0C6I/AAAAAAAAAIk/Qxt8Eg83a00/s320/5.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5491490185612102562" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;Step 5&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Once completed, and you hit next, the download of the plugin will occur.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_4f1LhtA4Gj0/TDWxJtatkKI/AAAAAAAAAIc/R8Ea8fMIKI8/s1600/6.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 262px;" src="http://3.bp.blogspot.com/_4f1LhtA4Gj0/TDWxJtatkKI/AAAAAAAAAIc/R8Ea8fMIKI8/s320/6.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5491490101016760482" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Conclusion: &lt;/b&gt;Restart Eclipse...&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_4f1LhtA4Gj0/TDWxtV4LyBI/AAAAAAAAAIs/pZNHbWfr0bc/s1600/7.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 113px;" src="http://4.bp.blogspot.com/_4f1LhtA4Gj0/TDWxtV4LyBI/AAAAAAAAAIs/pZNHbWfr0bc/s320/7.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5491490713173215250" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;Connecting to Repository:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Next step is to download the repository of your projects source. Unlike CVS, SVN represents branches and tags as files in the folder structure.  We want to be careful not to check out the entire repository.  If the entire repository is checked out, a representation of every tag and branch ever made for the application will be downloaded as a local copy to the hard drive.  This could consume a lot of disk space very carefully.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Create a new project in Eclipse from the SVN repository.  Select "Checkout Projects from SVN." Then click next.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_4f1LhtA4Gj0/TDWyBvabiII/AAAAAAAAAI0/Zwbvh-R6JQo/s1600/8.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 305px;" src="http://1.bp.blogspot.com/_4f1LhtA4Gj0/TDWyBvabiII/AAAAAAAAAI0/Zwbvh-R6JQo/s320/8.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5491491063625123970" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you do not have any repository yet, select "Create a new repository location" then click next. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_4f1LhtA4Gj0/TDWySnzukDI/AAAAAAAAAI8/lyTXJkSR1bU/s1600/9.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 294px; height: 320px;" src="http://4.bp.blogspot.com/_4f1LhtA4Gj0/TDWySnzukDI/AAAAAAAAAI8/lyTXJkSR1bU/s320/9.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5491491353641521202" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And provide the SVN repository path and click Next and then Finish.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_4f1LhtA4Gj0/TDWye1bwBbI/AAAAAAAAAJE/6Wo08wVyPo4/s1600/10.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 293px; height: 320px;" src="http://3.bp.blogspot.com/_4f1LhtA4Gj0/TDWye1bwBbI/AAAAAAAAAJE/6Wo08wVyPo4/s320/10.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5491491563457480114" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Select the appropriate project listed (Not Shown here) and click Next.&lt;/div&gt;&lt;div&gt;Create a new project to add to your workspace.  Ensure "Check out HEAD revision_"_ and check out as a new project in your workspace, or use the New Project Wizard (not shown) to create a new project.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_4f1LhtA4Gj0/TDWyuACz_5I/AAAAAAAAAJM/TMMVycewiyc/s1600/11.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 294px; height: 320px;" src="http://3.bp.blogspot.com/_4f1LhtA4Gj0/TDWyuACz_5I/AAAAAAAAAJM/TMMVycewiyc/s320/11.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5491491824003710866" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Use the default workspace, or one you already have defined.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_4f1LhtA4Gj0/TDWzCh3T6VI/AAAAAAAAAJU/FQ77dORxUG8/s1600/12.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 294px; height: 320px;" src="http://1.bp.blogspot.com/_4f1LhtA4Gj0/TDWzCh3T6VI/AAAAAAAAAJU/FQ77dORxUG8/s320/12.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5491492176679659858" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The SVN Repository checkout will start right away.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-4422531235494140987?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/4422531235494140987/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=4422531235494140987' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/4422531235494140987'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/4422531235494140987'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2010/07/installation-of-subclipse-and.html' title='Installation of Subclipse and Connecting to Repository'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_4f1LhtA4Gj0/TDWwE7Os8RI/AAAAAAAAAH8/wCBO5sTZnYo/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-6293384045640593924</id><published>2010-07-08T01:38:00.000-07:00</published><updated>2010-07-08T01:41:47.103-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='Tomcat 7'/><title type='text'>Sysdeo Eclipse Tomcat Launcher plugin</title><content type='html'>&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif; font-weight: normal; font-size: 12px; color: rgb(17, 17, 17); -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "&gt;&lt;h3 style="font-weight: bold; font-size: 12pt; color: rgb(17, 17, 17); font-style: normal; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; text-align: left; "&gt;Plugin features&lt;/h3&gt;&lt;ul&gt;&lt;li style="font-size: 10pt; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; text-align: left; line-height: 11pt; margin-top: 0.3em; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; color: rgb(17, 17, 17); "&gt;&lt;p style="font-size: 9pt; font-family: Arial, Helvetica, sans-serif; text-align: left; "&gt;Starting and stopping Tomcat 4.x, 5.x and 6.x&lt;/p&gt;&lt;/li&gt;&lt;li style="font-size: 10pt; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; text-align: left; line-height: 11pt; margin-top: 0.3em; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; color: rgb(17, 17, 17); "&gt;&lt;p style="font-size: 9pt; font-family: Arial, Helvetica, sans-serif; text-align: left; "&gt;Registering Tomcat process to Eclipse debugger&lt;/p&gt;&lt;/li&gt;&lt;li style="font-size: 10pt; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; text-align: left; line-height: 11pt; margin-top: 0.3em; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; color: rgb(17, 17, 17); "&gt;&lt;p style="font-size: 9pt; font-family: Arial, Helvetica, sans-serif; text-align: left; "&gt;Creating a WAR project (wizard can update server.xml file)&lt;/p&gt;&lt;/li&gt;&lt;li style="font-size: 10pt; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; text-align: left; line-height: 11pt; margin-top: 0.3em; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; color: rgb(17, 17, 17); "&gt;&lt;p style="font-size: 9pt; font-family: Arial, Helvetica, sans-serif; text-align: left; "&gt;Adding Java Projects to Tomcat classpath&lt;/p&gt;&lt;/li&gt;&lt;li style="font-size: 10pt; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; text-align: left; line-height: 11pt; margin-top: 0.3em; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; color: rgb(17, 17, 17); "&gt;&lt;p style="font-size: 9pt; font-family: Arial, Helvetica, sans-serif; text-align: left; "&gt;Setting Tomcat JVM parameters, classpath and bootclasspath&lt;/p&gt;&lt;/li&gt;&lt;li style="font-size: 10pt; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; text-align: left; line-height: 11pt; margin-top: 0.3em; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; color: rgb(17, 17, 17); "&gt;&lt;p style="font-size: 9pt; font-family: Arial, Helvetica, sans-serif; text-align: left; "&gt;Exporting a Tomcat project to a WAR File&lt;/p&gt;&lt;/li&gt;&lt;li style="font-size: 10pt; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; text-align: left; line-height: 11pt; margin-top: 0.3em; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; color: rgb(17, 17, 17); "&gt;&lt;p style="font-size: 9pt; font-family: Arial, Helvetica, sans-serif; text-align: left; "&gt;Capability to use a custom Tomcat classloader to load classes in several java projects at the same classloader level than classes in a Tomcat project, see &lt;a href="http://www.eclipsetotale.com/tomcatPlugin/readmeDevLoader.html" style="font-size: 10pt; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; color: rgb(0, 0, 255); text-align: left; "&gt;readmeDevLoader.html&lt;/a&gt; (Thanks Martin Kahr)&lt;/p&gt;&lt;p style="font-size: 9pt; font-family: Arial, Helvetica, sans-serif; text-align: left; "&gt;&lt;b&gt;Download Link: &lt;/b&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Georgia, serif; line-height: normal; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-size: 16px; "&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif; font-weight: normal; font-size: 12px; color: rgb(17, 17, 17); -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;b&gt;&lt;ul style="display: inline !important; "&gt;&lt;li style="font-size: 10pt; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; text-align: left; line-height: 11pt; margin-top: 0.3em; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; color: rgb(17, 17, 17); display: inline !important; "&gt;&lt;a href="http://www.eclipsetotale.com/tomcatPlugin.html#A3"&gt;http://www.eclipsetotale.com/tomcatPlugin.html#A3&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/b&gt;&lt;p&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/span&gt;&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-6293384045640593924?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/6293384045640593924/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=6293384045640593924' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/6293384045640593924'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/6293384045640593924'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2010/07/sysdeo-eclipse-tomcat-launcher-plugin.html' title='Sysdeo Eclipse Tomcat Launcher plugin'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-6565959879664458905</id><published>2010-06-30T04:37:00.000-07:00</published><updated>2010-06-30T04:42:21.734-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tomcat 7'/><title type='text'>Apache Tomcat Version 7.0 is Released</title><content type='html'>The new features provided in Apache Tomcat 7, including the new features in the Servlet 3.0, JSP 2.2 &amp; EL 2.2 specifications, improvements in memory leak detection and prevention, new security features that can prevent CSRF attacks and session fixation attacks and a host of other new features.&lt;br /&gt;&lt;br /&gt;Here is the official download link:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://tomcat.apache.org/download-70.cgi"&gt;http://tomcat.apache.org/download-70.cgi&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-6565959879664458905?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/6565959879664458905/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=6565959879664458905' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/6565959879664458905'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/6565959879664458905'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2010/06/apache-tomcat-version-70-is-released.html' title='Apache Tomcat Version 7.0 is Released'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-4273893596199160347</id><published>2009-07-01T03:26:00.000-07:00</published><updated>2010-08-25T05:27:40.958-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL: UDF to convert the seconds into MM:SS</title><content type='html'>-- =============================================  &lt;br /&gt;-- Author:Sabah u din Irfan&lt;br /&gt;-- Create date: July/1/2009&lt;br /&gt;-- Description:   A UDF to convert the seconds into MM:SS &lt;br /&gt;-- Example: select [dbo].[fn_SEC2MIN](36)&lt;br /&gt;--          print dbo.fn_SEC2MIN ( 36045)&lt;br /&gt;-- =============================================  &lt;br /&gt;CREATE FUNCTION [dbo].[fn_SEC2MIN]( @Sec as int )  &lt;br /&gt;RETURNS VARCHAR (15)   &lt;br /&gt;AS  &lt;br /&gt;BEGIN  &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;DECLARE @return AS VARCHAR (15)   &lt;br /&gt;DECLARE @i_MM as INT  &lt;br /&gt;DECLARE @i_SS as INT  &lt;br /&gt;  &lt;br /&gt; SET @i_MM=0&lt;br /&gt; SET @i_SS=0&lt;br /&gt; SET @return = '00:00'&lt;br /&gt;&lt;br /&gt; IF ( @SEC &gt;= 60 )  &lt;br /&gt;  BEGIN  &lt;br /&gt;   SET @i_MM = FLOOR(@Sec / 60 )  &lt;br /&gt;   SET @i_SS = @Sec % 60   &lt;br /&gt;  END  &lt;br /&gt; ELSE  &lt;br /&gt;        BEGIN  &lt;br /&gt;   SET @i_SS = @Sec&lt;br /&gt;     &lt;br /&gt;  END  &lt;br /&gt;SET @return = case len(cast( @i_MM AS Varchar)) when 1 then right('00' + cast( @i_MM AS Varchar), 2 ) else cast( @i_MM AS Varchar) end +':'+ right('00' + cast( @i_SS AS Varchar), 2 )  &lt;br /&gt;  &lt;br /&gt;RETURN @return   &lt;br /&gt;&lt;br /&gt;END&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-4273893596199160347?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/4273893596199160347/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=4273893596199160347' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/4273893596199160347'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/4273893596199160347'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2009/07/sql-udf-to-convert-seconds-into-mmss.html' title='SQL: UDF to convert the seconds into MM:SS'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-5803118132570352069</id><published>2009-07-01T03:12:00.000-07:00</published><updated>2010-08-25T06:50:28.554-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL: UDF to convert the seconds into HH:MM:SS</title><content type='html'>-- =============================================  &lt;br /&gt;-- Author:      Sabah u din Irfan&lt;br /&gt;-- Description:   A UDF to convert the seconds into HH:MM:SS &lt;br /&gt;-- Example: SELECT fn_SEC2HHMMSS(65)&lt;br /&gt;-- =============================================  &lt;br /&gt;CREATE FUNCTION [dbo].[fn_SEC2HHMMSS]( @sec as int )  &lt;br /&gt;RETURNS VARCHAR (15)   &lt;br /&gt;AS  &lt;br /&gt;BEGIN  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;RETURN&lt;br /&gt; case len(convert(varchar(15),@sec/3600)) &lt;br /&gt; when 1 &lt;br /&gt;  then RIGHT('00'+convert(varchar(5),@sec/3600),2)&lt;br /&gt; else convert(varchar(15),@sec/3600)&lt;br /&gt;end&lt;br /&gt;+':'+RIGHT('0'+convert(varchar(5),@sec%3600/60),2)&lt;br /&gt;+':'+RIGHT('0'+convert(varchar(5),(@sec%60)),2)&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;END&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-5803118132570352069?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/5803118132570352069/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=5803118132570352069' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/5803118132570352069'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/5803118132570352069'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2009/07/sql-udf-to-convert-seconds-into-hhmmss.html' title='SQL: UDF to convert the seconds into HH:MM:SS'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-8514588257315725068</id><published>2009-06-27T08:52:00.000-07:00</published><updated>2009-06-27T09:10:08.547-07:00</updated><title type='text'>JSP: Defining Implicit Includes</title><content type='html'>&lt;p&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;There are two implicit includes in JSP and both of these are configured in the deployment descriptor (web.xml) file.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;1- One that is &lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;included in the beginning of every JSP&lt;/span&gt; matching the specified property group is called "&lt;span style="font-weight: bold;"&gt;include-prelude&lt;/span&gt;",&lt;br /&gt;&lt;/p&gt;&lt;p&gt;2- The other that is  &lt;span style="color: rgb(51, 51, 255);"&gt;included at the end of ever JSP&lt;/span&gt; page matching the specified property group is called "&lt;span style="font-weight: bold;"&gt;include-coda&lt;/span&gt;".&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The &lt;tt class="filename"&gt;include-prelude&lt;/tt&gt; element is an optional subelement of       &lt;tt class="filename"&gt;jsp-property-group&lt;/tt&gt;. It has no subelements. Its value is a       context-relative path that must correspond to an element in the Web Application.       When the element is present, the given path will be automatically included (as in an       &lt;tt class="filename"&gt;include&lt;/tt&gt; directive) at the beginning of the JSP page in the       &lt;tt class="filename"&gt;jsp-property-group&lt;/tt&gt;. When there are more than one       &lt;tt class="filename"&gt;include-prelude&lt;/tt&gt; element in a group, they are to be included in       the order they appear. When more than one &lt;tt class="filename"&gt;jsp-property-group&lt;/tt&gt;       applies to a JSP page, the corresponding includeprelude elements will be processed in       the same order as they appear in the JSP configuration section of       &lt;tt class="filename"&gt;web.xml&lt;/tt&gt;.     &lt;/p&gt;&lt;p&gt;      The &lt;tt class="filename"&gt;include-coda&lt;/tt&gt; element is an optional subelement of       &lt;tt class="filename"&gt;jsp-property-group&lt;/tt&gt;. It has no subelements. Its value is a       context-relative path that must correspond to an element in the Web Application. When       the element is present, the given path will be automatically included (as in an       &lt;tt class="filename"&gt;include&lt;/tt&gt; directive) at the end of the JSP page in the       &lt;tt class="filename"&gt;jsp-property-group&lt;/tt&gt;. When there are more than one       &lt;tt class="filename"&gt;include-coda&lt;/tt&gt; element in a group, they are to be included in       the order they appear. When more than one &lt;tt class="filename"&gt;jsp-property-group&lt;/tt&gt; applies       to a JSP page, the corresponding &lt;tt class="filename"&gt;include-coda&lt;/tt&gt; elements will be       processed in the same order as they appear in the JSP configuration section      of &lt;tt class="filename"&gt;web.xml&lt;/tt&gt;. Note that these semantics are in contrast to the       way &lt;tt class="filename"&gt;url-patterns&lt;/tt&gt; are matched for other configuration elements.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;      Preludes and codas follow the same rules as statically included JSP segments.      In particular, start tags and end tags must appear in the same file.     &lt;/p&gt;&lt;p&gt;      For example, the following &lt;tt class="filename"&gt;web.xml&lt;/tt&gt; fragment defines two groups.       Together they indicate that everything in directory &lt;tt class="filename"&gt;/two/&lt;/tt&gt; have       &lt;tt class="filename"&gt;/WEB-INF/jspf/prelude1.jspf&lt;/tt&gt; and       &lt;tt class="filename"&gt;/WEB-INF/jspf/prelude2.jspf&lt;/tt&gt; at the beginning and       &lt;tt class="filename"&gt;/WEB-INF/jspf/coda1.jspf&lt;/tt&gt; and       &lt;tt class="filename"&gt;/WEB-INF/jspf/coda2.jspf&lt;/tt&gt; at the end, in that order, while other       &lt;tt class="filename"&gt;.jsp&lt;/tt&gt; files only have &lt;tt class="filename"&gt;/WEB-INF/jspf/prelude1.jspf&lt;/tt&gt;       at the beginning and &lt;tt class="filename"&gt;/WEB-INF/jspf/coda1.jspf&lt;/tt&gt; at the      end:      &lt;/p&gt;&lt;pre class="programlisting"&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;jsp-property-group &amp;gt;&lt;br /&gt; &amp;lt;url-pattern&gt;*.jsp&amp;lt;/url-pattern&amp;gt;&lt;br /&gt; &amp;lt;include-prelude&gt;/WEB-INF/jspf/prelude1.jspf&amp;lt;/include-prelude&amp;gt;&lt;br /&gt; &amp;lt;include-coda&gt;/WEB-INF/jspf/coda1.jspf&amp;lt;/include-coda&amp;gt;&lt;br /&gt;&amp;lt;/jsp-property-group&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;jsp-property-group&amp;gt;&lt;br /&gt; &amp;lt;url-pattern&amp;gt;/two/*&amp;lt;/url-pattern&amp;gt;&lt;br /&gt; &amp;lt;include-prelude&amp;gt;/WEB-INF/jspf/prelude2.jspf&amp;lt;/include-prelude&amp;gt;&lt;br /&gt; &amp;lt;include-coda&amp;gt;/WEB-INF/jspf/coda2.jspf&amp;lt;/include-coda&amp;gt;&lt;br /&gt;&amp;lt;/jsp-property-group&amp;gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-8514588257315725068?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/8514588257315725068/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=8514588257315725068' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/8514588257315725068'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/8514588257315725068'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2009/06/jsp-defining-implicit-includes.html' title='JSP: Defining Implicit Includes'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-7529831918207108902</id><published>2009-05-13T05:44:00.000-07:00</published><updated>2010-08-25T06:49:28.334-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>JAVA: Reading Properties File</title><content type='html'>public static String &lt;span style="font-weight: bold;"&gt;getProperty&lt;/span&gt;(String filePath,String property) throws java.io.IOException&lt;br /&gt;    {&lt;br /&gt;        String value="";&lt;br /&gt;        java.io.File f = new java.io.File(filePath);&lt;br /&gt;        if(f.exists()){&lt;br /&gt;            java.util.Properties pro = new java.util.Properties();&lt;br /&gt;            java.io.FileInputStream in = new java.io.FileInputStream(f);&lt;br /&gt;            pro.load(in);&lt;br /&gt;           &lt;br /&gt;             value =pro.getProperty(property);&lt;br /&gt;           &lt;br /&gt;          }&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;            value="";&lt;br /&gt;        }&lt;br /&gt;        return value;&lt;br /&gt;    }&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-7529831918207108902?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/7529831918207108902/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=7529831918207108902' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/7529831918207108902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/7529831918207108902'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2009/05/java-reading-properties-file.html' title='JAVA: Reading Properties File'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-6230098085939609220</id><published>2009-02-23T10:12:00.000-08:00</published><updated>2009-02-23T10:19:07.760-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Sun Certified Web Component Developer for the Java Platform, Enterprise Edition 5 (CX-310-083)</title><content type='html'>&lt;span style="font-size:180%;"&gt;&lt;/span&gt;Details                      &lt;ul&gt;&lt;li&gt;Delivered at: Authorized Worldwide Prometric Testing Centers&lt;/li&gt;&lt;li&gt;Prerequisites: Sun Certified Programmer for the Java Platform (any edition)&lt;/li&gt;&lt;li&gt;Exam type: Multiple Choice and Drag and Drop&lt;/li&gt;&lt;li&gt;Number of questions: 69&lt;/li&gt;&lt;li&gt;Pass score: 70% (49 of 69 questions)&lt;/li&gt;&lt;li&gt;Time limit: 180 minutes&lt;/li&gt;&lt;/ul&gt;                                                                                                                                &lt;b&gt;                                                                Section 1: The Servlet Technology Model                                &lt;/b&gt;&lt;br /&gt;                            &lt;hr /&gt;&lt;br /&gt;                                                                                                                                                                                                                                                                                                                                                                                                  &lt;ul&gt;&lt;li&gt;For each of the HTTP Methods (such as GET, POST, HEAD, and so on) describe the purpose of the method and the technical characteristics of the HTTP Method protocol, list triggers that might cause a Client (usually a Web browser) to use the method; and identify the HttpServlet method that corresponds to the HTTP Method.&lt;/li&gt;&lt;li&gt;Using the HttpServletRequest interface, write code to retrieve HTML form parameters from the request, retrieve HTTP request header information, or retrieve cookies from the request.&lt;/li&gt;&lt;li&gt;Using the HttpServletResponse interface, write code to set an HTTP response header, set the content type of the response, acquire a text stream for the response, acquire a binary stream for the response, redirect an HTTP request to another URL, or add cookies to the response.&lt;/li&gt;&lt;li&gt;Describe the purpose and event sequence of the servlet life cycle: (1) servlet class loading, (2) servlet instantiation, (3) call the init method, (4) call the service method, and (5) call destroy method.&lt;/li&gt;&lt;/ul&gt;  &lt;br /&gt;                                                                                        &lt;br /&gt;                                                        &lt;b&gt;                                                                Section 2: The Structure and Deployment of Web Applications                                &lt;/b&gt;&lt;br /&gt;                            &lt;hr /&gt;&lt;br /&gt;                                                                                                                                                                                                                                                                                                                                                                                                  &lt;ul&gt;&lt;li&gt;Construct the file and directory structure of a Web Application that may contain (a) static content, (b) JSP pages, (c) servlet classes, (d) the deployment descriptor, (e) tag libraries, (d) JAR files, and (e) Java class files; and describe how to protect resource files from HTTP access.&lt;/li&gt;&lt;li&gt;Describe the purpose and semantics of the deployment descriptor.&lt;/li&gt;&lt;li&gt;Construct the correct structure of the deployment descriptor.&lt;/li&gt;&lt;li&gt;Explain the purpose of a WAR file and describe the contents of a WAR file, how one may be constructed.&lt;/li&gt;&lt;/ul&gt;  &lt;br /&gt;                                                                                        &lt;br /&gt;                                                        &lt;b&gt;                                                                Section 3: The Web Container Model                                &lt;/b&gt;&lt;br /&gt;                            &lt;hr /&gt;&lt;br /&gt;                                                                                                                                                                                                                                                                                                                                                                                                  &lt;ul&gt;&lt;li&gt;For the ServletContext initialization parameters: write servlet code to access initialization parameters; and create the deployment descriptor elements for declaring initialization parameters.&lt;/li&gt;&lt;li&gt;For the fundamental servlet attribute scopes (request, session, and context): write servlet code to add, retrieve, and remove attributes; given a usage scenario, identify the proper scope for an attribute; and identify multi-threading issues associated with each scope.&lt;/li&gt;&lt;li&gt;Describe the Web container request processing model; write and configure a filter; create a request or response wrapper; and given a design problem, describe how to apply a filter or a wrapper.&lt;/li&gt;&lt;li&gt;Describe the Web container life cycle event model for requests, sessions, and web applications;create and configure listener classes for each scope life cycle; create and configure scope attribute listener classes; and given a scenario, identify the proper attribute listener to use.&lt;/li&gt;&lt;li&gt;Describe the RequestDispatcher mechanism; write servlet code to create a request dispatcher; write servlet code to forward or include the target resource; and identify and describe the additional request-scoped attributes provided by the container to the target resource.&lt;/li&gt;&lt;/ul&gt;  &lt;br /&gt;                                                                                        &lt;br /&gt;                                                        &lt;b&gt;                                                                Section 4: Session Management                                &lt;/b&gt;&lt;br /&gt;                            &lt;hr /&gt;&lt;br /&gt;                                                                                                                                                                                                                                                                                                                                                                                                  &lt;ul&gt;&lt;li&gt;Write servlet code to store objects into a session object and retrieve objects from a session object.&lt;/li&gt;&lt;li&gt;Given a scenario describe the APIs used to access the session object, explain when the session object was created, and describe the mechanisms used to destroy the session object, and when it was destroyed.&lt;/li&gt;&lt;li&gt;Using session listeners, write code to respond to an event when an object is added to a session, and write code to respond to an event when a session object migrates from one VM to another.&lt;/li&gt;&lt;li&gt;Given a scenario, describe which session management mechanism the Web container could employ, how cookies might be used to manage sessions, how URL rewriting might be used to manage sessions, and write servlet code to perform URL rewriting.&lt;/li&gt;&lt;/ul&gt;  &lt;br /&gt;                                                                                        &lt;br /&gt;                                                        &lt;b&gt;                                                                Section 5: Web Application Security                                &lt;/b&gt;&lt;br /&gt;                            &lt;hr /&gt;&lt;br /&gt;                                                                                                                                                                                                                                                                                                                                                                                                  &lt;ul&gt;&lt;li&gt;Based on the servlet specification, compare and contrast the following security mechanisms: (a) authentication, (b) authorization, (c) data integrity, and (d) confidentiality.&lt;/li&gt;&lt;li&gt;In the deployment descriptor, declare a security constraint, a Web resource, the transport guarantee, the login configuration, and a security role.&lt;/li&gt;&lt;li&gt;Compare and contrast the authentication types (BASIC, DIGEST, FORM, and CLIENT-CERT); describe how the type works; and given a scenario, select an appropriate type.&lt;/li&gt;&lt;/ul&gt;  &lt;br /&gt;                                                                                        &lt;br /&gt;                                                        &lt;b&gt;                                                                Section 6: The JavaServer Pages (JSP) Technology Model                                &lt;/b&gt;&lt;br /&gt;                            &lt;hr /&gt;&lt;br /&gt;                                                                                                                                                                                                                                                                                                                                                                                                  &lt;ul&gt;&lt;li&gt;Identify, describe, or write the JSP code for the following elements: (a) template text, (b) scripting elements (comments, directives, declarations, scriptlets, and expressions), (c) standard and custom actions, and (d) expression language elements.&lt;/li&gt;&lt;li&gt;Write JSP code that uses the directives: (a) 'page' (with attributes 'import', 'session', 'contentType', and 'isELIgnored'), (b) 'include', and (c) 'taglib'.&lt;/li&gt;&lt;li&gt;Write a JSP Document (XML-based document) that uses the correct syntax.&lt;/li&gt;&lt;li&gt;Describe the purpose and event sequence of the JSP page life cycle: (1) JSP page translation, (2) JSP page compilation, (3) load class, (4) create instance, (5) call the jspInit method, (6) call the _jspService method, and (7) call the jspDestroy method.&lt;/li&gt;&lt;li&gt;Given a design goal, write JSP code using the appropriate implicit objects: (a) request, (b) response, (c) out, (d) session, (e) config, (f) application, (g) page, (h) pageContext, and (i) exception.&lt;/li&gt;&lt;li&gt;Configure the deployment descriptor to declare one or more tag libraries, deactivate the evaluation language, and deactivate the scripting language. 6.7 Given a specific design goal for including a JSP segment in another page, write the JSP code that uses the most appropriate inclusion mechanism (the include directive or the jsp:include standard action).&lt;/li&gt;&lt;/ul&gt;  &lt;br /&gt;                                                                                        &lt;br /&gt;                                                        &lt;b&gt;                                                                Section 7: Building JSP Pages Using the Expression Language (EL)                                &lt;/b&gt;&lt;br /&gt;                            &lt;hr /&gt;&lt;br /&gt;                                                                                                                                                                                                                                                                                                                                                                                                  &lt;ul&gt;&lt;li&gt;Given a scenario, write EL code that accesses the following implicit variables including pageScope, requestScope, sessionScope, and applicationScope, param and paramValues, header and headerValues, cookie, initParam and pageContext.&lt;/li&gt;&lt;li&gt;Given a scenario, write EL code that uses the following operators: property access (the . operator), collection access (the [] operator).&lt;/li&gt;&lt;/ul&gt;  &lt;br /&gt;                                                                                        &lt;br /&gt;                                                        &lt;b&gt;                                                                Section 8: Building JSP Pages Using Standard Actions                                &lt;/b&gt;&lt;br /&gt;                            &lt;hr /&gt;&lt;br /&gt;                                                                                                                                                                                                                                                                                                                                                                                                  &lt;ul&gt;&lt;li&gt;Given a design goal, create a code snippet using the following standard actions: jsp:useBean (with attributes: 'id', 'scope', 'type', and 'class'), jsp:getProperty, jsp:setProperty (with all attribute combinations), and jsp:attribute.&lt;/li&gt;&lt;li&gt;Given a design goal, create a code snippet using the following standard actions:  jsp:include, jsp:forward, and jsp:param.&lt;/li&gt;&lt;/ul&gt;  &lt;br /&gt;                                                                                        &lt;br /&gt;                                                        &lt;b&gt;                                                                Section 9: Building JSP Pages Using Tag Libraries                                &lt;/b&gt;&lt;br /&gt;                            &lt;hr /&gt;&lt;br /&gt;                                                                                                                                                                                                                                                                                                                                                                                                  &lt;ul&gt;&lt;li&gt;For a custom tag library or a library of Tag Files, create  the 'taglib' directive for a JSP page.&lt;/li&gt;&lt;li&gt;Given a design goal, create the custom tag structure in a JSP page  to support that goal.&lt;/li&gt;&lt;li&gt;Given a design goal, use an appropriate JSP Standard Tag Library (JSTL v1.1)  tag from the "core" tag library.&lt;/li&gt;&lt;/ul&gt;  &lt;br /&gt;                                                                                        &lt;br /&gt;                                                        &lt;b&gt;                                                                Section 10: Building a Custom Tag Library                                &lt;/b&gt;&lt;br /&gt;                            &lt;hr /&gt;&lt;br /&gt;                                                                                                                                                                                                                                                                                                                                                                                                  &lt;ul&gt;&lt;li&gt;Describe the semantics of the "Classic" custom tag event model when each event method (doStartTag, doAfterBody, and doEndTag) is executed, and explain what the return value for each event method means; and write a tag handler class.&lt;/li&gt;&lt;li&gt;Using the PageContext API, write tag handler code to access the JSP implicit  variables and access web application attributes.&lt;/li&gt;&lt;li&gt;Given a scenario, write tag handler code to access the parent tag and  an arbitrary tag ancestor.&lt;/li&gt;&lt;li&gt;Describe the semantics of the "Simple" custom tag event model when the event method (doTag) is executed; write a tag handler class; and explain the constraints on the JSP content within the tag.&lt;/li&gt;&lt;li&gt;Describe the semantics of the Tag File model; describe the web application structure for tag files; write a tag file; and explain the constraints on the JSP content in the body of the tag.&lt;/li&gt;&lt;/ul&gt;  &lt;br /&gt;                                                                                        &lt;br /&gt;                                                        &lt;b&gt;                                                                Section 11: Java EE Patterns                                &lt;/b&gt;&lt;br /&gt;                            &lt;hr /&gt;&lt;br /&gt;                                                                                                                                                                                                                                                                                                                                                                                                  &lt;ul&gt;&lt;li&gt;Given a scenario description with a list of issues, select a pattern that would solve the issues. The list of patterns you must know are: Intercepting Filter, Model-View-Controller, Front Controller, Service Locator, Business Delegate, and Transfer Object.&lt;/li&gt;&lt;li&gt;Match design patterns with statements describing potential benefits that accrue from the use of the pattern, for any of the following patterns: Intercepting Filter, Model-View-Controller, Front Controller, Service Locator, Business Delegate, and Transfer Object.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-6230098085939609220?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/6230098085939609220/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=6230098085939609220' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/6230098085939609220'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/6230098085939609220'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2009/02/sun-certified-web-component-developer.html' title='Sun Certified Web Component Developer for the Java Platform, Enterprise Edition 5 (CX-310-083)'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-5643204765556983465</id><published>2009-02-11T12:06:00.000-08:00</published><updated>2009-02-11T12:08:30.984-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SCJP'/><title type='text'>Sun Certified Programmer for the Java Platform, Standard Edition 5.0 (CX-310-055)</title><content type='html'>&lt;h5&gt;                                                                Exam Objectives: &lt;/h5&gt;&lt;h5&gt;&lt;a href="http://www.sun.com/training/catalog/courses/CX-310-055.xml"&gt;http://www.sun.com/training/catalog/courses/CX-310-055.xml&lt;/a&gt;&lt;br /&gt;&lt;/h5&gt;&lt;br /&gt;                                                                                                                                                         &lt;b&gt;                                                                Section 1: Declarations, Initialization and Scoping                                &lt;/b&gt;&lt;br /&gt;                               &lt;hr /&gt;&lt;br /&gt;                                                                                                                                                                                                                                                                                                                                                                                                     &lt;ul&gt;&lt;li&gt;Develop code that declares classes (including abstract and all forms of nested classes), interfaces, and enums, and includes the appropriate use of package and import statements (including static imports).&lt;/li&gt;&lt;li&gt;Develop code that declares an interface. Develop code that implements or extends one or more interfaces. Develop code that declares an abstract class. Develop code that extends an abstract class.&lt;/li&gt;&lt;li&gt;Develop code that declares, initializes, and uses primitives, arrays, enums, and objects as static, instance, and local variables. Also, use legal identifiers for variable names.&lt;/li&gt;&lt;li&gt;Develop code that declares both static and non-static methods, and - if appropriate - use method names that adhere to the JavaBeans naming standards. Also develop code that declares and uses a variable-length argument list.&lt;/li&gt;&lt;li&gt;Given a code example, determine if a method is correctly overriding or overloading another method, and identify legal return values (including covariant returns), for the method.&lt;/li&gt;&lt;li&gt;Given a set of classes and superclasses, develop constructors for one or more of the classes. Given a class declaration, determine if a default constructor will be created, and if so, determine the behavior of that constructor. Given a nested or non-nested class listing, write code to instantiate the class.&lt;/li&gt;&lt;/ul&gt;     &lt;br /&gt;                                                                                              &lt;br /&gt;                                                           &lt;b&gt;                                                                Section 2: Flow Control                                &lt;/b&gt;&lt;br /&gt;                               &lt;hr /&gt;&lt;br /&gt;                                                                                                                                                                                                                                                                                                                                                                                                     &lt;ul&gt;&lt;li&gt;Develop code that implements an if or switch statement; and identify legal argument types for these statements.&lt;/li&gt;&lt;li&gt;Develop code that implements all forms of loops and iterators, including the use of for, the enhanced for loop (for-each), do, while, labels, break, and continue; and explain the values taken by loop counter variables during and after loop execution.&lt;/li&gt;&lt;li&gt;Develop code that makes use of assertions, and distinguish appropriate from inappropriate uses of assertions.&lt;/li&gt;&lt;li&gt;Develop code that makes use of exceptions and exception handling clauses (try, catch, finally), and declares methods and overriding methods that throw exceptions.&lt;/li&gt;&lt;li&gt;Recognize the effect of an exception arising at a specified point in a code fragment. Note that the exception may be a runtime exception, a checked exception, or an error.&lt;/li&gt;&lt;li&gt;Recognize situations that will result in any of the following being thrown: ArrayIndexOutOfBoundsException,ClassCastException, IllegalArgumentException, IllegalStateException, NullPointerException, NumberFormatException, AssertionError, ExceptionInInitializerError, StackOverflowError or NoClassDefFoundError. Understand which of these are thrown by the virtual machine and recognize situations in which others should be thrown programatically.&lt;/li&gt;&lt;/ul&gt;     &lt;br /&gt;                                                                                              &lt;br /&gt;                                                           &lt;b&gt;                                                                Section 3: API Contents                                &lt;/b&gt;&lt;br /&gt;                               &lt;hr /&gt;&lt;br /&gt;                                                                                                                                                                                                                                                                                                                                                                                                     &lt;ul&gt;&lt;li&gt;Develop code that uses the primitive wrapper classes (such as Boolean, Character, Double, Integer, etc.), and/or autoboxing &amp;amp; unboxing. Discuss the differences between the String, StringBuilder, and StringBuffer classes.&lt;/li&gt;&lt;li&gt;Given a scenario involving navigating file systems, reading from files, or writing to files, develop the correct solution using the following classes (sometimes in combination), from java.io: BufferedReader,BufferedWriter, File, FileReader, FileWriter and PrintWriter.&lt;/li&gt;&lt;li&gt;Develop code that serializes and/or de-serializes objects using the following APIs from java.io: DataInputStream, DataOutputStream, FileInputStream, FileOutputStream, ObjectInputStream, ObjectOutputStream and Serializable.&lt;/li&gt;&lt;li&gt;Use standard J2SE APIs in the java.text package to correctly format or parse dates, numbers, and currency values for a specific locale; and, given a scenario, determine the appropriate methods to use if you want to use the default locale or a specific locale. Describe the purpose and use of the java.util.Locale class.&lt;/li&gt;&lt;li&gt;Write code that uses standard J2SE APIs in the java.util and java.util.regex packages to format or parse strings or streams. For strings, write code that uses the Pattern and Matcher classes and the String.split method. Recognize and use regular expression patterns for matching (limited to: . (dot), * (star), + (plus), ?, \d, \s, \w, [], ()). The use of *, +, and ? will be limited to greedy quantifiers, and the parenthesis operator will only be used as a grouping mechanism, not for capturing content during matching. For streams, write code using the Formatter and Scanner classes and the PrintWriter.format/printf methods. Recognize and use formatting parameters (limited to: %b, %c, %d, %f, %s) in format strings.&lt;/li&gt;&lt;/ul&gt;     &lt;br /&gt;                                                                                              &lt;br /&gt;                                                           &lt;b&gt;                                                                Section 4: Concurrency                                &lt;/b&gt;&lt;br /&gt;                               &lt;hr /&gt;&lt;br /&gt;                                                                                                                                                                                                                                                                                                                                                                                                     &lt;ul&gt;&lt;li&gt;Write code to define, instantiate, and start new threads using both java.lang.Thread and java.lang.Runnable.&lt;/li&gt;&lt;li&gt;Recognize the states in which a thread can exist, and identify ways in which a thread can transition from one state to another.&lt;/li&gt;&lt;li&gt;Given a scenario, write code that makes appropriate use of object locking to protect static or instance variables from concurrent access problems.&lt;/li&gt;&lt;li&gt;Given a scenario, write code that makes appropriate use of wait, notify, or notifyAll.&lt;/li&gt;&lt;/ul&gt;     &lt;br /&gt;                                                                                              &lt;br /&gt;                                                           &lt;b&gt;                                                                Section 5: OO Concepts                                &lt;/b&gt;&lt;br /&gt;                               &lt;hr /&gt;&lt;br /&gt;                                                                                                                                                                                                                                                                                                                                                                                                     &lt;ul&gt;&lt;li&gt;Develop code that implements tight encapsulation, loose coupling, and high cohesion in classes, and describe the benefits.&lt;/li&gt;&lt;li&gt;Given a scenario, develop code that demonstrates the use of polymorphism. Further, determine when casting will be necessary and recognize compiler vs. runtime errors related to object reference casting.&lt;/li&gt;&lt;li&gt;Explain the effect of modifiers on inheritance with respect to constructors, instance or static variables, and instance or static methods.&lt;/li&gt;&lt;li&gt;Given a scenario, develop code that declares and/or invokes overridden or overloaded methods and code that declares and/or invokes superclass or overloaded constructors. &lt;/li&gt;&lt;li&gt;Develop code that implements "is-a" and/or "has-a" relationships.&lt;/li&gt;&lt;/ul&gt;     &lt;br /&gt;                                                                                              &lt;br /&gt;                                                           &lt;b&gt;                                                                Section 6: Collections / Generics                                &lt;/b&gt;&lt;br /&gt;                               &lt;hr /&gt;&lt;br /&gt;                                                                                                                                                                                                                                                                                                                                                                                                     &lt;ul&gt;&lt;li&gt;Given a design scenario, determine which collection classes and/or interfaces should be used to properly implement that design, including the use of the Comparable interface.&lt;/li&gt;&lt;li&gt;Distinguish between correct and incorrect overrides of corresponding hashCode and equals methods, and explain the difference between == and the equals method.&lt;/li&gt;&lt;li&gt;Write code that uses the generic versions of the Collections API, in particular, the Set, List, and Map interfaces and implementation classes. Recognize the limitations of the non-generic Collections API and how to refactor code to use the generic versions.&lt;/li&gt;&lt;li&gt;Develop code that makes proper use of type parameters in class/interface declarations, instance variables, method arguments, and return types; and write generic methods or methods that make use of wildcard types and understand the similarities and differences between these two approaches.&lt;/li&gt;&lt;li&gt;Use capabilities in the java.util package to write code to manipulate a list by sorting, performing a binary search, or converting the list to an array. Use capabilities in the java.util package to write code to manipulate an array by sorting, performing a binary search, or converting the array to a list. Use the java.util.Comparator and java.lang.Comparable interfaces to affect the sorting of lists and arrays. Furthermore, recognize the effect of the "natural ordering" of primitive wrapper classes and java.lang.String on sorting.&lt;/li&gt;&lt;/ul&gt;     &lt;br /&gt;                                                                                              &lt;br /&gt;                                                           &lt;b&gt;                                                                Section 7: Fundamentals                                &lt;/b&gt;&lt;br /&gt;                               &lt;hr /&gt;&lt;br /&gt;                                                                                                                                                                                                                                                                                                                                                                                                     &lt;ul&gt;&lt;li&gt;Given a code example and a scenario, write code that uses the appropriate access modifiers, package declarations, and import statements to interact with (through access or inheritance) the code in the example.&lt;/li&gt;&lt;li&gt;Given an example of a class and a command-line, determine the expected runtime behavior.&lt;/li&gt;&lt;li&gt;Determine the effect upon object references and primitive values when they are passed into methods that perform assignments or other modifying operations on the parameters.&lt;/li&gt;&lt;li&gt;Given a code example, recognize the point at which an object becomes eligible for garbage collection, and determine what is and is not guaranteed by the garbage collection system. Recognize the behaviors of System.gc and finalization.&lt;/li&gt;&lt;li&gt;Given the fully-qualified name of a class that is deployed inside and/or outside a JAR file, construct the appropriate directory structure for that class. Given a code example and a classpath, determine whether the classpath will allow the code to compile successfully.&lt;/li&gt;&lt;li&gt;Write code that correctly applies the appropriate operators including assignment operators (limited to: =, +=, -=), arithmetic operators (limited to: +, -, *, /, %, ++, --), relational operators (limited to: &lt;, &lt;=, &gt;, &gt;=, ==, !=), the instanceof operator, logical operators (limited to: &amp;amp;, |, ^, !, &amp;amp;&amp;amp;, ||), and the conditional operator ( ? : ), to produce a desired result. Write code that determines the equality of two objects or two primitives.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-5643204765556983465?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/5643204765556983465/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=5643204765556983465' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/5643204765556983465'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/5643204765556983465'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2009/02/sun-certified-programmer-for-java.html' title='Sun Certified Programmer for the Java Platform, Standard Edition 5.0 (CX-310-055)'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-641400270526042292</id><published>2009-02-04T08:51:00.000-08:00</published><updated>2010-08-25T06:49:09.740-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>JavaScript: TRIM Function</title><content type='html'>Following function is very helpful to trim the leading as well as trailing spaces in a string. To make use of this function, first add the following code snip(declaration) in your JS library or in head section of HTML.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt; String.prototype.trim = function() {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;a = this.replace(/^\s+/, '');&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;return a.replace(/\s+$/, '');&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;};&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Then you may call this function like:&lt;br /&gt;&lt;br /&gt;Example No:1&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 204);"&gt; alert("Test Case 1:" + " StrinValue                    ".trim()+"sabah" )&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Example No:2&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 204);"&gt;&lt; name="textfieldid" type="text" onchange="this.value=this.value.trim()"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-641400270526042292?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/641400270526042292/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=641400270526042292' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/641400270526042292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/641400270526042292'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2009/02/javascript-trim-function.html' title='JavaScript: TRIM Function'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-5428470017002399563</id><published>2009-01-30T07:48:00.000-08:00</published><updated>2010-08-25T06:48:57.786-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>JAVA ENUM Key Notes for SCJP</title><content type='html'>Enumerations are set of closely related items, often called Type Safe Enum that are introduced in JDK 5. It is the better way to define constants, but it is more than that. you can read and test the examples from online sun tutorials on enums.&lt;br /&gt;&lt;br /&gt;Couple of Key notes that I have noted are as followings:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;enums are implicitly final subclasses of java.lang.Enum that is inherited from java.lang.Object.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;As enums are implicitly final classes, so inheritance between enums or simple classes is not possible.&lt;/li&gt;&lt;li&gt;If an enum is member of a class it is implicitly static.&lt;/li&gt;&lt;li&gt;new keyword can never be used with enum.&lt;/li&gt;&lt;li&gt;name() and valueOf() methods simply use the text of enum constant.&lt;/li&gt;&lt;li&gt;Defualt implementation of toString() returns the name of the enum constant, but you can override its implementation.&lt;/li&gt;&lt;li&gt;For enum constants equals() and == amount to the same thing and can be used interchangebly.&lt;/li&gt;&lt;li&gt;enum constants are implicitly public, static and final&lt;/li&gt;&lt;li&gt;The order of appearance of enum constants is called their NATURAL ORDER &lt;/li&gt;&lt;li&gt;There is a built in method named as values() that returns the array of all enum constants.&lt;/li&gt;&lt;li&gt;All instances of Enums are serializable by default. As Enums are subclasses of class java.lang.Enum, which implements the interface java.io.Serializable. If a class implements the interface java.io.Serialisable, its objects are serializable.&lt;/li&gt;&lt;li&gt;Enums are compiled to a .class file. &lt;/li&gt;&lt;li&gt;An enum can define a main method and it can be executed as a standalone application&lt;/li&gt;&lt;li&gt;You can provide the abstract methods in the enum, but this abstract method needs to be implemented by all of the enum constants because we can not declare enum itself as abstract. Simply We cannot define abstract enums.&lt;/li&gt;&lt;li&gt;Enums cannot be instantiated, we can only create the reference of an enum&lt;/li&gt;&lt;li&gt;Enums may be used as a operand for the instanceof operator in the same way that it can be used by a class&lt;/li&gt;&lt;li&gt;Enums can be used in switch statements. &lt;/li&gt;&lt;li&gt;An enum can define more than 1 constructor (similar to a class) and its constructor can accept more than 1 method parameter. Please note we can not create the actual object using new like we do with classes.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;name() is a final method, which cannot be overridden. It returns the name of the enum constant, exactly as declared in its enum declaration. &lt;/li&gt;&lt;li&gt;Constructors for an enum type should be declared as private. The compiler allows non&lt;br /&gt;private declares for constructors, but this seems misleading to the reader, since new can&lt;br /&gt;never be used with enum types.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Constructor of enum can only be private or default. public and protected are not allowed with constructor of Enum.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;Enum can implement interface.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;Enums cannot be declared within a method!&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-5428470017002399563?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/5428470017002399563/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=5428470017002399563' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/5428470017002399563'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/5428470017002399563'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2009/01/java-enum-key-notes-for-scjp.html' title='JAVA ENUM Key Notes for SCJP'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-5511257320482650586</id><published>2009-01-19T23:55:00.000-08:00</published><updated>2009-01-19T23:56:03.155-08:00</updated><title type='text'>UET Lahore among the top world ranking universities (2008)</title><content type='html'>The University of Engineering and Technology, Lahore has been placed at &lt;b&gt;&lt;u&gt;592&lt;/u&gt;&lt;/b&gt; among the top ranked Universities of the world in World Ranking Universities 2008.&lt;br /&gt;            It is a remarkable achievement for UET, Lahore that it has got international recognition.&lt;br /&gt;            It is also worth noting that only &lt;b&gt;Four Pakistani Universities including UET, Lahore &lt;/b&gt;are included in the World Ranking 2008.&lt;br /&gt;           &lt;br /&gt;            &lt;a target="_blank" href="http://www.topuniversities.com/university_rankings/results/2008/overall_rankings/fullrankings/"&gt;http://www.topuniversities.com/university_rankings/results/2008/overall_rankings/fullrankings/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-5511257320482650586?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/5511257320482650586/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=5511257320482650586' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/5511257320482650586'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/5511257320482650586'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2009/01/uet-lahore-among-top-world-ranking.html' title='UET Lahore among the top world ranking universities (2008)'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-5457970914417382678</id><published>2009-01-14T10:43:00.000-08:00</published><updated>2010-08-25T06:48:46.506-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>JAVA: Named Inner-class Listeners</title><content type='html'>Defining an inner class listener to handle events is a very popular style.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;     &lt;span style="font-weight: bold;"&gt;Access:-&lt;/span&gt;Use an inner class rather than an outer class to access instance variables of the enclosing class. In the example below, the txt1, txt2, txt3 can be referenced by the listener class. Because simple program listeners typically get or set values of other widgets in the interface, it is very convenient to use an inner class.&lt;/li&gt;&lt;li&gt;     &lt;span style="font-weight: bold;"&gt;Reuse&lt;/span&gt;:-Unlike anonymous inner class listeners, it's easy to reuse the same listener for more than one control, eg, the click of a button might perform the same action as the equivalent menu item, and might be the same as hitting the enter key in a text field.&lt;/li&gt;&lt;li&gt;    &lt;span style="font-weight: bold;"&gt;Organization&lt;/span&gt;:- It's easier to group all the listeners together with inner classes than with anonymous inner class listeners.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;EXAMPLE No:1 &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;Using One Inner class for different Events&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import java.awt.*;&lt;br /&gt;import java.awt.event.ActionEvent;&lt;br /&gt;import java.awt.event.ActionListener;&lt;br /&gt;&lt;br /&gt;import javax.swing.*;&lt;br /&gt;&lt;br /&gt;/***&lt;br /&gt;*&lt;br /&gt;* @author Sabah u Din Irfan&lt;br /&gt;* @Description ActionListener Example Using Named Inner Classes&lt;br /&gt;*&lt;br /&gt;***/&lt;br /&gt;public class ActionListenerInnerClassDemo extends JFrame{&lt;br /&gt;&lt;br /&gt;JLabel lbl ;&lt;br /&gt;JTextField txt1;&lt;br /&gt;JTextField txt2;&lt;br /&gt;JTextField txt3;&lt;br /&gt;JButton btnAdd;&lt;br /&gt;JButton btnSub;&lt;br /&gt;&lt;br /&gt;ActionListenerInnerClassDemo()&lt;br /&gt;{&lt;br /&gt;// Set Frame Window properties&lt;br /&gt;super("Action Listner Demo!!");&lt;br /&gt;setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);&lt;br /&gt;// Get Container&lt;br /&gt;Container container = getContentPane();&lt;br /&gt;container.setLayout(new FlowLayout());&lt;br /&gt;// Create Components&lt;br /&gt;lbl = new JLabel(" Please Enter two values in text fields:");&lt;br /&gt;txt1 = new JTextField(15);&lt;br /&gt;txt2 = new JTextField(15);&lt;br /&gt;txt3 = new JTextField(15);&lt;br /&gt;btnAdd = new JButton("Add");&lt;br /&gt;btnSub = new JButton("Sub");&lt;br /&gt;// Add Components&lt;br /&gt;&lt;br /&gt;container.add(lbl);&lt;br /&gt;container.add(txt1);&lt;br /&gt;container.add(txt2);&lt;br /&gt;container.add(txt3);&lt;br /&gt;container.add(btnAdd);&lt;br /&gt;container.add(btnSub);&lt;br /&gt;&lt;br /&gt;// Add Action Listners.. Use Annonymous Inner Classes&lt;br /&gt;MyListener listener = new MyListener();&lt;br /&gt;&lt;br /&gt;btnAdd.addActionListener(listener);&lt;br /&gt;btnSub.addActionListener(listener);&lt;br /&gt;&lt;br /&gt;// Make frame visible and set its size&lt;br /&gt;setVisible(true);&lt;br /&gt;pack();&lt;br /&gt;} // end of Constructor&lt;br /&gt;&lt;br /&gt;// Private Named Inner Class to Handle the Events&lt;br /&gt;//////////////////////////////////////////////////////&lt;br /&gt;private class MyListener implements ActionListener&lt;br /&gt;{&lt;br /&gt;     public void actionPerformed(ActionEvent e) {&lt;br /&gt;         if ( e.getSource() == btnAdd)&lt;br /&gt;         {&lt;br /&gt;          int a = Integer.parseInt(txt1.getText());&lt;br /&gt;  int b = Integer.parseInt(txt2.getText());&lt;br /&gt;&lt;br /&gt;  int c = a+b;&lt;br /&gt;&lt;br /&gt;  txt3.setText(c+"");&lt;br /&gt;         }&lt;br /&gt;         else if( e.getSource() == btnSub)&lt;br /&gt;         {&lt;br /&gt;          int a = Integer.parseInt(txt1.getText());&lt;br /&gt;  int b = Integer.parseInt(txt2.getText());&lt;br /&gt;&lt;br /&gt;  int c = a-b;&lt;br /&gt;&lt;br /&gt;  txt3.setText(c+"");&lt;br /&gt;         }&lt;br /&gt;      &lt;br /&gt;     }&lt;br /&gt; }// end named inner class MyListener&lt;br /&gt;/**&lt;br /&gt;* @param args&lt;br /&gt;*/&lt;br /&gt;public static void main(String[] args) {&lt;br /&gt;// TODO Auto-generated method stub&lt;br /&gt; ActionListenerInnerClassDemoframe = new ActionListenerInnerClassDemo();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;EXAMPLE No:2 &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;Using Different Inner classes for different Events&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;import java.awt.*;&lt;br /&gt;import java.awt.event.ActionEvent;&lt;br /&gt;import java.awt.event.ActionListener;&lt;br /&gt;import javax.swing.*;&lt;br /&gt;&lt;br /&gt;/***&lt;br /&gt;*&lt;br /&gt;* @author Sabah u Din Irfan&lt;br /&gt;* @Description ActionListener Example Using Named Inner Classes&lt;br /&gt;*&lt;br /&gt;***/&lt;br /&gt;public class ActionListenerInnerClassDemo extends JFrame{&lt;br /&gt;&lt;br /&gt; JLabel lbl ;&lt;br /&gt; JTextField txt1;&lt;br /&gt; JTextField txt2;&lt;br /&gt; JTextField txt3;&lt;br /&gt; JButton btnAdd;&lt;br /&gt; JButton btnSub;&lt;br /&gt; &lt;br /&gt; ActionListenerInnerClassDemo()&lt;br /&gt; {&lt;br /&gt;  // Set Frame Window properties&lt;br /&gt;  super("Action Listner Demo!!");&lt;br /&gt;  setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);&lt;br /&gt;  // Get Container&lt;br /&gt;  Container container = getContentPane();&lt;br /&gt;  container.setLayout(new FlowLayout());&lt;br /&gt;  // Create Components&lt;br /&gt;  lbl = new JLabel(" Please Enter two values in text fields:");&lt;br /&gt;  txt1 = new JTextField(15);&lt;br /&gt;  txt2 = new JTextField(15);&lt;br /&gt;  txt3 = new JTextField(15);&lt;br /&gt;  btnAdd = new JButton("Add");&lt;br /&gt;  btnSub = new JButton("Sub");&lt;br /&gt;  // Add Components&lt;br /&gt;  &lt;br /&gt;  container.add(lbl);&lt;br /&gt;  container.add(txt1);&lt;br /&gt;  container.add(txt2);&lt;br /&gt;  container.add(txt3);&lt;br /&gt;  container.add(btnAdd);&lt;br /&gt;  container.add(btnSub);&lt;br /&gt;  &lt;br /&gt;  // Add Action Listners.. Use Annonymous Inner Classes&lt;br /&gt;  AddListener addlistener = new AddListener();&lt;br /&gt;  SubListener sublistener = new SubListener();&lt;br /&gt;  &lt;br /&gt;  btnAdd.addActionListener(addlistener);&lt;br /&gt;  btnSub.addActionListener(sublistener);&lt;br /&gt;  &lt;br /&gt;  // Make frame visible and set its size&lt;br /&gt;  setVisible(true);&lt;br /&gt;  pack();&lt;br /&gt;  } // end of Constructor&lt;br /&gt; &lt;br /&gt; // Private Named Inner Classes to Handle the Events&lt;br /&gt; //////////////////////////////////////////////////////&lt;br /&gt; private class AddListener implements ActionListener&lt;br /&gt; {&lt;br /&gt;       public void actionPerformed(ActionEvent e) {&lt;br /&gt;          &lt;br /&gt;            int a = Integer.parseInt(txt1.getText());&lt;br /&gt;    int b = Integer.parseInt(txt2.getText());&lt;br /&gt;    &lt;br /&gt;    int c = a+b;&lt;br /&gt;    &lt;br /&gt;    txt3.setText(c+"");         &lt;br /&gt;       }&lt;br /&gt;   }// end named inner class&lt;br /&gt; private class SubListener implements ActionListener&lt;br /&gt; {&lt;br /&gt;       public void actionPerformed(ActionEvent e) {&lt;br /&gt;          &lt;br /&gt;            int a = Integer.parseInt(txt1.getText());&lt;br /&gt;    int b = Integer.parseInt(txt2.getText());&lt;br /&gt;    &lt;br /&gt;    int c = a - b;&lt;br /&gt;    &lt;br /&gt;    txt3.setText(c+"");         &lt;br /&gt;       }&lt;br /&gt;   }// end named inner class MyListener&lt;br /&gt; /**&lt;br /&gt;  * @param args&lt;br /&gt;  */&lt;br /&gt; public static void main(String[] args) {&lt;br /&gt;  // TODO Auto-generated method stub&lt;br /&gt;  ActionListenerInnerClassDemo frame = new ActionListenerInnerClassDemo();&lt;br /&gt;   &lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-5457970914417382678?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/5457970914417382678/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=5457970914417382678' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/5457970914417382678'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/5457970914417382678'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2009/01/java-named-inner-class-listeners.html' title='JAVA: Named Inner-class Listeners'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-8935501592901360774</id><published>2009-01-14T10:29:00.001-08:00</published><updated>2010-08-25T06:48:29.478-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>JAVA: Anonymous Listeners</title><content type='html'>There is no need to define a named class simply to add a listener object to a button. Java has a somewhat obscure syntax for creating an &lt;i&gt;anonymous innner class&lt;/i&gt; listener that implements an interface.  There is no need to memorize the syntax; just copy and paste it each time.   For example,  &lt;pre style="color: rgb(51, 51, 255);" class="example"&gt;class myPanel extends JPanel {&lt;br /&gt;. . .&lt;br /&gt;   public MyPanel() {&lt;br /&gt;       . . .  //in the constructor&lt;br /&gt;       JButton b1 = new JButton("Hello");&lt;br /&gt;       b1.addActionListener(&lt;br /&gt;           &lt;span class="hilite"&gt;new ActionListener() {&lt;br /&gt;               public void actionPerformed(ActionEvent e) {&lt;br /&gt;                   // do something for button b1&lt;br /&gt;               }&lt;br /&gt;           }&lt;/span&gt;&lt;br /&gt;       );&lt;/pre&gt;   &lt;h2&gt;&lt;span style="font-size:100%;"&gt;Creates a class&lt;/span&gt;&lt;/h2&gt; &lt;p&gt;The above example creates a subclass of &lt;code&gt;Object&lt;/code&gt; that  &lt;code&gt;implements&lt;/code&gt; the &lt;code&gt;ActionListener&lt;/code&gt; interface. The compiler creates names for anonymous classes.  The JDK typically uses the enclosing class name followed by $ followed by a number, eg, you may see a &lt;code&gt;MyPanel$1.class&lt;/code&gt;  file generated by the compiler.  &lt;/p&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-size:100%;" &gt;ActionListener Example Using Anonymous Inner Classes&lt;br /&gt;-------------------------------------------------------------&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="color: rgb(51, 51, 255);" class="example"&gt;&lt;br /&gt;import java.awt.*;&lt;br /&gt;import java.awt.event.ActionEvent;&lt;br /&gt;import java.awt.event.ActionListener;&lt;br /&gt;import javax.swing.*;&lt;br /&gt;&lt;br /&gt;/****&lt;br /&gt; *&lt;br /&gt; * @author Sabah u Din Irfan&lt;br /&gt; * @Description ActionListener Example Using Anonymous Inner Classes&lt;br /&gt; */&lt;br /&gt;public class ActionListnerDemo extends JFrame{&lt;br /&gt;&lt;br /&gt;    JLabel lbl ;&lt;br /&gt;    JTextField txt1;&lt;br /&gt;    JTextField txt2;&lt;br /&gt;    JTextField txt3;&lt;br /&gt;    JButton btnAdd;&lt;br /&gt;    JButton btnSub;&lt;br /&gt;    &lt;br /&gt;    ActionListnerDemo()&lt;br /&gt;    {&lt;br /&gt;        // Set Frame Window properties&lt;br /&gt;        super("Action Listner Demo!!");&lt;br /&gt;        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);&lt;br /&gt;        // Get Container&lt;br /&gt;        Container container = getContentPane();&lt;br /&gt;        container.setLayout(new FlowLayout());&lt;br /&gt;        // Create Components&lt;br /&gt;        lbl = new JLabel(" Please Enter two values in text fields:");&lt;br /&gt;        txt1 = new JTextField(15);&lt;br /&gt;        txt2 = new JTextField(15);&lt;br /&gt;        txt3 = new JTextField(15);&lt;br /&gt;        btnAdd = new JButton("Add");&lt;br /&gt;        btnSub = new JButton("Sub");&lt;br /&gt;        // Add Components&lt;br /&gt;        &lt;br /&gt;        container.add(lbl);&lt;br /&gt;        container.add(txt1);&lt;br /&gt;        container.add(txt2);&lt;br /&gt;        container.add(txt3);&lt;br /&gt;        container.add(btnAdd);&lt;br /&gt;        container.add(btnSub);&lt;br /&gt;        &lt;br /&gt;        // Add Action Listners.. Use Annonymous Inner Classes&lt;br /&gt;        &lt;br /&gt;        btnAdd.addActionListener( new ActionListener() {&lt;br /&gt;            &lt;br /&gt;            public void actionPerformed(ActionEvent e) {&lt;br /&gt;                int a = Integer.parseInt(txt1.getText());&lt;br /&gt;                int b = Integer.parseInt(txt2.getText());&lt;br /&gt;                &lt;br /&gt;                int c = a+b;&lt;br /&gt;                &lt;br /&gt;                txt3.setText(c+"");&lt;br /&gt;                &lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        );&lt;br /&gt;        &lt;br /&gt;        ////////////////////&lt;br /&gt;        btnSub.addActionListener( new ActionListener() {&lt;br /&gt;            &lt;br /&gt;            public void actionPerformed(ActionEvent e) {&lt;br /&gt;                int a = Integer.parseInt(txt1.getText());&lt;br /&gt;                int b = Integer.parseInt(txt2.getText());&lt;br /&gt;                &lt;br /&gt;                int c = a-b;&lt;br /&gt;                &lt;br /&gt;                txt3.setText(c+"");&lt;br /&gt;                &lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        );&lt;br /&gt;        &lt;br /&gt;        // Make frame visible and set its size&lt;br /&gt;        setVisible(true);&lt;br /&gt;        pack();&lt;br /&gt;    }&lt;br /&gt;    /**&lt;br /&gt;     * @param args&lt;br /&gt;     */&lt;br /&gt;    public static void main(String[] args) {&lt;br /&gt;        // TODO Auto-generated method stub&lt;br /&gt;            ActionListnerDemo frame = new ActionListnerDemo();&lt;br /&gt;            &lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-8935501592901360774?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/8935501592901360774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=8935501592901360774' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/8935501592901360774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/8935501592901360774'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2009/01/java-anonymous-listeners.html' title='JAVA: Anonymous Listeners'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-285824565681429810</id><published>2009-01-10T06:21:00.000-08:00</published><updated>2010-08-25T06:48:12.934-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript: Function To Check Whether TextField is ReadOnly</title><content type='html'>The following Javascript function can be used to check whether the given control is read only or not?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Sample 1:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;function isReadOnly()&lt;br /&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;    var m = document.getElementById("TextBox1").getAttribute("Readonly");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;   if (m==true)&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;   {&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;       alert('Read Only!');&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;       return true;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;br /&gt;   }&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;br /&gt;   else&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;br /&gt;   {&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;br /&gt;     alert('Not Read Only');&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;br /&gt;    return false;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;br /&gt;   }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Sample 2:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;function isReadOnly(controlID)&lt;br /&gt;{&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;br /&gt;    var m = document.getElementById(&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;controlID&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;).getAttribute("Readonly");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span style="color: rgb(51, 51, 255);"&gt;   if (m==true)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;   {&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt; &lt;br /&gt;     alert('Read Only!');&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;br /&gt;       return true;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;br /&gt;  }&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;br /&gt;   else&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;br /&gt;   {&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;br /&gt;     alert('Not Read Only');&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;br /&gt;    return false;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;br /&gt;   }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span style="color: rgb(51, 51, 255);"&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-285824565681429810?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/285824565681429810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=285824565681429810' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/285824565681429810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/285824565681429810'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2009/01/javascript-function-to-check-whether.html' title='Javascript: Function To Check Whether TextField is ReadOnly'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-2633268842107203010</id><published>2009-01-09T08:03:00.000-08:00</published><updated>2010-08-25T06:48:01.193-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>JavaScript: Masking on Text Field</title><content type='html'>It is quite often that when we create HTML forms we need masking in fields and most of the times in text fields(Text Boxes) for some specific type of input like for DATE, PHONE NO, CURRENCY etc.  Couple of server side technologies provide built in controls for most common masking but a few does not.&lt;br /&gt;&lt;br /&gt;The following Javascript function provides you the facility to customize you text boxes with specific masking.&lt;br /&gt;&lt;br /&gt;For Example, you may need masking  for data input like : DD/MM/YYYY e.g 31/12/2008&lt;br /&gt;Similarly sometimes you may want to provide masking like: 121-23-1231&lt;br /&gt;and sometimes you may want to provide masking like: 12-42-1412&lt;br /&gt;&lt;br /&gt;The following function is smart enough to handle all these requirements with a little change in the input parameter.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;function mask(str,textbox,loc,delim){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;var locs = loc.split(',');&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;for (var i = 0; i &lt;= locs.length; i++){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;    for (var k = 0; k &lt;= str.length; k++){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;     if (k == locs[i]){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;      if (str.substring(k, k+1) != delim){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;        str = str.substring(0,k) + delim + str.substring(k,str.length)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;      }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;     }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;textbox.value = str&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Where the parameters are for:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;code&gt;str&lt;/code&gt; - the value of the current textbox control,  &lt;/li&gt;&lt;li&gt;&lt;code&gt;textbox&lt;/code&gt; - the actual textbox object, (so that the value can be set)  &lt;/li&gt;&lt;li&gt;&lt;code&gt;loc&lt;/code&gt; - a string of multiple locations to place the specified character,  &lt;/li&gt;&lt;li&gt;&lt;code&gt;delim&lt;/code&gt; - the character (delimiter) that you want to use a separator. &lt;/li&gt;&lt;/ol&gt;&lt;span style="font-weight: bold;"&gt;Examples to Call this function:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 1:&lt;/span&gt;&lt;br /&gt; First of all add this function in the head section.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 2:&lt;/span&gt;&lt;br /&gt;You need to call this function on &lt;span style="font-weight: bold;"&gt;onKeyUp &lt;/span&gt;&amp;amp; &lt;span style="font-weight: bold;"&gt;onBlur &lt;/span&gt;events like:&lt;br /&gt;&lt;br /&gt;To provide the output like(121-23-1231): &lt;input name="Field1" type="text" onkeyup="javascript:return mask(this.value,this,'3,6','-');" onblur="javascript:return mask(this.value,this,'3,6','-');" style="font-family:verdana;font-size:10pt;width:110px;" maxlength="11" value ="121-23-1231"&gt;&lt;br /&gt;&lt;br /&gt;You need to call this javascript function like:&lt;br /&gt;&lt; name="Field1" value="" type="text" onkeyup="javascript:return mask(this.value,this,'3,6','-');" onblur="javascript:return mask(this.value,this,'3,6','-');" style="font-family:verdana;font-size:10pt;width:110px;" maxlength="11"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To provide the output like(21/12/2009): &lt;input name="Field2" value="21/12/2009" type="text" onkeyup="javascript:return mask(this.value,this,'2,5','/');" onblur="javascript:return mask(this.value,this,'2,5','/');" style="font-family:verdana;font-size:10pt;width:110px;" maxlength="10"&gt;&lt;br /&gt;&lt;br /&gt;You need to call this javascript function like:&lt;br /&gt;&lt; name="Field2" value="" type="text" onkeyup="javascript:return mask(this.value,this,'2,5','/');" onblur="javascript:return mask(this.value,this,'2,5','/');" style="font-family:verdana;font-size:10pt;width:110px;" maxlength="10"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To provide the output like(12,23,2312): &lt;input name="Field3" value="12,23,2312" type="text" onkeyup="javascript:return mask(this.value,this,'2,5',',');" onblur="javascript:return mask(this.value,this,'2,5','-');" style="font-family:verdana;font-size:10pt;width:110px;" maxlength="10"&gt;&lt;br /&gt; &lt;br /&gt; You need to call this javascript function like:&lt;br /&gt;&lt; name="Field3" value="" type="text" onkeyup="javascript:return mask(this.value,this,'2,5',',');" onblur="javascript:return mask(this.value,this,'2,5',',');" style="font-family:verdana;font-size:10pt;width:110px;" maxlength="10"&gt;&lt;br /&gt;&lt;br /&gt; To provide the output like(12#32#1312): &lt;input name="Field3" value="12#32#1312" type="text" onkeyup="javascript:return mask(this.value,this,'2,5','#');" onblur="javascript:return mask(this.value,this,'2,5','#');" style="font-family:verdana;font-size:10pt;width:110px;" maxlength="10"&gt;&lt;br /&gt;  &lt;br /&gt;  You need to call this javascript function like:&lt;br /&gt;&lt; name="Field3" value="12#32#1312" type="text" onkeyup="javascript:return mask(this.value,this,'2,5','#');" onblur="javascript:return mask(this.value,this,'2,5','#');" style="font-family:verdana;font-size:10pt;width:110px;" maxlength="10"&gt;&lt;br /&gt;&lt;br /&gt;You may change your mask symbol and the places accordingly using the provided parameters.&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-2633268842107203010?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/2633268842107203010/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=2633268842107203010' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/2633268842107203010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/2633268842107203010'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2009/01/javascript-masking-on-text-field.html' title='JavaScript: Masking on Text Field'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-5940222141035349396</id><published>2009-01-08T07:59:00.002-08:00</published><updated>2010-08-25T06:47:45.232-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript: Function To Validate Date Format DD/MM/YYYY</title><content type='html'>Please use the following java script to validate the Date in the format(DD/MM/YYYY) wherever you needed in transcription screens:&lt;br /&gt;&lt;br /&gt;Place this code in the head section of your HTML/JSP and pass the value(12/12/2008) to function named as validateDateDDMMYYY(‘12/12/2008’)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function validateDateDDMMYYY(DateOfBirth)&lt;br /&gt;  {&lt;br /&gt;&lt;br /&gt;   var Char1 = DateOfBirth.charAt(2);&lt;br /&gt;   var Char2 = DateOfBirth.charAt(5);&lt;br /&gt;   //    alert(Char1);    alert(Char2);&lt;br /&gt;&lt;br /&gt;   var flag =false;&lt;br /&gt; &lt;br /&gt;   if ( Char1 =='/' &amp;amp;&amp;amp; Char2 == '/' )&lt;br /&gt;    {&lt;br /&gt;       //       alert ('valid positions of non numeric characters.');&lt;br /&gt;       flag = true;&lt;br /&gt;    }&lt;br /&gt;    else&lt;br /&gt;    {&lt;br /&gt;       //      alert('invalid position of non numeric symbols');&lt;br /&gt;       flag =false;&lt;br /&gt;    }&lt;br /&gt;     &lt;br /&gt;    var day;&lt;br /&gt;    var month;&lt;br /&gt;    var year;&lt;br /&gt;  &lt;br /&gt;    day = DateOfBirth.substring(0,2);&lt;br /&gt;    month = DateOfBirth.substring(3,5);&lt;br /&gt;     year = DateOfBirth.substring(6,10);&lt;br /&gt;  &lt;br /&gt;//     alert(day); alert(month);alert(year);&lt;br /&gt;    if( validDay(day) &amp;amp;&amp;amp; validMonth(month) &amp;amp;&amp;amp; validYear(year) &amp;amp;&amp;amp; (flag ==true) )&lt;br /&gt;    {&lt;br /&gt;     // alert(' Valid Date')&lt;br /&gt;     return true;&lt;br /&gt;    }&lt;br /&gt;     else&lt;br /&gt;    {&lt;br /&gt;      alert('Invalid  Date Format: Please enter DD/MM/YYYY for Date of Birth!');&lt;br /&gt;      return false;&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt; } // end func&lt;br /&gt;&lt;br /&gt;function IsNumeric(sText)&lt;br /&gt;{&lt;br /&gt;   var ValidChars = "0123456789.";&lt;br /&gt;   var IsNumber=true;&lt;br /&gt;   var Char;&lt;br /&gt;     &lt;br /&gt;   for (i = 0; i &lt; sText.length &amp;amp;&amp;amp; IsNumber == true; i++)    &lt;br /&gt;{    &lt;br /&gt;        Char = sText.charAt(i);    &lt;br /&gt;         if (ValidChars.indexOf(Char) == -1)    &lt;br /&gt;          {    &lt;br /&gt;              IsNumber = false;    &lt;br /&gt;          }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; return IsNumber;  &lt;br /&gt;} // end func      &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function validDay(day)  &lt;br /&gt;{    &lt;br /&gt;        if ( IsNumeric(day) )    &lt;br /&gt;            {&lt;br /&gt;                   if( day &gt;0 &amp;amp;&amp;amp; day &lt;32)        &lt;br /&gt;                     {         &lt;br /&gt;                        return true;        &lt;br /&gt;                     }&lt;br /&gt;                     else&lt;br /&gt;                    {          &lt;br /&gt;                       return false;        &lt;br /&gt;                    }&lt;br /&gt;           }&lt;br /&gt;         else     &lt;br /&gt;          {&lt;br /&gt;             return false;&lt;br /&gt;           }&lt;br /&gt;  &lt;br /&gt;    }// end func    &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function validMonth(month)  &lt;br /&gt; {&lt;br /&gt;         if ( IsNumeric(month) )    &lt;br /&gt;           {       &lt;br /&gt;                 if( month &gt;0 &amp;amp;&amp;amp; month &lt;13)        &lt;br /&gt;                     {         &lt;br /&gt;                            return true;        &lt;br /&gt;                       }&lt;br /&gt;                  else        &lt;br /&gt;                     {          &lt;br /&gt;                           return false;        &lt;br /&gt;                      }         &lt;br /&gt;           }&lt;br /&gt;           else     &lt;br /&gt;           {      &lt;br /&gt;               return false;     &lt;br /&gt;            }&lt;br /&gt;  }// end func    &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function validYear(year)  &lt;br /&gt; {      &lt;br /&gt;            var d = new Date();      &lt;br /&gt;            var currentYear = d.getFullYear();            &lt;br /&gt;&lt;br /&gt;           if( year.length!= 4)       {                return false;        }          &lt;br /&gt;&lt;br /&gt;         if ( IsNumeric(year) )&lt;br /&gt;         {       &lt;br /&gt;                 if( year &gt;0 &amp;amp;&amp;amp; year &lt;=currentYear)&lt;br /&gt;                  {&lt;br /&gt;                      return true;&lt;br /&gt;                   }&lt;br /&gt;                  else&lt;br /&gt;                  {&lt;br /&gt;                      return false;&lt;br /&gt;                   }&lt;br /&gt;  &lt;br /&gt;          }&lt;br /&gt;          else&lt;br /&gt;         {&lt;br /&gt;             return false;&lt;br /&gt;          }&lt;br /&gt; &lt;br /&gt; }// end func&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-5940222141035349396?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/5940222141035349396/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=5940222141035349396' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/5940222141035349396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/5940222141035349396'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2009/01/javascript-function-to-validate-date.html' title='Javascript: Function To Validate Date Format DD/MM/YYYY'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-5137901813484610146</id><published>2009-01-08T07:59:00.001-08:00</published><updated>2010-08-25T06:50:54.975-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript: Function To Validate Date Format DD/MM/YYYY</title><content type='html'>unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:lsdexception&gt; &lt;/w:lsdexception&gt;&lt;!--[endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face  {font-family:"Cambria Math";  panose-1:2 4 5 3 5 4 6 3 2 4;  mso-font-charset:1;  mso-generic-font-family:roman;  mso-font-format:other;  mso-font-pitch:variable;  mso-font-signature:0 0 0 0 0 0;} @font-face  {font-family:Calibri;  panose-1:2 15 5 2 2 2 4 3 2 4;  mso-font-charset:0;  mso-generic-font-family:swiss;  mso-font-pitch:variable;  mso-font-signature:-1610611985 1073750139 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal  {mso-style-unhide:no;  mso-style-qformat:yes;  mso-style-parent:"";  margin:0in;  margin-bottom:.0001pt;  mso-pagination:widow-orphan;  font-size:11.0pt;  font-family:"Calibri","sans-serif";  mso-ascii-font-family:Calibri;  mso-ascii-theme-font:minor-latin;  mso-fareast-font-family:Calibri;  mso-fareast-theme-font:minor-latin;  mso-hansi-font-family:Calibri;  mso-hansi-theme-font:minor-latin;  mso-bidi-font-family:"Times New Roman";  mso-bidi-theme-font:minor-bidi;} span.EmailStyle15  {mso-style-type:personal;  mso-style-noshow:yes;  mso-style-unhide:no;  mso-ansi-font-size:11.0pt;  mso-bidi-font-size:11.0pt;  font-family:"Calibri","sans-serif";  mso-ascii-font-family:Calibri;  mso-ascii-theme-font:minor-latin;  mso-fareast-font-family:Calibri;  mso-fareast-theme-font:minor-latin;  mso-hansi-font-family:Calibri;  mso-hansi-theme-font:minor-latin;  mso-bidi-font-family:"Times New Roman";  mso-bidi-theme-font:minor-bidi;  color:windowtext;} .MsoChpDefault  {mso-style-type:export-only;  mso-default-props:yes;  mso-ascii-font-family:Calibri;  mso-ascii-theme-font:minor-latin;  mso-fareast-font-family:Calibri;  mso-fareast-theme-font:minor-latin;  mso-hansi-font-family:Calibri;  mso-hansi-theme-font:minor-latin;  mso-bidi-font-family:"Times New Roman";  mso-bidi-theme-font:minor-bidi;} @page Section1  {size:8.5in 11.0in;  margin:1.0in 1.0in 1.0in 1.0in;  mso-header-margin:.5in;  mso-footer-margin:.5in;  mso-paper-source:0;} div.Section1  {page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable  {mso-style-name:"Table Normal";  mso-tstyle-rowband-size:0;  mso-tstyle-colband-size:0;  mso-style-noshow:yes;  mso-style-priority:99;  mso-style-qformat:yes;  mso-style-parent:"";  mso-padding-alt:0in 5.4pt 0in 5.4pt;  mso-para-margin:0in;  mso-para-margin-bottom:.0001pt;  mso-pagination:widow-orphan;  font-size:11.0pt;  font-family:"Calibri","sans-serif";  mso-ascii-font-family:Calibri;  mso-ascii-theme-font:minor-latin;  mso-fareast-font-family:"Times New Roman";  mso-fareast-theme-font:minor-fareast;  mso-hansi-font-family:Calibri;  mso-hansi-theme-font:minor-latin;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class="MsoNormal"&gt;Pleas&lt;b style=""&gt;&lt;i style=""&gt;&lt;font style="" size="10" face="&amp;quot;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;function validateDateDDMMYYY(DateOfBirth)&lt;br /&gt;  {&lt;br /&gt;&lt;br /&gt;   var Char1 = DateOfBirth.charAt(2);&lt;br /&gt;   var Char2 = DateOfBirth.charAt(5);&lt;br /&gt;   //    alert(Char1);    alert(Char2);&lt;br /&gt;&lt;br /&gt;   var flag =false;&lt;br /&gt; &lt;br /&gt;   if ( Char1 =='/' &amp;amp;&amp;amp; Char2 == '/' )&lt;br /&gt;    {&lt;br /&gt;       //       alert ('valid positions of non numeric characters.');&lt;br /&gt;       flag = true;&lt;br /&gt;    }&lt;br /&gt;    else&lt;br /&gt;    {&lt;br /&gt;       //      alert('invalid position of non numeric symbols');&lt;br /&gt;       flag =false;&lt;br /&gt;    }&lt;br /&gt;     &lt;br /&gt;    var day;&lt;br /&gt;    var month;&lt;br /&gt;    var year;&lt;br /&gt;  &lt;br /&gt;    day = DateOfBirth.substring(0,2);&lt;br /&gt;    month = DateOfBirth.substring(3,5);&lt;br /&gt;     year = DateOfBirth.substring(6,10);&lt;br /&gt;  &lt;br /&gt;//     alert(day); alert(month);alert(year);&lt;br /&gt;    if( validDay(day) &amp;amp;&amp;amp; validMonth(month) &amp;amp;&amp;amp; validYear(year) &amp;amp;&amp;amp; (flag ==true) )&lt;br /&gt;    {&lt;br /&gt;     // alert(' Valid Date')&lt;br /&gt;     return true;&lt;br /&gt;    }&lt;br /&gt;     else&lt;br /&gt;    {&lt;br /&gt;      alert('Invalid  Date Format: Please enter DD/MM/YYYY for Date of Birth!');&lt;br /&gt;      return false;&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt; } // end func&lt;br /&gt;&lt;br /&gt;function IsNumeric(sText)&lt;br /&gt;{&lt;br /&gt;   var ValidChars = "0123456789.";&lt;br /&gt;   var IsNumber=true;&lt;br /&gt;   var Char;&lt;br /&gt;     &lt;br /&gt;   for (i = 0; i &lt; sText.length &amp;amp;&amp;amp; IsNumber == true; i++)     {     Char = sText.charAt(i);     if (ValidChars.indexOf(Char) == -1)     {     IsNumber = false;     }     }     return IsNumber;   } // end func       function validDay(day)   {     if ( IsNumeric(day) )     {        if( day &gt;0 &amp;amp;&amp;amp; day &lt;32)         {          return true;         }         else         {           return false;         }          }      else      {       return false;      }       }// end func     function validMonth(month)   {     if ( IsNumeric(month) )     {        if( month &gt;0 &amp;amp;&amp;amp; month &lt;13)         {          return true;         }         else         {           return false;         }          }      else      {       return false;      }       }// end func     function validYear(year)   {       var d = new Date();       var currentYear = d.getFullYear();             if( year.length!= 4)       {               return false;       }           if ( IsNumeric(year) )     {        if( year &gt;0 &amp;amp;&amp;amp; year &lt;=currentYear)&lt;br /&gt;       {&lt;br /&gt;        return true;&lt;br /&gt;       }&lt;br /&gt;       else&lt;br /&gt;       {&lt;br /&gt;         return false;&lt;br /&gt;       }&lt;br /&gt;  &lt;br /&gt;   }&lt;br /&gt;    else&lt;br /&gt;    {&lt;br /&gt;     return false;&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt; }// end func&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-5137901813484610146?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/5137901813484610146/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=5137901813484610146' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/5137901813484610146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/5137901813484610146'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2009/01/javascript-function-to-validate-date_08.html' title='Javascript: Function To Validate Date Format DD/MM/YYYY'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-3687946037081176281</id><published>2009-01-03T07:57:00.000-08:00</published><updated>2010-08-25T06:51:26.754-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL Server: WAITFOR TIME Statement</title><content type='html'>WAITFOR TIME SQL statement is used to set the particular time to execute the next query/SQL statement.&lt;br /&gt;&lt;br /&gt;For Example the second query will execute when the particular time will be reached:&lt;br /&gt;&lt;br /&gt;&lt;code style="font-size: 12px;"&gt;&lt;span style="color: blue;"&gt;DECLARE &lt;/span&gt;&lt;span style="color: rgb(67, 67, 67);"&gt;@MyDateTime &lt;/span&gt;&lt;span style="color: black;"&gt;DATETIME&lt;br /&gt;&lt;/span&gt;&lt;span style="color: green;"&gt;/* Add 5 seconds to current &lt;wbr&gt;time so&lt;br /&gt;system waits for 15 seconds*/&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;SET &lt;/span&gt;&lt;span style="color: rgb(67, 67, 67);"&gt;@MyDateTime &lt;/span&gt;&lt;span style="color: blue;"&gt;= &lt;/span&gt;&lt;span style="color: magenta;"&gt;DATEADD&lt;/span&gt;&lt;span style="color: gray;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;s&lt;/span&gt;&lt;span style="color: gray;"&gt;,&lt;/span&gt;&lt;span style="color: black;"&gt;15&lt;/span&gt;&lt;span style="color: gray;"&gt;,&lt;/span&gt;&lt;span style="color: magenta;"&gt;GETDATE&lt;/span&gt;&lt;span style="color: gray;"&gt;())&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;SELECT &lt;/span&gt;&lt;span style="color: magenta;"&gt;GETDATE&lt;/span&gt;&lt;span style="color: gray;"&gt;() &lt;/span&gt;&lt;span style="color: black;"&gt;CurrentTime&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;WAITFOR &lt;/span&gt;&lt;span style="color: black;"&gt;TIME &lt;/span&gt;&lt;span style="color: rgb(67, 67, 67);"&gt;@MyDateTime&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;SELECT &lt;/span&gt;&lt;span style="color: magenta;"&gt;GETDATE&lt;/span&gt;&lt;span style="color: gray;"&gt;() &lt;/span&gt;&lt;span style="color: black;"&gt;CurrentTime&lt;/span&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-3687946037081176281?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/3687946037081176281/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=3687946037081176281' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/3687946037081176281'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/3687946037081176281'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2009/01/sql-server-waitfor-time-statement.html' title='SQL Server: WAITFOR TIME Statement'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-2043794270606844382</id><published>2009-01-03T07:54:00.000-08:00</published><updated>2010-08-25T06:51:45.583-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL Server: WAITFOR DELAY Statement to set Delay in Queries</title><content type='html'>WAITFOR DELAY statement is used in T-SQL to set the delay time between the SQL queries. For example the second query will execute after 10 seconds of delay:&lt;br /&gt;&lt;br /&gt;&lt;p style="text-align: justify;"&gt;&lt;code style="font-size: 12px;"&gt;&lt;span style="color: blue;"&gt;SELECT &lt;/span&gt;&lt;span style="color: magenta;"&gt;GETDATE&lt;/span&gt;&lt;span style="color: gray;"&gt;() &lt;/span&gt;&lt;span style="color: black;"&gt;CurrentTime&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;WAITFOR &lt;/span&gt;&lt;span style="color: black;"&gt;DELAY &lt;/span&gt;&lt;span style="color: red;"&gt;‘00:00:10′ &lt;/span&gt;&lt;span style="color: green;"&gt;—- 10 Second Delay&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;SELECT &lt;/span&gt;&lt;span style="color: magenta;"&gt;GETDATE&lt;/span&gt;&lt;span style="color: gray;"&gt;() &lt;/span&gt;&lt;span style="color: black;"&gt;CurrentTime&lt;/span&gt;&lt;/code&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-2043794270606844382?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/2043794270606844382/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=2043794270606844382' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/2043794270606844382'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/2043794270606844382'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2009/01/sql-server-waitfor-delay-statement-to.html' title='SQL Server: WAITFOR DELAY Statement to set Delay in Queries'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-608320066588575084</id><published>2008-11-20T07:32:00.000-08:00</published><updated>2010-08-25T06:52:04.197-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript: Making Initial Letter Capital for text box</title><content type='html'>Following script will work to make the initial letter in your text box automatically.&lt;br /&gt;&lt;br /&gt;I have placed this in onKeyup event, you can use it according to your own requirements.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;onkeyup=&lt;br /&gt;"this.value=this.value.substring(0,1).toUpperCase()&lt;br /&gt;+this.value.substring(1,this.value.length)"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here is the example:&lt;br /&gt;&lt;br /&gt;&lt;input name="txtFName" value="Enter text Here..." onkeyup="this.value=this.value.substring(0,1).toUpperCase()+this.value.substring(1,this.value.length)" type="text"&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-608320066588575084?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/608320066588575084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=608320066588575084' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/608320066588575084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/608320066588575084'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2008/11/javascript-making-initial-letter.html' title='Javascript: Making Initial Letter Capital for text box'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-8704195166641636991</id><published>2008-11-13T05:01:00.000-08:00</published><updated>2010-08-25T06:52:20.974-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>JavaScript: Function To Check Whether provided string contains some wildcard character</title><content type='html'>The following function returns true if the string value contains the specific wild-card character.&lt;br /&gt;&lt;br /&gt;Parameters:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1- fieldValue -- String &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;     It is a string that needs to be checked whether it contains some special/wildcard characters&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;2- wildChar -- String/ Single Char&lt;/span&gt;&lt;br /&gt;It is a character that you want to search whether it is present in the string passed as first parameter of this function.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;function containsWildCard(fieldValue, wildChar)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;  &lt;span style="color: rgb(0, 153, 0);"&gt;//   var fieldValue =  window.document.getElementById("fieldID").value;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;            if (fieldValue.split(wildChar).length &gt; 1)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;         {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;                alert ("WildCard!");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;                return false;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;         }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;         else&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;                 alert ("No - WildCard!");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;                 return true;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;         }&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt; }&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-8704195166641636991?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/8704195166641636991/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=8704195166641636991' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/8704195166641636991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/8704195166641636991'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2008/11/javascript-function-to-check-whether.html' title='JavaScript: Function To Check Whether provided string contains some wildcard character'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-1254675716194324495</id><published>2008-11-03T04:50:00.000-08:00</published><updated>2010-08-25T06:53:08.880-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript: Function To Get Currrent Time</title><content type='html'>function &lt;span style="font-weight:bold;"&gt;getCurrentTime&lt;/span&gt;()&lt;br /&gt;  {&lt;br /&gt;  var d = new Date();&lt;br /&gt;  &lt;br /&gt;  var hour=d.getHours();&lt;br /&gt;  var minute=d.getMinutes();&lt;br /&gt;  var second=d.getSeconds();&lt;br /&gt;  &lt;br /&gt;  if(hour&lt;10)&lt;br /&gt;  {&lt;br /&gt;  hour = '0'+hour;&lt;br /&gt;  }&lt;br /&gt;  if(minute&lt;10)&lt;br /&gt;  {&lt;br /&gt;  minute= '0'+minute;&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  if(second&lt;10)&lt;br /&gt;  {&lt;br /&gt;  second= '0'+second;&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  var time =hour+':'+minute+':'+second&lt;br /&gt;&lt;br /&gt;   return time;&lt;br /&gt;   }&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-1254675716194324495?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/1254675716194324495/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=1254675716194324495' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/1254675716194324495'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/1254675716194324495'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2008/11/javascript-function-to-get-currrent.html' title='Javascript: Function To Get Currrent Time'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-9020356798309299759</id><published>2008-10-16T06:40:00.000-07:00</published><updated>2010-08-25T06:53:37.215-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>JAVA Certification Track Summary</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;span style="font-size:180%;"&gt;JAVA Certification Track&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_4f1LhtA4Gj0/SPdpxAKgysI/AAAAAAAAADQ/YfL0sAcSLQ8/s1600-h/certpathJava.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_4f1LhtA4Gj0/SPdpxAKgysI/AAAAAAAAADQ/YfL0sAcSLQ8/s320/certpathJava.gif" alt="" id="BLOGGER_PHOTO_ID_5257787380556942018" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1. Sun Certified Associate for the Java Platform, Exam Version  1.0 (CX-310-019)&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Delivered at: Authorized Prometric Testing Centers  &lt;/li&gt;&lt;li&gt;Prerequisites: None  &lt;/li&gt;&lt;li&gt;Other exams/assignments required for this certification: None  &lt;/li&gt;&lt;li&gt;Exam type: Multiple choice and Drag and Drop  &lt;/li&gt;&lt;li&gt;Number of questions: 51  &lt;/li&gt;&lt;li&gt;Pass score: 68% (35 of 51 questions)  &lt;/li&gt;&lt;li&gt;Time limit: 115 &lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;2. Sun Certified Java Programmer, Standard Edition 6 (CX-310-065)&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Delivered at: Authorized Worldwide Prometric Testing Centers  &lt;/li&gt;&lt;li&gt;Prerequisites: None  &lt;/li&gt;&lt;li&gt;Other exams/assignments required for this certification: None  &lt;/li&gt;&lt;li&gt;Exam type: Multiple choice and drag and drop  &lt;/li&gt;&lt;li&gt;Number of questions: 72  &lt;/li&gt;&lt;li&gt;Pass score: 65% (47 of 72 questions)  &lt;/li&gt;&lt;li&gt;Time limit: 210 minutes &lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;3.  Sun Certified Web Component Developer &lt;/span&gt;(SCWCD)&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Delivered at: Delivered at: Authorized Worldwide Prometric Testing Centers&lt;/li&gt;&lt;li&gt;Prerequisites: Sun Certified Programmer for the Java Platform (any edition)&lt;/li&gt;&lt;li&gt;Exam type: Multiple Choice and Drag and Drop&lt;/li&gt;&lt;li&gt;Number of questions: 69&lt;/li&gt;&lt;li&gt;Pass score: 70% (49 of 69 questions)&lt;/li&gt;&lt;li&gt;Time limit: 180 minutes&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;4. Sun Certified Business Component Developer (SCWCD)&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Delivered at: Authorized Worldwide Prometric Testing Centers&lt;/li&gt;&lt;li&gt;Prerequisites: Sun Certified Programmer for the Java 2 Platform (any edition)&lt;/li&gt;&lt;li&gt;Exam type: Multiple-Choice, Scenario-based questions and Drag-and-Drop questions&lt;/li&gt;&lt;li&gt;Number of questions: 61&lt;/li&gt;&lt;li&gt;Pass score: 59% (36 of 61 questions)&lt;/li&gt;&lt;li&gt;Time limit: 145 minutes&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;5. Sun Certified Developer for Java Web Services (SCDJWS)&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Delivered at: Authorized Worldwide Prometric Testing Centers&lt;/li&gt;&lt;li&gt;Prerequisites: Sun Certified Programmer for the Java 2 Platform (any edition)&lt;/li&gt;&lt;li&gt;Other exams/assignments required for this certification: None&lt;/li&gt;&lt;li&gt;Exam type: Multiple choice, drag and drop&lt;/li&gt;&lt;li&gt;Number of questions: 69&lt;/li&gt;&lt;li&gt;Pass score: 68% (47 items of 69 questions)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Time limit: 150 minutes&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;6. Sun Certified Mobile Application Developer (SCMAD)&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Delivered at: Authorized Worldwide Prometric Testing Centers&lt;/li&gt;&lt;li&gt;Prerequisites: Sun Certified Programmer for the Java 2 Platform (any edition)&lt;/li&gt;&lt;li&gt;Exam type: Multiple choice, drag and drop&lt;/li&gt;&lt;li&gt;Number of questions: 68&lt;/li&gt;&lt;li&gt;Pass score: 55% (38 items of 68)&lt;/li&gt;&lt;li&gt;Time limit: 150 minutes&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;7. Sun certified Java Developer (SCJD)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This exam consists of two parts first part is an programming assignment. The scale of the assignment can be imagined by the lines of code; roughly this assignment consists of 3500 lines of code.&lt;br /&gt;&lt;br /&gt;The second part of this exam is an essay type consisting of four different questions that are related from your programming assignment of part one.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;PART ONE:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Delivered at: CertManager database&lt;/li&gt;&lt;li&gt;Prerequisites: Must be Sun Certified Programmer for the Java Platform (any edition)&lt;/li&gt;&lt;li&gt;Other exams/assignments required for this certification: Step 2 (CX-310-027)&lt;/li&gt;&lt;li&gt;Exam type: Programming assignment&lt;/li&gt;&lt;li&gt;Number of questions: N/A&lt;/li&gt;&lt;li&gt;Pass score: 320 points out of 400 possible points *&lt;/li&gt;&lt;li&gt;Time limit: None&lt;/li&gt;&lt;/ul&gt;&lt;b&gt;Categories&lt;/b&gt; - &lt;b&gt;Maximum points&lt;/b&gt;&lt;br /&gt;&lt;br /&gt; General Considerations - 80&lt;br /&gt;  Documentation - 50&lt;br /&gt;  Object-Oriented Design - 50&lt;br /&gt;  GUI - 70&lt;br /&gt;  Locking - 80&lt;br /&gt;  Language Fluency - 70&lt;br /&gt;&lt;br /&gt;&lt;b&gt;APIs relevant to the assignment&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Thread handling and synchronization&lt;/li&gt;&lt;li&gt;Swing (and AWT to the extent necessary to support Swing)&lt;/li&gt;&lt;li&gt;Standard file IO (java.io, not java.nio)&lt;/li&gt;&lt;li&gt;Either: Socket-based network programming and serialization _or_ Java RMI (Java Remote Method Invocation) (your choice of one or the other, not both)&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;APIs and facilities may not be used:&lt;/span&gt;  &lt;ul&gt;&lt;li&gt;Enterprise JavaBeans&lt;/li&gt;&lt;li&gt;Servlets, JSP technology, or any other web-oriented APIs&lt;/li&gt;&lt;li&gt;NIO, the New IO facilities&lt;/li&gt;&lt;li&gt;Java DataBase Connectivity (JDBC) and SQL&lt;/li&gt;&lt;li&gt;Java IDL API and CORBA&lt;/li&gt;&lt;li&gt;Third party software libraries or tools (such as browsers)&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;PART TWO:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Delivered at: Authorized Prometric testing centers&lt;/li&gt;&lt;li&gt;Prerequisites: Must be Sun Certified Programmer for the Java Platform (any edition) Completion of Step 1 (CX-310-252A)&lt;/li&gt;&lt;li&gt;Other exams/assignments required for this certification: Step 1 (CX-310-252A)&lt;/li&gt;&lt;li&gt;Exam type: Essay&lt;/li&gt;&lt;li&gt;Number of questions: 4&lt;/li&gt;&lt;li&gt;Pass score: Subject to the evaluation of the essay exam and validation of the&lt;/li&gt;&lt;li&gt;Time limit: 120 minutes&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-9020356798309299759?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/9020356798309299759/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=9020356798309299759' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/9020356798309299759'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/9020356798309299759'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2008/10/java-certification-track-summary.html' title='JAVA Certification Track Summary'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_4f1LhtA4Gj0/SPdpxAKgysI/AAAAAAAAADQ/YfL0sAcSLQ8/s72-c/certpathJava.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-8060360784634263161</id><published>2008-09-01T09:32:00.000-07:00</published><updated>2010-08-25T06:53:54.125-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>JavaScript: Ways to Hit Server Side using JavaScript</title><content type='html'>There are three ways to hit the server side application using JavaScript that may be some servlet/JSP/CGI Script. Following are the ways:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Use AJAX to hit the Server Side. You can get the details on this from following post: &lt;a href="http://www.codeproject.com/KB/ajax/SimpleAJAX.aspx"&gt;http://www.codeproject.com/KB/ajax/SimpleAJAX.aspx&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Second way is to submit the form data using the JavaScript. Following sample JavaScript function will perform the required task. Make sure you place this function in your HEAD tag of HTML in a script tag.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    function goForward()     {&lt;br /&gt;        // alert ("Go Forward ..... ");&lt;br /&gt;        frm=document.forms[0];&lt;br /&gt;        frm.method="GET"; // POST&lt;br /&gt;          &lt;br /&gt;        frm.action="ServerSidePage.jsp";//Some servlet/Some CGI Script/URL        &lt;br /&gt;         frm.submit();    &lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;        3. You can use the &lt;span style="font-weight: bold;"&gt;"document.location.href", &lt;/span&gt;and you can specify the server side path of any servlet/JSP/ CGI Script/ Other URL.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Example No:1&lt;br /&gt;&lt;/span&gt;The&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;following code&lt;span style="font-weight: bold;"&gt;&lt;/span&gt; segment will display an button on your page and when u will click on it, it will open the Google page.&lt;br /&gt;&lt;br /&gt;"&lt; i n p u t name="myButt" value="Call Server Side" onclick="document.location.href='http://www.google.com'" type="button" &gt;&lt;br /&gt;&lt;br /&gt;This  example will look like this:&lt;br /&gt;&lt;input name="myButt" value="Call Server Side" onclick="document.location.href='http://www.google.com'" type="button"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Example No:2&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;In this example, we select the an item from the drop down list and it will go to the page that you have specified in the value of selected option.&lt;br /&gt;&lt;br /&gt;Place the following method in your HEAD section of HTML:&lt;br /&gt;&lt;br /&gt;function callURL()&lt;br /&gt;  {&lt;br /&gt;      document.location.href= document.formName.SelectListID.options[document.formName.SelectListID.selectedIndex].value&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Andplace the following code in body section of your HTML:&lt;br /&gt;&lt;br /&gt;"&lt;br /&gt;&lt; f o r m name="formName"&gt;&lt;br /&gt;&lt; s e l e c t name="SelectListID" onchange="callURL();"&gt; &lt; o p t i o n value="http://www.sabahmyrsh.blogspost.com" select e d="selected"&gt;select an item from List:&lt;/ o p t ion&gt;&lt; o p t i o n value="http://www.alislam.org"&gt;AlIslam&lt;/o p t i o n &gt;&lt;option value="http://www.uet.edu.pk"&gt;UET Lahore&lt;/ o p t i o n &gt;&lt; o p t i o n value="http://www.sabahmyrsh.blogspost.com"&gt;Sabah Myrsh&lt;/ o ption&gt;&lt; o ption value="http://www.localhost:8080/servlet/myservlet"&gt;Some Servlet&lt;/ o ption&gt;&lt; o ption value="http://www.localhost:8080/JSP/myswebpage.jsp"&gt;Some JSP&lt;/ o ption&gt;&lt; / s e l e c t&gt;&lt;br /&gt;&lt;br /&gt;&lt; / f o r m&gt;&lt;br /&gt;"&lt;br /&gt;This example will look like this:&lt;br /&gt;&lt;br /&gt;&lt;form name="formName"&gt;&lt;br /&gt;&lt;select name="SelectListID" onchange="callURL();"&gt;&lt;option value="http://www.sabahmyrsh.blogspost.com" selected="selected"&gt;select an item from List:&lt;/option&gt;&lt;option value="http://www.alislam.org"&gt;AlIslam&lt;/option&gt;&lt;option value="http://www.uet.edu.pk"&gt;UET Lahore&lt;/option&gt;&lt;option value="http://www.sabahmyrsh.blogspost.com"&gt;Sabah Myrsh&lt;/option&gt;&lt;option value="http://www.localhost:8080/servlet/myservlet"&gt;Some Servlet&lt;/option&gt;&lt;option value="http://www.localhost:8080/JSP/myswebpage.jsp"&gt;Some JSP&lt;/option&gt;&lt;/select&gt;&lt;br /&gt;&lt;br /&gt;&lt;/form&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-8060360784634263161?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/8060360784634263161/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=8060360784634263161' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/8060360784634263161'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/8060360784634263161'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2008/09/javascript-ways-to-hit-server-side.html' title='JavaScript: Ways to Hit Server Side using JavaScript'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-8958548761306287110</id><published>2008-08-22T11:02:00.000-07:00</published><updated>2010-08-25T06:54:08.246-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript function similar to Sleep of JAVA</title><content type='html'>Here is a Javascript function that works similar to the &lt;span style="color: rgb(0, 153, 0); font-weight: bold;"&gt;Thread.sleep(milliseconds)&lt;/span&gt; method of JAVA.&lt;br /&gt;&lt;br /&gt;The code of the JavaScript function is as under:&lt;br /&gt;&lt;br /&gt;&lt;span name="intelliTxt" id="intelliTxt"&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;         function pause(numberMillis) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;         {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;             var now = new Date();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;             var exitTime = now.getTime() + numberMillis;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;             while (true) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;             {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;                 now = new Date();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;                 if (now.getTime() &gt; exitTime)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;                     return;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;             }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;         } &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You need to call this function like&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0); font-weight: bold; font-style: italic;"&gt;pause(1000) ;&lt;/span&gt;&lt;br /&gt;to wait a second!&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-8958548761306287110?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/8958548761306287110/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=8958548761306287110' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/8958548761306287110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/8958548761306287110'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2008/08/javascript-function-similar-to-sleep-of.html' title='Javascript function similar to Sleep of JAVA'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-4074499918654675338</id><published>2008-08-18T09:54:00.000-07:00</published><updated>2010-08-25T06:54:25.150-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>JavaScript: Print Button on Your Web Page</title><content type='html'>It is fairly simple to add a PRINT Button on your web pages using JavaScript. The best practise to provide the facility of printing on web page is to provide a page that does not contain the banners/headers/footers/menus etc.&lt;br /&gt;For this just create another web page containing only the data you actually need to print; For this make sure the background is not dark or does not contains the darked background image. etc&lt;br /&gt;&lt;br /&gt;You can use simple JavaScript built in method &lt;strong&gt;window.print(). &lt;/strong&gt;For example the following code segment will place a print link on your webpage using the img tag of HTML.&lt;br /&gt;&lt;br /&gt;&lt; i m g  onclick="window.print();" src="/images/PrinterIcon.gif"&lt;br /&gt;style="cursor:hand;" /&gt;&lt;br /&gt;&lt;br /&gt;(Replace the text /images/PrinterIcon.gif with the location of an icon in your site.)&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-4074499918654675338?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/4074499918654675338/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=4074499918654675338' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/4074499918654675338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/4074499918654675338'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2008/08/javascript-print-button-on-your-web.html' title='JavaScript: Print Button on Your Web Page'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-2097845605003029746</id><published>2008-08-13T02:20:00.000-07:00</published><updated>2010-08-25T06:54:37.101-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>JAVA: Method That Removes Specified Characters From String</title><content type='html'>I needed a method that can remove specified set of characters from a given string. I came up with this solution. This method takes two parameters.&lt;br /&gt;&lt;br /&gt;1. First parameter is original String from which you want to remove the characters.&lt;br /&gt;2. Second parameter is a string containing the characters that we want to remove from the original string.&lt;br /&gt;&lt;br /&gt;EXAMPLE:&lt;br /&gt;&lt;br /&gt;If we provide the following input:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 102, 0);"&gt;removeFromString&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;("MYRSH Blogs by Sabah u Din Irfan","asi");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The method will return the followin output:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;MYRSH Blog by Sbh u Dn Irfn&lt;br /&gt;///////////////////////////////////////////&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;     public static String removeFromString(String str,String rem)&lt;br /&gt;     {&lt;br /&gt;         StringBuffer result=new StringBuffer();&lt;br /&gt;        &lt;br /&gt;        char[] s = str.toCharArray();&lt;br /&gt;        char [] r = rem.toCharArray();&lt;br /&gt;       &lt;br /&gt;        boolean [] flags =new boolean[128];&lt;br /&gt;       &lt;br /&gt;        int len=str.length();&lt;br /&gt;        int src, dest;&lt;br /&gt;       &lt;br /&gt;        for(src = 0 ; src &lt; r.length; ++src )&lt;br /&gt;        {&lt;br /&gt;              //System.out.println("src="+src);&lt;br /&gt;            flags[r[src]]=true;&lt;br /&gt;        }&lt;br /&gt;       &lt;br /&gt;        src = 0 ; dest = 0 ;&lt;br /&gt;        while(src &lt; len)&lt;br /&gt;        {&lt;br /&gt;            if( !flags[(int)s[src]] )&lt;br /&gt;            {&lt;br /&gt;                result.append(s[src]);&lt;br /&gt;            }&lt;br /&gt;            ++src;&lt;br /&gt;        }&lt;br /&gt;         return result.toString();&lt;br /&gt;     }&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-2097845605003029746?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/2097845605003029746/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=2097845605003029746' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/2097845605003029746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/2097845605003029746'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2008/08/java-method-that-removes-specified.html' title='JAVA: Method That Removes Specified Characters From String'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-387350347894152711</id><published>2008-08-08T06:11:00.000-07:00</published><updated>2010-08-25T06:55:45.990-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JSP'/><title type='text'>JSP: Save As Pop Up in JSP Another way</title><content type='html'>Place the following code segment in your scriptlet tag of JSP page.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;                                response.setContentType("application/vnd.ms-excel");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;                                response.setHeader("Content-Disposition","attachment; filename=&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0); font-style: italic;"&gt;abc.xls&lt;/span&gt;&lt;span style="font-style: italic;"&gt;"); &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;                                ServletOutputStream so = response.getOutputStream();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-style: italic;"&gt;                                String filename = "c:\\reports\myreport.xls";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;                                String mimetype = "application/vnd.ms-excel";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;                                ByteArrayOutputStream output = new ByteArrayOutputStream();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;                                InputStream in = new BufferedInputStream(new FileInputStream(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0); font-style: italic;"&gt;filename&lt;/span&gt;&lt;span style="font-style: italic;"&gt;));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;                                byte bytebuff[] = new byte[500];&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;                                for(int lengthread = 0; (lengthread = in.read(bytebuff)) != -1;){&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;                                output.write(bytebuff, 0, lengthread);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;                                }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;                                byte data[] = output.toByteArray();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;                                response.setContentType(mimetype);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;                                so.write(data);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;                                in.close();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;                                so.close();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;WHERE:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-style: italic; font-weight: bold;"&gt;abc.xls&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;is the file name that will automatically appear in the file Name box of SaveAs Pop Up.&lt;br /&gt;&lt;br /&gt;and&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0); font-style: italic; font-weight: bold;"&gt; filename&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-style: italic;"&gt;is the actual file path on your server machine. It may be outside of your WEB-INF directory. &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0); font-style: italic; font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-387350347894152711?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/387350347894152711/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=387350347894152711' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/387350347894152711'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/387350347894152711'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2008/08/jsp-save-as-pop-up-in-jsp-another-way.html' title='JSP: Save As Pop Up in JSP Another way'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-3530307789449029995</id><published>2008-08-08T06:00:00.000-07:00</published><updated>2010-08-25T06:55:57.456-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JSP'/><title type='text'>JSP: Save As Pop Up in JSP</title><content type='html'>&lt;span style="color: rgb(51, 0, 153); font-weight: bold;"&gt;Step First:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Add the following method in the declaration tag of your JSP page.&lt;br /&gt;&lt;br /&gt;&lt;%!&lt;br /&gt;&lt;br /&gt;        void returnFile(String filename, OutputStream out)throws Exception&lt;br /&gt;        {&lt;br /&gt;            //    open file here using File object&lt;br /&gt;             File inputFile =new File(filename);&lt;br /&gt;            //    open stream from that file&lt;br /&gt;             FileReader in = new FileReader(inputFile);&lt;br /&gt;            int c;&lt;br /&gt;            while ((c = in.read()) != -1)&lt;br /&gt;               out.write(c);&lt;br /&gt;               &lt;br /&gt;            //    close the stream&lt;br /&gt;             in.close();&lt;br /&gt;            //    close the file&lt;br /&gt;           &lt;br /&gt;        }&lt;br /&gt;%&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 0, 153);"&gt;Step Two:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Add the following code segment in scriptlet tag.&lt;br /&gt;&lt;br /&gt;                 response.setContentType("application/octet-stream");&lt;br /&gt;                 response.setHeader("Content-Disposition", "attachment; filename=&lt;span style="color: rgb(255, 0, 0);"&gt;ASPTransBreakOut.txt&lt;/span&gt;");&lt;br /&gt;               &lt;br /&gt;                //  Send the file.&lt;br /&gt;                 OutputStream outstr = response.getOutputStream(  );        &lt;br /&gt;                 returnFile(&lt;span style="color: rgb(255, 0, 0);"&gt;fileLocation&lt;/span&gt;, outstr);  // Method implemented in declarative tag in step first&lt;br /&gt;                 outstr.flush();&lt;br /&gt;&lt;br /&gt;WHERE:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ASPTransBreakOut.txt&lt;/span&gt;&lt;br /&gt;is the name that will automatically show you up in SaveAs Popup menu&lt;br /&gt;&lt;br /&gt;and&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;fileLocation&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;is the location of the actual fine on your server.&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-3530307789449029995?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/3530307789449029995/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=3530307789449029995' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/3530307789449029995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/3530307789449029995'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2008/08/jsp-save-as-pop-up-in-jsp.html' title='JSP: Save As Pop Up in JSP'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-2691313055155908243</id><published>2008-07-09T09:08:00.000-07:00</published><updated>2010-08-25T06:56:10.207-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL Server: Lising all the Databses Names and Their Size</title><content type='html'>Following stored procedure lists all of the data bases names along with their sizes and remarks/&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;exec sp_databases&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="section" id="sectionSection1" name="collapseableSection"&gt;&lt;table style="background-color: rgb(204, 204, 204);" xmlns="" border="1" cellpadding="0" cellspacing="0" width="100%"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;th&gt;Column name &lt;/th&gt; &lt;th&gt;Data type &lt;/th&gt; &lt;th&gt;Description &lt;/th&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;p&gt;&lt;b&gt;DATABASE_NAME&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td&gt; &lt;p&gt;&lt;b&gt;sysname&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td&gt; &lt;p&gt;Name of the database. In the Database Engine, this column represents the  database name as stored in the &lt;b&gt;sys.databases&lt;/b&gt; catalog view.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;p&gt;&lt;b&gt;DATABASE_SIZE&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td&gt; &lt;p&gt;&lt;b&gt;int&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td&gt; &lt;p&gt;Size of database, in kilobytes.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;p&gt;&lt;b&gt;REMARKS&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td&gt; &lt;p&gt;&lt;b&gt;varchar(254)&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td&gt; &lt;p&gt;For the Database Engine, this field always returns  NULL.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-2691313055155908243?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/2691313055155908243/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=2691313055155908243' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/2691313055155908243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/2691313055155908243'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2008/07/sql-server-lising-all-databses-names.html' title='SQL Server: Lising all the Databses Names and Their Size'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-3113753640310395074</id><published>2008-04-16T14:28:00.001-07:00</published><updated>2008-04-16T14:30:01.480-07:00</updated><title type='text'>ON LIVE PERSON</title><content type='html'>&lt;a href="http://www.liveperson.com/professional/expert-profile.aspx?_x002F_CC1yVhS3mW93v7qx7_x002B_MgEk5W9_x002F_O8eor_x002F_x04UwY2lwmXrgDXOspeolQlIAHVimgOOJO481FY_x002F_8xDU6qoew6L_x002F_L4tkCJMx5e8"&gt;&lt;img src="http://www.liveperson.com/VirtualPages/onlineexp.aspx?COa0sHKCZCloFJmxKqHOVFCezZPsoa6KK07g5rz3Rn2ihDY_x002F_BuHo8CBBxHwpfkR6yAqbiE3Mfc1qLRl_x002B_W6Alnw_x003D__x003D_" alt="Ask an Expert - Visit my Virtual Office at LivePerson" align="absmiddle" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-3113753640310395074?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/3113753640310395074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=3113753640310395074' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/3113753640310395074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/3113753640310395074'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2008/04/on-live-person.html' title='ON LIVE PERSON'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-1886743145020439974</id><published>2008-04-16T14:17:00.000-07:00</published><updated>2010-08-25T06:56:31.722-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DOS'/><title type='text'>DOS Command To Delete Those Files Having Attribute Other than A</title><content type='html'>If you want to delete the files that have their Attribute value equal to "-A"(Other than A), Use the following Command:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;DEL /Q /A:-A *.*&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Where:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;/A&lt;/span&gt; is a switch that selects files to delete based on attributes&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;-A&lt;/span&gt; means that only those files that have attribute value other than A&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;/Q&lt;/span&gt;&lt;/span&gt; is a switch for Quiet mode, do not ask if ok to delete on global wildcard&lt;br /&gt;&lt;br /&gt;and&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;*.*  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;means all files.&lt;br /&gt;&lt;br /&gt;For further details you can visit the following reference page.&lt;br /&gt;&lt;a href="http://www.computerhope.com/delhlp.htm"&gt;http://www.computerhope.com/delhlp.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.liveperson.com/professional/expert-profile.aspx?_x002F_CC1yVhS3mW93v7qx7_x002B_MgEk5W9_x002F_O8eor_x002F_x04UwY2lwmXrgDXOspeolQlIAHVimgOOJO481FY_x002F_8xDU6qoew6L_x002F_L4tkCJMx5e8"&gt;&lt;img src="http://www.liveperson.com/VirtualPages/onlineexp.aspx?COa0sHKCZCloFJmxKqHOVMbiYjs4M8umh17melo1sEXOBikIkuHlNWeKy9j2jO_x002B_03KT1FfVangpwoLJOkBslzg_x003D__x003D_" alt="Ask an Expert - Visit my Virtual Office at LivePerson" align="absmiddle" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-1886743145020439974?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/1886743145020439974/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=1886743145020439974' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/1886743145020439974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/1886743145020439974'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2008/04/dos-command-to-delete-those-files.html' title='DOS Command To Delete Those Files Having Attribute Other than A'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-1349966104258591758</id><published>2008-04-08T11:47:00.000-07:00</published><updated>2010-08-25T06:56:52.136-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>JAvaScript function to Count no Of Specific Fields( Like TextBoxes)</title><content type='html'>Sometimes, you create textboxes or othe form fields dynamically using some server side scripting language. Then you may need to count the number of fields using some JAvaScript. The following javascript function will return the no of specific fields of a form passed in parameters:&lt;br /&gt;&lt;br /&gt;It has two parameters:&lt;br /&gt;1- formName:- It is the attribute name of the form&lt;br /&gt;2- inputtype:- Type of Field as a String argument.&lt;br /&gt;&lt;br /&gt;For Example if you would like to count the number of textBoxes in the HTML form, the following call will work.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic; color: rgb(51, 51, 255);"&gt;var noOfTextBoxes = countElement(formName,"text");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Similarly, to count no of buttons in HTML form, call the function like:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic; color: rgb(51, 51, 255);"&gt;var noOfTextBoxes = countElement(formName,"button");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here is the implementation of JavaScript function:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold; color: rgb(51, 51, 255);"&gt;function countElement(formName,inputtype)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold; color: rgb(51, 51, 255);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold; color: rgb(51, 51, 255);"&gt;    var count =0;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold; color: rgb(51, 51, 255);"&gt;    for(i=0; i &amp;lt formName.elements.length ; i++ )&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold; color: rgb(51, 51, 255);"&gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold; color: rgb(51, 51, 255);"&gt;    if(formName.elements[i].type==inputtype)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold; color: rgb(51, 51, 255);"&gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold; color: rgb(51, 51, 255);"&gt;      //&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold; color: rgb(51, 51, 255);"&gt;      alert(formName.elements[i].value);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold; color: rgb(51, 51, 255);"&gt;      count=count+1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold; color: rgb(51, 51, 255);"&gt;      &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold; color: rgb(51, 51, 255);"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold; color: rgb(51, 51, 255);"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold; color: rgb(51, 51, 255);"&gt;    return count;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold; color: rgb(51, 51, 255);"&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.linkedin.com/in/sabahudin"&gt;&lt;img src="http://www.linkedin.com/img/webpromo/btn_viewmy_160x33.gif" alt="View Sabah u Din Irfan's profile on LinkedIn" border="0" height="33" width="160" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-1349966104258591758?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/1349966104258591758/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=1349966104258591758' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/1349966104258591758'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/1349966104258591758'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2008/04/javascript-function-to-count-no-of.html' title='JAvaScript function to Count no Of Specific Fields( Like TextBoxes)'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-1527166096960044082</id><published>2008-04-07T12:52:00.000-07:00</published><updated>2010-08-25T06:57:10.854-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>JAVA@ Removing Duplicate Records from ArrayList</title><content type='html'>The following code removes the duplicate records from the ArrayList of Java.&lt;br /&gt;&lt;br /&gt;//////////////////////////////////////&lt;br /&gt;&lt;br /&gt;import java.util.ArrayList;&lt;br /&gt;&lt;br /&gt;public class RemoveDuplicateArrayElement {&lt;br /&gt;   public static void main(String [] as)&lt;br /&gt;   {  &lt;br /&gt;            // String [] temp={"sqqa","as","sa","sd","sa","fd","sa","sa","sa"};&lt;br /&gt;             ArrayList aryDuplicate=new ArrayList();&lt;br /&gt;     &lt;br /&gt;             aryDuplicate.add(new String("sabah"));&lt;br /&gt;             aryDuplicate.add(new String("irfan"));&lt;br /&gt;             aryDuplicate.add(new String("waqas"));&lt;br /&gt;             aryDuplicate.add(new String("sabah"));&lt;br /&gt;             aryDuplicate.add(new String("sabah"));&lt;br /&gt;             aryDuplicate.add(new String("Ahmad"));&lt;br /&gt;//              for(int i=0;i&lt;temp.length&gt;&lt;br /&gt;//              {&lt;br /&gt;//                      if(listContains(aryL,temp[i]))&lt;br /&gt;//                      {&lt;br /&gt;//                          // This is already in the List, Don't push it.&lt;br /&gt;//                          //System.out.println("List already contains"+temp[i]);&lt;br /&gt;//                      }&lt;br /&gt;//                      else&lt;br /&gt;//                      {&lt;br /&gt;//                          aryL.add(new String(temp[i]));&lt;br /&gt;//                      }&lt;br /&gt;//              }&lt;br /&gt;//              aryDuplicate1=aryDuplicate;//&lt;br /&gt;//            &lt;br /&gt;//              for(int j=0;j&lt;aryduplicate1.size();j++)&gt;&lt;br /&gt;//              {&lt;br /&gt;//                  //System.out.println(j+":"+(String)aryDuplicate1.get(j));&lt;br /&gt;//              }&lt;br /&gt;           &lt;br /&gt;             aryDuplicate=RemoveDuplicates(aryDuplicate);&lt;br /&gt;             System.out.println(aryDuplicate.size());&lt;br /&gt;             for(int j=0;j&lt;aryduplicate.size();j++)&gt;&lt;br /&gt;             {&lt;br /&gt;                 System.out.println(j+":"+(String)aryDuplicate.get(j));&lt;br /&gt;             }&lt;br /&gt;             //System.out.println("List contains = "+listContains(aryL,"sfa") );&lt;br /&gt;   }&lt;br /&gt;  /////////////////////////////////////&lt;br /&gt;&lt;br /&gt;   public static ArrayList RemoveDuplicates(ArrayList aryLst)&lt;br /&gt;   {&lt;br /&gt;       ArrayList noDuplicate=new ArrayList();&lt;br /&gt;        for(int i=0;i&lt;arylst.size();i++)&gt;&lt;br /&gt;        {&lt;br /&gt;         &lt;br /&gt;            if(listContains(noDuplicate,(String)aryLst.get(i)))&lt;br /&gt;                    {&lt;br /&gt;                        //This is already in the List, Don't push it.&lt;br /&gt;                        //    System.out.println((String)aryLst.get(i));&lt;br /&gt;                    }&lt;br /&gt;            else&lt;br /&gt;            {&lt;br /&gt;                noDuplicate.add(new String((String)aryLst.get(i)));&lt;br /&gt;              &lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;     &lt;br /&gt;       return noDuplicate;&lt;br /&gt;   }&lt;br /&gt;  /////////////////////////&lt;br /&gt;   public static boolean listContains(ArrayList aryList, String str)&lt;br /&gt;   {&lt;br /&gt;       boolean result=false;&lt;br /&gt;     &lt;br /&gt;       for(int i=0;i&lt;arylist.size();i++)&gt;&lt;br /&gt;       {&lt;br /&gt;           // System.out.println((String)aryList.get(i));&lt;br /&gt;           if(str.equalsIgnoreCase((String)aryList.get(i)))&lt;br /&gt;           {&lt;br /&gt;               result= true;&lt;br /&gt;               break;&lt;br /&gt;           }&lt;br /&gt;           else&lt;br /&gt;           {&lt;br /&gt;               result= false;&lt;br /&gt;           }&lt;br /&gt;         &lt;br /&gt;       }&lt;br /&gt;     &lt;br /&gt;       return result;&lt;br /&gt;   }&lt;br /&gt;   ///////////////////////////////////&lt;br /&gt;&lt;br /&gt;   public static boolean listContains(String[] aryList, String str)&lt;br /&gt;   {&lt;br /&gt;       boolean result=false;&lt;br /&gt;     &lt;br /&gt;       for(int i=0;i&lt;arylist.length;i++)&gt;&lt;br /&gt;       {&lt;br /&gt;           // System.out.println((String)aryList.get(i));&lt;br /&gt;           if(str.equalsIgnoreCase((String)aryList[i]))&lt;br /&gt;           {&lt;br /&gt;               result= true;&lt;br /&gt;               break;&lt;br /&gt;           }&lt;br /&gt;           else&lt;br /&gt;           {&lt;br /&gt;               result= false;&lt;br /&gt;           }&lt;br /&gt;         &lt;br /&gt;       }&lt;br /&gt;     &lt;br /&gt;       return result;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;} // end class&lt;/arylist.length;i++)&gt;&lt;/arylist.size();i++)&gt;&lt;/arylst.size();i++)&gt;&lt;/aryduplicate.size();j++)&gt;&lt;/aryduplicate1.size();j++)&gt;&lt;/temp.length&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-1527166096960044082?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/1527166096960044082/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=1527166096960044082' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/1527166096960044082'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/1527166096960044082'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2008/04/java-removing-duplicate-records-from.html' title='JAVA@ Removing Duplicate Records from ArrayList'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-1892902020568858475</id><published>2008-03-14T09:48:00.000-07:00</published><updated>2010-08-25T06:57:32.121-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>JAVAScript: Function To Validate UK ZipCodes</title><content type='html'>// Method that validates the Basic Business Rules for UK Zip codes.&lt;br /&gt;&lt;br /&gt;function  checkPostCode(pc) { //check postcode format is valid&lt;br /&gt;       var test = pc;&lt;br /&gt;       var size = test.length&lt;br /&gt;       test = test.toUpperCase(); //Change to uppercase&lt;br /&gt;       while (test.slice(0,1) == " ") { //Strip leading spaces&lt;br /&gt;           test = test.substr(1,size-1);size = test.length&lt;br /&gt;       }&lt;br /&gt;       while(test.slice(size-1,size) == " ") { //Strip trailing spaces&lt;br /&gt;           test = test.substr(0,size-1);size = test.length&lt;br /&gt;       }&lt;br /&gt;       if (size == 0) {&lt;br /&gt;           return "please enter a valid postcode";&lt;br /&gt;       }&lt;br /&gt;       //document.details.pcode.value = test; //write back to form field&lt;br /&gt;       if (size &lt;&gt; 8){ //Code length rule&lt;br /&gt;           //return "please enter a valid postcode";&lt;br /&gt;           return test + " is not a valid postcode - wrong length";&lt;br /&gt;       }&lt;br /&gt;       if (!(isNaN(test.charAt(0)))){ //leftmost character must be alpha character rule&lt;br /&gt;           //return "please enter a valid postcode";&lt;br /&gt;           return   test + " is not a valid postcode - cannot start with a number";&lt;br /&gt;       }&lt;br /&gt;       if (isNaN(test.charAt(size-3))){ //first character of inward code must be numeric rule&lt;br /&gt;          // return "please enter a valid postcode";&lt;br /&gt;           return test + " is not a valid postcode - alpha character in wrong position";&lt;br /&gt;          &lt;br /&gt;       }&lt;br /&gt;       if (!(isNaN(test.charAt(size-2)))){ //second character of inward code must be alpha rule&lt;br /&gt;           //return "please enter a valid postcode";&lt;br /&gt;           return test + " is not a valid postcode - number in wrong position";&lt;br /&gt;       }&lt;br /&gt;       if (!(isNaN(test.charAt(size-1)))){ //third character of inward code must be alpha rule&lt;br /&gt;           //return "please enter a valid postcode";&lt;br /&gt;           return test + " is not a valid postcode - number in wrong position";&lt;br /&gt;       }&lt;br /&gt;       if (!(test.charAt(size-4) == " ")){//space in position length-3 rule&lt;br /&gt;           //return "please enter a valid postcode";&lt;br /&gt;           return test + " is not a valid postcode -   space in wrong position";&lt;br /&gt;          &lt;br /&gt;       }&lt;br /&gt;       count1 = test.indexOf(" ");count2 = test.lastIndexOf(" ");&lt;br /&gt;       if (count1 != count2){//only one space rule&lt;br /&gt;           return "please enter a valid postcode";&lt;br /&gt;           return test + " is not a valid postcode - only one space allowed";&lt;br /&gt;       }&lt;br /&gt;       return "OK";&lt;br /&gt;   }&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-1892902020568858475?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/1892902020568858475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=1892902020568858475' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/1892902020568858475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/1892902020568858475'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2008/03/javascript-function-to-validate-uk.html' title='JAVAScript: Function To Validate UK ZipCodes'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-1395954557206105487</id><published>2008-03-12T05:51:00.000-07:00</published><updated>2010-08-25T06:57:46.984-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>JAVAScript: StringTokenizer Function</title><content type='html'>String.prototype.tokenize = tokenize;&lt;br /&gt;&lt;br /&gt;function tokenize()&lt;br /&gt; {&lt;br /&gt;    var input             = "";&lt;br /&gt;    var separator         = " ";&lt;br /&gt;    var trim              = "";&lt;br /&gt;    var ignoreEmptyTokens = true;&lt;br /&gt;&lt;br /&gt;    try {&lt;br /&gt;      String(this.toLowerCase());&lt;br /&gt;    }&lt;br /&gt;    catch(e) {&lt;br /&gt;      window.alert("Tokenizer Usage: string myTokens[] = myString.tokenize(string separator, string trim, boolean ignoreEmptyTokens);");&lt;br /&gt;      return;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    if(typeof(this) != "undefined")&lt;br /&gt;      {&lt;br /&gt;         input = String(this);&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;    if(typeof(tokenize.arguments[0]) != "undefined")&lt;br /&gt;      {&lt;br /&gt;         separator = String(tokenize.arguments[0]);&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;    if(typeof(tokenize.arguments[1]) != "undefined")&lt;br /&gt;      {&lt;br /&gt;         trim = String(tokenize.arguments[1]);&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;    if(typeof(tokenize.arguments[2]) != "undefined")&lt;br /&gt;      {&lt;br /&gt;         if(!tokenize.arguments[2])&lt;br /&gt;           ignoreEmptyTokens = false;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;    var array = input.split(separator);&lt;br /&gt;&lt;br /&gt;    if(trim)&lt;br /&gt;      for(var i=0; i&lt;array.length;&gt;&lt;br /&gt;        {&lt;br /&gt;          while(array[i].slice(0, trim.length) == trim)&lt;br /&gt;            array[i] = array[i].slice(trim.length);&lt;br /&gt;          while(array[i].slice(array[i].length-trim.length) == trim)&lt;br /&gt;            array[i] = array[i].slice(0, array[i].length-trim.length);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;    var token = new Array();&lt;br /&gt;    if(ignoreEmptyTokens)&lt;br /&gt;      {&lt;br /&gt;         for(var i=0; i&lt;array.length;&gt;&lt;br /&gt;           if(array[i] != "")&lt;br /&gt;             token.push(array[i]);&lt;br /&gt;      }&lt;br /&gt;    else&lt;br /&gt;      {&lt;br /&gt;         token = array;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;    return token;&lt;br /&gt; }&lt;br /&gt;/////////////////////////////////&lt;/array.length;&gt;&lt;/array.length;&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-1395954557206105487?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/1395954557206105487/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=1395954557206105487' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/1395954557206105487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/1395954557206105487'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2008/03/javascript-stringtokenizer-function.html' title='JAVAScript: StringTokenizer Function'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-5249998477979838056</id><published>2008-01-31T09:02:00.000-08:00</published><updated>2008-01-31T09:03:24.372-08:00</updated><title type='text'>Profile on Linked In</title><content type='html'>&lt;a href="http://www.linkedin.com/in/sabahudin"&gt;&lt;img src="http://www.linkedin.com/img/webpromo/btn_viewmy_160x33.gif" width="160" height="33" border="0" alt="View Sabah u Din Irfan's profile on LinkedIn" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-5249998477979838056?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/5249998477979838056/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=5249998477979838056' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/5249998477979838056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/5249998477979838056'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2008/01/profile-on-linked-in.html' title='Profile on Linked In'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-8348842559352391763</id><published>2007-11-30T13:33:00.000-08:00</published><updated>2010-08-25T07:19:56.715-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C #'/><title type='text'>Final Release of VS 2008 and .NET 3.5 Now Available</title><content type='html'>&lt;div class="post_item_image"&gt;&lt;a href="http://asp.net/downloads/vs2008/" target="_blank"&gt;&lt;img class="thumbnail_59 align_left" alt="Final Release of VS 2008 and .NET 3.5 Now Available" src="http://static.asp.net/asp.net/images/announcements/announ-117.jpg" /&gt;&lt;/a&gt;   &lt;/div&gt;    &lt;h3 class="post_title"&gt;&lt;a href="http://asp.net/downloads/vs2008/" target="_blank"&gt;Final Release of VS 2008 and   .NET 3.5 Now Available&lt;/a&gt;&lt;/h3&gt;  &lt;p class="post_date"&gt;Monday, November 19, 2007&lt;/p&gt;  &lt;p class="post_description"&gt;Experience the latest release of the most productive   and powerful development tool and user interface platform on the planet. &lt;a href="http://www.bloglines.com/downloads/vs2008" target="_blank"&gt;Learn about the new features&lt;/a&gt; in Visual Studio 2008   and the .NET Framework 3.5, from built-in ASP.NET AJAX support, to the new   Visual Studio Web page designer, to the enhanced JavaScript support; then watch   the &lt;a href="http://www.bloglines.com/learn/3.5-videos/" target="_blank"&gt;ASP.NET 3.5 video series&lt;/a&gt; and the &lt;a href="http://www.bloglines.com/learn/linq-videos" target="_blank"&gt;LINQ video series&lt;/a&gt;; and then download a free copy   of &lt;a href="http://www.bloglines.com/downloads/essential" target="_blank"&gt;Visual Web Developer 2008&lt;/a&gt; to try it out   yourself.&lt;/p&gt;&lt;b&gt;Go to the link: &lt;/b&gt;&lt;a style="font-weight: bold;" href="http://asp.net/downloads/vs2008/" target="_blank"&gt;http://asp.net/downloads/vs2008/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.linkedin.com/in/sabahudin"&gt;&lt;img src="http://www.linkedin.com/img/webpromo/btn_viewmy_160x33.gif" alt="View Sabah u Din Irfan's profile on LinkedIn" border="0" height="33" width="160" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-8348842559352391763?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/8348842559352391763/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=8348842559352391763' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/8348842559352391763'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/8348842559352391763'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/11/final-release-of-vs-2008-and-net-35-now.html' title='Final Release of VS 2008 and .NET 3.5 Now Available'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-6047338086856670116</id><published>2007-11-30T13:27:00.000-08:00</published><updated>2010-08-25T07:20:27.776-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C #'/><title type='text'>What's new in Visual Studio 2008 and .NET Fx 3.5 for the Web Developer</title><content type='html'>Kindly visit the following link, it is very useful:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-gb/bb905504.aspx?id=108"&gt;http://msdn2.microsoft.com/en-gb/bb905504.aspx?id=108&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-6047338086856670116?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/6047338086856670116/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=6047338086856670116' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/6047338086856670116'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/6047338086856670116'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/11/whats-new-in-visual-studio-2008-and-net.html' title='What&apos;s new in Visual Studio 2008 and .NET Fx 3.5 for the Web Developer'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-8179900191391803648</id><published>2007-11-30T13:22:00.001-08:00</published><updated>2010-08-25T06:58:12.673-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL Server 2005: Using NULLIF</title><content type='html'>It takes two parametes like,&lt;br /&gt;&lt;b&gt;NULLIF (param1,param2)&lt;/b&gt;&lt;br /&gt;and returns NULL if both param1 and param2 are equal.&lt;br /&gt;&lt;br /&gt;NULLIF returns the first &lt;i&gt;parameter&lt;/i&gt; if the two &lt;i&gt;parameters&lt;/i&gt; are not   equivalent&lt;br /&gt;&lt;br /&gt;&lt;b&gt;NOTE:&lt;/b&gt;&lt;br /&gt;param1 and param2 can be a constant, column name, function, subquery, or any combination of   arithmetic, bitwise, and string operators.&lt;br /&gt;&lt;br /&gt;NULLIF is somehow similar to CASE function.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;http://www.bloglines.com/blog/sabah-irfan?id=41&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-8179900191391803648?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/8179900191391803648/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=8179900191391803648' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/8179900191391803648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/8179900191391803648'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/11/sql-server-2005-using-nullif_30.html' title='SQL Server 2005: Using NULLIF'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-4430685832166096460</id><published>2007-11-30T13:22:00.000-08:00</published><updated>2010-08-25T06:58:37.152-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL Server 2005: Using NULLIF</title><content type='html'>It takes two parametes like,&lt;br /&gt;&lt;b&gt;NULLIF (param1,param2)&lt;/b&gt;&lt;br /&gt;and returns NULL if both param1 and param2 are equal.&lt;br /&gt;&lt;br /&gt;NULLIF returns the first &lt;i&gt;parameter&lt;/i&gt; if the two &lt;i&gt;parameters&lt;/i&gt; are not   equivalent&lt;br /&gt;&lt;br /&gt;&lt;b&gt;NOTE:&lt;/b&gt;&lt;br /&gt;param1 and param2 can be a constant, column name, function, subquery, or any combination of   arithmetic, bitwise, and string operators.&lt;br /&gt;&lt;br /&gt;NULLIF is somehow similar to CASE function.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;http://www.bloglines.com/blog/sabah-irfan?id=41&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-4430685832166096460?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/4430685832166096460/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=4430685832166096460' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/4430685832166096460'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/4430685832166096460'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/11/sql-server-2005-using-nullif.html' title='SQL Server 2005: Using NULLIF'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-3005387098951926304</id><published>2007-10-29T14:00:00.000-07:00</published><updated>2010-08-25T06:58:55.521-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>JavaScript: Some Useful Functions</title><content type='html'>&lt;span style="font-weight: bold;"&gt;toUpperFirstChar&lt;/span&gt;:    &lt;br /&gt;Accepts an object of type "Text" and converts the first character of the string to upper case.&lt;br /&gt;Parameters:            Object&lt;br /&gt;Returns:             n/a&lt;br /&gt;&lt;br /&gt;Here is the defination:&lt;br /&gt;&lt;br /&gt;function toUpperFirstChar(obj)&lt;br /&gt;{&lt;br /&gt;    LTrimObj(obj);&lt;br /&gt;    obj.value = obj.value.substr(0,1).toUpperCase()+obj.value.substr(1,obj.value.length-1);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;checkDateValidity:-&lt;/span&gt;&lt;br /&gt;This method checks if the fDt is less than tDt or not.&lt;br /&gt;Parameters:            FromDate, ToDate&lt;br /&gt;Returns:             Boolean&lt;br /&gt;&lt;br /&gt;Here is the defination..&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function checkDateValidity(fDT,tDT)&lt;br /&gt;{&lt;br /&gt;    var fyear=fDT.charAt(7)+fDT.charAt(8)+fDT.charAt(9)+fDT.charAt(10);   &lt;br /&gt;    var tyear=tDT.charAt(7)+tDT.charAt(8)+tDT.charAt(9)+tDT.charAt(10);   &lt;br /&gt;&lt;br /&gt;    var fm=fDT.charAt(3)+fDT.charAt(4)+fDT.charAt(5);   &lt;br /&gt;    var tm=tDT.charAt(3)+tDT.charAt(4)+tDT.charAt(5);   &lt;br /&gt;    var fmonth=MonthReplace(fm);&lt;br /&gt;    var tmonth=MonthReplace(tm);&lt;br /&gt;&lt;br /&gt;    var fday=fDT.charAt(0)+fDT.charAt(1);   &lt;br /&gt;    var tday=tDT.charAt(0)+tDT.charAt(1);   &lt;br /&gt;&lt;br /&gt;    fDate = new Date(fyear,fmonth-1,fday);&lt;br /&gt;    tDate = new Date(tyear,tmonth-1,tday);&lt;br /&gt;&lt;br /&gt;    if(fDate &gt; tDate)&lt;br /&gt;    {&lt;br /&gt;        alert("From date must not be greater than to date");&lt;br /&gt;        return false;&lt;br /&gt;    }&lt;br /&gt;    else&lt;br /&gt;    {&lt;br /&gt;        return true;&lt;br /&gt;    }   &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;varifyPassword:-&lt;br /&gt;&lt;/span&gt;varifies if the password is more than 6 char long and it contains atleast one digit and 4 distinct characters.&lt;br /&gt;&lt;br /&gt;Here is the defination of the function:&lt;br /&gt;&lt;br /&gt; function varifyPassword(pass)&lt;br /&gt;  {&lt;br /&gt;      pass=Trim(pass);&lt;br /&gt;      var validFlag = 1;&lt;br /&gt;       if(pass.length &lt; 6)&lt;br /&gt;       {&lt;br /&gt;           validFlag = 0;&lt;br /&gt;       }&lt;br /&gt;       else&lt;br /&gt;       {&lt;br /&gt;           alphaList=new Array();&lt;br /&gt;           numList=new Array();&lt;br /&gt;           var flag=0;&lt;br /&gt;        for(var i=0; i&lt; pass.length; i++)&lt;br /&gt;        {&lt;br /&gt;            var oneChar=pass.charAt(i)&lt;br /&gt;            if(isAlphabet(oneChar))&lt;br /&gt;            {&lt;br /&gt;                var charFlag=1;&lt;br /&gt;                for(var p=0; p&lt;alphaList.length; p++)&lt;br /&gt;                {&lt;br /&gt;                     if(oneChar==alphaList[p])&lt;br /&gt;                     {&lt;br /&gt;                         charFlag=0;&lt;br /&gt;                         break;&lt;br /&gt;                     }&lt;br /&gt;                }&lt;br /&gt;                if(charFlag)&lt;br /&gt;                {&lt;br /&gt;                    alphaList[alphaList.length]=oneChar;&lt;br /&gt;                }   &lt;br /&gt;            }&lt;br /&gt;            else if(oneChar&gt;=0 &amp;amp;&amp;amp; oneChar &lt;=9)&lt;br /&gt;            {&lt;br /&gt;                var numFlag=1;&lt;br /&gt;                for(var p=0; p&lt;numList.length; p++)&lt;br /&gt;                {&lt;br /&gt;                     if(oneChar==numList[p])&lt;br /&gt;                     {&lt;br /&gt;                         numFlag=0;&lt;br /&gt;                         break;&lt;br /&gt;                     }&lt;br /&gt;                }&lt;br /&gt;                if(numFlag)&lt;br /&gt;                {&lt;br /&gt;                    numList[numList.length]=oneChar;&lt;br /&gt;                }   &lt;br /&gt;            }&lt;br /&gt;            else&lt;br /&gt;            {&lt;br /&gt;                validFlag = 0;&lt;br /&gt;                break;&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;           &lt;br /&gt;            if ((alphaList.length &gt;= 1) &amp;amp;&amp;amp; (numList.length&gt;= 1) &amp;amp;&amp;amp; ((alphaList.length + numList.length) &gt;= 4))&lt;br /&gt;            {&lt;br /&gt;                flag = 1;&lt;br /&gt;                break;&lt;br /&gt;            }       &lt;br /&gt;              }&lt;br /&gt;       &lt;br /&gt;        if(flag)&lt;br /&gt;        {&lt;br /&gt;            return true;&lt;br /&gt;        }   &lt;br /&gt;        else&lt;br /&gt;        {   &lt;br /&gt;            validFlag = 0;&lt;br /&gt;        }   &lt;br /&gt;           }&lt;br /&gt;          &lt;br /&gt;           if (! validFlag)&lt;br /&gt;           {&lt;br /&gt;            alert("The password is not valid, or needs to be updated. Consult the help page for instructions about choosing a valid password.")&lt;br /&gt;            return false;&lt;br /&gt;           }&lt;br /&gt;   }&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-3005387098951926304?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/3005387098951926304/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=3005387098951926304' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/3005387098951926304'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/3005387098951926304'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/10/javascript-some-useful-functions.html' title='JavaScript: Some Useful Functions'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-2137967980655058280</id><published>2007-10-29T13:53:00.000-07:00</published><updated>2010-08-25T06:59:50.256-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JSP'/><title type='text'>JSP: sendRedirect() vs. getRequestDispatcher()</title><content type='html'>&lt;p class="MsoNormal" style="margin-right: 0.5in; margin-left: 0.5in;"&gt;    &lt;span&gt;Today my other team member was facing a problem and the request objects were destroed when he was using request.sendRedirect().  He was struggling with it and came to me.  Actually there is other method to use when you want to pass the origional request objects, that is &lt;/span&gt;&lt;span&gt;getRequestDispatcher();&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-right: 0.5in; margin-left: 0.5in;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-right: 0.5in; margin-left: 0.5in;"&gt;&lt;span&gt;When you want to preserve the current    request/response objects and transfer them to another resource WITHIN the    context, you must use getRequestDispatcher or getNamedDispatcher.    &lt;p&gt; &lt;/p&gt;&lt;/span&gt;  &lt;/p&gt;  &lt;p style="margin: 5pt 0.5in;"&gt;    &lt;span&gt;If you want to dispatch to resources OUTSIDE    the context, then you must use sendRedirect. In this case you won't be sending    the original request/response objects, but you will be sending a header asking    to the browser to issue a request to the new URL. &lt;p&gt; &lt;/p&gt;&lt;/span&gt;  &lt;/p&gt;        &lt;span&gt;&lt;br /&gt;NOTE: If you don't need to preserve the    request/response objects, you can use either.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-2137967980655058280?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/2137967980655058280/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=2137967980655058280' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/2137967980655058280'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/2137967980655058280'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/10/java-sendredirect-vs.html' title='JSP: sendRedirect() vs. getRequestDispatcher()'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-3084771595133964711</id><published>2007-09-28T02:35:00.000-07:00</published><updated>2010-08-25T07:00:07.627-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>JavaScript@ Validation Functions</title><content type='html'>&lt;p&gt;&lt;strong&gt;1- Empty Field Validation:-&lt;/strong&gt; (To check whether a text field is empty or not)&lt;/p&gt;&lt;p&gt;function IsEmpty(aTextField) {&lt;br /&gt;   if ((aTextField.value.length==0)&lt;br /&gt;   (aTextField.value==null)) {&lt;br /&gt;      return true;&lt;br /&gt;   }&lt;br /&gt;   else { return false; }&lt;br /&gt;}&lt;br /&gt;////////////////////////////////////////////////&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;2- Numeric Validation:-&lt;/strong&gt; (To check whether a text field contains Numeric Values)&lt;br /&gt;&lt;br /&gt;function IsNumeric(sText)&lt;br /&gt;{&lt;br /&gt;   var ValidChars = "0123456789.";&lt;br /&gt;   var IsNumber=true;&lt;br /&gt;   var Char;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;   for (i = 0; i &lt; sText.length &amp;amp;&amp;amp; IsNumber == true; i++)&lt;br /&gt;      {&lt;br /&gt;      Char = sText.charAt(i);&lt;br /&gt;      if (ValidChars.indexOf(Char) == -1)&lt;br /&gt;         {&lt;br /&gt;         IsNumber = false;&lt;br /&gt;         }&lt;br /&gt;      }&lt;br /&gt;   return IsNumber;&lt;br /&gt;  &lt;br /&gt;   }&lt;br /&gt;////////////////////////////////////////////////&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;3- Aplphabet Validation:-&lt;/strong&gt; (To check whether a text field contains Alphabetic Values)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;function IsAlphabet(sText)&lt;br /&gt;{&lt;br /&gt;   var ValidChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";&lt;br /&gt;   var IsAlpha=true;&lt;br /&gt;   var Char;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;   for (i = 0; i &lt; sText.length &amp;amp;&amp;amp; IsAlpha == true; i++)&lt;br /&gt;      {&lt;br /&gt;      Char = sText.charAt(i);&lt;br /&gt;      if (ValidChars.indexOf(Char) == -1)&lt;br /&gt;         {&lt;br /&gt;         IsAlpha= false;&lt;br /&gt;         }&lt;br /&gt;      }&lt;br /&gt;   return IsAlpha;&lt;br /&gt;  &lt;br /&gt;   }&lt;br /&gt;/////////////////////////////////////////////////////////////////////////&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt; 3- Email Address Validation:-&lt;/strong&gt; (To check whether a text field contains valid email value)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;function isValidEmail(str) {&lt;br /&gt;   return (str.indexOf(".") &gt; 2) &amp;amp;&amp;amp; (str.indexOf("@") &gt; 0);&lt;br /&gt;&lt;br /&gt;}&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-3084771595133964711?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/3084771595133964711/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=3084771595133964711' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/3084771595133964711'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/3084771595133964711'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/09/javascript-validation-functions.html' title='JavaScript@ Validation Functions'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-1295874073777316372</id><published>2007-09-24T11:22:00.000-07:00</published><updated>2010-08-25T07:03:44.284-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL Server @ To List The Database Names along with their Size</title><content type='html'>The following system stored procedure is helpful to list the all database names along with their size in KiloBytes:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;EXEC&lt;/span&gt; &lt;span style="color: rgb(102, 51, 51);"&gt;sp_databases&lt;br /&gt;&lt;br /&gt;Results:&lt;br /&gt;--------------------------------&lt;br /&gt;DataBase_Name         DataBase_Size      REMARKS&lt;br /&gt;HighFall_Rockin            3712                        NULL&lt;br /&gt;master                                4608                         NULL&lt;br /&gt;model                                  1728                         NULL&lt;br /&gt;msdb                                    7360                        NULL&lt;br /&gt;tempdb    19456    NULL&lt;br /&gt;TLSPFX    4689152    NULL&lt;br /&gt;TLSPFX_BK    987008    NULL&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-1295874073777316372?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/1295874073777316372/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=1295874073777316372' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/1295874073777316372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/1295874073777316372'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/09/sql-server-to-list-database-names-along.html' title='SQL Server @ To List The Database Names along with their Size'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-1778811372104850259</id><published>2007-09-24T10:48:00.001-07:00</published><updated>2010-08-25T07:04:01.072-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL Server @ Query To List Available Triggers On a DataBase</title><content type='html'>The following query is helpful to enlist all the available triggers on a specific database.  sys.triggers is a view that contains a row for each object that is a trigger.&lt;br /&gt;&lt;br /&gt;Here is the query:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;USE&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; MSDB &lt;/span&gt;&lt;span style="color: rgb(0, 153, 0); font-weight: bold;"&gt;-- Database Name Here &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;SELECT&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; name,type,type_desc,create_date,modify_date &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;FROM&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 153, 0); font-weight: bold;"&gt;sys.triggers &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Results:&lt;br /&gt;---------------------------------------------------------&lt;br /&gt;&lt;/span&gt;name                                          type        type_desc            create_date                                modify_date&lt;br /&gt;&lt;br /&gt;trig_sysmail_profile_delete    TR    SQL_TRIGGER    2005-10-14 01:55:32.520    2005-10-14 02:02:31.787&lt;br /&gt;trig_sysmail_servertype    TR    SQL_TRIGGER    2005-10-14 01:55:32.740    2005-10-14 02:02:31.850&lt;br /&gt;trig_sysmail_server    TR    SQL_TRIGGER    2005-10-14 01:55:33.067    2005-10-14 02:02:31.910&lt;br /&gt;trig_sysmail_configuration    TR    SQL_TRIGGER    2005-10-14 01:55:33.287    2005-10-14 02:02:31.943&lt;br /&gt;trig_sysmail_mailitems    TR    SQL_TRIGGER    2005-10-14 01:55:33.507    2005-10-14 02:02:31.990&lt;br /&gt;trig_backupset_delete    TR    SQL_TRIGGER    2005-10-14 01:55:16.113    2005-10-14 02:02:32.007&lt;br /&gt;trig_sysmail_attachments    TR    SQL_TRIGGER    2005-10-14 01:55:33.723    2005-10-14 02:02:32.050&lt;br /&gt;trig_sysmail_log    TR    SQL_TRIGGER    2005-10-14 01:55:33.943    2005-10-14 02:02:32.100&lt;br /&gt;trig_sysoriginatingservers_delete    TR    SQL_TRIGGER    2005-10-14 01:54:09.833    2005-10-14 02:02:32.397&lt;br /&gt;trig_sysjobs_insert_update    TR    SQL_TRIGGER    2005-10-14 01:54:10.490    2005-10-14 02:02:32.520&lt;br /&gt;trig_sysschedules_insert_update    TR    SQL_TRIGGER    2005-10-14 01:54:12.677    2005-10-14 02:02:33.210&lt;br /&gt;trig_targetserver_insert    TR    SQL_TRIGGER    2005-10-14 01:55:08.570    2005-10-14 02:02:34.740&lt;br /&gt;trig_notification_ins_or_upd    TR    SQL_TRIGGER    2005-10-14 01:55:14.583    2005-10-14 02:02:35.333&lt;br /&gt;trig_notification_delete    TR    SQL_TRIGGER    2005-10-14 01:55:14.910    2005-10-14 02:02:35.363&lt;br /&gt;trig_sysmail_profile    TR    SQL_TRIGGER    2005-10-14 01:55:31.647    2005-10-14 02:02:35.787&lt;br /&gt;trig_principalprofile    TR    SQL_TRIGGER    2005-10-14 01:55:31.867    2005-10-14 02:02:35.833&lt;br /&gt;trig_sysmail_account    TR    SQL_TRIGGER    2005-10-14 01:55:32.083    2005-10-14 02:02:35.863&lt;br /&gt;trig_sysmail_profileaccount    TR    SQL_TRIGGER    2005-10-14 01:55:32.303    2005-10-14 02:02:35.910&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-1778811372104850259?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/1778811372104850259/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=1778811372104850259' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/1778811372104850259'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/1778811372104850259'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/09/sql-server-query-to-list-available.html' title='SQL Server @ Query To List Available Triggers On a DataBase'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-148996825314164741</id><published>2007-09-24T10:06:00.001-07:00</published><updated>2010-08-25T07:04:18.065-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL Server @ Query To List The available SQL JOBS</title><content type='html'>The following query is helpful to enlist the name, created date, modified date and description of the Sql Jobs available. You can add the mre column in the result set if needed.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;USE&lt;/span&gt; MSDB&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;SELECT&lt;/span&gt; name,enabled,date_created,date_modified,description&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;FROM &lt;/span&gt; sysjobs &lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;Results:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;-------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;Name                        Enabled         Date Created                      Date Modified&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;GEServiceEntries    1    2007-04-11 11:25:49.897    2007-04-11 11:54:05.503&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;CDW_CORFXSQL01_CORFXSQL01_0    1    2006-02-28 19:51:08.967    2006-02-28 19:51:09.217&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;DataEntryHHReports    1    2006-11-03 13:25:36.230    2007-09-20 11:43:29.297&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-148996825314164741?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/148996825314164741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=148996825314164741' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/148996825314164741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/148996825314164741'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/09/sql-server-query-to-list-available-sql.html' title='SQL Server @ Query To List The available SQL JOBS'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-7302666086100845982</id><published>2007-09-24T09:53:00.000-07:00</published><updated>2010-08-25T07:04:34.990-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL Server@ Query To See the Execution History of SQL JOBS</title><content type='html'>I have made a couple of SQL jobs that are scheduled accordingly to perform some specific tasks. I wanted to know whether the jobs are executed accordingly or not? And what are the results of the execution? Means success or failure. And finally, I created a query for this purpose after looking into the MSDB. Here is it:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;USE&lt;/span&gt; MSDB&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;SELECT&lt;/span&gt; j.name,h.run_status,h.run_date,h.run_time, h.run_duration,h.server, h.message&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;FROM&lt;/span&gt; sysjobhistory h,sysjobs j&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;WHERE&lt;/span&gt; h.job_id=j.job_id&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;ORDER BY&lt;/span&gt; run_date &lt;span style="color: rgb(51, 51, 255);"&gt;desc &lt;/span&gt;,run_time &lt;span style="color: rgb(51, 51, 255);"&gt;desc&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;Here are the results: (NOTE: I have omitted the Message column here)&lt;br /&gt;-----------------------------------------------------------------------------&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;DataEntryHHReports    1    20070921    121000    0    CORFXSQL01&lt;br /&gt;DataEntryHHReports    1    20070921    121000    1    CORFXSQL01&lt;br /&gt;DataEntryHHReports    0    20070914    121301    0    CORFXSQL01&lt;br /&gt;DataEntryHHReports    2    20070914    121001    0    CORFXSQL01&lt;br /&gt;DataEntryHHReports    0    20070914    121000    301    CORFXSQL01&lt;br /&gt;GEServiceEntries    1    20070911    0    0    CORFXSQL01&lt;br /&gt;GEServiceEntries    1    20070911    0    1    CORFXSQL01&lt;br /&gt;DataEntryHHReports    1    20070907    121000    1    CORFXSQL01&lt;br /&gt;DataEntryHHReports    1    20070907    121000    1    CORFXSQL01&lt;br /&gt;DataEntryHHReports    1    20070831    121001    0    CORFXSQL01&lt;br /&gt;DataEntryHHReports    1    20070831    121000    1    CORFXSQL01&lt;br /&gt;DataEntryHHReports    1    20070824    121001    0    CORFXSQL01&lt;br /&gt;DataEntryHHReports    1    20070824    121000    1    CORFXSQL01&lt;br /&gt;DataEntryHHReports    1    20070817    121000    0    CORFXSQL01&lt;br /&gt;DataEntryHHReports    1    20070817    121000    0    CORFXSQL01&lt;br /&gt;GEServiceEntries    1    20070811    0    0    CORFXSQL01&lt;br /&gt;GEServiceEntries    1    20070811    0    0    CORFXSQL01&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-7302666086100845982?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/7302666086100845982/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=7302666086100845982' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/7302666086100845982'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/7302666086100845982'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/09/sql-server-query-to-see-execution.html' title='SQL Server@ Query To See the Execution History of SQL JOBS'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-3631727788394007148</id><published>2007-09-03T12:52:00.000-07:00</published><updated>2010-08-25T07:04:50.594-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL Server@ List Stored Procedure Names using specific table</title><content type='html'>Sometimes you need to drop some table or needs to modify the name of the table, and before doing that you want to make sure which are the stored procedures that are using this table?&lt;br /&gt;&lt;br /&gt;Secondly, you just want to update the table by deleting it's some column, and you want to make sure which are the stored procedures that are using this column?&lt;br /&gt;&lt;br /&gt;The following query gives you the list of Stored procedures that are using some specific table name "CDRMaster".&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;SELECT &lt;/span&gt;Name, create_date,modify_date&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;FROM&lt;/span&gt; &lt;span style="color: rgb(51, 204, 0);"&gt;sys.procedures&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;WHERE&lt;/span&gt; OBJECT_DEFINITION(object_id)&lt;span style="color: rgb(153, 153, 153);"&gt; LIKE &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;'%CDRMaster%'&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;The following query will give you the list of the stored procedures using some specific column name(CDRID in this case)of the table CDRMaster:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;SELECT &lt;/span&gt;Name, create_date,modify_date&lt;/span&gt;&lt;br /&gt; &lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;FROM&lt;/span&gt; &lt;span style="color: rgb(51, 204, 0);"&gt;sys.procedures&lt;/span&gt;&lt;/span&gt;&lt;br /&gt; &lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;WHERE&lt;/span&gt; OBJECT_DEFINITION(object_id)&lt;span style="color: rgb(153, 153, 153);"&gt; LIKE &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;'%CDRMaster%'&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;AND&lt;/span&gt; OBJECT_DEFINITION(object_id)&lt;span style="color: rgb(153, 153, 153);"&gt; LIKE &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;'%CDRID%'&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-3631727788394007148?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/3631727788394007148/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=3631727788394007148' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/3631727788394007148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/3631727788394007148'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/09/sql-server-list-stored-procedure-names_03.html' title='SQL Server@ List Stored Procedure Names using specific table'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-7604460636746713928</id><published>2007-09-03T12:42:00.000-07:00</published><updated>2010-08-25T07:05:07.463-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL Server@ List Stored Procedure Names Created in Specific Date Range</title><content type='html'>This simple query returns the list of stored procedure names that are created with in the specific data range given in where clause.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;SELECT&lt;/span&gt; &lt;span style="color: rgb(51, 51, 51);"&gt;Name,create_date,modify_date &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;FROM  &lt;/span&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;sys.procedures &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;WHERE&lt;/span&gt;  create_date &lt;span style="color: rgb(153, 153, 153);"&gt;between&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;'07/14/2007' &lt;/span&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;and&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;'08/20/2007'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-7604460636746713928?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/7604460636746713928/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=7604460636746713928' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/7604460636746713928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/7604460636746713928'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/09/sql-server-list-stored-procedure-names.html' title='SQL Server@ List Stored Procedure Names Created in Specific Date Range'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-4255111307738239734</id><published>2007-08-29T13:50:00.000-07:00</published><updated>2010-08-25T07:05:25.217-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Java 1.4: ASSERTIONS</title><content type='html'>Assertions provide a convenient mechanism for verifying that a class's methods are called correctly. This mechanism can be enabled or disabled at runtime. The intention is that assertions typically be enabled during development and disabled in the field.&lt;br /&gt;&lt;br /&gt;Assertions  has the following syntax:&lt;br /&gt;&lt;br /&gt;assert Expression1;&lt;br /&gt;assert Expression1 : Expression2;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Expression1 must be boolean type.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Expression2 may have any type.&lt;/li&gt;&lt;li&gt;If assertions are disables at runtime (default state)  then assert statement does nothing.&lt;/li&gt;&lt;li&gt;If assertions are enabled at runtime( using command line argument to JVM) then Expression1 is evaluated. If it is true, no further action is taken. If it is false then AssertionError is thrown. If Expression2 is present, it is passed to constructor of the AssertionError where it is converted to String and used as a error message.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-4255111307738239734?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/4255111307738239734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=4255111307738239734' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/4255111307738239734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/4255111307738239734'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/08/java-14-assertions.html' title='Java 1.4: ASSERTIONS'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-6634884142106417192</id><published>2007-08-16T14:04:00.000-07:00</published><updated>2010-08-25T07:05:47.015-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Inserting rows with default values in a Table</title><content type='html'>The following simple query will insert a row into the table name specified with the default values for each column:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-weight: bold; color: rgb(0, 0, 153); font-style: italic;"&gt;INSERT INTO TableName DEFAULT VALUES&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-6634884142106417192?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/6634884142106417192/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=6634884142106417192' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/6634884142106417192'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/6634884142106417192'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/08/inserting-rows-with-default-values-in.html' title='Inserting rows with default values in a Table'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-4839133260180986032</id><published>2007-08-07T12:40:00.000-07:00</published><updated>2010-08-25T07:06:21.512-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>JAVA 5.0 Autoboxing/Unboxing</title><content type='html'>&lt;span style="font-weight: bold; color: rgb(102, 0, 0);"&gt;What is Boxing?&lt;br /&gt;       &lt;/span&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;Converting a primitive type to it's wrapper class is known as Boxing. For example converting from int to Integer, float to Float, double to Double etc.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0);"&gt;What is unboxing?&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;         The reciprocal of Boxing is called unboxing, means converting from some wrapper class to it's respective primitive type is known as unboxing. For example converting from Integer to int, Float to float, Double to double etc.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;In the earlier versions from JDK 1.5 ,  boxing and unboxing  was manual.  You have to explicitly convert from one into another. But in JDK 1.5 boxing  and unboxing is automatic and the compiler will do this itself on your behalf.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0);"&gt;Example of Manual Boxing/unboxing:&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0); font-weight: bold;"&gt; int a = 2;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0); font-weight: bold;"&gt; int b;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0); font-weight: bold;"&gt; Integer aW = Integer(a);  // This is example of boxing&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0); font-weight: bold;"&gt; b =aW&lt;/span&gt;&lt;span style="color: rgb(102, 0, 0); font-weight: bold;font-family:monospace;" &gt;.&lt;/span&gt;&lt;span style="color: rgb(102, 0, 0); font-weight: bold;"&gt;intValue(); // This is an example of unboxing.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;If you want to store int values of some range say 0-100 in an ArrayList, then what you need to do ? Certainly you will make the wrapper objects of Integer class and will add them into an array list like here &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;code style="color: rgb(102, 0, 0);"&gt;          &lt;b style="font-weight: bold;"&gt;ArrayList&lt;integer&gt; list = new &lt;/integer&gt;&lt;/b&gt;&lt;span style="font-weight: bold;"&gt;ArrayList&lt;integer&gt;();&lt;/integer&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;          &lt;/span&gt;&lt;b style="font-weight: bold;"&gt;for&lt;/b&gt;&lt;span style="font-weight: bold;"&gt;(&lt;/span&gt;&lt;b style="font-weight: bold;"&gt;int &lt;/b&gt;&lt;span style="font-weight: bold;"&gt;i = 0; i &lt;100;i++)&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;             list.add(&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code style="color: rgb(102, 0, 0); font-weight: bold;"&gt;new Integer(i)&lt;/code&gt;&lt;code style="color: rgb(102, 0, 0);"&gt;&lt;span style="font-weight: bold;"&gt;);// You can pass only Objects into add  method                                       // not primitives&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;          }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is basically boxing. Similarly if you want to add the elements of the ArrayList into some int variable then you need to do the unboxing like shown here:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;  sum += ((Integer)list.get(i)).intValue(); &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;But if you are using JAVA 5.0, all of these will be done automatically by the compiler on your behalf like shown here:&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;code style="color: rgb(102, 0, 0);"&gt;       &lt;b style="font-weight: bold;"&gt;  ArrayList&lt;integer&gt; list = new &lt;/integer&gt;&lt;/b&gt;&lt;span style="font-weight: bold;"&gt;ArrayList&lt;integer&gt;();&lt;/integer&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;           &lt;/span&gt;&lt;b style="font-weight: bold;"&gt;for&lt;/b&gt;&lt;span style="font-weight: bold;"&gt;(&lt;/span&gt;&lt;b style="font-weight: bold;"&gt;int &lt;/b&gt;&lt;span style="font-weight: bold;"&gt;i = 0; i &lt;100;i++)&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;           {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;              list.add(i); // AutoBoxing is done here&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;           }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;          &lt;/span&gt;&lt;span style="font-weight: bold;font-family:mon;" &gt;&lt;br /&gt;         &lt;/span&gt;&lt;b style="font-weight: bold;"&gt;int &lt;/b&gt;&lt;span style="font-weight: bold;"&gt;sum = 0;           &lt;/span&gt;&lt;b style="font-weight: bold;"&gt;&lt;br /&gt;         for &lt;/b&gt;&lt;span style="font-weight: bold;"&gt;( Integer j : list)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;            {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;                sum += j; // Auto-unboxing is done here.. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;            }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For further reference Read the &lt;a href="http://java.sun.com/j2se/1.5.0/docs/guide/language/autoboxing.html"&gt;SUN DOCUMENTATION&lt;/a&gt; from the following link:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://java.sun.com/j2se/1.5.0/docs/guide/language/autoboxing.html"&gt;http://java.sun.com/j2se/1.5.0/docs/guide/language/autoboxing.html&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0);"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-4839133260180986032?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/4839133260180986032/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=4839133260180986032' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/4839133260180986032'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/4839133260180986032'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/08/sql-server-how-to-find-table-names.html' title='JAVA 5.0 Autoboxing/Unboxing'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-3829981908263130059</id><published>2007-08-06T14:12:00.000-07:00</published><updated>2010-08-25T07:06:35.863-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>JAVA 5.0 Enhanced For- Loop</title><content type='html'>&lt;span style="color: rgb(102, 0, 0);font-family:arial;" &gt;Enhanced FOR-LOOP is a new addition in JAVA 5.0. If you have worked in Visual Basic then you have used FOR-EACH loop in VB.  Enhanced For-loop in JAVA5.0 is very similar to For-Each Loop of Visual Basic.  &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);font-family:arial;" &gt;Enhanced for-loop is used to iterate arrays and collections. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0);font-family:arial;" &gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Iteration over Arrays : &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;pre  style="font-weight: bold; color: rgb(102, 0, 0);font-family:arial;"&gt;&lt;span style="font-weight: normal;font-family:arial;" &gt; The  syntax for iteration over arrays is as following :&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;for (&lt;i&gt;type&lt;/i&gt; &lt;i&gt;var&lt;/i&gt;iable : &lt;i&gt;array&lt;/i&gt;)&lt;br /&gt;{&lt;br /&gt; &lt;i&gt;body-of-loop&lt;/i&gt;&lt;br /&gt;}&lt;/pre&gt;&lt;span style="color: rgb(102, 0, 0);font-family:arial;" &gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0);font-family:arial;" &gt;&lt;/span&gt;&lt;span style="color: rgb(102, 0, 0);font-family:arial;" &gt;First we make a function that uses  simple/conventional For Loop to add an array of int  and returns its sum: &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);font-family:arial;" &gt;int sumArray( int [] arr )&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);font-family:arial;" &gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);font-family:arial;" &gt;       int sumArray=0;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);font-family:arial;" &gt;      &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0);font-family:arial;" &gt; for ( int i=0;i&lt;arr.length;i++)&gt;&lt;/arr.length;i++)&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0);font-family:arial;" &gt;       {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0);font-family:arial;" &gt;          sumArray+=arr[i];&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0);font-family:arial;" &gt;        }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);font-family:arial;" &gt;   return  sumArray;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);font-family:arial;" &gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);font-family:arial;" &gt;If we want to utilize the new Enhanced for-loop( sometimes called For-Each loop or For-In loop) the above function will be like. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);font-family:arial;" &gt;int sumArray( int [] arr )&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);font-family:arial;" &gt; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);font-family:arial;" &gt;        int sumArray=0;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);font-family:arial;" &gt;       &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0);font-family:arial;" &gt; for ( int i : arr )&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0);font-family:arial;" &gt;       {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0);font-family:arial;" &gt;          sumArray+=i;   //  &lt;/span&gt;&lt;span style="color: rgb(102, 0, 0);font-family:arial;" &gt;here i gets successively each value in array a &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0);font-family:arial;" &gt;   &lt;br /&gt;     }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);font-family:arial;" &gt;    return  sumArray;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);font-family:arial;" &gt; }&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0);font-family:arial;" &gt;&lt;span style="font-size:130%;"&gt;Iteration over Collections : &lt;/span&gt;&lt;br /&gt;&lt;/span&gt; &lt;pre  style="font-weight: bold; color: rgb(102, 0, 0);font-family:arial;"&gt;&lt;span style="font-weight: normal;font-family:arial;" &gt; The  syntax for iteration over collections is as following :&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;for (&lt;i&gt;type&lt;/i&gt; &lt;i&gt;variable&lt;/i&gt; : &lt;i&gt;collection &lt;/i&gt;)&lt;br /&gt;{&lt;br /&gt; &lt;i&gt;body-of-loop&lt;/i&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: normal;"&gt;For example we have a collection of books in a List and we retrieve it using Iterators using the&lt;br /&gt;conventional for- loop like:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="font-weight: bold;"&gt;List books = ...... &lt;/span&gt;&lt;/span&gt; &lt;span style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/span&gt; for (Iterator i = books.iterator(); i.hasNext(); )&lt;br /&gt;{&lt;br /&gt;&lt;span&gt;   Book  book= (Book) i.next();&lt;br /&gt;&lt;/span&gt;   &lt;span style="font-weight: normal;"&gt;//..... body of loop  .... &lt;/span&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: normal;"&gt;Its reciprocal syntax using enhanced-for loop  will look like,&lt;br /&gt;// Assume there is a List of books available like&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;List books = ...... &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt; for (&lt;span&gt;Book  &lt;/span&gt;book : books)&lt;br /&gt;{&lt;br /&gt;&lt;span style="font-weight: normal;"&gt;  // /now book has the value for each iteration of list &lt;/span&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt; &lt;span style="color: rgb(102, 0, 0);font-family:arial;" &gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Restrictions of Enhanced For-Loop:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul style="color: rgb(102, 0, 0);"&gt;&lt;li&gt;It is not possible to traverse  more than one structures at the same time. For example  two arrays.&lt;/li&gt;&lt;li&gt;You can only access only single element at each iteration. You can not have access to more than one elements. Like in case of comparing successive elements in an array.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;You can not iterate an array backwards. It is forward-only and single step increment.&lt;/li&gt;&lt;li&gt;It is not compatible for the earlier versions of the JAVA 5.0.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;For more details visit the following link of &lt;/span&gt;&lt;a style="font-weight: bold; font-style: italic; font-family: webdings; color: rgb(102, 0, 0);" href="http://java.sun.com/j2se/1.5.0/docs/guide/language/foreach.html"&gt;SUN DOCOMENTATION&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-3829981908263130059?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/3829981908263130059/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=3829981908263130059' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/3829981908263130059'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/3829981908263130059'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/08/java-50-enhanced-for-loop.html' title='JAVA 5.0 Enhanced For- Loop'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-1818861398779078504</id><published>2007-08-03T08:47:00.000-07:00</published><updated>2010-08-25T07:06:49.768-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>JAVA: A Method to Get Current Day of Week</title><content type='html'>&lt;span style="color: rgb(153, 0, 0); font-weight: bold;"&gt;Hello everybody, here is the method that returns the current day of week. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;public static String getCurrentDayofWeek()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;          String DAY="";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;          Calendar cal =Calendar.getInstance();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;          int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK);        &lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;          switch (dayOfWeek)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;          {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;          case 1:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;              DAY="SUNDAY";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;              break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;          case 2:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;              DAY="MONDAY";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;              break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;          case 3:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;              DAY="TUESDAY";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;              break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;          case 4:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;              DAY="WEDNESDAY";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;              break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;          case 5:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;              DAY="THRUSDAY";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;              break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;          case 6:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;              DAY="FRIDAY";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;              break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;          case 7:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;              DAY="SATURDAY";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;              break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;          }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;        return DAY;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;    }&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-1818861398779078504?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/1818861398779078504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=1818861398779078504' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/1818861398779078504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/1818861398779078504'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/08/java-method-to-get-current-day-of-week.html' title='JAVA: A Method to Get Current Day of Week'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-3946607913503927188</id><published>2007-08-02T14:42:00.000-07:00</published><updated>2010-08-25T07:07:21.720-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>New Features in JAVA 5.0</title><content type='html'>The following is the list of new features added on in version 5.0 of JAVA.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Generics&lt;/li&gt;&lt;li&gt;Enhanced "for" loop  ( &lt;a href="http://sabahmyrsh.blogspot.com/2007/08/java-50-enhanced-for-loop.html"&gt;Click Here for Detail&lt;/a&gt; )&lt;/li&gt;&lt;li&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;Autoboxing&lt;/span&gt;/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;Unboxing &lt;/span&gt;( &lt;a href="http://sabahmyrsh.blogspot.com/2007/08/sql-server-how-to-find-table-names.html"&gt;Click Here for Detail&lt;/a&gt; )&lt;/li&gt;&lt;li&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;Typesafe&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;Enums&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;Varargs&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Static Import ( &lt;a href="http://sabahmyrsh.blogspot.com/2007/07/static-import-new-feature-in-java-50.html"&gt;Click Here for Detail&lt;/a&gt; )&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;Metadata&lt;/span&gt;( Annotations)&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-3946607913503927188?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/3946607913503927188/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=3946607913503927188' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/3946607913503927188'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/3946607913503927188'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/08/new-features-in-java-50.html' title='New Features in JAVA 5.0'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-4510114995765251862</id><published>2007-08-02T14:07:00.001-07:00</published><updated>2010-08-25T07:07:06.370-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SCJP'/><title type='text'>SCJP Hand outs Part-1</title><content type='html'>&lt;ol style="margin-top: 0in;" start="1" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;The      floating-point numbers did not throw divide by zero ArithmeticException.      They will give a result that is Not A Number NAN. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;The      case argument must be either an int literal , or an int-compatible      variable which is a constant (i.e static or final)&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Assume      byte a=3; byte b=2;&lt;span style=""&gt;  &lt;/span&gt;byte c=      a+b;&lt;span style=""&gt;   &lt;/span&gt;&lt;span style="font-family: Wingdings;"&gt;&lt;span style=""&gt;à&lt;/span&gt;&lt;/span&gt;      Compile time error because the addition operator will wide the byte to int      before addition and result should be stored in int variable. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;An      abstract class can have a constructor.&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;It is      legal to access a static method using an instance of the class. But it is      preferred way to use the class name to access. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Methods      can be overridden Attributes/member variables can not. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;If a      try/catch block calls System.exit() then finally block will not execute. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;A member      variable can not be native. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Constructors      are not inherited. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;You      can not automatically/implicitly convert a char to short. There is same      bit depth but since char are unsigned they might have higher positive      value than a short can accept.&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Arithmetic      Exception is not a checked exception. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;An      interface can extend multiple interfaces however a class can extend only      one class.&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;A      member variable can not be declared synchronized. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Math.round(-3.22)      = -3 &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;You      can not make a final abstract class. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;A      constructor of a class can not be declared static.&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Inner      classes can not be defined in a class outside of its methods like where      declaring member variables.&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;A      class can not be declared transient. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;A      method can not be declared transient. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;static      methods of a class can not be accessed using this.MethodName(). &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Only      variables can be declared as volatile. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;A      floating point literal (like 3.45) in java will be treated as double      unless you specify an f at the end like (3.45f).&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;A top      level class can not be marked as private.&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;An      overloaded method can change the return type, but return type alone is not      enough—it also must change the argument list. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;If      there is a return statement in try/catch block then finally block will      also be executed. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;int      iArray[5] = new int[] {1,2,3,4,5}; will&lt;span style=""&gt;       &lt;/span&gt;not compile but int iArray[] = new int[] {1,2,3,4,5}; will compile.      &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;An      anonymous inner class can not have a constructor.&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Result      of System.out.println(Math.sqrt(-4)); is equal to &lt;st1:place st="on"&gt;NAN&lt;/st1:place&gt;.&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;A top      level class can not be marked as protected.&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;cast      is not a keyword in JAVA. &lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-4510114995765251862?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/4510114995765251862/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=4510114995765251862' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/4510114995765251862'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/4510114995765251862'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/08/scjp-hand-outs-part-1.html' title='SCJP Hand outs Part-1'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-2126163005082626970</id><published>2007-07-31T06:23:00.000-07:00</published><updated>2010-08-25T07:07:36.048-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>STATIC Import, A new feature in JAVA 5.0</title><content type='html'>Static Import statement is the new addition in JDK 5.0. This statement is used to import the static variables/fields  and  static members of some class.&lt;br /&gt;&lt;br /&gt;Let's take an example, like if we need to use the "PI" static  field of Math class in java.lang then  we need to write something like :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial; color: rgb(0, 0, 153);font-size:85%;" &gt;double a=10;&lt;br /&gt;&lt;/span&gt;&lt;pre style="font-family: arial;"&gt;&lt;span style="color: rgb(0, 0, 153);font-size:85%;" &gt;double res = &lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);font-size:85%;color:#cc0000;"  &gt;Math.&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);font-size:85%;" &gt;sin(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);font-size:85%;color:#cc0000;"  &gt;Math.&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);font-size:85%;" &gt;PI * a)&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;But if you use the static import in your program then it will be like:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;import static java.lang.Math.PI;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial; color: rgb(0, 0, 153);font-size:85%;" &gt;double a=10;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);font-size:85%;" &gt;double res = &lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);font-size:85%;color:#cc0000;"  &gt;Math.&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);font-size:85%;" &gt;sin(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);font-size:85%;" &gt;PI * a)&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;you noticed that we have no need to write the fully qualified  name of the PI but still we need to write the fully qualified name of the static method &lt;span style="font-weight: bold; font-style: italic;"&gt;"sin"&lt;/span&gt; like &lt;span style="font-weight: bold; font-style: italic;"&gt;Math.sin(..)&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;There is a second form of the static import that imports all of the static  fields and members of a class .i.e by using  the&lt;span style="font-weight: bold; font-style: italic;"&gt; * notation&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: arial;"&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;import static java.lang.Math.*;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial; color: rgb(0, 0, 153);font-size:85%;" &gt;double a=10;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);font-size:85%;" &gt;double res = &lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);font-size:85%;" &gt;sin(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);font-size:85%;" &gt;PI * a)&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-2126163005082626970?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/2126163005082626970/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=2126163005082626970' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/2126163005082626970'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/2126163005082626970'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/07/static-import-new-feature-in-java-50.html' title='STATIC Import, A new feature in JAVA 5.0'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-3332152573359160046</id><published>2007-07-27T13:24:00.000-07:00</published><updated>2010-08-25T07:20:12.533-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C #'/><title type='text'>Visual Studio .NET 2008 Beta Available to Download Now</title><content type='html'>&lt;span style="font-weight: bold; color: rgb(0, 153, 0);"&gt;Visual Studio .NET 2008 Beta Available to Download Now on the Microsoft website:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 153, 0);"&gt;Here are the Links:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 153, 0);font-family:arial;font-size:85%;"  &gt;You can download the Visual Studio 2008 product&lt;a href="http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx"&gt; &lt;/a&gt;&lt;a href="http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx" target="_blank"&gt;here&lt;/a&gt;.  You can alternatively download the smaller VS 2008 Express Editions &lt;a href="http://msdn2.microsoft.com/en-us/express/future/bb421473.aspx" target="_blank"&gt;here&lt;/a&gt;. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 153, 0);"&gt;Enjoy!!!!!!&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-3332152573359160046?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/3332152573359160046/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=3332152573359160046' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/3332152573359160046'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/3332152573359160046'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/07/visual-studio-net-2008-beta-available.html' title='Visual Studio .NET 2008 Beta Available to Download Now'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-4078946138362015156</id><published>2007-07-27T13:17:00.000-07:00</published><updated>2010-08-25T07:20:45.230-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C #'/><title type='text'>Visual Studio .NET 2008 First Look Video</title><content type='html'>I was surfing on the net today and came across a link for the first look video of Visual Studio .NET 2008. I would like to share it with you people.&lt;br /&gt;&lt;br /&gt;Here  is the link:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.xmlforasp.net/codebank/download/blog/video/LinqDataSource.wmv"&gt;http://www.xmlforasp.net/codebank/download/blog/video/LinqDataSource.wmv&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Enjoy!!!!!!&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-4078946138362015156?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/4078946138362015156/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=4078946138362015156' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/4078946138362015156'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/4078946138362015156'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/07/visual-studio-net-2008-first-look-video.html' title='Visual Studio .NET 2008 First Look Video'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-8020121777624254584</id><published>2007-07-27T12:37:00.000-07:00</published><updated>2010-08-25T07:08:11.752-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>UDF to Get Day of Week in SQL Server 2005</title><content type='html'>The following UDF can be used to get the Day of Week by passing it a specific date:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;CREATE FUNCTION dbo.udf_Day_Of_Week(@p_Date DATETIME)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;RETURNS VARCHAR(10)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;AS&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;BEGIN&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;DECLARE @return_DayofWeek VARCHAR(10)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;SELECT @return_DayofWeek = CASE DATEPART(dw,@p_Date)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;WHEN 1 THEN 'SUNDAY'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;WHEN 2 THEN 'MONDAY'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;WHEN 3 THEN 'TUESDAY'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;WHEN 4 THEN 'WEDNESDAY'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;WHEN 5 THEN 'THURSDAY'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;WHEN 6 THEN 'FRIDAY'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;WHEN 7 THEN 'SATURDAY'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;END&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;RETURN (@return_DayofWeek)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;END&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-8020121777624254584?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/8020121777624254584/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=8020121777624254584' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/8020121777624254584'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/8020121777624254584'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/07/udf-to-get-day-of-week-in-sql-server.html' title='UDF to Get Day of Week in SQL Server 2005'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-8572647883426802266</id><published>2007-07-25T07:03:00.000-07:00</published><updated>2010-08-25T07:07:56.332-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>How To Take Database Schema Backup in SQL Server 2005</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;span style="font-size:130%;"&gt;How To Take Database Schema Backup in SQL Server 2005&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Go to OBJECT EXPLORER of the SQL Server 2005 and expand the Databases tree node, you can see the available databases in your server.&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_4f1LhtA4Gj0/RqdaGPS18bI/AAAAAAAAAAU/X1k65t-3a4E/s1600-h/1.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_4f1LhtA4Gj0/RqdaGPS18bI/AAAAAAAAAAU/X1k65t-3a4E/s320/1.JPG" alt="" id="BLOGGER_PHOTO_ID_5091136966996914610" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin-left: 0.25in; text-align: center;" align="center"&gt;&lt;b style=""&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 27pt;"&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shapetype id="_x0000_t75" coordsize="21600,21600" spt="75" preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"&gt;  &lt;v:stroke joinstyle="miter"&gt;  &lt;v:formulas&gt;   &lt;v:f eqn="if lineDrawn pixelLineWidth 0"&gt;   &lt;v:f eqn="sum @0 1 0"&gt;   &lt;v:f eqn="sum 0 0 @1"&gt;   &lt;v:f eqn="prod @2 1 2"&gt;   &lt;v:f eqn="prod @3 21600 pixelWidth"&gt;   &lt;v:f eqn="prod @3 21600 pixelHeight"&gt;   &lt;v:f eqn="sum @0 0 1"&gt;   &lt;v:f eqn="prod @6 1 2"&gt;   &lt;v:f eqn="prod @7 21600 pixelWidth"&gt;   &lt;v:f eqn="sum @8 21600 0"&gt;   &lt;v:f eqn="prod @7 21600 pixelHeight"&gt;   &lt;v:f eqn="sum @10 21600 0"&gt;  &lt;/v:formulas&gt;  &lt;v:path extrusionok="f" gradientshapeok="t" connecttype="rect"&gt;  &lt;o:lock ext="edit" aspectratio="t"&gt; &lt;/v:shapetype&gt;&lt;v:shape id="_x0000_i1032" type="#_x0000_t75" style="'width:5in;"&gt;  &lt;v:imagedata src="file:///C:\DOCUME~1\suddin\LOCALS~1\Temp\msohtml1\01\clip_image001.png" title=""&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;br /&gt;&lt;!--[endif]--&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 27pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;Then      Right Click on the specific Database you wish to make the schema backup.      And go to TASKS&lt;span style="font-family:Wingdings;"&gt;&lt;span style=""&gt;à&lt;/span&gt;&lt;/span&gt; GENERATE SCRIPTS like      shown in the figure below:&lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal" style="margin-left: 27pt;"&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1025" type="#_x0000_t75" style="'width:369pt;height:255pt'"&gt;  &lt;v:imagedata src="file:///C:\DOCUME~1\suddin\LOCALS~1\Temp\msohtml1\01\clip_image003.png" title=""&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;br /&gt;&lt;!--[endif]--&gt;&lt;/p&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_4f1LhtA4Gj0/Rqdag_S18cI/AAAAAAAAAAc/JD1h2jsJwLQ/s1600-h/2.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_4f1LhtA4Gj0/Rqdag_S18cI/AAAAAAAAAAc/JD1h2jsJwLQ/s320/2.JPG" alt="" id="BLOGGER_PHOTO_ID_5091137426558415298" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;After      selecting the GENERATE SCRIPTS you will see a welcome screen like shown      below.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_4f1LhtA4Gj0/RqddkPS18dI/AAAAAAAAAAk/VmkMLXJR8_Q/s1600-h/3.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_4f1LhtA4Gj0/RqddkPS18dI/AAAAAAAAAAk/VmkMLXJR8_Q/s320/3.JPG" alt="" id="BLOGGER_PHOTO_ID_5091140780927873490" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1026" type="#_x0000_t75" style="'width:342pt;height:295.5pt'"&gt;  &lt;v:imagedata src="file:///C:\DOCUME~1\suddin\LOCALS~1\Temp\msohtml1\01\clip_image005.png" title=""&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;br /&gt;&lt;!--[endif]--&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;Click      on NEXT button of the Wizard and you will be asked to select the database      you wish to generate schema backup like below in figure(TestDB is the      database in this case):&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_4f1LhtA4Gj0/RqdeDvS18eI/AAAAAAAAAAs/6JGEiC8h18I/s1600-h/4.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_4f1LhtA4Gj0/RqdeDvS18eI/AAAAAAAAAAs/6JGEiC8h18I/s320/4.JPG" alt="" id="BLOGGER_PHOTO_ID_5091141322093752802" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1027" type="#_x0000_t75" style="'width:333pt;height:261pt'"&gt;  &lt;v:imagedata src="file:///C:\DOCUME~1\suddin\LOCALS~1\Temp\msohtml1\01\clip_image007.png" title=""&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;br /&gt;&lt;!--[endif]--&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;If you      want to take the full schema back up of the database then check the      checkbox &lt;b style=""&gt;&lt;i style=""&gt;“Script all objects in the selected database”&lt;/i&gt;&lt;/b&gt;&lt;i style=""&gt; &lt;/i&gt;like shown here in the figure and      click Next button of the wizard. &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_4f1LhtA4Gj0/Rqdk8PS18fI/AAAAAAAAAA0/JlHnQtUNN6M/s1600-h/5.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_4f1LhtA4Gj0/Rqdk8PS18fI/AAAAAAAAAA0/JlHnQtUNN6M/s320/5.JPG" alt="" id="BLOGGER_PHOTO_ID_5091148889826128370" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1028" type="#_x0000_t75" style="'width:342pt;height:277.5pt'"&gt;  &lt;v:imagedata src="file:///C:\DOCUME~1\suddin\LOCALS~1\Temp\msohtml1\01\clip_image009.png" title=""&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;br /&gt;&lt;!--[endif]--&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;In the      next screen you can play with the different properties. Just need to      change one of the property if you need to use this schema on SQL Server      2000 version, that is &lt;b style=""&gt;&lt;i style=""&gt;“Script for Server Version”&lt;/i&gt;&lt;/b&gt; and      select the appropriate version you needed.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_4f1LhtA4Gj0/RqdlSfS18gI/AAAAAAAAAA8/GRd5uPJ0nl0/s1600-h/6.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_4f1LhtA4Gj0/RqdlSfS18gI/AAAAAAAAAA8/GRd5uPJ0nl0/s320/6.JPG" alt="" id="BLOGGER_PHOTO_ID_5091149272078217730" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1029" type="#_x0000_t75" style="'width:333pt;height:270pt'"&gt;  &lt;v:imagedata src="file:///C:\DOCUME~1\suddin\LOCALS~1\Temp\msohtml1\01\clip_image011.png" title=""&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;br /&gt;&lt;!--[endif]--&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;After      selecting the appropriate SQL Server version for which you are preparing      the schema backup click Next Button and you will reach at the OUTPUT      OPTION and then select the appropriate output option. In my case I am      saving the script of schema in a File of Unicode Text like:&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_4f1LhtA4Gj0/RqdlnfS18hI/AAAAAAAAABE/rxVEqpHFieU/s1600-h/7.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_4f1LhtA4Gj0/RqdlnfS18hI/AAAAAAAAABE/rxVEqpHFieU/s320/7.JPG" alt="" id="BLOGGER_PHOTO_ID_5091149632855470610" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1030" type="#_x0000_t75" style="'width:324pt;height:294.75pt'"&gt;  &lt;v:imagedata src="file:///C:\DOCUME~1\suddin\LOCALS~1\Temp\msohtml1\01\clip_image013.png" title=""&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;br /&gt;&lt;!--[endif]--&gt;&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;Then      Click Next and you will reach on the Script wizard Summary screen, Simply      Click Finish to execute your requested job.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_4f1LhtA4Gj0/Rqdl2vS18iI/AAAAAAAAABM/Sq5Y0auWVew/s1600-h/8.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_4f1LhtA4Gj0/Rqdl2vS18iI/AAAAAAAAABM/Sq5Y0auWVew/s320/8.JPG" alt="" id="BLOGGER_PHOTO_ID_5091149894848475682" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1031" type="#_x0000_t75" style="'width:297pt;height:270.75pt'"&gt;  &lt;v:imagedata src="file:///C:\DOCUME~1\suddin\LOCALS~1\Temp\msohtml1\01\clip_image015.png" title=""&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;br /&gt;&lt;!--[endif]--&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;After      clicking the Finish button you will reach at &lt;b style=""&gt;&lt;i style=""&gt;the Generate Script progress      Wizard. &lt;/i&gt;&lt;/b&gt;It will take a little time depending upon the number of      objects in your selected database. After completing its job it will show      you the success status. &lt;b style=""&gt;&lt;i style=""&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_4f1LhtA4Gj0/RqdpkfS18kI/AAAAAAAAABc/wDfG1X_PSoE/s1600-h/9.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_4f1LhtA4Gj0/RqdpkfS18kI/AAAAAAAAABc/wDfG1X_PSoE/s320/9.JPG" alt="" id="BLOGGER_PHOTO_ID_5091153979362374210" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;b style=""&gt;&lt;i style=""&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1033" type="#_x0000_t75" style="'width:315pt;height:287.25pt'"&gt;  &lt;v:imagedata src="file:///C:\DOCUME~1\suddin\LOCALS~1\Temp\msohtml1\01\clip_image017.png" title=""&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;br /&gt;&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;If you      want to see the Report of the whole process, just select from the options      of Report button just up from the Close and select the output option of      the report. Otherwise click Close. That’s it and you are Done. &lt;/li&gt;&lt;/ul&gt;  &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-8572647883426802266?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/8572647883426802266/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=8572647883426802266' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/8572647883426802266'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/8572647883426802266'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/07/how-to-take-database-schema-backup-in.html' title='How To Take Database Schema Backup in SQL Server 2005'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_4f1LhtA4Gj0/RqdaGPS18bI/AAAAAAAAAAU/X1k65t-3a4E/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-3504274050791750108</id><published>2007-07-24T09:05:00.000-07:00</published><updated>2010-08-25T07:08:27.978-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>A UDF To Get Previous Working Day in SQL Server 2005</title><content type='html'>It has pretty similar logic as we done with the UDF of Next Working Day. You can read the  earlier post on "&lt;span style="font-weight: bold;"&gt;How to get the Week Day&lt;/span&gt;"  for better understanding. Here is the self explanatory code. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;CREATE FUNCTION dbo.udf_GetPreviousWorkingDay (@p_Date DATETIME )&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;RETURNS DATETIME&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;AS&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;BEGIN&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;DECLARE @m_WeekDay INT&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;DECLARE @rt_Prev_Working_Day DATETIME&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;SET @m_WeekDay = DATEPART(weekday,@p_Date)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;IF @m_WeekDay = 1      -- IF SUNDAY then subtract 2 fromsunday to get friday that is working day&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;SET @rt_Prev_Working_Day = DATEADD(d,-2,@p_Date)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;ELSE IF @m_WeekDay = 2 -- IF MONDAY then subtract 3 fromsunday to get friday that is working day&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;SET @rt_Prev_Working_Day = DATEADD(d,-3,@p_Date)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;ELSE  -- ELSE subtract one to get the prev date&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;SET @rt_Prev_Working_Day = DATEADD(d,-1,@p_Date)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;RETURN @rt_Prev_Working_Day&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;END&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here are some of the test cases having the same result:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0); font-weight: bold;"&gt;SELECT dbo.udf_GetPreviousWorkingDay  ( '07/21/2007')&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0); font-weight: bold;"&gt;SELECT dbo.udf_GetPreviousWorkingDay  ( '07/22/2007')&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0); font-weight: bold;"&gt;SELECT dbo.udf_GetPreviousWorkingDay  ( '07/23/2007')&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Result:&lt;br /&gt;&lt;br /&gt;2007-07-20 00:00:00.000&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-3504274050791750108?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/3504274050791750108/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=3504274050791750108' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/3504274050791750108'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/3504274050791750108'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/07/udf-to-get-previous-working-day-in-sql.html' title='A UDF To Get Previous Working Day in SQL Server 2005'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-6913061596648647541</id><published>2007-07-24T08:54:00.000-07:00</published><updated>2010-08-25T07:08:41.208-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>A UDF  To Get The Next Working Day  @ SQL Server 2005</title><content type='html'>The following scalar valued function will return the next working day of the week.  Here is the code:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;CREATE FUNCTION dbo.udf_GetNextWorkingDay (@p_Date DATETIME )&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;RETURNS DATETIME&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;AS&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;BEGIN&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;DECLARE @m_WeekDay INT&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;DECLARE @rt_Next_Working_Day DATETIME&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;SET @m_WeekDay = DATEPART(weekday,@p_Date)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;IF @m_WeekDay = 6      -- Friday&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;SET @rt_Next_Working_Day = DATEADD(d,3,@p_Date)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;ELSE IF @m_WeekDay = 7 -- Saturday &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;SET @rt_Next_Working_Day = DATEADD(d,2,@p_Date)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;ELSE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;SET @rt_Next_Working_Day = DATEADD(d,1,@p_Date)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;RETURN @rt_Next_Working_Day&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;END&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;To test this UDF you can use the following example:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SELECT dbo.udf_GetNextWorkingDay  ( '07/20/2007')&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SELECT dbo.udf_GetNextWorkingDay  ( '07/21/2007')&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SELECT dbo.udf_GetNextWorkingDay  ( '07/22/2007')&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The result of all of the above test cases will be as following:&lt;br /&gt; 2007-07-23 00:00:00.000&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-6913061596648647541?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/6913061596648647541/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=6913061596648647541' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/6913061596648647541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/6913061596648647541'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/07/udf-to-get-next-working-day-sql-server.html' title='A UDF  To Get The Next Working Day  @ SQL Server 2005'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-3440795232083027967</id><published>2007-07-24T07:31:00.000-07:00</published><updated>2010-08-25T07:09:01.128-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>How to Get Week-Day and Quarter of year  in SQL Server 2005</title><content type='html'>&lt;ul&gt;&lt;li&gt;You can get the week-day by using the DATEPART scalar valued function of the SQL Server 2005.  For example the following statement returns 1 (one) as it is default value for Sunday.&lt;/li&gt;&lt;/ul&gt;&lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;SELECT  DATEPART(weekday,'07/22/2007' )&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;or&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;                                       SELECT  DATEPART(dw,'07/22/2007' )&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;                                   &lt;br /&gt;                                     &lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;Result = 1&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;-------------------------------------------------------&lt;br /&gt;The following are the default values for the week days:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SUNDAY =         1 &lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;MONDAY=         2&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;TUESDAY =       3&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;WEDNESDAY=4&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;THURSDAY=    5&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;FRIDAY    =       6&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SATURDAY =   7&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Similarly you can check the quarter of the year by using one of the following query. &lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;SELECT  DATEPART(quarter,'07/22/2007' )&lt;/span&gt; or&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;SELECT  DATEPART(qq,'07/22/2007' )   or &lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;SELECT  DATEPART(q,'07/22/2007' )&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;      &lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;  Result: 3&lt;/span&gt; ( as this is 3rd quarter of the year)&lt;br /&gt;&lt;br /&gt;You can get the details from MSDN online, Here is the reference of the MSDN:&lt;br /&gt;&lt;a href="ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/15f1a5bc-4c0c-4c48-848d-8ec03473e6c1.htm"&gt;&lt;/a&gt;&lt;a style="font-weight: bold; font-style: italic;" href="http://ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/15f1a5bc-4c0c-4c48-848d-8ec03473e6c1.htm"&gt;MSDN ONLINE&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-3440795232083027967?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/3440795232083027967/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=3440795232083027967' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/3440795232083027967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/3440795232083027967'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/07/how-to-get-week-day-and-quarter-of-year.html' title='How to Get Week-Day and Quarter of year  in SQL Server 2005'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-8940849190707472542</id><published>2007-07-20T12:34:00.000-07:00</published><updated>2010-08-25T07:09:18.074-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hibernate'/><title type='text'>Hibernate Plugin for Eclipse (HibernateSynchronizer)</title><content type='html'>Hibernate is used for  database object/relational persistence and it is a very cool. It is available for both JAVA and .NET but is most popular for JAVA.&lt;br /&gt;&lt;br /&gt;I was working with the Hibernate using eclipse. I was looking for some plugin of Eclipse and I found one with the name of &lt;span style="font-weight: bold;"&gt;"HibernateSynchronizer"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It is an Eclipse plugin code generation tool which, by default, binds to *.hbm files and automatically generates business objects when your hibernate schema configuration file is modified.&lt;br /&gt;&lt;br /&gt;Here is the link to download it:&lt;br /&gt;&lt;a href="http://hibernatesynch.sourceforge.net/"&gt;http://hibernatesynch.sourceforge.net/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://sourceforge.net/project/showfiles.php?group_id=99370"&gt;http://sourceforge.net/project/showfiles.php?group_id=99370&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-8940849190707472542?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/8940849190707472542/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=8940849190707472542' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/8940849190707472542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/8940849190707472542'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/07/hibernate-plugin-for-eclipse.html' title='Hibernate Plugin for Eclipse (HibernateSynchronizer)'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-3396855271390706113</id><published>2007-07-20T10:12:00.000-07:00</published><updated>2010-08-25T07:19:08.152-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>String Functions @ SQL Server 2005</title><content type='html'>&lt;span style="color: rgb(102, 0, 0);"&gt;There are number of  scalar function to manipulate the strings in SQL server. I will just discuss the most common used scalar functions available for string manipulation:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0);" id="nsrTitle"&gt;1- REVERSE&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(102, 0, 0);" id="nsrTitle"&gt;                                    This scalar function is used to reverse  the character string provided. The input parameter may be constant string, variable or column name of character or binary type.&lt;br /&gt; &lt;span style="color: rgb(51, 51, 255);"&gt;    EXAMPLE:-  SELECT REVERSE('SABAH') , REVERSE('IRFAN') &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;     RESULT:- HABAS    NAFRI&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2- LEN&lt;br /&gt;&lt;/span&gt;                                It returns the number of characters in the input parameter provided. Input parameter may be constant char string, variable or column name. Please note it will not count the trailing spaces.&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt; EXAMPLE:-  SELECT LEN('SABAH U DIN') , LEN('IRFAN        ') &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;     RESULT:-  11    5&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;3- &lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0);" id="nsrTitle"&gt;SPACE&lt;br /&gt;                           &lt;/span&gt;&lt;span style="color: rgb(102, 0, 0);" id="nsrTitle"&gt;It returns the number of spaces according to the integer parameter provided as input.  It takes integer_expression as input. if the integer expression is negative then it returns null string.&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;     EXAMPLE:-  SELECT 'Sabah' +SPACE(10)+'Irfan'&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;     RESULT:-     Sabah          Irfan&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;4- &lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0);" id="nsrTitle"&gt;REPLACE&lt;br /&gt;                         &lt;/span&gt;&lt;span style="color: rgb(102, 0, 0);" id="nsrTitle"&gt;This function has three parameters all of character type. It finds the 2nd parameter_string from 1st_parameter string and replaces all occurrence with the 3rd parameter_string.&lt;br /&gt;   &lt;span style="color: rgb(51, 51, 255);"&gt;  EXAMPLE:- SELECT REPLACE('abcdefghicde','cde','xxx')&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;     RESULT:-    abxxxfghixxx&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;5- ASCII&lt;br /&gt;                   &lt;/span&gt;It returns the integer ASCII code of the left most character of the input string.&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;    EXAMPLE:- SELECT ASCII('A'),ASCII('ABCDEF')&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;    RESULT:-    65          65&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;6- CHAR&lt;br /&gt;&lt;/span&gt;                   It converts the integer ASCII code into char.&lt;br /&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;     EXAMPLE:- SELECT CHAR(65),CHAR(78)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;            RESULT:- A    N&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;7- &lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0);" id="nsrTitle"&gt;LOWER&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(102, 0, 0);" id="nsrTitle"&gt;                       It  returns the lower case character string after converting the upper case characters present into the input string.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);" id="nsrTitle"&gt;        &lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);" id="nsrTitle"&gt;EXAMPLE:-   &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);" id="nsrTitle"&gt;       &lt;/span&gt;&lt;span style="color: rgb(102, 0, 0);" id="nsrTitle"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;SELECT LOWER('SAbah U Din')&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;        RESULT:-                sabah u din&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(102, 0, 0);" id="nsrTitle"&gt;&lt;span style="font-weight: bold;"&gt;8- UPPER&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0);" id="nsrTitle"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(102, 0, 0);" id="nsrTitle"&gt;                       It  returns the upper case character string after converting the lower case characters present into the input string.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0);" id="nsrTitle"&gt;        &lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);" id="nsrTitle"&gt;EXAMPLE:-   &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);" id="nsrTitle"&gt;       &lt;/span&gt;&lt;span style="color: rgb(102, 0, 0);" id="nsrTitle"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;SELECT UPPER('SAbah U Din')&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;         RESULT:-                 SABAH U DIN&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;9- LEFT&lt;br /&gt;                      &lt;/span&gt;It returns the left part of the string with the number of characters provided.&lt;br /&gt;      &lt;span style="color: rgb(51, 51, 255);"&gt;  EXAMPLE:- SELECT LEFT('Sabah-u-Din',7)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;        RESULT:- Sabah-u&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;10- RIGHT&lt;br /&gt;                        &lt;/span&gt;It returns the right part of the character string with the number/count of characters provided in its 2nd parameter.&lt;br /&gt;  &lt;span style="color: rgb(51, 51, 255);"&gt;    EXAMPLE:- SELECT RIGHT('Sabah-u-Din',7)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;      RESULT:- h-u-Din&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;11- RTRIM&lt;br /&gt;                    &lt;/span&gt;It&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;/span&gt;returns a character string after truncating all trailing blanks(blanks at the end of string).&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);" id="nsrTitle"&gt;      &lt;span style="color: rgb(51, 51, 255);"&gt;EXAMPLE:- SELECT RTRIM('Sabah                      ')&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;       RESULT:- Sabah&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(102, 0, 0);" id="nsrTitle"&gt;&lt;span style="font-weight: bold;"&gt;12- LTRIM&lt;br /&gt;                    &lt;/span&gt;It&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;/span&gt;returns a character string after truncating all leading blanks(blanks at the start of string).&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);" id="nsrTitle"&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt; EXAMPLE:- SELECT LTRIM('              Sabah')&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;       RESULT:- Sabah&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;13- &lt;/span&gt;&lt;span style="font-weight: bold;" id="nsrTitle"&gt;CHARINDEX&lt;br /&gt;&lt;/span&gt;&lt;span id="nsrTitle"&gt;                                    It &lt;/span&gt;returns the starting position of the specified expression in a character string.  Its syntax is &lt;span style="font-weight: bold;" id="nsrTitle"&gt;&lt;br /&gt;&lt;/span&gt;&lt;pre&gt;CHARINDEX &lt;b&gt;(&lt;/b&gt; &lt;i&gt;expression1 &lt;/i&gt;&lt;b&gt;,&lt;/b&gt;&lt;i&gt;expression2&lt;/i&gt; [ &lt;b&gt;,&lt;/b&gt; &lt;i&gt;start_location &lt;/i&gt;] &lt;b&gt;)&lt;br /&gt;&lt;br /&gt; &lt;/b&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;EXAMPLE&lt;/span&gt;&lt;b style="color: rgb(51, 51, 255);"&gt;:- &lt;/b&gt;&lt;span style="color: rgb(51, 51, 255);"&gt; SELECT CHARINDEX('r','rSaba-u-din-irfan',3)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt; RESULT:- 14&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;NOTE: There are a couple of more scalar functions available in SQL Server but the above&lt;br /&gt;are the mostly used ones.&lt;br /&gt;&lt;/pre&gt;&lt;span style="color: rgb(102, 0, 0);" id="nsrTitle"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0);" id="nsrTitle"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-3396855271390706113?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/3396855271390706113/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=3396855271390706113' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/3396855271390706113'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/3396855271390706113'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/07/string-functions-sql-server-2005.html' title='String Functions @ SQL Server 2005'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-1670499019244195852</id><published>2007-07-11T06:32:00.000-07:00</published><updated>2010-08-25T07:09:31.447-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Listing Specific Objects From the DB @ SQL Server  2005</title><content type='html'>There are always situations when you need to check/find the specific object like table/stored procedure from the database and usually for enterprize  level applications there are hundreds  or even thousands of  user tables  and stored procedures. &lt;br /&gt;&lt;br /&gt;Following are some of the queries  that  will help to list the complete details of some specific&lt;br /&gt;Object whose type you are providing in the WHERE clause. You can filter out the results as you needed just by adding couple of more conditions.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;select * from sys.objects where type = 'D' -- DEFAULT_CONSTRAINT &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;select * from sys.objects where type = 'F' -- FOREIGN_KEY_CONSTRAINT&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;select * from sys.objects where type = 'FN'-- SQL_SCALAR_FUNCTION&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;select * from sys.objects where type = 'IT'-- INTERNAL_TABLE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;select * from sys.objects where type = 'P' -- SQL_STORED_PROCEDURE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;select * from sys.objects where type = 'PK'-- PRIMARY_KEY_CONSTRAINT&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;select * from sys.objects where type = 'S' -- SYSTEM_TABLE &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;select * from sys.objects where type = 'SQ'-- SERVICE_QUEUE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;select * from sys.objects where type = 'U' -- USER_TABLE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;select * from sys.objects where type = 'UQ'-- UNIQUE_CONSTRAINT&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The following query will result you with the available types of Objects of the database:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;select distinct(type) from  sys.objects order by type asc&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-1670499019244195852?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/1670499019244195852/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=1670499019244195852' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/1670499019244195852'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/1670499019244195852'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/07/listing-specific-objects-from-db-sql.html' title='Listing Specific Objects From the DB @ SQL Server  2005'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-4496292757312676699</id><published>2007-07-09T07:27:00.000-07:00</published><updated>2010-08-25T07:09:46.397-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>UDF to parse the numeric values from a String</title><content type='html'>This UDF will parse a string and will return the numeric values that are present in the string in the same sequence that they have in string.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;CREATE FUNCTION dbo.UDF_ParseNumeric  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;(  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;@string VARCHAR(8000)  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;)  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;RETURNS VARCHAR(8000)  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;AS  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;BEGIN  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;DECLARE    @IncorrectCharLoc SMALLINT  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;SET @IncorrectCharLoc = PATINDEX('%[^0-9]%', @string)  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;WHILE @IncorrectCharLoc &gt; 0  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;BEGIN  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;SET @string = STUFF(@string, @IncorrectCharLoc, 1, '')  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;SET @IncorrectCharLoc = PATINDEX('%[^0-9]%', @string)  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;END  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;SET @string = @string  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;RETURN @string  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;END&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0);"&gt;TEST:&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;SELECT dbo.UDF_ParseNumeric('san1as2,.?"&lt; \{4}[]6&gt;:')&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0);"&gt;&lt;br /&gt;Result:&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;1246&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-4496292757312676699?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/4496292757312676699/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=4496292757312676699' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/4496292757312676699'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/4496292757312676699'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/07/this-udf-will-parse-string-and-will.html' title='UDF to parse the numeric values from a String'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-2371791269450585528</id><published>2007-07-09T07:01:00.000-07:00</published><updated>2010-08-25T07:12:13.469-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>PATINDEX and STUFF @ SQL Server 2005</title><content type='html'>&lt;span style="font-weight: bold; color: rgb(102, 0, 0);font-size:130%;" &gt;1- PATINDEX:-  &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;                     It returns the starting index/position of the first occurrence of the pattern provided. If no match is found then it will return zero.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;Syntax: &lt;/span&gt;&lt;br /&gt;&lt;pre style="color: rgb(102, 0, 0);"&gt;PATINDEX( '%&lt;i&gt;pattern&lt;/i&gt;%', &lt;i&gt;expression &lt;/i&gt;)&lt;b&gt;&lt;br /&gt;&lt;br /&gt;where&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;pattern: &lt;/span&gt;&lt;/b&gt;is the pattern to find.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;expression: &lt;/span&gt;is the string or usually the column name that will be&lt;br /&gt;searched to find the specified pattern.&lt;br /&gt;--------------------------------------------------------&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-size:130%;"&gt;2- STUFF:-&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p style="color: rgb(102, 0, 0);"&gt;Deletes a specified length of characters and inserts another set of  characters&lt;br /&gt;at a specified starting point.&lt;/p&gt;&lt;p style="color: rgb(102, 0, 0);"&gt;Syntax:&lt;br /&gt;&lt;/p&gt;&lt;pre style="color: rgb(102, 0, 0);"&gt;STUFF &lt;b&gt;(&lt;/b&gt; &lt;i&gt;character_expression &lt;/i&gt;&lt;b&gt;, &lt;/b&gt;&lt;i&gt;start &lt;/i&gt;&lt;b&gt;, &lt;/b&gt;&lt;i&gt;length &lt;/i&gt;&lt;b&gt;,&lt;br /&gt;     &lt;/b&gt;&lt;i&gt;character_expression &lt;/i&gt;&lt;b&gt;)&lt;br /&gt;&lt;br /&gt;where:&lt;br /&gt;&lt;/b&gt;&lt;i&gt;&lt;span style="font-weight: bold;"&gt;character_expressio&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;n:&lt;/span&gt;  &lt;/span&gt;&lt;/i&gt;can be a constant, variable, or column&lt;br /&gt;   of either   character or binary data.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;start: &lt;/span&gt;is the start location for the deletion and insertion.&lt;br /&gt; It is  an integer value. If its value is negative or&lt;br /&gt; longer than character_expression then null string is&lt;br /&gt; returned.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;length: &lt;/span&gt;is the length of the character to be deleted.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Example:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;SELECT STUFF('abcdefgh', 2, 3, 'SABAH')&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Result:&lt;/span&gt; aSABAHefgh&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="color: rgb(102, 0, 0);"&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-2371791269450585528?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/2371791269450585528/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=2371791269450585528' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/2371791269450585528'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/2371791269450585528'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/07/1-patindex-it-returns-starting.html' title='PATINDEX and STUFF @ SQL Server 2005'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-9029425741509065156</id><published>2007-07-05T14:48:00.001-07:00</published><updated>2010-08-25T07:12:31.520-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C #'/><title type='text'>New Features in C# .NET 2.0</title><content type='html'>There are couple of new features/concepts that are introduced in the version 2.0 of C#.NET. These are listed below:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Generics&lt;/li&gt;&lt;li&gt;Partial Classes&lt;/li&gt;&lt;li&gt;Iterators&lt;/li&gt;&lt;li&gt;NULLABLE  Value Types&lt;/li&gt;&lt;li&gt;Anonymous Methods&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Coalesce operator: (&lt;code style="font-weight: bold;"&gt;??&lt;/code&gt;)&lt;/li&gt;&lt;li&gt;Anonymous delegates providing closure functionality&lt;/li&gt;&lt;li&gt;A yield return similar to yield in Python&lt;/li&gt;&lt;/ol&gt;Will explain one by one in different blogs for simplicity.&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-9029425741509065156?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/9029425741509065156/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=9029425741509065156' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/9029425741509065156'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/9029425741509065156'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/07/new-features-in-c-net-20.html' title='New Features in C# .NET 2.0'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-6282708232907582186</id><published>2007-07-05T14:21:00.000-07:00</published><updated>2010-08-25T07:12:45.272-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL Server @ WHERE vs  HAVING Clause</title><content type='html'>&lt;span style="font-weight: bold; color: rgb(102, 0, 0);"&gt;WHERE vs  HAVING Clause&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Both are used  to filter out the records but have coupe of differences:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;&lt;li style="color: rgb(153, 0, 0);"&gt;HAVING can only be used with SELECT statement, while WHERE can be used for SELECT, UPDATE and DELETE.&lt;/li&gt;&lt;li style="color: rgb(153, 0, 0);"&gt;HAVING specifies a search condition on group or aggregate function, while WHERE specifies the search condition on the individual rows.&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;HAVING is typically used with GROUP BY clause. If GROUP BY is not used then HAVING behaves like WHERE clause. &lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0);"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-6282708232907582186?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/6282708232907582186/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=6282708232907582186' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/6282708232907582186'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/6282708232907582186'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/07/sql-server-where-vs-having-clause.html' title='SQL Server @ WHERE vs  HAVING Clause'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-1989063396987573488</id><published>2007-07-03T15:43:00.000-07:00</published><updated>2010-08-25T07:12:58.199-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>sp_rename @ SQL Server 2005</title><content type='html'>It Changes the name of a user-created object in the current database. This object  can be a table, index, column, alias data type, or Microsoft .NET Framework  common language runtime (CLR) user-defined type.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Syntax:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;sp_rename @ObjectName, @ObjectNewName, @ObjectType&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;WHERE:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 51);"&gt;@ObjectName:&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);"&gt; is the name of the user object etc.&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 51);"&gt;&lt;br /&gt;@ObjectNewName: &lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;is the new name of the user object. It has no defaults.&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 51);"&gt;&lt;br /&gt;@ObjectType: &lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;defines the type of the user object to be renamed. The following types are supported:&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;A column&lt;br /&gt;&lt;/li&gt;&lt;li&gt;A database&lt;/li&gt;&lt;li&gt;An Index&lt;br /&gt;&lt;/li&gt;&lt;li&gt;UserDataType ( Alias type, objects created using CREATE statement and CLR user defined types)&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-1989063396987573488?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/1989063396987573488/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=1989063396987573488' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/1989063396987573488'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/1989063396987573488'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/07/sprename-sql-server-2005.html' title='sp_rename @ SQL Server 2005'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-4513449274390147556</id><published>2007-07-02T15:14:00.000-07:00</published><updated>2010-08-25T07:13:13.758-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>CREATE STORED PROCEDURE And UDF  WITH  ENCRYPTION</title><content type='html'>You can create encrypted stored procedures, so that no one can  see the source code of the stored procedure. Even if you will try to see its text using  sp_helptext procedure; it will show the following message&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;The text for object '[sptst_Test]' is encrypted.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;Syntax:&lt;br /&gt;             Just add WITH ENCRYPTION Clause after the parameter's list of the stored procedure or UDF.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Example:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;CREATE PROCEDURE [dbo].[sptst_Test]&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt; -- Add the parameters for the stored procedure here  &lt;/span&gt;&lt;br /&gt;WITH &lt;span style="color: rgb(51, 51, 51);"&gt;ENCRYPTION&lt;/span&gt;&lt;br /&gt;AS&lt;br /&gt;BEGIN&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt; -- SET NOCOUNT ON added to prevent extra result sets from  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt; -- interfering with SELECT statements.  &lt;/span&gt;&lt;br /&gt;SET NOCOUNT ON;&lt;br /&gt;&lt;br /&gt;   &lt;span style="color: rgb(0, 102, 0);"&gt;-- Insert statements for procedure here  &lt;/span&gt;&lt;br /&gt;   SELECT * FROM &lt;span style="color: rgb(0, 102, 0);"&gt;sys.tables&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;END&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;NOTE:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;&lt;li style="color: rgb(153, 0, 0);"&gt;&lt;span style="font-weight: bold;"&gt;You can not decrypt the Encrypted stored procedure or UDF. So it is good practice not to use this security. Rather use the user permissions if you need to restrict some one.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;CLR UDF and Stored Procedures can not be Encrypted. &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-4513449274390147556?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sabahmyrsh.blogspot.com/feeds/4513449274390147556/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8203987105897055974&amp;postID=4513449274390147556' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/4513449274390147556'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8203987105897055974/posts/default/4513449274390147556'/><link rel='alternate' type='text/html' href='http://sabahmyrsh.blogspot.com/2007/07/create-stored-procedure-and-udf-with.html' title='CREATE STORED PROCEDURE And UDF  WITH  ENCRYPTION'/><author><name>Sabah u Din Irfan</name><uri>http://www.blogger.com/profile/01605404281377087250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_4f1LhtA4Gj0/SJxU_GhYfZI/AAAAAAAAADI/FQulZUbZHR4/s1600-R/03-04-07_0944.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8203987105897055974.post-7860576092366322735</id><published>2007-07-02T14:44:00.000-07:00</published><updated>2010-08-25T07:13:31.210-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Replicate function in SQL Server 2005</title><content type='html'>The replicate function in SQL Server 2005 is used to replicate a specific value for a provided number of times. For example the following query,&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;select  replicate('Sabah ',10) as [Replicate Test]&lt;br /&gt;&lt;br /&gt;Results:&lt;br /&gt;&lt;br /&gt;Sabah Sabah Sabah Sabah Sabah Sabah Sabah Sabah Sabah Sabah&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Sabah u Din Irfan&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8203987105897055974-7860576092366322735?l=sabahmyrsh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='htt
