Pls help me with this program - urgent
Hi,
I am new to Java. First time to do the program. Stuck here.
The description of the program:
Implement a complex number (numbers of the form a+ib, where i2 = -1, i2 is i raised to power 2 ). Recall that a complex number consists of a real part (a) and an imaginary part (b). Provide a reasonable set of constructors; the methods add, subtract, multiply and divide; as well as toString and equals.
You are to implement a complex number as having two fields, one for the real part another for the imaginary part.
If z = a + ib and x = c + id are two complex numbers, then their sum z+ x = (a+c) + i(b+d), quotient z/x = (ac+bd)/(c*c+d*d) + i(-ab+bc)/(c*c + d*d). two complex numbers are equal if their real and imaginary parts are equal.
I really do not have any clues about imaginary parts and how to do it.
Could you please help me with that.
Thanks a lot.
ur dboubt has nothing to do java.. its a mathematical concept..
as the question says the complexnumbers can be represented in the form of a+ib where i=squre-root of -1 .. and as this is imaginary (ie u cant get a minus number by squring a number) the second part is called imaginay.
so as a programmer u dont have to give more strain on this but to declare a class having to instance varaiables and inplememts the methods as said.
and in the toString() method u can return the numbers in the reuired format like
return ( a + "+i" +b);
Similar Messages
-
Can someone pls help me with this code
The method createScreen() creates the first screen wherein the user makes a selection if he wants all the data ,in a range or single data.The problem comes in when the user makes a selection of single.that then displays the singleScreen() method.Then the user has to input a key data like date or invoice no on the basis of which all the information for that set of data is selected.Now if the user inputs a wrong key that does not exist for the first time the program says invalid entry of data,after u click ok on the option pane it prompts him to enter the data again.But since then whenever the user inputs wrong data the program says wrong data but after displaying the singlescreen again does not wait for input from the user it again flashes the option pane with the invalid entry message.and this goes on doubling everytime the user inputs wrong data.the second wrong entry of data flashes the error message twice,the third wrong entry flashes the option pane message 4 times and so on.What actually happens is it does not wait at the singlescreen() for user to input data ,it straight goes into displaying the JOptionPane message for wrong data entry so we have to click the optiion pane twice,four times and so on.
Can someone pls help me with this!!!!!!!!!
import java.util.*;
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
import java.awt.event.*;
import java.text.*;
import java.util.*;
public class MainMenu extends JFrame implements ActionListener,ItemListener{
//class
FileReaderDemo1 fd=new FileReaderDemo1();
FileReaderDemo1 fr;
Swing1Win sw;
//primary
int monthkey=1,counter=0;
boolean flag=false,splitflag=false;
String selection,monthselection,dateselection="01",yearselection="00",s,searchcriteria="By Date",datekey,smonthkey,invoiceno;
//arrays
String singlesearcharray[];
String[] monthlist={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"};
String[] datelist=new String[31];
String[] yearlist=new String[100];
String[] searchlist={"By Date","By Invoiceno"};
//collection
Hashtable allinvoicesdata=new Hashtable();
Vector data=new Vector();
Enumeration keydata;
//components
JButton next=new JButton("NEXT>>");
JComboBox month,date,year,search;
JLabel bydate,byinvno,trial;
JTextField yeartext,invtext;
JPanel panel1,panel2,panel3,panel4;
JRadioButton single,range,all;
ButtonGroup group;
JButton select=new JButton("SELECT");
//frame and layout declarations
JFrame jf;
Container con;
GridBagLayout gridbag=new GridBagLayout();
GridBagConstraints gc=new GridBagConstraints();
//constructor
MainMenu(){
jf=new JFrame();
con=getContentPane();
con.setLayout(null);
fr=new FileReaderDemo1();
createScreen();
setSize(500,250);
setLocation(250,250);
setVisible(true);
//This is thefirst screen displayed
public void createScreen(){
group=new ButtonGroup();
single=new JRadioButton("SINGLE");
range=new JRadioButton("RANGE");
all=new JRadioButton("ALL");
search=new JComboBox(searchlist);
group.add(single);
group.add(range);
group.add(all);
single.setBounds(100,50,100,20);
search.setBounds(200,50,100,20);
range.setBounds(100,90,100,20);
all.setBounds(100,130,100,20);
select.setBounds(200,200,100,20);
con.add(single);
con.add(search);
con.add(range);
con.add(all);
con.add(select);
search.setEnabled(false);
single.addItemListener(this);
search.addActionListener(new MyActionListener());
range.addItemListener(this);
all.addItemListener(this);
select.addActionListener(this);
public class MyActionListener implements ActionListener{
public void actionPerformed(ActionEvent a){
JComboBox cb=(JComboBox)a.getSource();
if(a.getSource().equals(month))
monthkey=((cb.getSelectedIndex())+1);
if(a.getSource().equals(date)){
dateselection=(String)cb.getSelectedItem();
if(a.getSource().equals(year))
yearselection=(String)cb.getSelectedItem();
if(a.getSource().equals(search)){
searchcriteria=(String)cb.getSelectedItem();
public void itemStateChanged(ItemEvent ie){
if(ie.getItem()==single){
selection="single";
search.setEnabled(true);
else if (ie.getItem()==all){
selection="all";
search.setEnabled(false);
else if (ie.getItem()==range){
search.setEnabled(false);
public void actionPerformed(ActionEvent ae){
if(ae.getSource().equals(select))
if(selection.equals("single")){
singleScreen();
if(selection.equals("all"))
sw=new Swing1Win();
if(ae.getSource().equals(next)){
if(monthkey<9)
smonthkey="0"+monthkey;
System.out.println(smonthkey+"/"+dateselection+"/"+yearselection+"it prints this");
allinvoicesdata=fr.read(searchcriteria);
if (searchcriteria.equals("By Date")){
System.out.println("it goes in this");
singleinvoice(smonthkey+"/"+dateselection+"/"+yearselection);
else if (searchcriteria.equals("By Invoiceno")){
invoiceno=invtext.getText();
singleinvoice(invoiceno);
if (flag == false){
System.out.println("flag is false");
singleScreen();
else{
System.out.println("its in here");
singlesearcharray=new String[data.size()];
data.copyInto(singlesearcharray);
sw=new Swing1Win(singlesearcharray);
public void singleinvoice(String searchdata){
keydata=allinvoicesdata.keys();
while(keydata.hasMoreElements()){
s=(String)keydata.nextElement();
if(s.equals(searchdata)){
System.out.println(s);
flag=true;
break;
if (flag==true){
System.out.println("vector found");
System.exit(0);
data= ((Vector)(allinvoicesdata.get(s)));
else{
JOptionPane.showMessageDialog(jf,"Invalid entry of date : choose again");
public void singleScreen(){
System.out.println("its at the start");
con.removeAll();
SwingUtilities.updateComponentTreeUI(con);
con.setLayout(null);
counter=0;
panel2=new JPanel(gridbag);
bydate=new JLabel("By Date : ");
byinvno=new JLabel("By Invoice No : ");
dateComboBox();
invtext=new JTextField(6);
gc.gridx=0;
gc.gridy=0;
gc.gridwidth=1;
gridbag.setConstraints(month,gc);
panel2.add(month);
gc.gridx=1;
gc.gridy=0;
gridbag.setConstraints(date,gc);
panel2.add(date);
gc.gridx=2;
gc.gridy=0;
gc.gridwidth=1;
gridbag.setConstraints(year,gc);
panel2.add(year);
bydate.setBounds(100,30,60,20);
con.add(bydate);
panel2.setBounds(170,30,200,30);
con.add(panel2);
byinvno.setBounds(100,70,100,20);
invtext.setBounds(200,70,50,20);
con.add(byinvno);
con.add(invtext);
next.setBounds(300,200,100,20);
con.add(next);
if (searchcriteria.equals("By Invoiceno")){
month.setEnabled(false);
date.setEnabled(false);
year.setEnabled(false);
else if(searchcriteria.equals("By Date")){
byinvno.setEnabled(false);
invtext.setEnabled(false);
monthkey=1;
dateselection="01";
yearselection="00";
month.addActionListener(new MyActionListener());
date.addActionListener(new MyActionListener());
year.addActionListener(new MyActionListener());
next.addActionListener(this);
invtext.addKeyListener(new KeyAdapter(){
public void keyTyped(KeyEvent ke){
char c=ke.getKeyChar();
if ((c == KeyEvent.VK_BACK_SPACE) ||(c == KeyEvent.VK_DELETE)){
System.out.println(counter+"before");
counter--;
System.out.println(counter+"after");
else
counter++;
if(counter>6){
System.out.println(counter);
counter--;
ke.consume();
else
if(!((Character.isDigit(c) || (c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)))){
getToolkit().beep();
counter--;
JOptionPane.showMessageDialog(null,"please enter numerical value");
ke.consume();
System.out.println("its at the end");
public void dateComboBox(){
for (int counter=0,day=01;day<=31;counter++,day++)
if(day<=9)
datelist[counter]="0"+String.valueOf(day);
else
datelist[counter]=String.valueOf(day);
for(int counter=0,yr=00;yr<=99;yr++,counter++)
if(yr<=9)
yearlist[counter]="0"+String.valueOf(yr);
else
yearlist[counter]=String.valueOf(yr);
month=new JComboBox(monthlist);
date=new JComboBox(datelist);
year=new JComboBox(yearlist);
public static void main(String[] args){
MainMenu mm=new MainMenu();
public class WindowHandler extends WindowAdapter{
public void windowClosing(WindowEvent we){
jf.dispose();
System.exit(0);
}Hi,
I had a similar problem with a message dialog. Don't know if it is a bug, I was in a hurry and had no time to search the bug database... I found a solution by using keyPressed() and keyReleased() instead of keyTyped():
private boolean pressed = false;
public void keyPressed(KeyEvent e) {
pressed = true;
public void keyReleased(KeyEvent e) {
if (!pressed) {
e.consume();
return;
// Here you can test whatever key you want
//...I don't know if it will help you, but it worked for me.
Regards. -
my toshiba satellite e105-s1802 do not recognized my a4tech pocket usb hub pls help me with this?
I AM HAVING THE SAME PROBLEM WITH THE SAME MODEL. I GOT THE SERVICE
MANUAL AND I'M THINKING TO OPEN IT AND SEE IF THERE'S SOME PHYSICAL BAD CONNECTION
INSIDE. BUT LIKE YOU SAID. IT'S ONLY THREE MONTHS OLD.!!! I DON'T WANT TO RUIN THE WARRANTEE.
BUT THIS IS VERY FRUSTATING. I WANDER IF TOSHIBA DOES THIS ON PURPUSE.!!! KEEP IN TOUCH AND
IF YOU NEED THE SERVICE MANUAL CONTACT ME AT [email protected]
THANK YOU.!!!! -
Hi pls help me with this speck.. very urgent...
REPORT zm_material_prodhier_update MESSAGE-ID zsd
NO STANDARD PAGE HEADING
LINE-SIZE 160.
Tables
TABLES: mara,mvke.
Data Definitions.
TYPES: BEGIN OF ty_mat,
matnr TYPE mara-matnr,
vkorg TYPE mvke-vkorg, " Sales Org
vtweg TYPE mvke-vtweg, " Dist. Channel
prdha TYPE mara-prdha, " Prod Hierarchy
err(60) TYPE C,
END OF ty_mat.
DATA: gt_matnr TYPE STANDARD TABLE OF ty_mat WITH HEADER LINE,
gt_matnr_err TYPE STANDARD TABLE OF ty_mat WITH HEADER LINE.
DATA: gs_matnr_err TYPE ty_mat.
DATA: lv_file_name TYPE string,
lv_message(200) TYPE c.
For BAPI
DATA: headdata TYPE bapimathead,
clientdata TYPE bapi_mara,
clientdatax TYPE bapi_marax,
return TYPE bapiret2,
salesdata TYPE bapi_mvke,
salesdatax TYPE bapi_mvkex.
DATA: ret TYPE STANDARD TABLE OF bapi_matreturn2 WITH HEADER LINE.
Selection Screen
SELECTION-SCREEN BEGIN OF BLOCK b001 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_matnr FOR mara-matnr,
s_vkorg FOR mvke-vkorg OBLIGATORY,
s_vtweg FOR mvke-vtweg OBLIGATORY,
s_matkl FOR mara-matkl.
SELECTION-SCREEN END OF BLOCK b001.
SELECTION-SCREEN BEGIN OF BLOCK b002 WITH FRAME TITLE text-002.
PARAMETERS: p_err TYPE localfile OBLIGATORY.
SELECTION-SCREEN: END OF BLOCK b002.
At selection screen
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_err.
PERFORM get_filename USING 'Output - Error File'
CHANGING p_err.
START-OF-SELECTION.
START-OF-SELECTION.
PERFORM 100_collect_dbrecs.
PERFORM 200_process_dbrecs.
END-OF-SELECTION.
*& TOP-OF-PAGE.
TOP-OF-PAGE.
WRITE: 40 'Material Product Hierarchy Update Report'.
ULINE (115).
*SKIP.
WRITE: /'MATERIAL'.
WRITE: /.
ULINE (115).
*& Form 100_collect_dbrecs
FORM 100_collect_dbrecs .
SELECT maramatnr mvkevkorg mvkevtweg maraprdha
INTO CORRESPONDING FIELDS OF TABLE gt_matnr
FROM mara INNER JOIN mvke
ON maramatnr = mvkematnr
WHERE mara~matnr IN s_matnr
AND mara~prdha NE space
AND mara~matkl IN s_matkl
AND mara~lvorm EQ space
AND mvke~vkorg IN s_vkorg
AND mvke~vtweg IN s_vtweg
AND mvke~prodh EQ space.
ENDFORM. " 100_collect_dbrecs
*& Form 200_process_dbrecs
FORM 200_process_dbrecs.
IF gt_matnr[] IS INITIAL.
MESSAGE s000 WITH 'No Materials Processed.'.
ELSE.
LOOP AT gt_matnr.
CLEAR: headdata,
clientdata,
clientdatax,
return,
salesdata ,
salesdatax,
ret.
REFRESH: ret.
Filling Material.
MOVE: gt_matnr-matnr TO headdata-material,
'X' TO headdata-sales_view.
Sales Org
MOVE: gt_matnr-vkorg TO salesdata-sales_org,
gt_matnr-vkorg TO salesdatax-sales_org.
*Dist Channel
MOVE: gt_matnr-vtweg TO salesdata-distr_chan,
gt_matnr-vtweg TO salesdatax-distr_chan.
*Prod Hierarchy
MOVE: gt_matnr-prdha TO salesdata-prod_hier,
'X' TO salesdatax-prod_hier.
PERFORM 220_bapi_call.
CLEAR: gt_matnr.
ENDLOOP.
Download Error Files
IF gt_matnr_err[] IS INITIAL.
no errors to be downloaded
ELSE.
Error File being downloaded.
lv_file_name = p_err.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = lv_file_name
filetype = 'ASC'
TABLES
data_tab = gt_matnr_err
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 99.
IF sy-subrc = 0.
WRITE: /05 'Error File Download - Successful.'.
ELSE.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
INTO lv_message.
FORMAT INTENSIFIED ON.
WRITE: /05 'Write error:', lv_message COLOR COL_NEGATIVE.
ENDIF.
ENDIF.
ENDIF.
ENDFORM. " 200_process_dbrecs
*& Form 220_BAPI_CALL
FORM 220_bapi_call .
DATA: lv_message(60) TYPE c.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = headdata
clientdata = clientdata
clientdatax = clientdatax
salesdata = salesdata
salesdatax = salesdatax
IMPORTING
return = return
TABLES
returnmessages = ret.
IF sy-subrc EQ 0.
MOVE : return-message TO lv_message.
IF return-type EQ 'E'.
WRITE: / gt_matnr-matnr,
'Change Failed -', lv_message.
MOVE-CORRESPONDING gt_matnr TO gs_matnr_err.
APPEND gs_matnr_err to gt_matnr_err. CLEAR gs_matnr_err.
ELSE.
WRITE: / gt_matnr-matnr,
'Change Successful -', lv_message, ' for ', gt_matnr-vkorg,' ', gt_matnr-vtweg.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
COMMIT WORK.
ENDIF.
ENDIF.
ENDFORM. " 220_BAPI_CALL
*& Form get_filename
Call up a dialog window to retrieve the filename
--> P_FILETITLE Dialog file title
<-- P_FILENAME FIle name retrieved
FORM get_filename USING p_filetitle TYPE c
CHANGING p_filename TYPE localfile.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
def_filename = ' '
def_path = ' '
mask = ',.,..'
mode = 'O'
title = p_filetitle
IMPORTING
filename = p_filename
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
ENDFORM. " get_filename
the program reads the product higher from Basic View to Sales View.
You all must be familiar with this program.
Modify the program with option(radio button) to be able to run the program in foreground and background.
Currently the program should in foreground mode.
Add to this program option so this program is executed in the background and the file is downloaded as well.
can anyone help me by editing the code n givin one sample prog..
kindly help.
Thnx
NaveenHi Naveen,
you mean background is job scheduling if yes you couldnt down load the file into Desktop bec sys my be swithc-off, in this case you can down load the file into application server or you can create the display normal report while program run in back ground.
Here i am giving code for background.
PARAMETERS : p_dload_fg AS CHECKBOX,
p_dload_bg AS CHECKBOX
download the data into Local pc file
IF p_dload_fg EQ 'X'.
PERFORM file_download.
ENDIF.
IF sy-batch NE space.
*Display normal report when this program put in
*batch job
PERFORM normal_report. " this is to dispaly normal report
download the data into Application Server
IF p_dload_bg EQ 'X'.
PERFORM file_download. " this is for down load the file into Apllication sercver.
ENDIF.
ELSE. " If program run in foreground.
IF NOT gt_matnr[] IS INITIAL.
*Display the output data in ALV
PERFORM alv_report.
ELSE.
MESSAGE s999 WITH text-001.
ENDIF.
ENDIF.
<b>
NOTE</b> : try to avoid the joins with replacing FOR ALL ENTRIES to better performance ,while selection the data from d/b.
Let me know if u have any doubts.
<b>Reward with points if helpful.</b>
Regards,
Vijay -
Pls help me with this installation problem. Your advice is highly needed.
I am installing oracle 11.1.6.0 on windows xp professional everything was going fine untill there was a pop up that reads below
INFO: exit-tool: Launch browser
INFO: saving exit only tools ...
INFO: no detached only tools in this session
INFO: exit-only tools are created in single installation
INFO: no. of sets of tools to be run: 1
INFO: ca page to be shown: true
INFO: exitonly tools to be excuted passed: 1
INFO: Starting to execute configuration assistants
INFO: Command = C:\WINDOWS\system32\cmd /c call c:\app\doN H\home/bin/netca.bat /orahome c:\app\doN H\home /orahnam OraDb11g_home1 /instype typical /inscomp client,oraclenet,javavm,server,ano /insprtcl tcp,nmp /cfg local /authadp NO_VALUE /nodeinfo NO_VALUE /responseFile c:\app\doN H\home\network\install\netca_typ.rsp
Command = C:\WINDOWS\system32\cmd /c call c:\app\doN H\home/bin/netca.bat has failed
Execution Error : 'c:\app\doN' is not recognized as an internal or external command,
operable program or batch file.
INFO: Configuration assistant "Oracle Net Configuration Assistant" failed
*** Starting OUICA ***
Oracle Home set to c:\app\doN H\home
Configuration directory is set to c:\app\doN H\home\cfgtoollogs. All xml files under the directory will be processed
INFO: The "c:\app\doN H\home\cfgtoollogs\configToolFailedCommands" script contains all commands that failed, were skipped or were cancelled. This file may be used to run these configuration assistants outside of OUI. Note that you may have to update this script with passwords (if any) before executing the same.
INFO:
The Runconfig command constructed is C:\app\doN H\home\oui\bin\runConfig.bat ORACLE_HOME=C:\app\doN H\home MODE=perform ACTION=configure RERUN=false $*
INFO: Since there is an Internal Plugin Invocation or a Java Plugin Invocation tool in the Oracle Home C:\app\doN H\home we use the runConfig Command instead of the plugin's command
INFO: Created a new file C:\app\doN H\home\cfgtoollogs\configToolFailedCommands
INFO: Since the option is to overwrite the existing C:\app\doN H\home\cfgtoollogs\configToolFailedCommands file, backing it up
INFO: The backed up file name is C:\app\doN H\home\cfgtoollogs\configToolFailedCommands.bak
SEVERE: OUI-25031:Some of the configuration assistants failed/cancelled. It is strongly recommended that you retry the configuration assistants at this time. Not successfully running any "Recommended" assistants means your system will not be correctly configured.
1. Check the Details panel on the Configuration Assistant Screen to see the errors resulting in the failures.
2. Fix the errors causing these failures.
3. Select the failed assistants and click the 'Retry' button to retry them.
INFO: User Selected: Yes/OK
INFO: Starting to execute configuration assistants
INFO: Command = C:\WINDOWS\system32\cmd /c call c:\app\doN H\home/bin/netca.bat /orahome c:\app\doN H\home /orahnam OraDb11g_home1 /instype typical /inscomp client,oraclenet,javavm,server,ano /insprtcl tcp,nmp /cfg local /authadp NO_VALUE /nodeinfo NO_VALUE /responseFile c:\app\doN H\home\network\install\netca_typ.rsp
Command = C:\WINDOWS\system32\cmd /c call c:\app\doN H\home/bin/netca.bat has failed
Execution Error : 'c:\app\doN' is not recognized as an internal or external command,
operable program or batch file.
INFO: Configuration assistant "Oracle Net Configuration Assistant" failed
*** Starting OUICA ***
Oracle Home set to c:\app\doN H\home
Configuration directory is set to c:\app\doN H\home\cfgtoollogs. All xml files under the directory will be processed
INFO: The "c:\app\doN H\home\cfgtoollogs\configToolFailedCommands" script contains all commands that failed, were skipped or were cancelled. This file may be used to run these configuration assistants outside of OUI. Note that you may have to update this script with passwords (if any) before executing the same.
INFO:
The Runconfig command constructed is C:\app\doN H\home\oui\bin\runConfig.bat ORACLE_HOME=C:\app\doN H\home MODE=perform ACTION=configure RERUN=false $*
INFO: Since there is an Internal Plugin Invocation or a Java Plugin Invocation tool in the Oracle Home C:\app\doN H\home we use the runConfig Command instead of the plugin's command
INFO: Since the option is to overwrite the existing C:\app\doN H\home\cfgtoollogs\configToolFailedCommands file, backing it up
INFO: The backed up file name is C:\app\doN H\home\cfgtoollogs\configToolFailedCommands.bak.1
SEVERE: OUI-25031:Some of the configuration assistants failed/cancelled. It is strongly recommended that you retry the configuration assistants at this time. Not successfully running any "Recommended" assistants means your system will not be correctly configured.
1. Check the Details panel on the Configuration Assistant Screen to see the errors resulting in the failures.
2. Fix the errors causing these failures.
3. Select the failed assistants and click the 'Retry' button to retry them.
INFO: User Selected: No
1...The Netmgr and the ODCA was not properly configured and they are not opening on the windows enviroment.
2...The sqlplus, whenever called up, aooears and disappears in 1 second
3...I can not connet to the database. Says adapter error
4...Will 1 start the listner before i can connect and how?
Ur contribution is highly needed. TNXI am installing oracle 11g on windows xp, everything installed suceessfully except the enterprise control. the error reads
Jan 14, 2011 5:32:30 PM oracle.sysman.emcp.util.PlatformInterface serviceCommand
CONFIG: Waiting for service 'OracleDBConsoleorcl1' to fully start
Jan 14, 2011 5:32:40 PM oracle.sysman.emcp.util.PlatformInterface serviceCommand
CONFIG: Waiting for service 'OracleDBConsoleorcl1' to fully start
Jan 14, 2011 5:32:51 PM oracle.sysman.emcp.util.PlatformInterface serviceCommand
CONFIG: Waiting for service 'OracleDBConsoleorcl1' to fully start
Jan 14, 2011 5:33:01 PM oracle.sysman.emcp.util.PlatformInterface serviceCommand
CONFIG: Waiting for service 'OracleDBConsoleorcl1' to fully start
Jan 14, 2011 5:33:11 PM oracle.sysman.emcp.util.PlatformInterface serviceCommand
CONFIG: Waiting for service 'OracleDBConsoleorcl1' to fully start
Jan 14, 2011 5:33:21 PM oracle.sysman.emcp.util.PlatformInterface serviceCommand
CONFIG: Waiting for service 'OracleDBConsoleorcl1' to fully start
Jan 14, 2011 5:33:31 PM oracle.sysman.emcp.util.PlatformInterface serviceCommand
CONFIG: Waiting for service 'OracleDBConsoleorcl1' to fully start
Jan 14, 2011 5:33:41 PM oracle.sysman.emcp.EMConfig perform
SEVERE: Error starting Database Control
Refer to the log file at G:\app\doN_H\cfgtoollogs\dbca\orcl1\emConfig.log for more details.
Jan 14, 2011 5:33:41 PM oracle.sysman.emcp.EMConfig perform
CONFIG: Stack Trace:
oracle.sysman.emcp.exception.EMConfigException: Error starting Database Control
at oracle.sysman.emcp.EMDBPostConfig.performConfiguration(EMDBPostConfig.java:869)
at oracle.sysman.emcp.EMDBPostConfig.invoke(EMDBPostConfig.java:250)
at oracle.sysman.emcp.EMDBPostConfig.invoke(EMDBPostConfig.java:213)
at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:235)
at oracle.sysman.assistants.util.em.EMConfiguration.run(EMConfiguration.java:460)
at java.lang.Thread.run(Thread.java:595)
Jan 14, 2011 5:33:41 PM oracle.sysman.emcp.EMConfig restoreOuiLoc
CONFIG: Restoring oracle.installer.oui_loc to G:\app\doN_H\product\11.1.0\db_1\oui
It also told me that i can configure it later by running G:\app\doN_H\product\11.1.0\db_1\BIN\emca.script
Pls help me. I appreciate ur help so far. -
Can someone help me with this program?
Can someone make this program for me?
Make a Java-webapplication containing a few webpages (html-files and servlets, but NO jsp's). With this application you can get bankdata from a database, for example:
page 1: html-file: Welcome on the website, type your bankaccount and password
page 2: error if bankaccount doesn't exist or wrong password
page 3: welcome with name and option to choose for your balance or a list with transactions from that account (the user can give a starting date)
page 4: showing the balance or the list with transactions, name and accountnumber
Store the information about the account and name in sessionsvariables
the database is an access-file with two tables
table Accounts with colums: accountnumber, name, balance and password
table Transactions with colums: accountnumber, amount, plus/minus, date, sorttransaction and contra-account
(when I need to send you the database by mail, you can ask me ...)
maybe someone can help me,
thanks in advance
greetings BastiaanSure we can help you. Post the code you have already and explain any problems you are currently having together with any and all complete compiler error messages and/or exceptions.
But no, we are not going to do your homework for you. -
Hi experts pls help me with this materialized view refresh time!!!
Hi Expeerts ,
Please clarify my doubt about this materialized view code
[\n]
CREATE MATERIALIZED VIEW SCHEMANAME.products_mv
REFRESH WITH ROWID
AS SELECT * from VIEW_TABLE@DATAOPPB;
[n]
Here i am creating a materialized view named products_mv of the view_table present in the remote server.Can anyone tell me when will my table product_mv will get refreshed if i follow this code.As what i read from the books is that the refresh period is implicit and is carried out by the database implicitly.so can u tell me suppose i insert 2 new records into my view_table when will this record get updated into my product_mv table.
I cant use primary key approach so this is the approach i am following .Kindly help me in understanding when will refresh of records occur in the materialized view product_mv...Pls help
regards
debashisHi Justin ,
Yes, my database can reasonably schedule other jobs too .Its not an issue.
Actually what i meant "fine in all aspects" is that will the matrerialized view will get refreshed w.r.t the documetum_v table present in my remote server.This is all i need to refresh my materialized view .
I queries the DBA_JOBS table .I could see the following result i have pasted below:-
[\n]
NLS_ENV
MISC_ENV INSTANCE
dbms_refresh.refresh('"WORKFLOW"."PRODUCTS_MV2"');
JOB LOG_USER PRIV_USER
SCHEMA_USER LAST_DATE LAST_SEC THIS_DATE THIS_SEC NEXT_DATE
NEXT_SEC TOTAL_TIME B
INTERVAL
FAILURES
WHAT
[n]
here WORKFLOW"."PRODUCTS_MV2 is the materialized view i have created.So can u tell me that whether we can predict our refresh part is functioning fine from this data.If so how?
Actually i am asking u in details as i dont have much exposure to materialized view .I am using it for the very first time.
Regds
debashis -
Please help me with this. - urgent
for computing the gcd (greatest common divisor) of two positive integers, m and n . the algorithm terminates in at most 2 log n steps. Or, in other words, the time-complexity of this algorithm is O(log n) . Implement (in JAVA) this algorithm and record in a table, for at least 50 pairs of different inputs, the number of times Step 1 of the algorithm (refer to your notes) executes. In another column of this table write down the value of 2 log n . Do the observed number of steps agree well with the theoretical estimate ?
I am taking Data Structure and Algorithmic Analysis.
Pls help. thanksThe information I got is
Algorithm GreatestCommonDivisor
Input: Two positive integers m and n
Output: the GCD of m and n
Step1: Set r = m mod n;
Step 2: if r != 0, m=n, n =r, go to step 1.
Step 3: Output n and STOP
The correctness of the GCD algorithm depends on the following loop invariant
Claim: gcd(m, n) = gcd(n, r);
this means that the gcd of the new pair, generated when r!=0, is equal to the gcd of the previus pair. it is easy to see why the claim is corret. we can write the process of dividing m by n in the following equational form: m = qn+r, where 0<=r<n from this we see that every dividsor m and n is a divisor of n and r and covnersely.
r become 0 in at most 2logn iterations.
Thanks. -
Pls help me with this pinball flippers
Hi all
I am in a project of implementing the flippers for Pinball, but I couldn't made the user see the movement of flippers. Pls help.
To prevent your email address from exposure, pls write an email to me @ [email protected] I will send the program to you for advice.Ok ... my logics is rather simple, I just wanted to a simple flipper. Just want to see it change from it initial state to a flip state. I'm using a polygon for it initial state and a rectangle when the keyPressed method is invoked. However, whenever I pressed the key, nothing happens. Pls help.
Below is my code,
public void keyPressed(KeyEvent evt) {
char ch = evt.getKeyChar();
// Move the left flipper.
if(ch == 122){
//leftflip = new LeftFlipper(true);
setStatus(true);
System.out.println(stat);
update(getGraphics());
else if (ch == 109){
// Move the right flipper.
// rightflip = new RightFlipper(true);
setStatus(true);
System.out.println(stat);
update(getGraphics());
else{
setStatus(false);
System.out.println(stat);
update(getGraphics());
Part of my flipper class,
public void paint (Graphics g)
g.setColor(Color.red);
p = new PinBallGame();
state1= p.getStatus();
if(state1 == true){
g.fillRect(hit1.x, hit1.y, hit1.width, hit1.height);
System.out.println("In R fillRect");
state1=false;
else{
g.fillPolygon(rflipper);
}Pls advice me what should i do to see the flipper move. -
Can anyone help me with this program using the Scanner Class?
I have to write a program that asks for the speed of a vehicle (in miles-per-hour) and the number of hours it has traveled. It should use a loop to display the distance a vehicle has traveled for each hour of a time period specified by the user. Such as 1 hour will equal 40 miles traveled, 2 hours will equal 80, 3 hours will equal 120, etc. This is what I've come up with thus far. Any help is appreciated.
import java.util.Scanner;
public class DistanceTraveled
public static void main(String[] args)
int speed;
int hours;
int distance;
Scanner keyboard = new Scanner(System.in);
System.out.print("What is the speed of the vehicle in miles-per-hour?");
speed = keyboard.nextInt();
System.out.print("How many hours has the vehicle traveled for?");
hours = keyboard.nextInt();
distance = speed*hours;
while (speed < 0)
while (hours < 1)
System.out.println("Hour Distance Traveled");
System.out.println("------------------------");
System.out.println(hours + " " + distance);
}When you post code, wrap it in code tags. Highlight it and click the CODE button above the text input area.
You seem to be trying to reuse the speed and hours variables in your loop. That's probably a mistake at this point. Keep it simpler by defining a loop variable.
Also I don't see the need for two loops. You just want to show how far the vehicle has traveled for each one-hour increment, assuming constant speed, for the number of hours it has been traveling, right? So a single for loop should be sufficient. -
Can anyone help me with this program?
I have to make program that asks the user for information that they would want on a business card. Then, I am supposed ot take that information that was gathered with a listener and display it on a second panel using graphicsstuff (such as g.drawString(VARIABLEHERE, int x, int y). I can get thepart of the program that would ask for the information, but I can't figure out where to go from there on how to display the information. If anyone could help I would be enternally gratefully. This assignment is due Friday morning at 9:00. Thanks!
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class PanelPractice extends JPanel
private static JButton insert;
private static JTextField nameField, positionField, areaField, telField, faxField, emailField, add1Field, add2Field, add3Field;
private static String nameText, positionText, areaText, telText, faxText, emailText, add1Text, add2Text, add3Text;
public static void main (String[] args)
//Makes two colored panels that are nested within a third.
JFrame frame = new JFrame ("Business Card");
frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
//Makes the first subpanel
JPanel subPanel1 = new JPanel();
JLabel nameLabel, positionLabel, areaLabel, telLabel, faxLabel, emailLabel, add1Label, add2Label, add3Label;
// Sets up the GUI
//Creates labels for the information questions
nameLabel = new JLabel ("Type the name you want on the card: ");
positionLabel = new JLabel ("Type the person's position: ");
areaLabel = new JLabel ("Type the person's area of business: ");
telLabel = new JLabel ("Type the person's telephone number: ");
faxLabel = new JLabel ("Type the person's fax number: ");
emailLabel = new JLabel ("Type the person's e-mail address: ");
add1Label = new JLabel ("Type the person's place of business: ");
add2Label = new JLabel ("Type the business' street address: ");
add3Label = new JLabel ("Type the business' city, state, and zip: ");
//Creates a JTextField to hold the person's name
nameField = new JTextField (10);
positionField = new JTextField (10);
areaField = new JTextField (10);
telField = new JTextField (10);
faxField = new JTextField (10);
emailField = new JTextField (10);
add1Field = new JTextField (10);
add2Field = new JTextField (10);
add3Field = new JTextField (10);
//add the nameLabel and nameField to the panel
subPanel1.add (nameLabel);
subPanel1.add (nameField);
//add the positionLabel and positionField to the panel
subPanel1.add (positionLabel);
subPanel1.add (positionField);
//add the areaLabel and areaField to the panel
subPanel1.add (areaLabel);
subPanel1.add (areaField);
//add the telLabel and telField to the panel
subPanel1.add (telLabel);
subPanel1.add (telField);
//add the faxLabel and faxField to the panel
subPanel1.add (faxLabel);
subPanel1.add (faxField);
//add the emailLabel and emailField to the panel
subPanel1.add (emailLabel);
subPanel1.add (emailField);
//add the add1Label and add1Field to the panel
subPanel1.add (add1Label);
subPanel1.add (add1Field);
//add the add2Label and add2Field to the panel
subPanel1.add (add2Label);
subPanel1.add (add2Field);
//add the add3Label and add3Field to the panel
subPanel1.add (add3Label);
subPanel1.add (add3Field);
//Creates a button to press to insert the information onto the card
insert = new JButton ("Insert Information!");
//Creates a Listener and makes it listen for the button to be pressed
insert.addActionListener (new ButtonListener());
//add the button to the panel
subPanel1.add (insert);
//set the size of the panel to the width and height constants
subPanel1.setPreferredSize (new Dimension (350, 300));
//set the color of the panel to whatever you choose
subPanel1.setBackground (Color.red);
//Makes the second subpanel
JPanel subPanel2 = new JPanel();
subPanel2.setPreferredSize (new Dimension(500,300));
subPanel2.setBackground (Color.blue);
//Makes the primary panel
JPanel primary = new JPanel();
primary.setBackground (Color.black);
primary.add (subPanel1);
primary.add (subPanel2);
frame.getContentPane().add(primary);
frame.pack();
frame.setVisible(true);
// Represents an action listener for the insert button.
private static class ButtonListener implements ActionListener
public void actionPerformed (ActionEvent event)
//get the text from the textfields
nameText = nameField.getText();
positionText = positionField.getText();
areaText = areaField.getText();
telText = telField.getText();
faxText = faxField.getText();
emailText = emailField.getText();
add1Text = add1Field.getText();
add2Text = add2Field.getText();
add3Text = add3Field.getText();
public static class CustomComponent extends JPanel
public void paintComponent(Graphics g)
super.paintComponent(g);
g.drawString(nameText, 5, 5);
}Sorry about that...
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class PanelPractice extends JPanel
private static JButton insert;
private static JTextField nameField, positionField, areaField, telField, faxField, emailField, add1Field, add2Field, add3Field;
private static String nameText, positionText, areaText, telText, faxText, emailText, add1Text, add2Text, add3Text;
public static void main (String[] args)
//Makes two colored panels that are nested within a third.
JFrame frame = new JFrame ("Business Card");
frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
//Makes the first subpanel
JPanel subPanel1 = new JPanel();
JLabel nameLabel, positionLabel, areaLabel, telLabel, faxLabel, emailLabel, add1Label, add2Label, add3Label;
// Sets up the GUI
//Creates labels for the information questions
nameLabel = new JLabel ("Type the name you want on the card: ");
positionLabel = new JLabel ("Type the person's position: ");
areaLabel = new JLabel ("Type the person's area of business: ");
telLabel = new JLabel ("Type the person's telephone number: ");
faxLabel = new JLabel ("Type the person's fax number: ");
emailLabel = new JLabel ("Type the person's e-mail address: ");
add1Label = new JLabel ("Type the person's place of business: ");
add2Label = new JLabel ("Type the business' street address: ");
add3Label = new JLabel ("Type the business' city, state, and zip: ");
//Creates a JTextField to hold the person's name
nameField = new JTextField (10);
positionField = new JTextField (10);
areaField = new JTextField (10);
telField = new JTextField (10);
faxField = new JTextField (10);
emailField = new JTextField (10);
add1Field = new JTextField (10);
add2Field = new JTextField (10);
add3Field = new JTextField (10);
//add the nameLabel and nameField to the panel
subPanel1.add (nameLabel);
subPanel1.add (nameField);
//add the positionLabel and positionField to the panel
subPanel1.add (positionLabel);
subPanel1.add (positionField);
//add the areaLabel and areaField to the panel
subPanel1.add (areaLabel);
subPanel1.add (areaField);
//add the telLabel and telField to the panel
subPanel1.add (telLabel);
subPanel1.add (telField);
//add the faxLabel and faxField to the panel
subPanel1.add (faxLabel);
subPanel1.add (faxField);
//add the emailLabel and emailField to the panel
subPanel1.add (emailLabel);
subPanel1.add (emailField);
//add the add1Label and add1Field to the panel
subPanel1.add (add1Label);
subPanel1.add (add1Field);
//add the add2Label and add2Field to the panel
subPanel1.add (add2Label);
subPanel1.add (add2Field);
//add the add3Label and add3Field to the panel
subPanel1.add (add3Label);
subPanel1.add (add3Field);
//Creates a button to press to insert the information onto the card
insert = new JButton ("Insert Information!");
//Creates a Listener and makes it listen for the button to be pressed
insert.addActionListener (new ButtonListener());
//add the button to the panel
subPanel1.add (insert);
//set the size of the panel to the width and height constants
subPanel1.setPreferredSize (new Dimension (350, 300));
//set the color of the panel to whatever you choose
subPanel1.setBackground (Color.red);
//Makes the second subpanel
JPanel subPanel2 = new JPanel();
subPanel2.setPreferredSize (new Dimension(500,300));
subPanel2.setBackground (Color.blue);
//Makes the primary panel
JPanel primary = new JPanel();
primary.setBackground (Color.black);
primary.add (subPanel1);
primary.add (subPanel2);
frame.getContentPane().add(primary);
frame.pack();
frame.setVisible(true);
// Represents an action listener for the insert button.
private static class ButtonListener implements ActionListener
public void actionPerformed (ActionEvent event)
//get the text from the textfields
nameText = nameField.getText();
positionText = positionField.getText();
areaText = areaField.getText();
telText = telField.getText();
faxText = faxField.getText();
emailText = emailField.getText();
add1Text = add1Field.getText();
add2Text = add2Field.getText();
add3Text = add3Field.getText();
public static class CustomComponent extends JPanel
public void paintComponent(Graphics g)
super.paintComponent(g);
g.drawString(nameText, 5, 5);
} No..I'm not expecting someone to do it for me. I am having trouble figuring out what to do next. I cannot get anything to show up on the second panel...the part that displays the information that the listener gathered.
If I could figure out how to get one thing to show up...then I could probably do the rest...it's getting it started that I can't get. -
Hello out there i have a problem with my iphone, it went off and whenever i on it there is this display, an arrow pointing to an itunes icon on it, can you help me fix my phone?
Your iPhone is in Recovery Mode try Restoring your iTunes to Factory settings using iTunes on your Computer :
http://support.apple.com/kb/ht1808 -
Unable to Intialize HDV deck - can anyone pls help me with this FCE Issue?
I have recently moved from a MacBook Pro (circa 2 yrs old) to a new MacBook Pro with the NEW firewire 800 port. I have bought a new firewire cable and my camera does not want to be capture from my Sony A1E.
I have a MacBook Pro 2.8ghz running on OS X 10.6.2 and have all the updates installed for FCE.
Every time i try to capture the message comes up "Unable to Intialize HDV deck. Please make sure a deck is connected and try again".
The System is set up to receive the correct frame rate footage and type of footage (which is: HDV-Apple Intermediate Codec 1080i50. Formats: All formats). I am running on PAL, so 25fps.
Is there any advice / direction that you could give me at all as I am struggling!
Any help support would be appreciated!
Thanks, MartinHi,
Would you confirm that you are using a 9-pin to 4-pin FW cable to connect to your camcorder and that your camcorder is the only FW device connected to your Mac.
When you start up FCE with the camera connected to your Mac and already powered on in VTR mode, does FCE 'see' the camera, or do you get a warning message that FCE is "Unable to locate the following external devices ..." ? -
Pls help me with this function
i want to write a function with parameters String striker,String nonstriker and Integer runsscored.
how can i write this with the following conditions
1.when runsscored ==1 or 3 or 5 or 7 striker and nonstriker should interchange and in other conditions it
should be same ie when runs scored are 2 , 4and 6public static void newRunScored(String striker, String nonStriker, int runScored) {
System.err.println("Before: " + striker + nonStriker);
if (runScored % 2 == 1) {
String temp = "";
temp = striker;
striker = nonStriker;
nonStriker = temp;
System.err.println("After: " + striker + nonStriker);
} -
Hi all,
I am trying to executr this .it is compiled and running but it ids giving no out put.(def.doc not found)
import org.apache.poi.hdf.extractor.util.*;
import org.apache.poi.hdf.extractor.data.*;
import org.apache.poi.hdf.extractor.*;
import java.util.*;
import java.io.*;
import javax.swing.*;
import java.awt.*;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.poifs.filesystem.POIFSDocument;
import org.apache.poi.poifs.filesystem.DocumentEntry;
import org.apache.poi.util.LittleEndian;
class hdf {
String origFileName;
String tempFile;
WordDocument wd;
hdf(String origFileName, String tempFile) {
this.tempFile=tempFile;
this.origFileName=origFileName;
public void getText() {
try {
wd = new WordDocument(origFileName);
Writer out = new BufferedWriter(new FileWriter(tempFile));
wd.writeAllText(out);
out.flush();
out.close();
catch (Exception eN) {
System.out.println("Error reading document:"+origFileName+"\n"+eN.toString());
public static void main(String args[])
hdf h=new hdf("c:\\abc.doc","c:\\def.doc");
}// end
thanks in advanceThe solution is for you to either learn something about Java, or just drop it.
If you decide on the first course...
Sun's basic Java tutorial
Sun's New To Java Center. Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
http://javaalmanac.com. A couple dozen code examples that supplement The Java Developers Almanac.
jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
Bruce Eckel's Thinking in Java (Available online.)
Joshua Bloch's Effective Java
Bert Bates and Kathy Sierra's Head First Java.
James Gosling's The Java Programming Language. Gosling is
the creator of Java. It doesn't get much more authoratative than this.
Maybe you are looking for
-
Finding the order of archive logs in RAC to NON-RAC manual cloning
Hi, I am in the process of automating a RAC to NON-RAC clone using traditional method [ not using RMAN ]. Here are the steps: On Source: Record the sequence number and thread of the instance put the database in begin backup mode copy the files disabl
-
Why are pdf file attachment in emails converting to wordpad and I can open them?
when I use webmail on my laptop why are attachments to email converting to wordpad and I can't open them. == This happened == Every time Firefox opened == unknown
-
Hi actually i don't know if i am in right place but i'm trying anyway. I am working on HIS System which is developed by Apex, The problem is, i want to send message to RIS System by HL7 messages , for example i want to send message to RIS system cont
-
as above
-
Taking garage band songs and saving as a waiv file to mix down in studio
I'm trying to take my songs and break each track( sound ) down and saving it as a waiv file or something to take to the studio and mix it down, or if any one knows if storm 3.0 can, or any other program. e-mac g4 Mac OS X (10.4.3)