Monday, 8 April 2013

Amazing HTML5 tags

Auto Complete Feature:

The <datalist> tag is used to provide an "autocomplete" feature on <input> elements. Users will see a drop-down list of pre-defined options as they input data.

Example code:


<form action="demo_form.asp" method="get">
<input list="browsers" name="browser">
<datalist id="browsers">
  <option value="Internet Explorer">
  <option value="Firefox">
  <option value="Chrome">
  <option value="Opera">
  <option value="Safari">
</datalist>
<input type="submit">
</form>

For Calculation:

The <output> tag represents the result of a calculation (like one performed by a script).

Example code:


<form oninput="x.value=parseInt(a.value)+parseInt(b.value)">0
<input type="range" id="a" value="50">100
+<input type="number" id="b" value="50">
=<output name="x" for="a b"></output>
</form>

Sunday, 7 April 2013

String pad in java


public class Trial {
    public static void main(String arg[])
    {
        String password="password";
        String padded=String.format("%"+password.length()+"s","").replace(" ", "*");
        System.out.println(padded);
    }
}

Output:


run:
********
BUILD SUCCESSFUL (total time: 0 seconds)


Different types:


     String.format("%10s", "foo").replace(' ', '*');
     String.format("%-10s", "bar").replace(' ', '*');
     String.format("%10s", "longer than 10 chars").replace(' ', '*');

     Output:

        *******foo
        bar*******
        longer*than*10*chars



Monday, 1 April 2013

Sample html webpage with div tag(Containers)


<!DOCTYPE html>
<html>
<body>
<div id="container" style="width:1350px">
<div id="header" style="background-color:#FFA500;">
<h1 style="margin-bottom:0;">Main Title of Web Page</h1>
</div>
<div id="menu" style="background-color:#FFD700;height:550px;width:200px;float:left;">
<b>Menu</b><br>
HTML<br>
CSS<br>
JavaScript
</div>
<div id="content" style="background-color:#EEEEEE;height:550px;width:1150px;float:left;">
Content goes here
</div>
<div id="footer" style="background-color:#FFA500;clear:both;text-align:center;">
Copyright © W3Schools.com
</div>
</div>
</body>
</html>

DBT - Models

Models are where your developers spend most of their time within a dbt environment. Models are primarily written as a select statement and ...