Urgent help with string tokenizing.
Hello Everyone,
I'm 4 months new to Java and JSP.
Can some one help me with a small favor please, my program below reads from a file and Tokenize the string, the top layer of the string is OK however I want to write another method to tokenize off of the top layer it must be in a separate method because I want to call the method on a JSP page. Can someone view my code and help me with the other method please.
Thanks
KT
package dev;
import java.io.*;
import java.util.*;
public class RoundDetail2
public String string_gameID;
public String string_roundID;
public String string_bet;
public String string_win;
public String string_roundDetail;
public String string_date_time;
public String tokenizer_topLayer;
public String readDetail_topLayer;
public static final String SUITS[] = {" ", "Clubs", "Hearts", "Spades", "Diamonds", "Joker", "FaceDown"};
public static final String VALUES[] = {"Joker ","Ace", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King"};
public static final String SuitVALUES[] = {" ","1","2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14"};
public RoundDetail2() throws FileNotFoundException
DataInputStream inFile=
new DataInputStream(
new BufferedInputStream(
new FileInputStream("C:/apps/jakarta-tomcat-4.0.6/webapps/ROOT/WEB-INF/classes/dev/Data_452SY2.txt")));
try {
if((readDetail_topLayer = inFile.readLine()) != null)
StringTokenizer tokenizer_topLayer = new StringTokenizer(readDetail_topLayer,"\t", true);
if (tokenizer_topLayer.hasMoreTokens())
string_gameID = tokenizer_topLayer.nextToken();
string_roundID = tokenizer_topLayer.nextToken();
catch(IOException e)
System.out.println(e.getMessage());
If you are trying to read tab delimited file and tokenize the contents, the code should be as below:
package dev;
import java.io.*;
import java.util.*;
public class RoundDetail2 {
public String string_gameID;
public String string_roundID;
public String string_bet;
public String string_win;
public String string_roundDetail;
public String string_date_time;
public String tokenizer_topLayer;
public String readDetail_topLayer;
public static final String SUITS[] = {" ", "Clubs", "Hearts", "Spades", "Diamonds", "Joker", "FaceDown"};
public static final String VALUES[] = {"Joker ","Ace", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King"};
public static final String SuitVALUES[] = {" ","1","2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14"};
String gameInfoText = "";
public RoundDetail2() throws FileNotFoundException
DataInputStream inFile = new DataInputStream(new BufferedInputStream(
new FileInputStream("C:/apps/jakarta-tomcat-4.0.6/webapps/ROOT/WEB-INF/classes/dev/Data_452SY2.txt")));
try
while((readDetail_topLayer = inFile.readLine()) != null)
gameInfoText += readDetail_topLayer;
} catch(IOException e)
System.out.println(e.getMessage());
public void getGameInfo()
StringTokenizer tokenizer_topLayer = new StringTokenizer(gameInfoText,"\t", false);
while (tokenizer_topLayer.hasMoreTokens())
string_gameID = tokenizer_topLayer.nextToken();
string_roundID = tokenizer_topLayer.nextToken();
System.out.println(string_gameID+" : "+string_roundID);
public static void main(String[] args)
try
RoundDetail2 roundDetail = new RoundDetail2();
roundDetail.getGameInfo();
}catch(Exception e){}
Test if it works for you by running at command prompt.
Goodluck
-Mak
Similar Messages
-
Hey guys,
I need some help with String Parsing. i hope experts here will help me.
i'm reading a text file and getting data as String in this format
*ABR, PAT MSSA 2009 7001 B ABC Y
*VBR, SAT ZSSA 2008 5001 A CED N
*ABC, AAT CSSA 5008 001 A AZX N
*CBC, CAT FSSA 308 5001 A XCV N
Now from following lines i have to extract Number data i.e. 2009 and 7001 from 1st line. 2008 and 5001 from 2nd line and so on.
Can anyone pls suggest me any way to get the data that i want from these Strings
Thanks for your time to read this.
Regards,
samThanks for the reply
Data length can vary. ABR, PAT is the last name, First Name of the Users.
it can be following or any other combination. i just need 2 set of numbers from the complete line rest i can ignore. Any other way to get that
*ABRaaassd, PATfffff MSSA 2009 7001 B ABC Y
*VBRaa, SATaa ZSSA 2008 5001 A CED N
*ABC, AAT CSSA 5008 001 A AZX N
*CBC, CAT FSSA 308 5001 A XCV N -
URGENT Help With Scientific Calculator!
Hi everybody,
I designed a calculator, and I need help with the rest of the actions. I know I need to use the different Math methods, but I tried tried that and it didn't work. Also, it needs to work as an applet and application, and in the applet, the buttons don't appear in order, how can I fix that?
I will really appreciate your help with this program, I can't get it to work and I'm frustrated, I need to finish this for next Tuesday 16th. Please e-mail me at [email protected].
Below is the code for the calcualtor.
Thanks a lot!
-Maria
// calculator
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
public class calculator extends JApplet implements
ActionListener
private JButton one, two, three, four, five, six, seven,
eight, nine, zero, dec, eq, plus, minus, mult, div, clear,
mem, mrc, sin, cos, tan, asin, acos, atan, x2, sqrt, exp, pi, percent;
private JLabel output, blank;
private Container container;
private String operation;
private double number1, number2, result;
private boolean clear = false;
//GUI
public void init()
container = getContentPane();
//Title
//super("Calculator");
JPanel container = new JPanel();
container.setLayout( new FlowLayout( FlowLayout.CENTER
output = new JLabel("");
output.setBorder(new MatteBorder(2,2,2,2,Color.gray));
output.setPreferredSize(new Dimension(1,26));
getContentPane().setBackground(Color.white);
getContentPane().add( "North",output );
getContentPane().add( "Center",container );
//blank
blank = new JLabel( " " );
container.add( blank );
//clear
clear = new JButton( "CE" );
clear.addActionListener(this);
container.add( clear );
//seven
seven = new JButton( "7" );
seven.addActionListener(this);
container.add( seven );
//eight
eight = new JButton( "8" );
eight.addActionListener(this);
container.add( eight );
//nine
nine = new JButton( "9" );
nine.addActionListener(this);
container.add( nine );
//div
div = new JButton( "/" );
div.addActionListener(this);
container.add( div );
//four
four = new JButton( "4" );
four.addActionListener(this);
container.add( four );
//five
five = new JButton( "5" );
five.addActionListener(this);
container.add( five );
//six
six = new JButton( "6" );
six.addActionListener(this);
container.add( six );
//mult
mult = new JButton( "*" );
mult.addActionListener(this);
container.add( mult );
//one
one = new JButton( "1" );
one.addActionListener(this);
container.add( one );
//two
two = new JButton( "2" );
two.addActionListener(this);
container.add( two );
//three
three = new JButton( "3" );
three.addActionListener(this);
container.add( three );
//minus
minus = new JButton( "-" );
minus.addActionListener(this);
container.add( minus );
//zero
zero = new JButton( "0" );
zero.addActionListener(this);
container.add( zero );
//dec
dec = new JButton( "." );
dec.addActionListener(this);
container.add( dec );
//plus
plus = new JButton( "+" );
plus.addActionListener(this);
container.add( plus );
//mem
mem = new JButton( "MEM" );
mem.addActionListener(this);
container.add( mem );
//mrc
mrc = new JButton( "MRC" );
mrc.addActionListener(this);
container.add( mrc );
//sin
sin = new JButton( "SIN" );
sin.addActionListener(this);
container.add( sin );
//cos
cos = new JButton( "COS" );
cos.addActionListener(this);
container.add( cos );
//tan
tan = new JButton( "TAN" );
tan.addActionListener(this);
container.add( tan );
//asin
asin = new JButton( "ASIN" );
asin.addActionListener(this);
container.add( asin );
//acos
acos = new JButton( "ACOS" );
cos.addActionListener(this);
container.add( cos );
//atan
atan = new JButton( "ATAN" );
atan.addActionListener(this);
container.add( atan );
//x2
x2 = new JButton( "X2" );
x2.addActionListener(this);
container.add( x2 );
//sqrt
sqrt = new JButton( "SQRT" );
sqrt.addActionListener(this);
container.add( sqrt );
//exp
exp = new JButton( "EXP" );
exp.addActionListener(this);
container.add( exp );
//pi
pi = new JButton( "PI" );
pi.addActionListener(this);
container.add( pi );
//percent
percent = new JButton( "%" );
percent.addActionListener(this);
container.add( percent );
//eq
eq = new JButton( "=" );
eq.addActionListener(this);
container.add( eq );
//Set size and visible
setSize( 190, 285 );
setVisible( true );
public static void main(String args[]){
//execute applet as application
//applet's window
JFrame applicationWindow = new JFrame("calculator");
applicationWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//applet instance
calculator appletObject = new calculator();
//init and start methods
appletObject.init();
appletObject.start();
} // end main
public void actionPerformed(ActionEvent ae)
JButton but = ( JButton )ae.getSource();
//dec action
if( but.getText() == "." )
//if dec is pressed, first check to make shure there
is not already a decimal
String temp = output.getText();
if( temp.indexOf( '.' ) == -1 )
output.setText( output.getText() + but.getText() );
//clear action
else if( but.getText() == "CE" )
output.setText( "" );
operation = "";
number1 = 0.0;
number2 = 0.0;
//plus action
else if( but.getText() == "+" )
operation = "+";
number1 = Double.parseDouble( output.getText() );
clear = true;
//output.setText( "" );
//minus action
else if( but.getText() == "-" )
operation = "-";
number1 = Double.parseDouble( output.getText() );
clear = true;
//output.setText( "" );
//mult action
else if( but.getText() == "*" )
operation = "*";
number1 = Double.parseDouble( output.getText() );
clear = true;
//output.setText( "" );
//div action
else if( but.getText() == "/" )
operation = "/";
number1 = Double.parseDouble( output.getText() );
clear = true;
//output.setText( "" );
//eq action
else if( but.getText() == "=" )
number2 = Double.parseDouble( output.getText() );
if( operation == "+" )
result = number1 + number2;
else if( operation == "-" )
result = number1 - number2;
else if( operation == "*" )
result = number1 * number2;
else if( operation == "/" )
result = number1 / number2;
//output result
output.setText( String.valueOf( result ) );
clear = true;
operation = "";
//default action
else
if( clear == true )
output.setText( "" );
clear = false;
output.setText( output.getText() + but.getText() );
}Multiple post:
http://forum.java.sun.com/thread.jsp?forum=31&thread=474370&tstart=0&trange=30 -
Urgent Help with Image Gallery
Hi,
I really need help with an image gallery i have created. Cannot think of a resolution
So....I have a dynamic image gallery that pulls the pics into a movie clip and adds them to the container (slider)
The issue i am having is that when i click on this i am essentially clicking on all the items collectively and i would like to be able to click on each image seperately...
Please see code below
var xml:XML;
var images:Array = new Array();
var totalImages:Number;
var nbDisplayed:Number = 1;
var imagesLoaded:int = 0;
var slideTo:Number = 0;
var imageWidth = 150;
var titles:Array = new Array();
var container_mc:MovieClip = new MovieClip();
slider_mc.addChild(container_mc);
container_mc.mask = slider_mc.mask_mc;
function loadXML(file:String):void{
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(new URLRequest(file));
xmlLoader.addEventListener(Event.COMPLETE, parseXML);
function parseXML(e:Event):void{
xml = new XML(e.target.data);
totalImages = xml.children().length();
loadImages();
function loadImages():void{
for(var i:int = 0; i<totalImages; i++){
var loader:Loader = new Loader();
loader.load(new URLRequest("images/"+String(xml.children()[i].@brand)));
images.push(loader);
// loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,onProgress);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,onComplete);
function onComplete(e:Event):void{
imagesLoaded++;
if(imagesLoaded == totalImages){
createImages();
function createImages():void{
for(var i:int = 0; i < images.length; i++){
var bm:Bitmap = new Bitmap();
bm = Bitmap(images[i].content);
bm.smoothing = true;
bm.x = i*170;
container_mc.addChild(bm);
var caption:textfile=new textfile();
caption.x=i*170; // fix text positions (x,y) here
caption.y=96;
caption.tf.text=(xml.children()[i].@brandname)
container_mc.addChild(caption);yes, sorry i do wish to click on individual images but dont know how to code that
as i mentioned i have 6 images that load into an array and then into a container and i think that maybe the problem is that i have the listener on the container so when i click on any image it gives the same results.
what i would like is have code thats says
if i click on image 1 then do this
if i click on image 2 then do something different
etc
hope that makes sense
thanks for you help! -
Urgent help with simple BPEL process for reading data from database
Hello there,
I need help with BPEL project.
i have created a table Employee in Database.
I did create application, BPEL project and connection to the database properly using Database Adapter.
I need to read the records from the database and convert into xml fomat and it should to go approval for BPM worklist.
Can someone please describe me step by step what i need to do.
Thx,
DpsI have created a table in Database with data like Empno,name,salary,comments.
I created Database Connection in jsp page and connecting to BPEL process.
It initiates the process and it goes automatically for approval.
Please refer the code once which i created.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.util.Map" %>
<%@page import="com.oracle.bpel.client.Locator" %>
<%@page import="com.oracle.bpel.client.NormalizedMessage" %>
<%@page import="com.oracle.bpel.client.delivery.IDeliveryService" %>
<%@page import="javax.naming.Context" %>
<%@page import="java.util.Hashtable" %>
<%@page import="java.util.HashMap" %>
<%@ page import="java.sql.*"%>
<%@ page import= "jspprj.DBCon"%>
<html>
<head>
<title>Invoke CreditRatingService</title>
</head>
<body>
<%
DBCon dbcon=new DBCon();
Connection conn=dbcon.createConnection();
Statement st=null;
PreparedStatement pstmt=null;
Hashtable env= new Hashtable();
ResultSet rs = null;
Map payload =null;
try
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
env.put(Context.PROVIDER_URL, "opmn:ormi://localhost:port:home/orabpel");//bpel server
env.put("java.naming.security.principal", "username");
env.put("java.naming.security.credentials", "password");//bpel console
Locator locator = new Locator("default","password",env);
IDeliveryService deliveryService =
(IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME );
// construct the normalized message and send to Oracle BPEL Process Manager
NormalizedMessage nm = new NormalizedMessage();
java.util.HashMap map = new HashMap();
st=conn.createStatement();
out.println("connected");
String query1="Select * from EMPLOYEE";
rs=st.executeQuery(query1);
/*reading Data From Database and converting into XML format
so that no need of going to BPEL console and entering the details.
while (rs.next()){
String xml1 = "<AsynchBPELProcess1ProcessRequest xmlns='http://xmlns.oracle.com/AsynchBPELProcess1'>"+
"<Empno>"+rs.getString(1)+"</Empno>"+
"<EmpName>"+rs.getString(2)+"</EmpName>"+
"<Salary>"+rs.getString(3)+"</Salary>"+
"<Comments>"+rs.getString(4)+"</Comments>"+
"</AsynchBPELProcess1ProcessRequest>";
out.println(xml1);
nm.addPart("payload", xml1 );
// EmployeeApprovalProcess is the BPEL process in which human task is implemented
deliveryService.post("EmployeeApprovalProcess", "initiate", nm);
// payload = res.getPayload();
out.println( "BPELProcess CreditRatingService executed!<br>" );
// out.println( "Credit Rating is " + payload.get("payload") );
//Incase there is an exception while invoking the first server invoke the second server i.e lsgpas13.
catch(Exception ee) {
//("BPEL Server lsgpas14 invoking error.\n"+ee.toString());
%>
</body>
</html>
Its working fine.And i want it for Bulk approvals.please help me step by step procedure if any other way to implement this. -
Urgent help with Pages 5.0 needed
Hi guys,
I need urgent help! I deleted Pages 5.0 (as I HATED it) but now can't open a very important document. Can someone please tell me how to reinstall it??
Thanks
KellieDownloading again is not as easy as that. you must find the app in the "Purchased" section of the
app store and I think you then must hold down the option key to reinstall it.
BTW, I only worked with one document as a trial for Pages 5 and then imported it to Word and saved it. I then deleted Pages 5 (I can't believe anyone who works with software would think that piece of worthless junk would sufice for anyone who uses a word processor professionally), reopened the Word document and saved it in Pages 09.
I hope this helps -
Urgent Help with a my Cheap Greek Hotel!
Thanks for your help with the pseudocode. I have got many errors with this program in the funtions. The code is below. Is there someone who can help me get my head around them?
import Date;
import Money;
public class Hotel {
private Room[] rooms = new Room[12];
public Hotel() {
for(int i = 0; i<rooms.length; i++){
rooms[i] = new Room(i+1,20);
public static void main (String[]args)
// public void bookIn(String guest, Date today)
public void bookIn(String guest, Date today, int roomNumber)
if (roomNumber < 1 || roomNumber > rooms.length){
throw new Exception("Room numbers must be within 1-" + rooms.length);
if (rooms[roomNumber-1].getRoomHolder() !=null){
throw new Exception("Room " + roomNumber + " not available.");
rooms[roomNumber-1].setRoomHolder(guest);
rooms[roomNumber-1].setBookedIn(today);
// fn to put a guest in ata a specified date
public void bookOut (Date checkedIn, Date checkedOut)
//In the date class you can probably check the Calendar class to find
//out the syntax for subtracting dates
int nightsStayed = checkedOut - checkedIn;
//Now I'd have an array of Guest
//objects, where the room number = the position in the
//array. When a guest checks in, you can set whatever
//info. you need (check in date, guest name, etc.) and
//set it back to null when a guest checks out.
new Room[12][roomNumber] = null;
//calculate the fee
double price = getFee(nightsStayed);
System.out.println("You owe: "+price);
// public double bookOut(Date currentdate)
}//end method
public double bookOut (Date currentdate)
// fn to empty the room and may be calculate & return the value of the bill
public double getFee(int nightsStayed)
double fee = (nightlyFee*nightsStayed);
return fee;
//end method
//end class
}The errors in this program are listed below`
T:\Year 1\Programming Workshop\Assignment2\Assignment2\Hotel.java:31: cannot resolve symbol
symbol : method setRoomHolder (java.lang.String)
location: class Room
rooms[RoomNumber-1].setRoomHolder(guest);
^
T:\Year 1\Programming Workshop\Assignment2\Assignment2\Hotel.java:32: cannot resolve symbol
symbol : method setBookedIn (Date)
location: class Room
rooms[RoomNumber-1].setBookedIn(today);
^
T:\Year 1\Programming Workshop\Assignment2\Assignment2\Hotel.java:40: operator - cannot be applied to Date,Date
int nightsStayed = checkedOut - checkedIn;
^
T:\Year 1\Programming Workshop\Assignment2\Assignment2\Hotel.java:46: cannot resolve symbol
symbol : variable RoomNumber
location: class Hotel
new Room[12][RoomNumber] = null;
^
T:\Year 1\Programming Workshop\Assignment2\Assignment2\Hotel.java:46: unexpected type
required: variable
found : value
new Room[12][RoomNumber] = null;
^
T:\Year 1\Programming Workshop\Assignment2\Assignment2\Hotel.java:59: cannot resolve symbol
symbol : variable nightlyFee
location: class Hotel
double fee = (nightlyFee*nightsStayed);
^
T:\Year 1\Programming Workshop\Assignment2\Assignment2\Room.java:36: cannot return a value from method whose result type is void
return bookedIn;
^
7 errors
*** Compiler reported errorsIs there anyone who can transfer my pseudocode into language specific java? I really need some help. Thanks.Thanks for your Help regarding methods. You managed to help me correct two errors. Which means i know have six. Thanks ever so much. The method setRoom Holder has been recognised aswell as the method setBookedIn.
What did you mean by "I cannot use minus operators on dates?" Is there any other way that I can code this function so that it is acceptable?
int nightsStayed = bookedOut - bookedIn;
Can you help me code these last four functions please? Then my program will have no errors. I have to get rid of six.
// public void bookIn(String guest, Date today)
public void bookIn(String guest, Date today, int RoomNumber)
if (RoomNumber < 1 || RoomNumber > rooms.length){
throw new Exception("Room numbers must be within 1-" + rooms.length);
if (rooms[RoomNumber-1].getRoomHolder() !=null){
throw new Exception("Room " + RoomNumber + " not available.");
rooms[RoomNumber-1].setRoomHolder(guest);
rooms[RoomNumber-1].setBookedIn(today);
// fn to put a guest in ata a specified date
public void bookOut (Date bookedIn, Date bookedOut)
//In the date class you can probably check the Calendar class to find
//out the syntax for subtracting dates
int nightsStayed = bookedOut - bookedIn;
//Now I'd have an array of Guest
//objects, where the room number = the position in the
//array. When a guest checks in, you can set whatever
//info. you need (check in date, guest name, etc.) and
//set it back to null when a guest checks out.
new Room[12][RoomNumber] = null;
//calculate the fee
double price = getFee(nightsStayed);
DerbyIO.getString("You owe: "+price);
// public double bookOut(Date currentdate)
}//end method
public double bookOut (Date currentdate)
// fn to empty the room and may be calculate & return the value of the bill
public double getFee(int nightsStayed)
double fee = (nightlyFee*nightsStayed);
return fee;
//end method
//end class
} -
Any help with this will be really appreciated. I'm new to programming.
If I search for an ssn in a database, I want to view all records relating to that ssn. However, I am getting all the records in the table.
eg.
at the prompt for ssn, let's say I enter 111111111
I would like to see
111111111 abc xyz etc
111111111 pdg ppp etc
however, I am getting
000000000 utt tui etc
111111111 tug etg etc
How do I make limit the search to the ssn I want?
The related code is below.
Thanks.
Java Code
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
if (checkLoginSessionPresent(request, response)) {
loadTable("/esoladm/TaxView.jsp", request, response);
else {
checkLoginSessionRedirect("/esoladm/ESOLAdminMain.jsp", request, response);
JSP Code
<% while (MyTaxSuppress != null) { %>
<% String sPlanCode = MyTaxSuppress.getPlanCode(); %>
<% String sSSN = MyTaxSuppress.getSSN(); %>
<% String sTaxYear = MyTaxSuppress.getTaxYear(); %>
<% String sDistCode = MyTaxSuppress.getDistCode(); %>
<% double sGrAmount = MyTaxSuppress.getGrAmount(); %>
<% String sStmtType = MyTaxSuppress.getStmtType(); %>
<% boolean bNewSuppress = MyTaxSuppress.getNewSuppress(); %>
<% String rowID = sPlanCode; %>
<% rowID += sSSN; %>
<% rowID += sTaxYear; %>
<% rowID += sDistCode; %>
<% rowID += sStmtType; %>
<% rowID += sGrAmount; %>
<% System.out.println( "Do While lp exiti" + rowID);%
<% if (bNewSuppress) { %>
<% out.println( "<TD> %>
<% <img BORDER='0' SRC='/esoladm/ESOLNew2.gif' %>
<% ALT='' WIDTH='50' HEIGHT='20'> </TD >"); %>
<% } else { %>
<% out.println( "<TD></TD>"); %>
<% } %>
<TD><%= sPlanCode %></TD>
<TD><%= sSSN %></TD>
<TD><%= sTaxYear %></TD>
<TD><%= sDistCode %></TD>
<TD><%= sGrAmount %></TD>
<TD><%= sStmyType %></TD>
<TD><input TYPE="checkbox" name="<%=rowID %>" ></TD>
<% MyTaxSuppress = MySuppressTaxList.getNext(); %>
<% } // end of while loop %>I don't see anywhere in your code where you conditionally output a tuple from your database. You seem to be outputting everything.
Maybe you need:
<% if (sSSN==input_value){ %>
<TD><input TYPE="checkbox" name="<%=rowID %>" ></TD>
<% } %> -
Urgent Help with Planning Book
Hello Gurus,
Need your help with a very urgent issue. I cannot see my key figure values in my planning book(Interactive Planning). I could sucessfully generate my CVC, then initialised my planning area. Then when I go the interactive planning I can see all my characteristics -Ex Material master( has all values), Prod type has values, etc. Iam in DEV system and have to move the whole config to QA now. I have to validate that the config works in QA. Its works ok in the sandbox but I cannot figureout why I can not see the values for key figs that Iam loading from a Flat File. Please help!!!!!!Hello Suresh,
I have one more question for you. Let me tell you my scenario. I have the client giving me a rough forecast for the future. I have to do stat forecast based on the history and check that against the initial forecast given by them. But, the problem I realised now is that when I go to my planning books I can see the values for 2008 in mothly buckets since I have 0calmonth. But the client gave me another file with forecast for 2008 in monthly buckets and for 2009 and 2010 in quarter buckets. So, i have a planning buck profile defined to meet that but, how do I upload the file with both 0calmonth and 0calquarter in a single file. Please let me know!! Urgent task.
Thanks again,
Chinna. -
Urgent Help with network access to FileOutputStream
URGENT HELP NEEDED GUYS...I am stuck on this past 2 days. I tried several alternatives but to vain.
I am trying to access a Folder on a user's computer which is lying in a different Domain.
For accessing this folder, I have the following information with me.
Domain name, PC name, folder name, windows username, windows password.
Note: This username and password will give me rights to read + write to that folder.
How to use these information to open a fileoutputstream ? Does the java.io package allow programs to pass a username, password , domainname, pcname and then the folder and filename to create/read/write files..
Pls. suggest code examples. Sometime back I posted this query but didnt get an answer to my satisfaction. I have tried at my end but unsuccessful yet. Help would be appreciated.
I am trying this on a Windows File System and Network domain
THIS IS V. URGENT
Thanks,Hi HJK,
I am referring to the last reply of yours.
" Hi, there are three approaches I can think of offhand:
1) make sure the user-context under which you run the java app has the right to access the remote drive.
2) Do the network connection in a batch or c program and call that at the start of your java app with Runtime#exec.
3) Write some c/c++ code to open the connection and integrate that via JNI.
Let me know what (other) solution you came up with in the end!
Regarding the 1st.
I am supposed to write a remote installation utility actually. There are around 200 PC(s) in a network on which I need to copy these java class files. My problem statement is such that at runtime I only have username, passwords, domain access. I am not supposed to map any drives. Its supposed to be done dynamically. No manual intervention required. :(
How do I do the network connection in a batch mode ? Let me know that?
If 2nd option can be done, probably I can think of action-3 at the moment I am quite blurr :( -
We are tring to syndicate the vendor numbers only from vendor repository in xml format. I created an XSD for the same. See the XSD below :
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="Vendor" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Vendors">
<xs:complexType>
<xs:sequence>
<xs:element name="LIFNR" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
XSD validates fine and generates an output from syndicator, but the problem that we face is that this is creating 1 file for each vendor record. We want a consolidated file. I know I am missing something but cannot make it to work.
I tried to put the unbounded parameter in <xs:element name="Vendors"> but that makes the XSD invalid.
Need urgent help on this.
Thanks<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="Vendors">
<xs:complexType>
<xs:sequence>
<xs:element name="Vendor" type="Vendor" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="Vendor">
<xs:sequence>
<xs:element name="LIFNR" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema> -
Need urgent help with HSDIO hardware timing
Hi everyone,
I need urgent help regarding HSDIO hardware timing. I've been working in a project which generating serial ramp using HSDIO pxie device.
I'm using clock rate 40MHz and generating 14 bit of boolean for each step of ramp. And I have to generate simply 256 steps ramp.
Which means, 256 (steps) x 14 (boolean array) x 25 ns (period of 1 boolean value) = 89,6 ns.
What I'm doing right now is with using index of FOR loop as my input data (converting the index into 14bit boolean), then write into pxie device in every iteration,
which means, my data is getting into output in every 1ms time, right? (I'm using windows)
And I want to be able to generate faster than that.
How can I prewrite my 256 steps ramp, then write them all at once into pxie device. I'm really stuck here.
In the picture can you see how I do the write into device in every iteration of FOR Loop.
Regards,
Yan.hi, thanks for responding.
with using example of dynamic generation with script, I can manage to generate the ramp with controllable delay (generate the whole waveform, including delay with script command, then write to the card).
But I still have 1 question, I can test the output of the generation using oscilloscope and cant see the start delay (I'm writing delay at the start, before generating the ramp). My signal generated at 0 sec.
How can I check this start delay? is there any good example delivered with Labview to check this generation? Somehow I cant use the "dynamic generation and acquisition" example to see my generation (cant figure out how to capture the generated signal).
regards,
Yan. -
Hi, i am writting a program which requires me to break up an inputed string and then then break it up and compare and use the individual words or parts of the string. Is that possible?! i am able to tokenize the string but i would like to know if it possible to then make those tokens into individual strings that i can use again?!?! i am new to this and would really appreciate any help i can get...
thankshmm... ok i guess i'm probabaly not explaining myself very well coz im still not exactly sure what im doing... right i have this
StringTokenizer st = new StringTokenizer(text);
String[] token = new String[st.countTokens90];
int count = 0;
while (st.hasMoreTokens()){
token[count] = st.nextToken();
count++;
so it seperates the string into tokens, my question is say the user enters the line Hello my name is Peter
Is it possible for to then use the individual words in the rest of my program. Assign a name to each like word1, word2, word3 etc... because i then need to use those words to compare them to other words and themselves.
Did that make any sense?! -
Hello,
First off thanks in advance to anyone who helps. I am trying to write a program that using a class string object to convert this kind of "text speech" to english. For example if the user inputs "HowAreYou?", I want the program to output "How are you?" I am having too much trouble with strings for some reason. This is what I have so far and I am not sure where to go from here. Should I use a do loop to check through the input string until it is done seperating the words? And how should I go about doing that?
import java.util.Scanner;
public class P8
public static void main( String args[] )
char choice;
String line = null;
String answer = null;
Scanner scan = new Scanner(System.in);
do
System.out.println();
System.out.print("ENTER TextSpeak sentence(s): ");
line = scan.nextLine();
System.out.print( "Converted to English: \t ");
System.out.print( textSpeaktoEng( line ) );
System.out.println();
System.out.print("Want more TextSpeak?\t\t ");
answer = scan.next();
choice = answer.charAt(0);
if( scan.hasNextLine() )
answer = scan.nextLine();
}while(choice != 'N' && choice != 'n');
public static String textSpeakToEng(String s)
String engStr = null;
if( Character.isUpperCase( s.charAt(j) ) )
engStr += ? ?;
engStr += Character.toLowerCase( s.charAt(j) );
scan.close();
}I got my program to compile and run but I have a problem. If I input something like "ThisForumIsGreat" it will output just "t f i g" in lower case letters. Any suggestions?
import java.util.Scanner;
public class P8
public static void main( String args[] )
char choice; // Repeat until n or N
String line = null; // Sentences to toTextSpeak
String answer = null; // Repeat program scan
Scanner scan = new Scanner(System.in); // Read from keyboard
do
System.out.println();
System.out.print("ENTER TextSpeak sentence(s): ");
line = scan.nextLine(); // Read input line
System.out.print( "Converted to English: \t ");
System.out.print( textSpeakToEng( line ) );
System.out.println();
System.out.print("Want more TextSpeak?\t\t ");
answer = scan.next(); // Read line, assign to string
choice = answer.charAt(0); // Assign 1st character
if( scan.hasNextLine() ) // <ENTER> character
answer = scan.nextLine(); // Read line, discard
}while(choice != 'N' && choice != 'n'); // Repeat until input start n or N
public static String textSpeakToEng(String s)
String engStr = null;
int i;
for ( i = 0; i < s.length(); ++i )
if( Character.isUpperCase( s.charAt(i) ) )
engStr += " "; // Append 1 blank space
engStr += Character.toLowerCase( s.charAt(i) ); // Append lowercase
return( engStr );
} -
Need urgent help with Ifs1.1 on Solaris
We have installed IFS 1.1 with Oracle 8.1.7 on a three tier System (two Suns). We use JWS as WebServer. When we start IFS and JWS everything seems to work fine. But after some time (irregulary) we are not able to contact the JSP-Sites via a bowser. After restarting JWS, everything works fine for some time.
Sometimes it happens (about one times a day), that the whole JWS crashes (JWS-Admin doesn't work). So we have to restart the whole IFS.
What can be the problem? We need urgent help, because the deadline for our project is Wednesday.
By the way:
Where do I have to start CTX on the IFS- or the Oracle-Side?
nullYes, we tried the Oracle HTTP - Server, but we weren4t able to get it to work. We didn4t get our JSP-Files to work with it. But that is another issue. I think it4s not a problem of JWS, but IFS.
Additionally it is strange, that we are still able to connect to the database via SqlPlus.
IFS works fine for about 15 minutes, than it crashes, nothing works anymore. We found following errors in the IfsAgents.log:
maybe it can help?!
Mon Dec 04 23:12:20 CET 2000
Server STARTED: IfsAgents(19944) not managed
Attempting to load agent EventExchangerAgent
Agent EventExchangerAgent loaded
Server STARTED: IfsProtocols(19945) not managed
Attempting to start agent EventExchangerAgent
EventExchangerAgent: Start request
Agent EventExchangerAgent started
Attempting to load agent ExpirationAgent
Agent ExpirationAgent loaded
EventExchangerAgent: starting timer
Attempting to start agent ExpirationAgent
ExpirationAgent: Start request
Agent ExpirationAgent started
Attempting to load agent GarbageCollectionAgent
Agent GarbageCollectionAgent loaded
ExpirationAgent: computed initial delay (in ms) is: 10024504
ExpirationAgent: starting timer
Attempting to start agent GarbageCollectionAgent
GarbageCollectionAgent: Start request
Agent GarbageCollectionAgent started
Attempting to load agent ContentGarbageCollectionAgent
Agent ContentGarbageCollectionAgent loaded
GarbageCollectionAgent: computed initial delay (in ms) is: 11816890
GarbageCollectionAgent: starting timer
Attempting to start agent ContentGarbageCollectionAgent
ContentGarbageCollectionAgent: Start request
Agent ContentGarbageCollectionAgent started
Attempting to load agent DanglingObjectAVCleanupAgent
Agent DanglingObjectAVCleanupAgent loaded
ContentGarbageCollectionAgent: starting timer
Attempting to start agent DanglingObjectAVCleanupAgent
DanglingObjectAVCleanupAgent: Start request
Agent DanglingObjectAVCleanupAgent started
Attempting to load agent OutboxAgent
Agent OutboxAgent loaded
DanglingObjectAVCleanupAgent: computed initial delay (in ms) is: 5500105
DanglingObjectAVCleanupAgent: starting timer
Attempting to start agent OutboxAgent
OutboxAgent: Start request
Agent OutboxAgent started
Attempting to load agent ServiceWatchdogAgent
Agent ServiceWatchdogAgent loaded
OutboxAgent: Done processing
Attempting to start agent ServiceWatchdogAgent
ServiceWatchdogAgent: Start request
Agent ServiceWatchdogAgent started
Attempting to load agent QuotaAgent
Agent QuotaAgent loaded
ServiceWatchdogAgent: Initializing ServerWatchdogTable with 9 entries
ServiceWatchdogAgent: starting timer
Server STARTED: FtpServer(20082) managed by IfsProtocols(19945)
ServiceWatchdogAgent: New Server being watchdogged
Attempting to start agent QuotaAgent
QuotaAgent: Start request
Agent QuotaAgent started
QuotaAgent: starting timer
Server STARTED: CupServer(20124) managed by IfsProtocols(19945)
ServiceWatchdogAgent: New Server being watchdogged
Server STARTED: ImapServer(20130) managed by IfsProtocols(19945)
ServiceWatchdogAgent: New Server being watchdogged
Server STARTED: SmtpServer(20150) managed by IfsProtocols(19945)
ServiceWatchdogAgent: New Server being watchdogged
ServiceWatchdogAgent: Unlocked Server Detected in checkServer
ServiceWatchdogAgent: Unlocked Server Detected in checkServer
ServiceWatchdogAgent: Unlocked Server Detected in checkServer
ServiceWatchdogAgent: Unlocked Server Detected in checkServer
ServiceWatchdogAgent: Unlocked Server Detected in checkServer
ServiceWatchdogAgent: Unlocked Server Detected in checkServer
ServiceWatchdogAgent: Unlocked Server being investigated
ServiceWatchdogAgent: Unlocked Server being investigated
ServiceWatchdogAgent: Unlocked Server being investigated
ServiceWatchdogAgent: Unlocked Server being investigated
ServiceWatchdogAgent: Unlocked Server being investigated
ServiceWatchdogAgent: Unlocked Server being investigated
ServiceWatchdogAgent: Freeing unlocked server 19687
ServiceWatchdogAgent: Freeing unlocked server 19666
Server STOPPED: CupServer(19687) managed by IfsProtocols(19519)
ServiceWatchdogAgent: Freeing unlocked server 19723
ServiceWatchdogAgent: Freeing unlocked server 19520
Server STOPPED: FtpServer(19666) managed by IfsProtocols(19519)
Server STOPPED: SmtpServer(19723) managed by IfsProtocols(19519)
ServiceWatchdogAgent: Freeing unlocked server 19519
Server STOPPED: IfsAgents(19520) not managed
ServiceWatchdogAgent: Freeing unlocked server 19712
Server STOPPED: IfsProtocols(19519) not managed
Server STOPPED: ImapServer(19712) managed by IfsProtocols(19519)
ServiceWatchdogAgent: Freed Server removed from watchdog list
ServiceWatchdogAgent: Freed Server removed from watchdog list
ServiceWatchdogAgent: Freed Server removed from watchdog list
ServiceWatchdogAgent: Freed Server removed from watchdog list
ServiceWatchdogAgent: Freed Server removed from watchdog list
ServiceWatchdogAgent: Freed Server removed from watchdog list
QuotaAgent: Timer event: 0 active; 0 exceeded
ContentGarbageCollectionAgent: Freed 5 unreferenced ContentObjects
QuotaAgent: Timer event: 0 active; 0 exceeded
ServiceWatchdogAgent: IfsException publishing timer details:
ServiceWatchdogAgent: oracle.ifs.common.IfsException: IFS-11012: Unable to get events from other services
java.sql.SQLException: ORA-03114: not connected to ORACLE
ServiceWatchdogAgent: IfsException in checkForDeadServices():
ServiceWatchdogAgent: oracle.ifs.common.IfsException: IFS-10651: Unable to begin transaction
oracle.ifs.common.IfsException: IFS-10603: Unable to set database savepoint
java.sql.SQLException: ORA-03114: not connected to ORACLE
ServiceWatchdogAgent: IfsException in handle loop; continuing:
ServiceWatchdogAgent: oracle.ifs.common.IfsException: IFS-10651: Unable to begin transaction
oracle.ifs.common.IfsException: IFS-10603: Unable to set database savepoint
java.sql.SQLException: ORA-03114: not connected to ORACLE
ServiceWatchdogAgent: IfsException publishing timer details:
ServiceWatchdogAgent: oracle.ifs.common.IfsException: IFS-10651: Unable to begin transaction
oracle.ifs.common.IfsException: IFS-10603: Unable to set database savepoint
java.sql.SQLException: ORA-03114: not connected to ORACLE
ServiceWatchdogAgent: IfsException publishing timer details:
ServiceWatchdogAgent: oracle.ifs.common.IfsException: IFS-10651: Unable to begin transaction
oracle.ifs.common.IfsException: IFS-10603: Unable to set database savepoint
java.sql.SQLException: ORA-03114: not connected to ORACLE
ServiceWatchdogAgent: IfsException publishing timer details:
ServiceWatchdogAgent: oracle.ifs.common.IfsException: IFS-10651: Unable to begin transaction
oracle.ifs.common.IfsException: IFS-10603: Unable to set database savepoint
java.sql.SQLException: ORA-03114: not connected to ORACLE
ServiceWatchdogAgent: IfsException publishing timer details:
ServiceWatchdogAgent: oracle.ifs.common.IfsException: IFS-10651: Unable to begin transaction
oracle.ifs.common.IfsException: IFS-10603: Unable to set database savepoint
java.sql.SQLException: ORA-03114: not connected to ORACLE
ServiceWatchdogAgent: IfsException publishing timer details:
ServiceWatchdogAgent: oracle.ifs.common.IfsException: IFS-10651: Unable to begin transaction
oracle.ifs.common.IfsException: IFS-10603: Unable to set database savepoint
java.sql.SQLException: ORA-03114: not connected to ORACLE
null
Maybe you are looking for
-
how do i display my mac onto my tv.. -i have a svideo cord, mini dvi-to-video, and composite video cable
-
I need step by step instructions as my 10 year old knows more than I do!
-
How do I change the name of an empty album in my photo file?
Could someone out there please tell me how to change the name on a photo file and or delete one?
-
Initializing the iterator in a loop - pointing to the first value
I have two iterators defined as given below. And I am trying to find if they have the same words remove it. It is working fine with the first set of words from the next. When I complete my fist loop and start the second one, I need to initialize the
-
Hi there,?The other day my computer died, so I had to re-install the OS and everything. I've searched everywhere but I cannot find the software CD that came with my creative Zen touch MP3 player. Is there a way I can get a new copy of this disc?Cheer