43,549 Solved Topics
Remove Filter ![]() | |
i have a form witch contains few user controls each control has combobox and 30 pictureboxes. each time i select a number from the combobox i want to press a button in my form and change the color of the picturebox for as many pictureboxes as i choose. for example: … Software Development | |
how do i reset the applet? i thought that it would work if i call the method itself thanks [code=java] private class ButtonListener1 implements ActionListener{ public void actionPerformed(ActionEvent e){ myButton1.setBackground(Color.black); int answer = JOptionPane.YES_OPTION; answer = JOptionPane.showConfirmDialog(null, "BOOOoooM!!! Would you like to play again?", "", JOptionPane.YES_NO_OPTION); if(answer == JOptionPane.YES_OPTION){ LoanApplet … Software Development java | |
I finally broke down and wrote my first header file, but one of my functions is acting a little weird... This function is supposed to convert from Celsius to Fahrenheit but whenever I call the function, it returns an incorrect value. Is there an easy way to multiply the float … Software Development c++ | |
Hi All, I have 2 classes. say Class A and Class B. My logic is coded in a method in class B. I am accessing this method of class B by creating an instance of class B in class A. To explain better: Class A{ ClassB b = new ClassB(); … Software Development java | |
plz take a look at the following code [CODE] #include <iostream> #include <string> #include <iostream> #include <string> using namespace std; class A { public: string sa; A(string sia); }; class B:public A { public: string sb; B(string sia, string sib); }; A::A(string sia):sa(sia) { } B::B( string sia, string sib):A(sia),sb(sib) … Software Development c++ | |
hey again, code below works but it tends to give some info which shouldn't be there: (for example a - 0 where 'a' is a letter and 0 is the times the letter was repeated) [code=cplusplus] #include <iostream> #include <stack> #include <fstream> using namespace std; int main() { fstream fin1("E:\\iras.txt", … | |
Write a program which will accept a Roman numeral input from the keyboard and return to the screen its numeric value. Some of you cases should input unusual or awkward input, and at least one trial must include an improperly formed Roman numeral. The following features of the Roman numeral … Software Development c++ | |
Well this is a lab assignment, the problem I'm having is that the sample code he gave us is suppose to run as is, but it doesn't. I email him and he thought that most likely there might be a problem with the CLASSPATH for java or that I might … Software Development java java-swing | |
Hello i am new in perl scripting.I have to write a script to check for .c file and then go in to the ,c file and find all function and insert line1 after `{` and line2 before `}` or before return( if return is present). Can any1 plz help me … Software Development perl | |
Hi All, I m working on a project that has different sub-projects. I would like to include a link to a file that is placed in another folder. For ex. My file whose path is ProjB/FolderB/FileB.asp --I want to write a line of code that will enable me to link … Software Development | |
hello. i created a new form and added to my form few user controls and menu. my menu contains numbers. i created all my user controls in the forms constructor and changed their visibility to false. my goal is to show the number of controls i picked in my menu. … Software Development | |
I am totally new in biopython and its my first program.so may be i am asking stupid question. I am working with a text filelooks like this: #NAME AA TOPO ACCESS DSSP STRIDE Z-COORD 1lghB A i 79.8 H H -24.58 1lghB V i 79.6 H H -22.06 1lghB H … Software Development python | |
I am passing information between two forms. Up to now, I have passed information from one form to another. Is there another way to do this? [DisplayDie dpDie = new DisplayDie(dp); // Getting constructor error in this line DisplayPanel dp = new DisplayPanel(dpDie,dpDie);] When I swap the lines, error moves … Software Development java | |
![]() | I searched the forums for Windows API tutorials and have found [URL="http://www.winprog.org/tutorial/"]this[/URL]. Is it necessary to do everything manually like in the tutorial and after getting the hang of it move on to QT or should I jump into QT right now? Software Development api c++ qt windows-api |
HI All I have a script which counts how many times a job has failed. For some reason my echo $list wont work in a variable, it works if i dont put it in a variable, but i need this in a variable so i can do a grep -c … Software Development shell-scripting | |
hey all, i've got a new issue with a program that allows the user to enter a number and then that number is checked against a random number that the PC chooses. Here's the code: [code] Private Sub xCalcButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles xCalcButton.Click 'show the … Software Development vb.net | |
Hi Can anyone help on how to add passwords to already created users non-interactively in shell script. Passwords will be stored in one text file. Script should automatically take passwords from file. Thanks in Advance Vishwajit Software Development shell-scripting | |
Hello All, I really hope that someone can provide some assistance. I have read a XML file into my hashtable. Next I created a second hashtable. If a key is located in my first hashtable, I want that key along with its value to be inserted into the second hashtable. … | |
Hi, Could someone point out ways on how I could reload the frame? so far, what I've done : [code]int more = JOptionPane.YES_OPTION; more = JOptionPane.showConfirmDialog(null, "BOOOoooM!!! Would you like to play again?", "", JOptionPane.YES_NO_OPTION); if(more == JOptionPane.YES_OPTION){ myFrame.setVisible(true); } else{ myFrame.setVisible(false); } [/code] I'm not sure what I should … Software Development java | |
hello i am trying to figure out the output of this specific code [CODE]int main() { int i , parent_id , ans ; parent_id = getpid() ; for ( i = 1 ; i <= 5 ; i++ ) { if ( getpid() == parent_id ) { ans = fork() … Software Development c | |
Problem Description: You are to write a golf game that allows the user to play one hole, a 280 metre par 5. For each swing, the player chooses a club and then the program generates the distance hit for each shot, updating the distance to the hole accordingly. Play proceeds … Software Development c++ java-swing | |
I need to use a for loop to print out the odd numbers between 25 - 1. program2 1) I also need to use a for loop to prompt user to input two intergers: firstNumber and secondNumber (firstNumber must be less then secondNumber) 2) Outputs all odd numbers between firstNumber … Software Development c++ | |
Hi all, I am currently working on a program which tests whether 2 numbers multiplied produces a PALINDROME. An example of a palindrome is 16461 which can be read same from both ways hence i devised a test. [CODE=cplusplus]#include <iostream> #include <string> using namespace std; char pali(char orig[100]); int main() … Software Development c++ | |
Hello, I'm still getting the hang of coding (just started a few weeks ago) so this may seem like a daft question. I keep on getting three errors when I run my code: ode_functions.c f:\ode_functions.c(41) : error C2296: '^' : illegal, left operand has type 'double' f:\ode_functions.c(41) : error C2297: … Software Development c | |
![]() | What's the best way to swap two arrays? Would it be better to copy each position into a new array and then assign the array a new name? Or would it be better to use pointers? What would the algorithm be if I were to use pointers or a dynamically … |
I've created simple WindowsApplication project with one additional windwos form named Form2. On default form I added button named button1. And added this code [CODE]using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Threading; namespace WindowsApplication1 { public partial class Form1 : Form { … Software Development | |
Hello, After having a list created from objects of a certain Class. I wish to sort the contents. How do I do this? This is my case: _bkgList = new ArrayList(); for(int i = 0; i<10; i++){ BookingResponse bkngRes = new BookingResponse(); bkngRes.setAwbNum(awbNum); bkngRes.setOrigin(origin); _bkgList.add(bkngRes); } As you can see, … Software Development java | |
Elo guys, i have trying to develop a client/server application! i'm new with sockets, so i'm trying to learn from existing source codes. I have come accros a piece of code: public static void main(String args[]) { // validate parameters: if (args.length != 2) { System.err.println("Usage: java GameClient <host> <friend_port>"); … Software Development client-server java open-source | |
I have another assignment for class that I am having some difficulties with. I seem to be able to write the program, except for the fact that it keeps looping over and over and I'm not quite sure how to stop this. Could anyone please help?? Thanks! This is the … Software Development c++ | |
I am trying to add values that I read from input file using fscanf. There are 15 float values that were read from .txt file. Im copying some of the code here [code=c] #define MAX 15 for (i = 0; i < MAX; i++) { fscanf(ifp, "%f", array[i].miles); } [/code] … Software Development c | |
im writing a personal program thats storing scores. The layout is done using Tkinter using labels buttons and entry widgets, however, because there are a lot of entry widgets needing created i just stuck their creation in a loop, [code] for m in range(1,10): self.input_score = Entry(frame,width=6) self.input_score.grid(column=5, row=m) [/code] … | |
![]() | I'm a little confused about empty arrays. I'm supposed to write code for a function of type boolean that returns whether an array is empty or not. This function is a part of a class called Sequence, and takes no parameters. Earlier in the code, I included a typedef so … Software Development c++ ![]() |
hey guys I need you help, I'm new comer in here but I hope this can help me. I'm writing a code that can read the file (such a story or newspaper) then the identifythe story if that story has a itemY in it the it will print +1 otherwise … | |
I am trying to write a function that will read one value of an array. I must prompt the user for an index and then read the its value. I am having a horrible time and need help. [code] // read_one_value(A, n) prompts the user for an index i and … Software Development c++ | |
Hey all, I am trying to display a message asking if the user is sure that they want to close just before closing. Here's what I've got...and it's only telling me that there's something wrong with the word "Message" after the MessageBox.Show part [code] Private Sub xExitButton_Click(ByVal sender As System.Object, … Software Development visual-basic | |
Hi everyone, Just started programming in Python and iI'm already starting to like this language very much. I have a problem with a program I wrote last night - I'm trying to ping a certain host using [CODE]os.popen("ping xxx.xxx.xxx.xxx"[/CODE] and then read the %errorlevel% from my system using [CODE]result = … Software Development python | |
Hi, I'm new to these forums. I've been working with java in school, but I can't stand the language. So I've been working with python and find it's very easy to understand, and I actually enjoy working with it. So just for fun I've been working on a pretty basic … Software Development python | |
i'm practicing my use of functions at the moment by writing a program to convert pounds to euros and vise versa but when i try calling the functions that do the converting i get a load of 'expected primary-expression' errors. what dose that actually mean because i'm not really sure … Software Development c++ | |
Hello, I am using a code to generate random numbers upto 32 char... The problem is that i want to display the 32 characters each randomly because the code is displaying the same char 32 times and i want to get the 32 chars generated randomly... The code is:- [code=c++]#include … Software Development c++ | |
works, allows entering a user selected amount of strings, however when i try to display, it displays only the last string, not the whole 'database', whatever you'd call it :) the main question is what is wrong and also, is there any way to not to ask a user to … Software Development c++ | |
Hello, The following is background on my assignment "Modify payroll program so that it uses a class to store and retrive the employee's name, hourly rate and the number of hours worked. Use a constructor to initialize the employee information, and a method within that class to calculate the weekly … Software Development java | |
Hi guys, I'm trying to use a nested for loop to change the first 'o' it finds while testing to an 's' and then exit the loop immediately after that. This is what I have, but it currently changes every second 'o' to 's' [code] for (int i = 0; … Software Development c++ | |
My code requires the validation of a string that starts with two letters and ends with six numbers. So, an example would be [B]br474897.[/B] This is what I got so far: [code] bool GetNID(char buf[]) { int i= 0; int length; bool valid = false; cin.getline(buf, 30); length = strlen(buf); … Software Development c++ | |
I can't identify the problem can somebody help me? [B][COLOR="Green"] objects.h (abstract base)[/COLOR][/B] [CODE=C++]#ifndef objects_h #define objects_h #include "colorScreen.h" #include "maincontrol.h" #include <ctime> #include <string> using namespace std; class objects { public: virtual ~objects(); virtual void print(const MainControl &inMain)const =0; protected: objects(); objects(const int& inX, const int& inY,const int&inScore); ... … Software Development c++ | |
hi all I'm trying to read a document char by char my question is how do I read the spaces as well? Thank you! Software Development c++ | |
I cannot figure out how to validate a string so that it accepts both uppercase and lowercase letters as in a name. Here is the code: [code] bool GetString(char buf[]) { int i; int length; bool valid; cin.getline(buf, 30); length = strlen(buf); for (i = 0; i < length; i++) … Software Development c++ | |
Hi, I was wondering if it's possible to call a function using a string that is the exact same as the name of the function. Here's an example in which I wanted to make 4 bitmap buttons using a for loop, and the event bound to each one would be … Software Development python | |
I have a problem with unsigned long long int's. I'll tried to do a function wich calculates the factors of an integer. It worked fine with int, but when an tried with unsigned long long int the % and <= operation failed... here is the surce code for the function … Software Development c | |
I'm having problem with this code. Here's what I'm trying to do. I want the user to enter the firstname, last name of the person whom he wants to delete from the phonebook. then I try to compare the data entered by user with the names already stored on phonebook. … | |
I have (in main()) something like: [CODE=C]int toChild[2], fromChild[2]; pid_t pid; //Creating pipes: if(pipe(toChild) != 0){ return 1; } if(pipe(fromChild) != 0){ return 1; } //Forking: if((pid = fork()) == -1) return 1; if(pid == 0) {/* CHILD */ close(toChild[1]); close(fromChild[0]); //create streams: (they are not used in this example) … Software Development c file-stream |
The End.