Pls help! about formatted output.
for example, I want to print "double a = 2.33, b =45.123" like:
###2.330
# 45.123 (# should be blank, in fact. )
with fixed width, precision and right alignment. But it seems there are no class can do this like printf function in C.
BTW:I tried DecimalFormat("00.000") but got 02.330.
Thanks in advance!
or perhaps try_1d could try reading the java docs...
###.### is exactly the same as the following
I could come up with an infinite number of possibilities so I will stop now.
Similar Messages
-
HELP about analog output video
Hello, I´m need help about analog output video in Premiere CS5 using Matrox RTX2. I need to crop a video with resolution in 1440x1080 to 4:3 in output analog. But what happens is wrong (I think). My video is in format anamorphic and the other option is 16:9 letterbox. Is there any way to crop the video without using effects. Thanks a Lot and sorry my bad english (my native language is Portuguese).
There are no 4:3 HD specifications. You'll have to put the video into a normal SD sequence, and scale it down till the top and bottom of the video meet the frame. That way the sides will be cut off.
-
Pls help about Rollback and Connection Pooling
Hello Friends.
I have some problems abount Rollback & ConnectionPooling.
If connection pooling is possible with rollback facility??????
I am giving my code below so pls guide me- i am using MySql and J2EE 1.3.
try
/* Setting auto commit off */
con.setAutoCommit(false);
affectedRow = myStatement.executeUpdate(String qury1);
affectedRow = myStatement.executeUpdate(String qury2);
affectedRow = myStatement.executeUpdate(String qury3);
con.commit();
}catch(SQLException sqle){
try{
con.rollback();
}catch(Exception e){e.printStackTrace();}
}finally {
saveFlg=false;
try {
if(myStatement!=null)
myStatement.close();
}catch(Exception e){e.printStackTrace();}
}// finally block complete...
/* Sample Code Ends*/
Thanks in advance and Happy New YearIf connection pooling is possible with rollback facility??????Should be, sure. What problem do you have with it?
I know very little about MySQL, but I understand it is somewhat "special". Do you have a version of MySQL that has transaction support? Check the MySQL docs: is there some configuration you need to do to enable transactions? -
Pls Help about counting the lines of the file in java
private int GrepPBArequestLog(String STRexpression) throws IOException
int totalnum = 0;
try {
String[] cmd = {"grep", "-ic", STRexpression, src};
System.out.println("grep, cmd " STRexpression" "+src);
Process grepProc = Runtime.getRuntime().exec(cmd);
String line = "";
BufferedReader br = new BufferedReader(new InputStreamReader(grepProc.getInputStream()));
line = br.readLine();
System.out.println("read: "+line);
while (line != null)
System.out.println("Line: "+line);
line = line.substring(line.indexOf(":") + 1, line.length());
System.out.println("Substring: "+line);
try
int temp = Integer.parseInt(line);
totalnum = totalnum + temp;
catch(NumberFormatException e)
System.out.println("String: "+line);
System.out.println("NumberFormatException Occured"+e.getMessage());
}//end while
the output is:
service No: 209
Wapdate: 07/Jul/2003
Went inside: GrepPBArequestLog
grep cmd .*07/Jul/2003.*GET.*209.* /var/log/httpd/access_log*
Line:
read: null
totalnum: 0
wap 07/Jul/2003:
wap 209:
total hits 209: 0
+++++++++++++++++++++++++++++++++
the read: should not be null because there is a number of lines and
totalnum shouldn't be 0.You don't want to simply:
import java.io.*;
public class CountEm {
private static BufferedReader br;
private static int count;
private static String fileName, record;
public static void main(String[] argv) {
switch(argv.length) {
case 1: { fileName = argv[0]; break; }
default: { System.out.println("Usage: java CountEm [filename]"); System.exit(-1); }
try { countEm(); }
catch(IOException ioe) { System.out.println("ERROR doing countEm()\n"+ioe); }
finally { System.out.println("Count: "+count); }
public static void countEm() throws IOException {
br = new BufferedReader(new FileReader(fileName));
while ( ( record = br.readLine() ) != null ) { count++; }
}~Bill -
Any java experts pls help me in converting attribute to XML formats
Pls help me oh my god i am a newbie here and i am given this project.
I had just written a XML doc. which looks like this
<ConsumerTransfer>
<TransactionId>
123:123
</TransactionId>
<Billingoption>
cash
</Billingoption>
</ConsumerTransfer>
I need to make this to attributes like
private String TransactionId()
private String BillingOption()
and so on.....
I need to convert this attributes to XML format
can any show me an example or the source codes for this
Really, I appreciate it.
JimmyKnotFor such node level operations I think that DOM would be a good idea. So here you go. Look for some nice tutorial for DOM and you got it.
salut -
Can i use output of one report in another report?? Pls help!
Hi Gurus,
I have a requirement where in i execute Report_1, inside that report_1, there is a pushbutton,
when i click on that, it executes Report_2.
My Report_2 creates some output xml and displays it too.
What i want is, i want to keep this output (xml) coming from report_2 and use it in my report_1
for further processing. Is it possible???
I donot know how it may work:
Approach1: Is it possible to take this output from report_2, place it in some sap directory server
as some file which is accessible for that session or client and then call it from report_1
Approach2: a tedious approach, to download this file using function modules, and then in report_1,
i can upload that file using the file path.???
Is there any other way? Is approach_1 possible. Coz i think that would be easier.
Pls help.
Thanks a lot,
RashmiHi Rashmi,
to best of my knowledge you are getting the data in to an internal table.
if this is right you can save this data either in ABAP or SAP memory
using EXPORT IMPORT or
SPA/GPA
this way you can use one program data in another.
hope this will serve your purpse.
Regards
Ramchander Rao.K -
yesterday i connect my iPhone with iTunes then one MSG displayed on screen about backup i ignore that but same time i have lost all my installed apps incouled my pics and vids from my iPhone pls help me.
1) ensure iTunes is authorized for your iTunes store account(s)
2) connect your device and right-click or control-click it in the iTunes Source list, then choose transfer purchases from the shortcut menu that appears.
3) sync the device
iTunes will wipe the iPhone but, since you transferred your purchases in the previous step, your content will be in your library and you can re-populate the iPhone with it.
above works for purchases from the iTunes store. for everything else, check out this post by Zevoneer. -
Pls help me: about log in
Dear all,
I have a created a dynamic page (PHP and mysql) with log in
(server vehaviour) page. and after user had enter their username
and password, if succeed they go to new page. in this new page ,
they can submit news. and my big problem is (sorry iam new bie) how
i can get their username in this new page that they had entered in
log in page, i want to search id_user in tabel1( field: id_user,
username, password) with their username and after got it , i want
to insert this id_user into table2 (filed: id_user, no_news,
date_news, news ). I hope my explaination will be understood. tks 4
any help....I don't need the code, you do. :O) Read the instructions
below. Replace
the parts of the code that are bad with parts of the code
thar are good.
Let's look at the tutorial/post, posted below in it's
entirety from
http://friendsofed.infopop.net/2/OpenTopic?a=tpc&s=989094322&f=8033053165&m=324102421&r=32 4102421#324102421.
1. Log In User needs changes in two places, plus the removal
of three
lines. Find the following lines of code
$GLOBALS['PrevUrl'] = $accesscheck;
session_register('PrevUrl');Replace them with
$_SESSION['PrevUrl'] = $accesscheck;2. Then find
$GLOBALS['MM_Username'] = $loginUsername;
$GLOBALS['MM_UserGroup'] = $loginStrGroup;Change them to
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;
3. Finally, DELETE the following lines
//register the session variables
session_register("MM_Username");
session_register("MM_UserGroup");That's it. You're done with
your Login
form. You know need to replace a few lines in your logout,
but we'll wait
on
that.===========================Article========================I
have
discovered there is a serious bug with the Dreamweaver MX
2004 User
Authentication server behaviors when used in conjunction with
PHP5.
Basically, the problem is that the DW server behaviors use
obsolete code
that appears to work with PHP4, but breaks once deployed on
PHP5 (with
register_globals set to the default off setting).
I have notified Macromedia of the problem, and they have
logged it as a high
severity bug, but have given no indication as to when a patch
will be
issued. Fortunately, the solution is easily fixed by hand.
The server
behaviors affected are Log In User and Log Out User.
Log In User needs changes in two places, plus the removal of
three lines.
Find the following lines of code
$GLOBALS['PrevUrl'] = $accesscheck;
session_register('PrevUrl');Replace them with
$_SESSION['PrevUrl'] = $accesscheck;Then find
$GLOBALS['MM_Username'] = $loginUsername;
$GLOBALS['MM_UserGroup'] = $loginStrGroup;Change them to
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;Finally, DELETE
the following
lines
//register the session variables
session_register("MM_Username");
session_register("MM_UserGroup");
In Log Out User, locate these two lines
session_unregister('MM_Username');
session_unregister('MM_UserGroup');Replace them with
unset($_SESSION['MM_Username']);
unset($_SESSION['MM_UserGroup']);
NOTE: There is NO need to do this if you are still using
PHP4, and not
experiencing any difficulties with User Authentication.
However, it does
affect the instructions for Chapters 14 and 15 of Foundation
Dreamweaver MX
2004 for anyone switching to PHP5.
David Powers
Co-author: Foundation Dreamweaver MX 2004
"jangade" <[email protected]> wrote in
message
news:[email protected]...
> Sorry, i still don't understand about that tutorial, can
u explain me more
> detail pls ( i am using php triad: php 4, mysql 1.3 and
apache 1.3 ). i
> give u
> the code :
>
> login page code:
> <?php require_once('Connections/koneksi.php'); ?>
> <?php
> // *** Validate request to login to this site.
> session_start();
>
> $loginFormAction = $_SERVER['PHP_SELF'];
> if (isset($accesscheck)) {
> $GLOBALS['PrevUrl'] = $accesscheck;
> session_register('PrevUrl');
> }
> login page :
>
> if (isset($_POST['pemakai'])) {
> $loginUsername=$_POST['pemakai'];
> $password=$_POST['sandi'];
> $MM_fldUserAuthorization = "";
> $MM_redirectLoginSuccess = "sukses_login.php";
> $MM_redirectLoginFailed = "tmbhdtteknisi.php";
> $MM_redirecttoReferrer = false;
> mysql_select_db($database_koneksi, $koneksi);
>
> $LoginRS__query=sprintf("SELECT username, password FROM
tblteknisi WHERE
> username='%s' AND password='%s'",
> get_magic_quotes_gpc() ? $loginUsername :
addslashes($loginUsername),
> get_magic_quotes_gpc() ? $password :
addslashes($password));
>
> $LoginRS = mysql_query($LoginRS__query, $koneksi) or
die(mysql_error());
> $loginFoundUser = mysql_num_rows($LoginRS);
> if ($loginFoundUser) {
> $loginStrGroup = "";
>
> //declare two session variables and assign them
> $GLOBALS['MM_Username'] = $loginUsername;
> $GLOBALS['MM_UserGroup'] = $loginStrGroup;
>
> //register the session variables
> session_register("MM_Username");
> session_register("MM_UserGroup");
>
> if (isset($_SESSION['PrevUrl']) && false) {
> $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
> }
> header("Location: " . $MM_redirectLoginSuccess );
> }
> else {
> header("Location: ". $MM_redirectLoginFailed );
> }
> }
> ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
4.01//EN"
> "
http://www.w3.org/TR/html4/strict.dtd">
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
> <title>Selamat Datang</title>
> .......
>
>
>
> and new page :
> <?php
> //initialize the session
> session_start();
>
> // ** Logout the current user. **
> $logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
> if ((isset($_SERVER['QUERY_STRING'])) &&
($_SERVER['QUERY_STRING'] !=
> "")){
> $logoutAction .="&".
htmlentities($_SERVER['QUERY_STRING']);
> }
>
> if ((isset($_GET['doLogout']))
&&($_GET['doLogout']=="true")){
> //to fully log out a visitor we need to clear the
session varialbles
> session_unregister('MM_Username');
> session_unregister('MM_UserGroup');
>
> $logoutGoTo = "index.php";
> if ($logoutGoTo) {
> header("Location: $logoutGoTo");
> exit;
> }
> }
> ?>
> <?php
> session_start();
> $MM_authorizedUsers = "";
> $MM_donotCheckaccess = "true";
>
> // *** Restrict Access To Page: Grant or deny access to
this page
> function isAuthorized($strUsers, $strGroups, $UserName,
$UserGroup) {
> // For security, start by assuming the visitor is NOT
authorized.
> $isValid = False;
>
> // When a visitor has logged into this site, the Session
variable
> MM_Username set equal to their username.
> // Therefore, we know that a user is NOT logged in if
that Session
> variable
> is blank.
> if (!empty($UserName)) {
> // Besides being logged in, you may restrict access to
only certain
> users
> based on an ID established when they login.
> // Parse the strings into arrays.
> $arrUsers = Explode(",", $strUsers);
> $arrGroups = Explode(",", $strGroups);
> if (in_array($UserName, $arrUsers)) {
> $isValid = true;
> }
> // Or, you may restrict access to only certain users
based on their
> username.
> if (in_array($UserGroup, $arrGroups)) {
> $isValid = true;
> }
> if (($strUsers == "") && true) {
> $isValid = true;
> }
> }
> return $isValid;
> }
>
> $MM_restrictGoTo = "index.php";
> if (!((isset($_SESSION['MM_Username'])) &&
> (isAuthorized("",$MM_authorizedUsers,
$_SESSION['MM_Username'],
> $_SESSION['MM_UserGroup'])))) {
> $MM_qsChar = "?";
> $MM_referrer = $_SERVER['PHP_SELF'];
> if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
> if (isset($QUERY_STRING) &&
strlen($QUERY_STRING) > 0)
> $MM_referrer .= "?" . $QUERY_STRING;
> $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar .
"accesscheck=" .
> urlencode($MM_referrer);
> header("Location: ". $MM_restrictGoTo);
> exit;
> }
> ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
4.01//EN"
> "
http://www.w3.org/TR/html4/strict.dtd">
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
> <title>Registrasi</title>
> <link href="css/stylesnew.css" type="text/css"
media="screen"
> rel="stylesheet">
> <!--[if gte IE 5]>
> <style>
> #LeftMNav ul a {height: 1em;}
> #LeftMNav li {float: left; clear: both; width: 100%;}
> </style>
> <![endif]-->
> <style type="text/
> ........
>
> how i can get username that user entered(login page) in
new page ?
> pls help me i'm just new bie....
> tks 4 kind attentions,
>
> regds
>
>
>
>
>
> -
Hİ
My ipad's screen is black. When it take charge, I can hear sound but still black. I press and hold both the sleep and home buttons for about 10 to 15 seconds but this doesn't work. Screen still black! PLS HELP ME!How long did you let it charge? It may take 30 minutes before the iPad responds when the battery is completely drained. Let it charge for at least 30 minute using the wall charger. Then rest the iPad. Press and hold both the Home button and the Sleep/Wake button continuously until the Apple logo appears. Then release the button and let the device restart. You will not lose data doing this. It's like a computer reboot.
If the iPad restarts let it continue to charge until the battery is 100%.
If the iPad still does not start make an appointment at an Apple Store to have your device examined by a technician. Or contact Apple Support. -
How to format posts in this forums well....pls help
Hi all,
This is just question about formatting to be done while posting..
sorry to post a non technical question...
okay..
for example if put some code beetween code tags it looks fine...
but if i post or copy query output from sqlplus or manual copy paste why its not being displayed correctly as it is..
even if i put that also within tags of code then also it wont aligned properly....
can somebody sugges on this..even pre command doesnot work incase of output data in the post...
please suggest..
Thanks
prasanthSee below link:
http://wiki.oracle.com/page/Oracle+Discussion+Forums+FAQ -
i purchased an iPod touch few months back. And i am very upset with the volume output it produces. iPod being an music player, has poor volume quality then my iPhone 3gs. Can anyone pls help. How do i rectify it?
Problem with both the speaker and earphones?
Have you tried another pair of headphones?
Yu can try the standard fixes to rule out a software problem:
- Reset. nothing is lost.
Reset iPod touch: Hold down the On/Off button and the Home button at the same time for at
least ten seconds, until the Apple logo appears.
- Restore from backup
- Restore to factory defaults/new iPod. -
I have two applications. One is Client, the other is Platform.
In the Platform, there are source files packaged into a library named ZtConfig.jar used by Client. If run Client and Platform, two applications can execute normally.
But if Client is started by user from platform, there is something wrong.
I noticed the error difficultly with finally catching exception.
I was puzzled. It is so strange. Pls help me. I list some codes here.
In Client where finally exception catched:
import zt.config;
try {
xmlFileUrl = new java.net.URL(
"file:///e:/Client/src/config/nsr1000.xml");
catch (IOException ex1) {
FileLogger.error(ex1.getMessage());
FileLogger.info("NSR1000Document.setIEDContent", xmlFileUrl.toString());
try {
xmlLoader = new XMLConfigLoader(xmlFileUrl);
finally {
FileLogger.error("NSR1000Document.setIEDContent",
"cannot new XMLConfigLoader object");
return; // the following codes cannot execute, so have to return here.
In the XMLConfigLoader, the constructor is
public XMLConfigLoader(java.net.URL xmlFileUrl) {
this.xmlFileUrl = xmlFileUrl;
configDoc = null;
builder = null;
xmlDoc = null;
Platform start Client application using the following code
Runtime.getRuntime().exec(
"java -jar e:/Client/Client.jar");I've got it!
Briefly, it is because classpath setting was overwritten by JBuilder.
Firstly, I start Platform from JBuilder. In its messages window. The command is
d:\j2sdk1.4.2_06\bin\javaw -classpath "JBPATH" zt.client.nsr1000.NSR1000App
Now, classpath environment variable was changed to be JBPATH. While I start
Client use Runtime.getRuntime().exec("java -jar Client.jar"), it will not run for classpath changed.
Then, I configured all packages used by Client into JBuilder libraries, including
Client.jar. And changed codes Runtime.getRuntime().exec("java -jar Client.jar") to be Runtime.getRuntime().exec("java -Xmx128m zt.client.nsr1000.NSR1000App")
I also changed CLASSPATH windows system environment variable.
I found this from command console, it can display exceptions. But from JBuilder, there is no exception that can be captured. So debug is difficult. -
Pls help me about two java virtual machine
have two applications. One is Client, the other is Platform.
In the Platform, there are source files packaged into a library named ZtConfig.jar used by Client. If run Client and Platform, two applications can execute normally.
But if Client is started by user from platform, there is something wrong.
I noticed the error difficultly with finally catching exception.
I was puzzled. It is so strange. Pls help me. I list some codes here.
In Client where finally exception catched:
import zt.config;
try {
xmlFileUrl = new java.net.URL(
"file:///e:/Client/src/config/nsr1000.xml");
catch (IOException ex1) {
FileLogger.error(ex1.getMessage());
FileLogger.info("NSR1000Document.setIEDContent", xmlFileUrl.toString());
try {
xmlLoader = new XMLConfigLoader(xmlFileUrl);
finally {
FileLogger.error("NSR1000Document.setIEDContent",
"cannot new XMLConfigLoader object");
return; // the following codes cannot execute, so have to return here.
}In the XMLConfigLoader, the constructor is
public XMLConfigLoader(java.net.URL xmlFileUrl) {
this.xmlFileUrl = xmlFileUrl;
configDoc = null;
builder = null;
xmlDoc = null;
}Platform start Client application using the following code
Runtime.getRuntime().exec(
"java -jar e:/Client/Client.jar");I've got it!
Briefly, it is because classpath setting was overwritten by JBuilder.
Firstly, I start Platform from JBuilder. In its messages window. The command is
d:\j2sdk1.4.2_06\bin\javaw -classpath "JBPATH" zt.client.nsr1000.NSR1000App
Now, classpath environment variable was changed to be JBPATH. While I start
Client use Runtime.getRuntime().exec("java -jar Client.jar"), it will not run for classpath changed.
Then, I configured all packages used by Client into JBuilder libraries, including
Client.jar. And changed codes Runtime.getRuntime().exec("java -jar Client.jar") to be Runtime.getRuntime().exec("java -Xmx128m zt.client.nsr1000.NSR1000App")
I also changed CLASSPATH windows system environment variable.
I found this from command console, it can display exceptions. But from JBuilder, there is no exception that can be captured. So debug is difficult. -
About COPA value fieds assignment-- pls help
Dear gurus,
we use COPA in project, SD create a condition type in pricing list, i will create a value fields and assign this condition type to the value fields.
and also we used incoming and actual in COPA. (different record type) . when i tested the new config, i found that:
in incoming sales order, i can get the data for the new value fields from SD condition type, but for the actual sales order which has billed, this field is empty.
this is the first time i meet this case. i feel a littele confused.
so pls help! your value point will be appreciated!
thanks
Ivanhi Shammi,
thanks for your quickly response.
in SD partner function we use sales rep, but we never refer to the SBU.
so i still confused, could you explain more details.
thanks & regards
IVAN -
Somebody help pls its about curve9360
hey i need to knw how to fix dis jvm error 545... asap.... pls help somebody... to fixdis up.... it strucked my ph half an hour back...
Hi rewachaturvedi,
If you go through the KB you will get all the Links,But still have a look :
1 KB16068 : How to update the BlackBerry device software through web.
2 KB10144 How to force the detection of the BlackBerry smartphone using Application Loader
Try the second one and see if it resolves.
Prince
Click " Like " if you want to Thank someone.
If Problem Resolves mark the post(s) as " Solution ", so that other can make use of it.
Click " Like " if you want to Thank someone.
If Problem Resolves mark the post(s) as " Solution ", so that other can make use of it.
Maybe you are looking for
-
Need help with a cash register program.
I'm a noob at JAVA, but having fun with i so far! I was wondering if anyone could help me with a school project I need to get done. I've done most of the work, but I can't get it to not display when I have zero results. What I mean is that the projec
-
Hi All, I developed a report in Project systems ,now I want to validate the output of the report. The report is cost element wise report for actual/comm/total/plan. Could you able to give suggestions against which table or standard report or any othe
-
Why is restoring iphone from back up taking so long?
why is restoring iphone from back up taking so long? i'm updating the software on my iphone 4 and started it yesterday... then my imac goes to sleep and not sure if the update is continuing... it says time remaining 31 minutes... then 33... 35... 37
-
Hi. I was trying to take out the SIM card. When I put the upin into that miniscule slot at the top of the phone, the black sim carrier popped out and I did not immediately see it (it fell in my lap) while the sim card ended in my hand. Not knowing th
-
Need profile option for determining DateTime format in Oracle Forms
Hello All, I also have requirement where I need to read the date format in which Oracle Forms displays date values. As per updates to [this thread|https://forums.oracle.com/forums/thread.jspa?messageID=10285119] , I just need to read the profile opti