Android:
Android is a Software Development platform as well as an Operation System for mobile devices based on Linux karnel. Android is developped by Open Handset Aliance (first by Google). It was releasen on november 2007. Android is developped in C.
Android software development tool is Java Programming Language, controlling the device by java libraries developped by google.
Java J2ME JSP J2EE Servlet Android
Avoid large white space in blogger/blogspot before table/ Table problem
If you want to use table in blogspot blog and many other blogs using <table> as following way..
<table>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>
You'll see a large white spaces before the table. This is for each time you press [ENTER] for new line blogspot generates a line break <br> and when you view the blog you'll find a whitespace for each <br> before the table.
If you want to avoid this unwanted white space just use the following code
<style type="text/css">.eatbr be{ display: none }</style>
<div class="eatbr">
PUT YOUR CODE FOR TABLE HERE
</div>
This will eat <br> inside it..
Happy Blogging...
<table>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>
You'll see a large white spaces before the table. This is for each time you press [ENTER] for new line blogspot generates a line break <br> and when you view the blog you'll find a whitespace for each <br> before the table.
If you want to avoid this unwanted white space just use the following code
<style type="text/css">.eatbr be{ display: none }</style>
<div class="eatbr">
PUT YOUR CODE FOR TABLE HERE
</div>
This will eat <br> inside it..
Happy Blogging...
Labels:
Blogger Tips
JAVA: Accessing properties file(resource) inside jar
You can not load a properties file inside a jar as following way..
Properties props = new Properties();
props.load(new FileInputStream("conf.properties"));
In this case you have to use
Properties props = new Properties();
InputStream in = this.getClass().getClassLoader().getResourceAsStream("conf.properties");
props.load(in);
I hope this will help you. For any other query you can post question as comment.
Properties props = new Properties();
props.load(new FileInputStream("conf.properties"));
In this case you have to use
Properties props = new Properties();
InputStream in = this.getClass().getClassLoader().getResourceAsStream("conf.properties");
props.load(in);
I hope this will help you. For any other query you can post question as comment.
Oracle DATE to TIMESTAMP
The is a function in oracle name to_timestamp that can transform from CHAR to TIMESTAMP. We can not transform a DATE to TIMESTAMP properly.
Lets consider a table mytab as follows-
mytab
name(CHAR(100)) bdate (DATE)
------------------------------------------------
Mr. Abc 10-10-2009 10:22:22 AM
If we use
SELECT TO_TIMESTAMP(bdate,'DD-MM-RRRR HH24:MI:SS') FROM mytab
we get the value of TO_TIMESTAMP(bdate,'DD-MM-RRRR HH24:MI:SS') as 10-10-2009 00:00:00 AM instead of 10-10-2009 10:22:22 AM. To get proper value of bdate in TIMESTAMP we can first change the DATE to CHAR then CHAR to TIMESTAMP as follows
TO_TIMESTAMP(TO_CHAR(bdate,'DD-MM-RRRR HH24:MI:SS'),'DD-MM-RRRR HH24:MI:SS') FROM mytab
So now
SELECT TO_TIMESTAMP(TO_CHAR(bdate,'DD-MM-RRRR HH24:MI:SS'),'DD-MM-RRRR HH24:MI:SS') FROM mytab
Will give us the value of bdate as TIMESTAMP as 10-10-2009 10:22:22 AM.
I expect your comment on this topic and other questions relating to this topic...
Lets consider a table mytab as follows-
mytab
name(CHAR(100)) bdate (DATE)
------------------------------------------------
Mr. Abc 10-10-2009 10:22:22 AM
If we use
SELECT TO_TIMESTAMP(bdate,'DD-MM-RRRR HH24:MI:SS') FROM mytab
we get the value of TO_TIMESTAMP(bdate,'DD-MM-RRRR HH24:MI:SS') as 10-10-2009 00:00:00 AM instead of 10-10-2009 10:22:22 AM. To get proper value of bdate in TIMESTAMP we can first change the DATE to CHAR then CHAR to TIMESTAMP as follows
TO_TIMESTAMP(TO_CHAR(bdate,'DD-MM-RRRR HH24:MI:SS'),'DD-MM-RRRR HH24:MI:SS') FROM mytab
So now
SELECT TO_TIMESTAMP(TO_CHAR(bdate,'DD-MM-RRRR HH24:MI:SS'),'DD-MM-RRRR HH24:MI:SS') FROM mytab
Will give us the value of bdate as TIMESTAMP as 10-10-2009 10:22:22 AM.
I expect your comment on this topic and other questions relating to this topic...
A way in java to user bangla number format
The following method will format a double number as thousand lac crore method
with 2 digits after decimal point.
for example 1234567890.987654321 will be formatted as
1,23,45,67,890.99
public static String banglaFormat(double number){
DecimalFormat format1 = new DecimalFormat("#,##0.00");
DecimalFormat format2 = new DecimalFormat("#,##");
DecimalFormat format3 = new DecimalFormat("000.00");
if(number<1000)
return format1.format(number);
double num2 = number/1000;
double num3 = number%1000;
return format2.format(num2)+","+format3.format(num3);
}
with 2 digits after decimal point.
for example 1234567890.987654321 will be formatted as
1,23,45,67,890.99
public static String banglaFormat(double number){
DecimalFormat format1 = new DecimalFormat("#,##0.00");
DecimalFormat format2 = new DecimalFormat("#,##");
DecimalFormat format3 = new DecimalFormat("000.00");
if(number<1000)
return format1.format(number);
double num2 = number/1000;
double num3 = number%1000;
return format2.format(num2)+","+format3.format(num3);
}
Subscribe to:
Posts (Atom)