Need help on Vb code to login into Ondemand application
Hi ,
here is the vb code tht I m using to fetch sessionid and do login into ondemand application using VB 6.0
However,its returning me error like :
"HTTP/1.1 500 Internal Server Error
Date: Tue, 09 Dec 2008 06:16:26 GMT
Server: Oracle-Application-Server-10g
Content-Length: 409
P3P: CP="CAO CUR ADM DEV TAI PSA PSD IVDi CONi TELi OUR IND PHY ONL UNI PUR FIN COM NAV INT CNT STA PRE"
Cache-Control:"
Code written on a button click:
Private Sub Command1_Click()
' Define a function or sub to contain the login steps as defined here.
Dim netHeaders As String * 1024
Dim headerSize As Long
' Open the internet connection.
m_hInternet = InternetOpen("Microsoft Internet Explorer", 0, vbNullString, vbNullString, 0)
m_hConnect = InternetConnect(m_hInternet, "secure-ausomxxxx.crmondemand.com", 443, "UserNameGiven
", "PasswordGiven", 3, 0, 0)
m_hRequest = HttpOpenRequest(m_hConnect, "GET", "/Services/Integration?command=login", "HTTP/1.1", vbNullString, vbNullString, &H84A83000, 0)
sHeaders = "Accept-Language: en" & vbCrLf & _
"Connection: Keep-Alive" & vbCrLf & _
"UserName: UserNameGiven" & vbCrLf & _
"Password: PasswordGiven"
result = HttpAddRequestHeaders(m_hRequest, sHeaders, Len(sHeaders), &HA0000000)
result = HttpSendRequest(m_hRequest, vbNullString, 0, vbNullString, 0)
headerSize = Len(netHeaders)
result = HttpQueryInfo(m_hRequest, &H16, ByVal netHeaders, headerSize, 0)
' Now parse netHeaders for header named JSESSIONID.
' This will be the value to use for the rest of the session.
' Then to Logoff, do the following:
m_hRequest = HttpOpenRequest(m_hConnect, "GET", "/Services/Integration?command=logoff", "HTTP/1.1", vbNullString, vbNullString, &H84A83000, 0)
sHeaders = "Accept-Language: en" & vbCrLf & _
"Connection: Keep-Alive" & vbCrLf & _
"Cookie: JSESSIONID=abc123:-1"
result = HttpAddRequestHeaders(m_hRequest, sHeaders, Len(sHeaders), &HA0000000)
result = HttpSendRequest(m_hRequest, vbNullString, 0, vbNullString, 0)
End Sub
Please help.
Thanks.
Hi,
I have already tried with that.Its nt then even allowing to run the function "HTTPSendRequest".
It's retunrning false value for that function.
Similar Messages
-
Need help in transcation code ime0
I need help in transaction code ime0. I mean to say what is this TCode doing? What different Drill-down program means? Where I can use this report?
Regards,
SubhasishHi
Please check the link for help
<a href="http://help.sap.com/saphelp_47x200/helpdata/EN/5c/8db33f555411d189660000e829fbbd/frameset.htm">CA - Drilldown Reporting</a>
Hope it helps
Anirban -
I need help with this code error "unreachable statement"
the error_
F:\Java\Projects\Tools.java:51: unreachable statement <-----------------------------------------------------------------------------------------------------------------THIS
int index;
^
F:\Java\Projects\Tools.java:71: missing return statement
}//end delete method
^
F:\Java\Projects\Tools.java:86: missing return statement
}//end getrecod
^
3 errors
import java.util.*;
import javax.swing.*;
import java.awt.*;
public class Tools//tool class
private int numberOfToolItems;
private ToolItems[] toolArray = new ToolItems[10];
public Tools()//array of tool
numberOfToolItems = 0;
for(int i = 0; i < toolArray.length; i++)//for loop to create the array tools
toolArray[i] = new ToolItems();
}//end for loop
}//end of array of tools
public int search(int id)//search mehtod
int index = 0;
while (index < numberOfToolItems)//while and if loop search
if(toolArray[index].getID() == id)
return index;
else
index ++;
}//en while and if loop
return -1;
}//end search method
public int insert(int id, int numberInStock, int quality, double basePrice, String nm)//insert method
if(numberOfToolItems >= toolArray.length)
return 0;
int index;
index = search(id); <-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------HERE
if (index == -1)
toolArray[index].assign(id,numberInStock, quality, basePrice,nm);
numberInStock ++;
return 1;
}//end if index
}//end if toolitem array
return -1;
}//end insert method
public int delete(/*int id*/)//delete method
}//end delete method
public void display()//display method
for(int i = 0; i < numberOfToolItems; i++)
//toolArray.display(g,y,x);
}//end display method
public String getRecord(int i)//get record method
// return toolArray[i].getName()+ "ID: "+toolArray[i].getID()
}//end getrecod
}//end class
Edited by: ladsoftware on Oct 9, 2009 6:08 AM
Edited by: ladsoftware on Oct 9, 2009 6:09 AM
Edited by: ladsoftware on Oct 9, 2009 6:10 AM
Edited by: ladsoftware on Oct 9, 2009 6:11 AMladsoftware wrote:
Subject: Re: I need help with this code error "unreachable statement"
F:\Java\Projects\Tools.java:51: unreachable statement <-----------------------------------------------------------------------------------------------------------------THIS
int index;
^
F:\Java\Projects\Tools.java:71: missing return statement
}//end delete method
^
F:\Java\Projects\Tools.java:86: missing return statement
}//end getrecod
^
3 errorsThe compiler is telling you exactly what the problems are:
public int insert(int id, int numberInStock, int quality, double basePrice, String nm)//insert method
if(numberOfToolItems >= toolArray.length)
return 0; // <<== HERE you return, so everyting in the if block after this is unreachable
int index;
index = search(id); //< -----------------------------------------------------------------------------------------------------------------HERE
if (index == -1)
toolArray[index].assign(id,numberInStock, quality, basePrice,nm);
numberInStock ++;
return 1;
}//end if index
}//end if toolitem array
return -1;
}//end insert method
public int delete(/*int id*/)//delete method
// <<== HERE where is the return statement?
}//end delete method
public String getRecord(int i)//get record method
// return toolArray.getName()+ "ID: "+toolArray[i].getID() <<== HERE you commented out the return statement
}//end getrecod
}//end class -
I need help with my code..
hi guys. as the subject says I need help with my code
the Q for my code is :
write a program that reads a positive integer x and calculates and prints a floating point number y if :
y = 1 ? 1/2 + 1/3 - ? + 1/x
and this is my code
This program that reads a positive integer x and calculates
and prints a floating point number y if :
y = 1 - 1/2 + 1/3 - ? + 1/x
import java.util.Scanner; // program uses class Scanner
class Sh7q2
// main method begins execution of Java application
public static void main( String args[] )
// create Scanner to obtain input from command window
Scanner input = new Scanner( System.in );
int i = 1; // i is to control the loop
int n = 2; // n is suppose to control the number sign
int x; // a positive integer entered by the user
int m;
System.out.println("Enter a positive integer");
x = input.nextInt();
do
m = (int) Math.pow( -1, n)/i;
System.out.println(m);
n++;
i++;
while ( m >= 1/x );
} // end method main
} // end class Sh7q2 when I compile it there is no error
but in the run it tells me to enter a positive integer
suppose i entered 5
then the result is 1...
can anyone tell me what's wrong with my codeThis program that reads a positive integer x and calculates
and prints a floating point number y if :
y = 1 - 1/2 + 1/3 - ? + 1/x
import java.util.Scanner; // program uses class Scanner
class Sh7q2
// main method begins execution of Java application
public static void main( String args[] )
// create Scanner to obtain input from command window
Scanner input = new Scanner( System.in );
int i = 1; // i is to control the loop
int n = 1; // n is suppose to control the number sign
int x; // a positive integer entered by the user
double m;
int a = 1;
double sum = 0;
System.out.println("Enter a positive integer");
x = input.nextInt();
for ( i = 1; a <= x; i++)
m = Math.pow( -1, n+1)/i;
sum = sum + m;
n++;
a++;
System.out.print("y = " + sum);
} // end method main
} // end class Sh7q2is it right :S -
I need help whenever I want to install a new application I receive a message that I cannot be connected to I tunes store although I am connected to the Internet Help
Click here and follow the instructions to change the iTunes Store country.
(85848) -
Need help in storing data from JList into a vector
need help in doing the following.-
alright i click a skill on industryskills Jlist and press the add button and it'll be added to the applicantskills Jlist. how do i further store this data that i added onto the applicantskills JList into a vector.
here are the codes:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.text.*;
import java.util.*;
import java.util.Vector;
import javax.swing.JScrollPane.*;
//import javax.swing.event.ListSelectionListener;
public class Employment extends JFrame
//declare class variables
private JPanel jpApplicant, jpEverything,jpWEST, jpCENTRE, jpEAST, jpAddEditDelete,
jpCentreTOP, jpCentreBOT, jpEastTOP, jpEastCENTRE, jpEastBOT,
jpBlank1, panel1, panel2, panel3, panel4,jpBottomArea,
jpEmptyPanelForDisplayPurposes;
private JLabel jlblApplicantForm, jlblAppList, jlblName, jlblPhone,
jlblCurrentSalary, jlblPassword, jlblDesiredSalary,
jlblNotes, jlblApplicantSkills, jlblIndustrySkills,
jlblBlank1, jlblBlank2, ApplicantListLabel,
NotesListLabel, ApplicantSkillsLabel,
IndustrySkillsLabel,jlblEmptyLabelForDisplayPurposes;
private JButton jbtnAdd1, jbtnEdit, jbtnDelete, jbtnSave, jbtnCancel,
jbtnAdd2, jbtnRemove;
private JTextField jtfName, jtfPhone, jtfCurrentSalary, jtfPassword,
jtfDesiredSalary;
private JTabbedPane tabbedPane;
private DefaultListModel /*listModel,*/listModel2;
String name,password,phone,currentsalary,desiredsalary,textareastuff,NotesText;
String selectedname;
final JTextArea Noteslist= new JTextArea();;
DefaultListModel listModel = new DefaultListModel();
JList ApplicantSkillsList = new JList(listModel);
private ListSelectionModel listSelectionModel;
JList ApplicantList, /*ApplicantSkillsList,*/ IndustrySkillsList;
//protected JTextArea NotesList;
//Vector details = new Vector();
Vector<StoringData> details = new Vector<StoringData>();
public static void main(String []args)
Employment f = new Employment();
f.setVisible(true);
f.setDefaultCloseOperation(EXIT_ON_CLOSE);
f.setResizable(false);
}//end of main
public Employment()
setSize(800,470);
setTitle("E-commerce Placement Agency");
Font listfonts = new Font("TimesRoman", Font.BOLD, 12);
JPanel topPanel = new JPanel();
topPanel.setLayout( new BorderLayout() );
getContentPane().add( topPanel );
createPage1();
createPage2();
createPage3();
createPage4();
tabbedPane = new JTabbedPane();
tabbedPane.addTab( "Applicant", panel1 );
tabbedPane.addTab( "Job Order", panel2 );
tabbedPane.addTab( "Skill", panel3 );
tabbedPane.addTab( "Company", panel4 );
topPanel.add( tabbedPane, BorderLayout.CENTER );
public void createPage1()//PAGE 1
/*******************TOP PART********************/
panel1 = new JPanel();
panel1.setLayout( new BorderLayout());
jpBottomArea = new JPanel();
jpBottomArea.setLayout(new BorderLayout());
jpApplicant= new JPanel();
jpApplicant.setLayout(new BorderLayout());
Font bigFont = new Font("TimesRoman", Font.BOLD,24);
jpApplicant.setBackground(Color.lightGray);
jlblApplicantForm = new JLabel("\t\t\t\tAPPLICANT FORM ");
jlblApplicantForm.setFont(bigFont);
jpApplicant.add(jlblApplicantForm,BorderLayout.EAST);
panel1.add(jpApplicant,BorderLayout.NORTH);
panel1.add(jpBottomArea,BorderLayout.CENTER);
/********************************EMPTY PANEL FOR DISPLAY PURPOSES*************************/
jpEmptyPanelForDisplayPurposes = new JPanel();
jlblEmptyLabelForDisplayPurposes = new JLabel(" ");
jpEmptyPanelForDisplayPurposes.add(jlblEmptyLabelForDisplayPurposes);
jpBottomArea.add(jpEmptyPanelForDisplayPurposes,BorderLayout.NORTH);
/*****************************************WEST*********************************/
jpWEST = new JPanel();
jpWEST.setLayout( new BorderLayout());
//Applicant List
listModel2=new DefaultListModel();
ApplicantList = new JList(listModel2);
listSelectionModel = ApplicantList.getSelectionModel();
listSelectionModel.addListSelectionListener(new SharedListSelectionHandler());
JScrollPane scrollPane3 = new JScrollPane(ApplicantList);
ApplicantList.setPreferredSize(new Dimension(20,40));
scrollPane3.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
scrollPane3.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
ApplicantListLabel = new JLabel( "Applicant List:");
jpWEST.add(ApplicantListLabel,"North");
jpWEST.add(scrollPane3,"Center");
jpBottomArea.add(jpWEST,BorderLayout.WEST);
/*********CENTRE*********/
jpCENTRE = new JPanel();
jpCENTRE.setLayout(new GridLayout(2,1));
jpCentreTOP = new JPanel();
jpBottomArea.add(jpCENTRE,BorderLayout.CENTER);
jpCENTRE.add(jpCentreTOP);
jpCentreTOP.setLayout(new GridLayout(6,2));
//Creating labels and textfields
jlblName = new JLabel( "Name:");
jlblBlank1 = new JLabel ("");
jtfName = new JTextField(18);
jlblBlank2 = new JLabel("");
jlblPhone = new JLabel("Phone:");
jlblCurrentSalary = new JLabel("Current Salary:");
jtfPhone = new JTextField(13);
jtfCurrentSalary = new JTextField(7);
jlblPassword = new JLabel("Password:");
jlblDesiredSalary = new JLabel("Desired Salary:");
jtfPassword = new JTextField(13);
jtfDesiredSalary = new JTextField(6);
//Add labels and textfields to panel
jpCentreTOP.add(jlblName);
jpCentreTOP.add(jlblBlank1);
jpCentreTOP.add(jtfName);
jpCentreTOP.add(jlblBlank2);
jpCentreTOP.add(jlblPhone);
jpCentreTOP.add(jlblCurrentSalary);
jpCentreTOP.add(jtfPhone);
jpCentreTOP.add(jtfCurrentSalary);
jpCentreTOP.add(jlblPassword);
jpCentreTOP.add(jlblDesiredSalary);
jpCentreTOP.add(jtfPassword);
jpCentreTOP.add(jtfDesiredSalary);
//Noteslist
jpCentreBOT = new JPanel();
jpCentreBOT.setLayout( new BorderLayout());
jpCENTRE.add(jpCentreBOT);
jpBlank1 = new JPanel();
// Noteslist = new JTextArea(/*Document doc*/);
JScrollPane scroll3=new JScrollPane(Noteslist);
scroll3.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
scroll3.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
NotesListLabel = new JLabel( "Notes:");
jpCentreBOT.add(NotesListLabel,"North");
jpCentreBOT.add(scroll3,"Center");
jpCentreBOT.add(jpBlank1,"South");
jpBottomArea.add(jpCENTRE,BorderLayout.CENTER);
/**********EAST**********/
//Applicant Skills Panel
//EAST ==> TOP
jpEAST = new JPanel();
jpEAST.setLayout( new BorderLayout());
jpEastTOP = new JPanel();
jpEastTOP.setLayout( new BorderLayout());
ApplicantSkillsLabel = new JLabel( "Applicant Skills");
JScrollPane scrollPane1 = new JScrollPane(ApplicantSkillsList);
scrollPane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
scrollPane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
ApplicantSkillsList.setVisibleRowCount(6);
jpEastTOP.add(ApplicantSkillsLabel,"North");
jpEastTOP.add(scrollPane1,"Center");
jpEAST.add(jpEastTOP,BorderLayout.NORTH);
jpBottomArea.add(jpEAST,BorderLayout.EAST);
//Add & Remove Buttons
//EAST ==> CENTRE
jpEastCENTRE = new JPanel();
jpEAST.add(jpEastCENTRE,BorderLayout.CENTER);
jbtnAdd2 = new JButton("Add");
jbtnRemove = new JButton("Remove");
//add buttons to panel
jpEastCENTRE.add(jbtnAdd2);
jpEastCENTRE.add(jbtnRemove);
//add listener to button
jbtnAdd2.addActionListener(new Add2Listener());
jbtnRemove.addActionListener(new RemoveListener());
//Industry Skills Panel
//EAST ==> BOTTOM
jpEastBOT = new JPanel();
jpEastBOT.setLayout( new BorderLayout());
String[] data = {"Access97", "Basic Programming",
"C++ Programming", "COBOL Programming",
"DB Design", "Fortran programming"};
IndustrySkillsList = new JList(data);
JScrollPane scrollPane = new JScrollPane(IndustrySkillsList);
scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
IndustrySkillsLabel = new JLabel( "Industry Skills:");
jpEastBOT.add(IndustrySkillsLabel,"North");
jpEastBOT.add(scrollPane,"Center");
jpEAST.add(jpEastBOT,BorderLayout.SOUTH);
//BOTTOM
jpAddEditDelete= new JPanel();
jbtnAdd1= new JButton("Add");
jbtnEdit= new JButton("Edit");
jbtnDelete= new JButton("Delete");
jbtnSave= new JButton("Save");
jbtnCancel= new JButton("Cancel");
jpAddEditDelete.add(jbtnAdd1);
jpAddEditDelete.add(jbtnEdit);
jpAddEditDelete.add(jbtnDelete);
jpAddEditDelete.add(jbtnSave);
jpAddEditDelete.add(jbtnCancel);
jbtnEdit.addActionListener(new EditListener());
jbtnDelete.addActionListener(new DeleteListener());
jbtnEdit.addActionListener(new EditListener());
jbtnAdd1.addActionListener(new Add1Listener());
jbtnCancel.addActionListener(new CancelListener());
jpBottomArea.add(jpAddEditDelete,BorderLayout.SOUTH);
public void createPage2()//PAGE 2
panel2 = new JPanel();
panel2.setLayout( new GridLayout(1,1) );
panel2.add( new JLabel( "Sorry,under construction" ) );
public void createPage3()//PAGE 3
panel3 = new JPanel();
panel3.setLayout( new GridLayout( 1, 1 ) );
panel3.add( new JLabel( "Sorry,under construction" ) );
public void createPage4()//PAGE 4
panel4 = new JPanel();
panel4.setLayout( new GridLayout( 1, 1 ) );
panel4.add( new JLabel( "Sorry,under construction" ) );
public class Add1Listener implements ActionListener
public void actionPerformed(ActionEvent e)
name = jtfName.getText();
password = jtfPassword.getText();
phone = jtfPhone.getText();
currentsalary = jtfCurrentSalary.getText();
int i= Integer.parseInt(currentsalary);
desiredsalary = jtfDesiredSalary.getText();
int j= Integer.parseInt(desiredsalary);
StoringData person = new StoringData(name,password,phone,i,j);
// StoringData AppSkillsList = new StoringData(listModel);
details.add(person);
// details.add(AppSkillsList);
listModel2.addElement(name);
jtfName.setText("");
jtfPassword.setText("");
jtfPhone.setText("");
jtfCurrentSalary.setText("");
jtfDesiredSalary.setText("");
// NotesList.setText("");
public class Add2Listener implements ActionListener
public void actionPerformed(ActionEvent e)
String temp1;
temp1 = (String)IndustrySkillsList.getSelectedValue();
listModel.addElement(temp1);
public class RemoveListener implements ActionListener
public void actionPerformed(ActionEvent e)
int index = ApplicantSkillsList.getSelectedIndex();
listModel.remove(index);
public class EditListener implements ActionListener
public void actionPerformed(ActionEvent e)
jtfName.setEditable(true);
jtfPassword.setEditable(true);
jtfPhone.setEditable(true);
jtfCurrentSalary.setEditable(true);
jtfDesiredSalary.setEditable(true);
Noteslist.setEditable(true);
jbtnAdd2.setEnabled(true);
jbtnRemove.setEnabled(true);
jbtnSave.setEnabled(true);
jbtnCancel.setEnabled(true);
public class DeleteListener implements ActionListener
public void actionPerformed(ActionEvent e)
int index1 = ApplicantList.getSelectedIndex();
listModel2.remove(index1);
public class SaveListener implements ActionListener
public void actionPerformed(ActionEvent e)
public class CancelListener implements ActionListener
public void actionPerformed(ActionEvent e)
jtfName.setText("");
jtfPassword.setText("");
jtfPhone.setText("");
jtfCurrentSalary.setText("");
jtfDesiredSalary.setText("");
public class SharedListSelectionHandler implements ListSelectionListener
public void valueChanged(ListSelectionEvent e)
selectedname =ApplicantList.getSelectedValue().toString();
StoringData selectedPerson = null;
jtfName.setEditable(false);
jtfPassword.setEditable(false);
jtfPhone.setEditable(false);
jtfCurrentSalary.setEditable(false);
jtfDesiredSalary.setEditable(false);
Noteslist.setEditable(false);
jbtnAdd2.setEnabled(false);
jbtnRemove.setEnabled(false);
jbtnSave.setEnabled(false);
jbtnCancel.setEnabled(false);
for (StoringData person : details)
if (person.getName1().equals(selectedname))
selectedPerson = person;
jtfName.setText(person.getName1());
jtfPassword.setText(person.getPassword1());
jtfPhone.setText(person.getPhone1());
//String sal1 = Integer.parseString(currentsalary);
// String sal2 = Integer.parseString(desiredsalary);
// jtfCurrentSalary.setText(sal1);
// jtfDesiredSalary.setText(sal2);
break;
// if (selectedPerson != null)
}Quit posting 300 line programs to ask a question. We don't care about your entire application. We only care about code that demonstrates your current problem. We don't want to read through 300 lines to try and find the line of code that is causing the problem.
If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the code retains its original formatting.
Here is a simple SSCCE. Now make your changes and if you still have problems you have something simple to post. If it works then you add it to your real application.
Learn to simplify your problem by simplifying the code.
import java.awt.*;
import javax.swing.*;
public class ListTest2 extends JFrame
JList list;
public ListTest2()
String[] numbers = { "one", "two", "three", "four", "five", "six", "seven" };
list = new JList( numbers );
JScrollPane scrollPane = new JScrollPane( list );
getContentPane().add( scrollPane );
public static void main(String[] args)
ListTest2 frame = new ListTest2();
frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
frame.setSize(200, 200);
frame.setLocationRelativeTo( null );
frame.setVisible( true );
} -
Help with html code - inserting video into Muse
I am seeking help writing the code to insert a video into Muse. I uploaded video into my Business Catalyst hosting. I need it to autoplay, loop and not show any controls or frames.
When I host video on Vimeo or YouTube, I see markings on the video that is why I am trying to just host in the same place that the files are stored for my website. If there is a way to host on youtube with out any markings showing up on the video I would be open to that too.
I don't want to see any play button or time bar.
Thanks in advance!!Hello,
Just as an FYI - we also have an HTML5 video tool over at MuseThemes.com that achieves this, but works on mobile devices as well. The link above looks like it uses Flash, which isn't common anymore since the release of HTML5 based video.
Simply drag the widget out onto your canvas, and link up your videos / set options like loop, controls visible, etc. It's quite a flexible widget, and there's a complete training video included so you don't get stuck
Check out the widget here
Just wanted to provide another alternative that could be helpful. Cheers!
Steve Harris
MuseThemes.com -
Need Help on this Code Immediately
Hi Friends,
Iam very new to java.
I have a Java Code that iam trying to Run. The Code Compiles fine but it fails on its 3rd Loop where it is trying to Run a report.
I have the Code part that is errorring out. Can someone please look into the code and tell me if i need to make any changes to the Code.
The Code when Executed gives an Error "The Client Did Something Wrong".
Please Help Me!!!
* Execute a report.
*@param path This is the search path to the report.
*@param format The array that contains the format options (PDF,HTML,etc...)
public void executeReport(String path,String[] format)
ParameterValue pv[] = new ParameterValue[]{};
Option ro[] = new Option[3];
RunOptionBoolean saveOutput = new RunOptionBoolean();
RunOptionStringArray rosa = new RunOptionStringArray();
RunOptionBoolean burstable = new RunOptionBoolean();
// Define that the report to save the output.
saveOutput.setName(RunOptionEnum.saveOutput);
saveOutput.setValue(true);
// What format do we want the report in: PDF? HTML? XML?
rosa.setName(RunOptionEnum.outputFormat);
rosa.setValue(format);
// Define that the report can be burst.
burstable.setName(RunOptionEnum.burst);
burstable.setValue(true);
// Fill the array with the run options.
ro[0] = rosa;
ro[1] = saveOutput;
ro[2] = burstable;
try
SearchPathSingleObject spSingle = new SearchPathSingleObject();
spSingle.setValue(path);
// Get the initial response.
AsynchReply res = reportService.run(spSingle,pv,ro);
// If it has not yet completed, keep waiting until it is done.
// In this case, we wait forever.
while (res.getStatus() != AsynchReplyStatusEnum.complete && res.getStatus() != AsynchReplyStatusEnum.conversationComplete)
res = reportService.wait(res.getPrimaryRequest(), new ParameterValue[]{}, new Option[]{});
reportService.release(res.getPrimaryRequest());
// Return the final response.
catch (Exception e)
System.out.println(e);
}Guess I was too late. Sorry
Inestead of posting you need help on code immediately how about intest posting the particular topic that you are working on. It's quite doubtful that you would be here if you didn't have a question. -
Need help fixing my code...
I'm currently working on a problem for school where you have to make a game called Pig.
I worked on it but need help on fixing it because it won't work the way I want it to, and I'm not sure what the problem is.
public class Pig
public static void main (String[] args)
int num1, num2, num3 = 0, num4, num5, num6 =0;
String answer="y";
PairOfDice die1 = new PairOfDice(); // die # 1
PairOfDice die2 = new PairOfDice(); // die # 2
while (num3 <= 100 || num6 <= 100)
// rolls dice
while (answer.equalsIgnoreCase("y"))
num1 = die1.roll();
num2 = die2.roll();
if (num1 == 1 || num2 == 1) // when either face is 1
{num3 = num3;
answer = "n";}
else
if (num1 == 1 && num2 == 1) // when both faces are 1
{num3 = 0;
answer = "n";}
else
num3 += num1 + num2; // sum of two faces
System.out.println (num1 +" "+ num2); // shows both faces
System.out.println (num3); // shows the sum of faces
System.out.println ("Do you want to roll again? (y/n)");
answer = Keyboard.readString();
if (answer.equalsIgnoreCase("n"))
answer = "1";
while (answer.equalsIgnoreCase("1"))
while (num6 <= 20)
num4 = die1.roll();
num5 = die2.roll();
if (num4 == 1 || num5 == 1) // when either face is 1
{num6 = num6;
answer = "2";}
else
if (num4 == 1 && num5 == 1) // when both faces are 1
{num6 = 0;
answer = "2";}
else
num6 += num4 + num5; // sum of two faces
System.out.println (num4 +" "+ num5); // shows both faces
System.out.println (num6); // shows the sum of faces
answer = "y";
Here is my code. It runs okay, but when the dice rolls a 1, it doesn't jump to the next while loop. I need the program to go to the "while loop answer = 1" when the dice rolls a 1 from the "while loop answer = y". If you see my code, I did it by making the answer = "n" to make it jump to the next while loop. I'm sorry if my explanation is confusing. It's my first time asking for help here...
You don't have to fix the code for me, as long as you tell me what I'm doing wrong.
Please help me...Thank you for your help.
Edited by: nakatsu on Nov 12, 2007 7:03 PMHint: all your code does NOT have to be in one method. You have numerous loops some nested inside others. This is starting to get mighty messy and can be tidied up if you think about how you can break some of the code down into smaller chunks and place these into their own methods.
while (answer.equalsIgnoreCase("1"))What other case is there? -
Need help with WMI code that will send output to db
'm new to WMI code writing, so I need some help with writing code that we can store on our server. I want this code to run when a user logs into their computer
and talks to our server. I also want the code to:
* check the users computer and find all installed patches
* the date the patches were installed
* the serial number of the users computer
* the computer name, os version, last boot up time, and mac address
and then have all this output to a database file. At the command prompt I've tried:
wmic qfe get description, hotfixid
This does return the patch information I'm looking for, but how do I combine that line of code with:
wmic os get version, csname, serialnumber, lastbootuptime
and
wmic nicconfig get macaddress
and then get all this to output to a database file?Thank you for the links. I checked out http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx and
found lots of good information. I also found a good command that will print information to a text file.
Basically what I'm trying to do is retrieve a list of all installed updates (Windows updates and 3rd party updates). I do like that the below code because it gives me the KB numbers for the Windows updates. I need this information so my IT co-workers &
I can keep track of which of our user computers need a patch/update installed and preferably which patch/update. The minimum we want to know is which patches / updates have been installed on which computer. If you wondering why we don't have Windows automatic
updates enable, that's because we are not allowed to.
This is my code so far.
#if you want the computer name, use this command
get-content env:computername
$computer = get-content env:computername
#list of installed patches
Get-Hotfix -ComputerName $computer#create a text file listing this information
Get-Hotfix > 'C:\users\little e\Documents\WMI help\PowerShell\printOutPatchList.txt'
I know you don't want to tell me the code that will print this out to a database (regardless if it's Access or SQL), and that's find. But maybe you can tell me this. Is it possible to have the results of this sent to a database file or do I need to go into
SQL and write code for SQL to go out and grab the data from an Excel file or txt file? If I'm understanding this stuff so far, then I suspect that it can be done both ways, but the code needs to be written correctly for this to happen. If it's true, then which
way is best (code in PowerShell to send information to SQL or SQL go get the information from the text file or Excel file)? -
Need help for importing oracle 10G dump into 9i database
hi, Someone help me to import oracle 10G dump into 9i database. I'm studying oracle . Im using oracle 10G developer suite(downloaded from oracle) and oracle 9i database. I saw some threads tat we can't import the higher version dumps into lower version database. But i'm badly need help for importing the dump...
or
someone please tell me the site to download oracle 9i Developer suite as i can't find it in oracle site...I didnt testet it to import a dump out of a 10g instance into a 9i instance if this export has been done using a 10g environment.
But it is possible to perform an export with a 9i environment against a 10g instance.
I am just testing this with a 9.2.0.8 environment against a 10.2.0.4.0 instance and is working so far.
The system raises an EXP-00008 / ORA-37002 error after exporting the data segments (exporting post-schema procedural objects and actions).
I am not sure if it is possible to perform an import to a 9i instance with this dump but maybe worth to give it a try.
It should potentially be possible to export at least 9i compatible objects/segments with this approach.
However, I have my doubts if this stunt is supported by oracle ...
Message was edited by:
user434854 -
Need help in combining two similair SQLs into one
DB Version:10gR2
I need to combine the following two queries into one query and return the following three columns
Unprocessed Quantity1,Unprocessed Quantity2, Total Uprocessed Cost
Unprocessed Quantity1 can be determined using
select t.ITEM, sum(t.QTY)
from (select cd.ITEM_ID ITEM, cd.ACTL_QTY QTY
from CONVEY_HDR ch, CURRENT_INVN cd, ALLOC_HDR ah
where ........
UNION
select sd.ITEM_ID ITEM, sd.INVN_QTY QTY
from shp_dtl pd
UNION
Select item_id, inv_qty from another table
GROUP BY.....
ITEM SUM(T.QTY)
88JAT 25
000002395 1
300108396 27
000004397 7
73984290 15Unprocessed quantity2 can be determined using
select t.ITEM, sum(t.QTY)
from (select cd.ITEM_ID ITEM, cd.ACTL_QTY QTY
from CONVEY_HDR ch, CURRENT_INVN cd, ALLOC_HDR ah
where rownum<6
group by t.ITEM
order by t.ITEM;
ITEM SUM(T.QTY)
189436171 2
009438837 160
000040685 16
000032410 18Total Unprocessed Cost can found using the sum of Quantities for a particular Item from above two queries multiplied by
ITEM_COST for that ITEM (which is found in ITEM_DTL table). For every item; ITEM_DTL.item_id=CARTON_dTL.carton_id
Total Unprocessed Cost= (Unprocessed Quantity1+Unprocessed Quantity2)*ITEM_DTL. ITEM_COST
Note: Unprocessed Quantity2 query looks very similair to first SQL in UNION of Unprocessed Quantity1, but ah.STAT_CODE < 90 for Unprocessed Quantity2 query
Edited by: user636669 on Jan 14, 2009 10:40 AM
Edited by: user636669 on Jan 14, 2009 10:57 AM
Corrected typo
Edited by: user636669 on Jan 14, 2009 7:07 PMHi,
Put the two queries you posted in sub-queries. You can then use their result sets as if they were tables.
Do something like this:
WITH uq1 AS
select t.ITEM, sum(t.QTY) AS total
from (select cd.ITEM_ID ITEM, cd.ACTL_QTY QTY
from CASE_HDR ch, CASE_DTL cd, ASN_HDR ah
... the rest of your first query goes here
, uq2 AS
select t.ITEM, sum(t.QTY) AS total
from (select cd.ITEM_ID ITEM, cd.ACTL_QTY QTY
from CASE_HDR ch, CASE_DTL cd, ASN_HDR ah
... the rest of your second query goes here
SELECT uq1.item
, uq1.total AS "Unprocessed Quantity1"
, uq2.total AS "Unprocessed Quantity2"
, (uq1.total + uq2.total) * dtl.item_cost
AS "Total Uprocessed Cost"
FROM uq1
JOIN uq2 ON uq1.item = uq2.item
JOIN item_dtl dtl ON uq1.item = dtl.item;If some items are in uq1 but not in uq2 (or vice-versa), then you'll probably want to do outer joins.
I don't have any of the tables used, so I can't test this myself.
If you need more help. then post a little sample data from each of the tables, and the results you want from that data.
It looks like you're doing the same join in each of your original queries.
You can add another sub-query that does that join once, and then use that sub-query in sub-queries uq1 and uq2. -
wazap guys ? long time not 2 see U :)
i need help , this application that will follow is supposed to count the words lengths
i.e if typed "I am poprage" the program will output :
the word length the occurence
1 1
2 1
3
4
5
6
7 1
compile it & u will understand it.
the problem is that it makes a table for each damen word
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
public class Application2 extends JFrame{
private JLabel label;
private JTextField field;
private JTextArea area;
private JScrollPane scroll;
private int count;
public Application2(){
super("Application 2 / Word Length");
Container c = getContentPane();
c.setLayout(new FlowLayout());
label = new JLabel("Enter The Text Here");
c.add(label);
field = new JTextField(30);
field.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent e){
StringTokenizer s = new StringTokenizer(e.getActionCommand());
count = s.countTokens();
while(s.hasMoreTokens()){
count--;
pop(s.nextToken());
c.add(field);
area = new JTextArea(10,30);
area.setEditable(false);
c.add(area);
scroll = new JScrollPane(area);
c.add(scroll);
setSize(500,500);
show();
public void pop (String s){
String poprage = "";
int count1 = 0;
int count2 = 0;
int count3 = 0;
int count4 = 0;
int count5 = 0;
int count6 = 0;
int count7 = 0;
int count8 = 0;
int count9 = 0;
int count10 = 0;
int count11 = 0;
int count12 = 0;
int count13 = 0;
int count14 = 0;
int count15 = 0;
int count16 = 0;
int count17 = 0;
int count18 = 0;
int count19 = 0;
int count20 = 0;
int count21 = 0;
int count22 = 0;
int count23 = 0;
int count24 = 0;
int count25 = 0;
for(int i = 0; i < s.length(); i++){
if(s.length() == 1) count1 += 1;
else if(s.length() == 2) count2 += 1;
else if(s.length() == 3) count3 += 1;
else if(s.length() == 4) count4 += 1;
else if(s.length() == 5) count5 += 1;
else if(s.length() == 6) count6 += 1;
else if(s.length() == 7) count7 += 1;
else if(s.length() == 8) count8 += 1;
else if(s.length() == 9) count9 += 1;
else if(s.length() == 10) count10 += 1;
else if(s.length() == 11) count11 += 1;
else if(s.length() == 12) count12 += 1;
else if(s.length() == 13) count13 += 1;
else if(s.length() == 14) count14 += 1;
else if(s.length() == 15) count15 += 1;
else if(s.length() == 16) count16 += 1;
else if(s.length() == 17) count17 += 1;
else if(s.length() == 18) count18 += 1;
else if(s.length() == 19) count19 += 1;
else if(s.length() == 20) count20 += 1;
else if(s.length() == 21) count21 += 1;
else if(s.length() == 22) count22 += 1;
else if(s.length() == 23) count23 += 1;
else if(s.length() == 24) count24 += 1;
else if(s.length() == 25) count25 += 1;
poprage += "The Length\t"+"The Occurence\n"+
"1\t"+count1+"\n"+
"2\t"+count2+"\n"+
"3\t"+count3+"\n"+
"4\t"+count4+"\n"+
"5\t"+count5+"\n"+
"6\t"+count6+"\n"+
"7\t"+count7+"\n"+
"8\t"+count8+"\n"+
"9\t"+count9+"\n"+
"10\t"+count10+"\n"+
"11\t"+count11+"\n"+
"12\t"+count12+"\n"+
"13\t"+count13+"\n"+
"14\t"+count14+"\n"+
"15\t"+count15+"\n"+
"16\t"+count16+"\n"+
"17\t"+count17+"\n"+
"18\t"+count18+"\n"+
"19\t"+count19+"\n"+
"20\t"+count20+"\n"+
"21\t"+count21+"\n"+
"22\t"+count22+"\n"+
"23\t"+count23+"\n"+
"24\t"+count24+"\n"+
"25\t"+count25+"\n";
area.append(poprage);
public static void main (String ar[]){
Application2 a = new Application2();
a.addWindowListener(
new WindowAdapter(){
public void windowClosing( WindowEvent e ){
System.exit(0);
can any one fix it ???????
REGARDS.Okay, so I took a look at it, where you are having the problem is that your pop() method not only updated the count variable, but then displays the result each time you call it. and since you call it in the loop, guess what it will give you a "table" for each "damen word"...
Any way, I was bored enough to "fix" the program and included comments as to what I did and the relative "why"...
So here goes...
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
public class Application2 extends JFrame{
private JLabel label;
private JTextField field;
private JTextArea area;
private JScrollPane scroll;
private int count;
// moved these up here so that all methods in this class
// can see and modify them, and more importantly so that they would not go
// out of scope and end up zero'd out before we display the values
// in the "table", once that done, then we can zero them out.
// although an array would be better and easier to use... -MaxxDmg...
private int count1 = 0;private int count2 = 0;
private int count3 = 0;private int count4 = 0;
private int count5 = 0;private int count6 = 0;
private int count7 = 0;private int count8 = 0;
private int count9 = 0;private int count10 = 0;
private int count11 = 0;private int count12 = 0;
private int count13 = 0;private int count14 = 0;
private int count15 = 0;private int count16 = 0;
private int count17 = 0;private int count18 = 0;
private int count19 = 0;private int count20 = 0;
private int count21 = 0;private int count22 = 0;
private int count23 = 0;private int count24 = 0;
private int count25 = 0;
// end move int count variable declarations - MaxxDmg...
public Application2(){
super("Application 2 / Word Length");
Container c = getContentPane();
c.setLayout(new FlowLayout());
label = new JLabel("Enter The Text Here");
c.add(label);
field = new JTextField(30);
field.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
String poprage = ""; // move this here, once pop() loop is done, then this string
// will be constructed and displayed - MaxxDmg...
StringTokenizer s = new StringTokenizer(e.getActionCommand());
count = s.countTokens();
while(s.hasMoreTokens()){ // this is the "pop() loop" since it calls pop() to count the words - MaxxDmg...
count--;
pop(s.nextToken()); // runs pop which only increments the count variable as needed - MaxxDmg...
}// end "pop() loop" - MaxxDmg...
// string poprage constructed one pop() loop is done to display the proper results - MaxxDmg...
poprage += "The Length\t"+"The Occurence\n"+"1\t"+count1+"\n"+
"2\t"+count2+"\n" + "3\t"+count3+"\n" + "4\t"+count4+"\n" +
"5\t"+count5+"\n" + "6\t"+count6+"\n" + "7\t"+count7+"\n" +
"8\t"+count8+"\n" + "9\t"+count9+"\n" + "10\t"+count10+"\n" +
"11\t"+count11+"\n" + "12\t"+count12+"\n" + "13\t"+count13+"\n" +
"14\t"+count14+"\n" + "15\t"+count15+"\n" + "16\t"+count16+"\n" +
"17\t"+count17+"\n" + "18\t"+count18+"\n" + "19\t"+count19+"\n" +
"20\t"+count20+"\n" + "21\t"+count21+"\n" + "22\t"+count22+"\n"+
"23\t"+count23+"\n" + "24\t"+count24+"\n" + "25\t"+count25+"\n";
area.append(poprage);
// end string construction and area update... - MaxxDmg...
// all int count variable set to 0 for next usage - MaxxDmg...
count = 0;
count1 = 0;count2 = 0;count3 = 0;count4 = 0;count5 = 0;
count6 = 0;count7 = 0;count8 = 0;count9 = 0;count10 = 0;
count11 = 0;count12 = 0;count13 = 0;count14 = 0;count15 = 0;
count16 = 0;count17 = 0;count18 = 0;count19 = 0;count20 = 0;
count21 = 0;count22 = 0;count23 = 0;count24 = 0;count25 = 0;
// end count variable reset... - MaxxDmg...
c.add(field);
area = new JTextArea(10,30);
area.setEditable(false);
c.add(area);
scroll = new JScrollPane(area);
c.add(scroll);
setSize(500,500);
show();
public void pop (String s){
// now all this method does is increment the count variables - MaxxDmg...
// which will eliminate the "making a table" for each "damen word" - MaxxDmg...
if(s.length() == 1) count1 += 1;
else if(s.length() == 2) count2 += 1;
else if(s.length() == 3) count3 += 1;
else if(s.length() == 4) count4 += 1;
else if(s.length() == 5) count5 += 1;
else if(s.length() == 6) count6 += 1;
else if(s.length() == 7) count7 += 1;
else if(s.length() == 8) count8 += 1;
else if(s.length() == 9) count9 += 1;
else if(s.length() == 10) count10 += 1;
else if(s.length() == 11) count11 += 1;
else if(s.length() == 12) count12 += 1;
else if(s.length() == 13) count13 += 1;
else if(s.length() == 14) count14 += 1;
else if(s.length() == 15) count15 += 1;
else if(s.length() == 16) count16 += 1;
else if(s.length() == 17) count17 += 1;
else if(s.length() == 18) count18 += 1;
else if(s.length() == 19) count19 += 1;
else if(s.length() == 20) count20 += 1;
else if(s.length() == 21) count21 += 1;
else if(s.length() == 22) count22 += 1;
else if(s.length() == 23) count23 += 1;
else if(s.length() == 24) count24 += 1;
else if(s.length() == 25) count25 += 1;
}// end modified pop() method - MaxxDmg...
public static void main (String ar[]){
Application2 a = new Application2();
a.addWindowListener(
new WindowAdapter(){
public void windowClosing( WindowEvent e ){
System.exit(0);
}So read the comments, look at the code and compare it to the original. You will see why the original did not give you the results you wanted, while the fixed version will...
- MaxxDmg...
- ' He who never sleeps... ' -
NEED HELP WITH REDEEMING CODE FOR OS LION!
im running 10.6.8 and im trying to update to Lion , im qualifyed to update free apple has sent me a code to redeem on the mac app store but i says " the code you have entered is not recognised as a valid code."
PLEASE HELP!IVE DONE IT, IF YOUR USING HOTMAIL EMAIL - CLICK DOWNLOAD ON THE ABOVE YOU MESSAGE AND A LINK SHOULD APPEAR, YOU SHOULD HAVE GOT ANOTHER EMAIL SAYING YOUR CODE - COPY AND PASTE THE CODE YOU GOT INTO THE LINK AND CLICK NEXT OR SOMETHING, THEN YOU SHOULD GET ANOTHER CODE AND GO TO MAC APP STORE ON YOUR LEFT YOU SHOULD HAVE "QUICK LINKS" AND UNDER THAT YOU SHOULD HAVE REDEEM CLICK THAT AND TYPE IN THE CODE YOU GOT FROM THE LINK THEN YOUR DONE!
Ps. if you did not get the email check your junk/spam folders. -
Need help with error code 150:30
need help with finding out what error code 150:30 is and how to fix it
See the following:
Error 150:30 - Error "Licensing has stopped working" | Mac OS :
http://helpx.adobe.com/x-productkb/global/error-licensing-stopped-mac-os.html
Maybe you are looking for
-
I keep getting charged$12.90 from the itunes store who keeps saying i owe them for songs i purchased but paid them twice what should i do whenever i want to purchase music i have to pay 12.90 first something is wrong please help me ?
-
How to use SoftBank' s iPhone 4S @Thailand
My wife can not use my iPhone 4S in Thailand. How to unlock my iPhone to use in Thailand. I do not need Jailbreak or Gevey sim. I think apple support can do. Please let me know about that.
-
We have swipe system , its transactions date are storing in float format. How to convert these float number to oracle dates. Below I have pasted the float numers, I am able to convert these float number using excel. Float Number ========= 40814.22152
-
Use Oracle Wallet to store repository (Registry/SS/EAS) credentials?
I'm running EPM 11.1.2.2 on AIX, Oracle repository, already installed and configured. The security team would prefer to have the repository credentials stored in an Oracle wallet as a matter of policy. I believe, from my limited research, that a JDB
-
I'm trying to make a button that behaves like a JToggleButton but I want to cutomize its appearance completely: including when it is selected, when its rolled over, when its not selected and when it has keyboard focus. I have started by extending the