132,726 Archived Topics
Remove Filter ![]() | |
Hello Everyone, I have a random number game program that I need to change to use a Class with a constructor. This is my first attempt at using these things, and the instructor hasn't been much help. I watched all of antiRTFM's videos up to video #37, but using constructors … | |
This code randomly generates 4 lottery tickets and prints them on seperate lines. The code works, but what if I wanted this to print for 100 lottery tickets? Is there a way to write this with less lines of codes? Would using a for loop work? [CODE] import java.util.Collections; import … Software Development java | |
Hi...I need to write dynamic menu... which will take all items from ini/cfg gile cfg file will look like that: [CODE] TEMPLATE_NAME=LEX UPDATE PL=Czesc to jest update. ENG=Hi this is uptade. TEMPLATE_NAME=WINDOWS ERROR PL=Blad ENG=Error! . etc . . [/CODE] Items will be read to dropdown menu called TEMPLATES.. I … Software Development c++ | |
I read an article about versatile webcam and I successfully worked it out. The thing is I can't save the image from the pictureBoxDisplay to SQL. Please I really need help on this. I'm converting the pictureBox into a byte array but there's an error in this line (line 123), … | |
Hello, I'm trying to open a URL wit the default browser in C++ using ShellExecute(), however I'm unable to do this, even using the example into the mocrosoft site. I'm not sure about what I'm missing. I have: [CODE] #include <windows.h> ... private: System::Void Go_home_LinkClicked(System::Object^ sender, System::Windows::Forms::LinkLabelLinkClickedEventArgs^ e) { ShellExecute(NULL, … Software Development c++ | |
write a program to read in a list of exam scores (integer percentage in the range 0 TO 100) and to output the total number of grades as well as the number of grades in each letter- grade category (90-100=A, 80-89=B, 70-79=C, 60-69=D and 0-59=F) and what percentage of the … Software Development java java-swing | |
It's only reading every other line. It's supposed to print out: 28 80.0 22 1 2 2 3 1 3 But it's only reading: 80.0 1 2 1 [CODE]//Load button - #=daynum, $=wallet, @=inventory, &=employees, !=customers if (btn2.getText().equals("Load")){ int id=0; File file = new File("savefile1.txt"); BufferedReader reader = null; try … Software Development java | |
Now i am doing the split after Readline method. But, my coding always got problem. Hope someone can help me... Here is my coding [CODE] file = new StreamReader(fileOpen.FileName); StringBuilder sb = new StringBuilder(); while ((line = file.ReadLine()) != null) { //MessageBox.Show(line,"TEST"); //textBox7.Text = line; sb.AppendLine(line); } textBox7.Text = sb.ToString(); … Software Development | |
Hi All I am new to XSLT development and have stuck at simple but essential point. I want to remove the content which is in between two specific comment tag <!--E-->Text which need to remove<!--/E--> I do try with the given below code [CODE]<xsl:template match="comment()"> <xsl:text disable-output-escaping="yes"><</xsl:text><xsl:value-of select="."><xsl:text disable-output-escaping="yes">></xsl:text> </xsl:template> … Software Development xml | |
Hi all, I'm using a vector to store x,y,z values for objects to be draw using OpenGL. I manipulate my vector in a function and then pass it to the method which uses it to draw objects. Basically the value at an element is supposed to be '-2' but if … | |
anybody know how to load 1 column data from accessdatabase into combobox item...i mean, i have 1 table " info_table and 1 column "product..so in product column have data like nokia and sony"..i want nokia and sony to be load into combobox item or dropdownlist...anybody help me... Software Development vb.net | |
Hi, When we define any integer array like int a[3]={1,2,3}; then it will assign the values as a[0]=1, a[1]=2, and a[2]=3 But, when we define any character array as char a[3]={'a','b'}; then compiler here automatically consider '\0' null character to represent the end of the string So, my question here … Software Development c | |
How can i rewrite set::inser() function,using a vector::insert() : [code] class Set { std::vector<T> set; public: void insert(const T& t) { set.insert(set.end(), t); } [/code] I tried to insert them at the end,but it wont work corectly. Software Development c++ | |
hi im having errors with listview binding navigation specifically in last >> and first << here's my code [CODE] Dim inc As Integer Dim MaxRows As Integer Dim dr As DataRow Dim ds As DataSet Public Sub navigaterecords() txtMed_ID.Text = ListView1.Items(inc).SubItems(0).Text txtMed_name.Text = ListView1.Items(inc).SubItems(1).Text txtfname.Text = ListView1.Items(inc).SubItems(2).Text txtMname.Text = ListView1.Items(inc).SubItems(3).Text … | |
[COLOR="Red"][B]The flowchart is on the attachment. Please check it out[/B][/COLOR] [COLOR="Red"][B]I also get this error: error: cannot convert `__gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >' to `char' in assignment|[/B][/COLOR] [CODE]/*************************************************** The following program will take user's input and check whether it is in the following language: <S> ---> a <B> | … | |
Hmmm... I'm trying to call a class and it doesn't work and i get this error /home/XXXX/Desktop/language/main.cpp|13|error: expected constructor, destructor, or type conversion before ‘.’ token| The syntax is: [CODE] print.base="print"; [/CODE] this simple method call returns an error. Am i really doing something wrong, seeing as i've already looked … Software Development c++ | |
Hi. I would like to achieve an effect similar to how strings in between the quotation marks in Visual C# are colored. I would like to italicize the text for anything between two asterisks (Including the asterisks themselves) inside a RichTextBox. For example: This is not counted [I]*This is counted*[/I] … Software Development | |
[CODE]#include <iostream> #include <cmath> #include <iomanip> using namespace std; int divides(int,int); int main () { int count = 10; //int prime = divides(count); int p = 0; // number of primes cout.setf(ios::fixed,ios::floatfield); cout << setw(6) << "NUMBER" << "\t" << setw(8) << "DIVISORS" << endl << endl; while (count<=50) { … | |
Hi, I'm just learning to program and I'm stuck on a basic problem, printing today's date in a form typified by (e.g.) 28 February 2011 [CODE]import java.util.*; class Date { int day, month, year; } class PrintToday { static Date thisDay() { Date today = new Date(); GregorianCalendar c = … Software Development java | |
[url]http://www.boost.org/doc/libs/1_46_0/libs/smart_ptr/shared_ptr.htm#ThreadSafety[/url] This section somewhat confused me, in my code I have a matrix of shared_ptr's pointing to an entirely thread-safe class. But the shared_ptr documentation says it is only as thread-safe as the built-in C++ types. Does this mean that if I read/write to my thread-safe class using shared_ptr's at … Software Development c++ | |
I really appreciate all the help i've been getting on my project lately from you guys, and hopefully this will be the last problem. I've written an applet, and it uses ActionListener to detect when the button is pressed. The program is [I]supposed[/I] to go through my methods when the … Software Development java | |
Hi, is here any other issues then readability between two functions below? [CODE] void getNames(int) { .... } void getnames(int meaningfullName) { static_cast<void>(meaningfullName); ... } [/CODE] Software Development c++ | |
I've tried every way I can possibly see to try and convert the value from the numctrl to a decimal but the problem lies with the retrieved value being a float. I cant covert the float to a string first because it looses the trailing 0 in values such as … Software Development python | |
Good Afternoon, Can someone help me with this program which is an assignment for a class. I'm new to C++ its my fist course in computer science. The assignment details are: 1. The function removeAt of the class arrayListType removes an element from the list by shifting the elements of … Software Development c++ | |
Hi Guys, I am trying to make a simple connection from my desktop(local computer) with Oracle 11g which is installed on windows server 2008 R2.Now I have problems with the ConnectionString. could you please let me know how I set a correct connection String while I have parameters like these: … Software Development oracle windows-server | |
I want to add a series of buttons, but I don't know what it is called, which makes it difficult to look into. In my scenario, I want a list of four buttons. Each button has an on or an off status (pressed or unpressed). The user would be able … Software Development | |
I binded data to a combobox using a dataset. [CODE] companycb.DisplayMember = "company"; companycb.ValueMember = "visitorVisitID"; companycb.DataSource = ds.Tables["tblVisitorVisit"];[/CODE] I need to remove the duplicate values from the combobox. Is there any other way instead of doing it using an SQL Distinct query? Software Development dataset | |
I have made a small example to illustrate my problem. I have overwritten the createToolTip method for a custom JComponent (eventually it will depend on where abouts the mouse is in the component as to what text to bring up) At first I thought it wasn't being called, but i … Software Development java java-swing | |
Hey guys! I am working on a project using single linked list and currently on the last task which is overloading the += operator. My merge from a+=b is inefficient because I am having a memory link problem and its slow when it used in list size of 100000. Please … Software Development c++ linked-list | |
will find number which is used frequently(often) in x array [CODE]int i; int x[i],frequency[i]; for(int i=0;i<3;i++) { cin>>x[i]; frequency[i]=0; } frequency[i]=0; for(int i=0;i<3;i++) { frequency[i]++; cout<<x[i]; } frequency[i]++; cout<<x[i]; cout<<frequency[i]; [/CODE] what should I do extra Software Development c++ | |
Hello, I have to finish my assignment. I have different console exercises. I can solve it. but I have to combine them so that they will execute one after another. I do not know how to do that. in my exercise, I make one program to declare class and other … Software Development | |
I'm trying to make a program where it displays the users name based on what they entered. For example if the user enters: John Average User the output would display User, John A. And if the user enters John A. User the program would output User, John A. The problem … | |
Hi Guys, I was wondering how one would write a C program that calculates the value of a cosine function without using any library functions from <math.h> I need the outputs to turn out like this Case 1: cos(-1.000) = 0.540302303792 Case 2: cos(1.000) = 0.540302303792 Case 3: cos(1.500) = … Software Development c | |
compiler gcc4.5 minGW OS : windows xp sp3 I try something like this [code] template<typename T, typename U> class fastRowSum { public : fastRowSum(); typedef void result_type; //what is this line for? template<typename inputItr, typename outputItr> void operator() (T const VALUE, inputItr ref, outputItr out) { error = VALUE > … Software Development c++ | |
i need help on my project 1. Write a program that will print out statistics for eight coin tosses. The user will input either an “h” for heads or a “t” for tails for the eight tosses. The program will then print out the total number and percentages of heads … Software Development java | |
hello everyone,i need to make an encryption/decryption program and I'm almost finished, the problem is when i tried to add some gui an error about throwing exception keeps showing.. this is the code without the gui and it works just fine because the [B]throws Exception[/B] is in the main.. [CODE] … Software Development algorithm api encryption gui java java-swing | |
SORRY FOR THE NOOB QUESTION, but until some time ago (1 or 2 weeks) all my programs we comand-line, so I didn't have to... build them(?) But some days ago, i decided to create a program with GUI, and I used QT creator for that. Now My program is finished, … | |
Ok I have another homework problem. Essentially I am to make a text file of randomized characters ( leters bothe upper and lower case, numbers, spaces and specialized characters) and import it as a string into my program. From there I am to make all lowercase letters uppercase. I think … Software Development java | |
I have been using a [icode]Image<Node>[/icode] as the main object to store the data for my program. It is a 2D grid of Node objects. The nodes have properties like [icode]bool Visited[/icode], [icode] float Priority[/icode], etc. I often want to modify these nodes, put some of them in a vector … Software Development c++ | |
I have saved a 2D matrix in a numpy file (.npy) in python. Is there a way I can access the same from C++ and possibly read in the values in a stl vector? [URL="http://www.scipy.org/C++_Extensions_that_use_NumPy_arrays"]This [/URL] is vaguely relevant. But here you make the call from python. I want to … | |
Hello:) I can change background colour on my existing form like this: [CODE]this.BackColor = System.Drawing.Color.Green;[/CODE] or like this [CODE]ActiveForm.BackColor = System.Drawing.Color.Green;[/CODE] But I have another form called CustomerData What I want to know is how I go about using a button click event on the first form to change the … Software Development | |
Hey, i trying to list out all the items after i split it in text box. But, the output always list items in wrong way. Can someone help me? For example: the output i want to print in the textbox is like this 1 2 3 4 5 but it … Software Development | |
hi. I was trying to choose data from the combobox then When I choose something.. it will also generate the other data into the textbox. I just wanted to choose a STUD_ID in the combobox and the fname and the lname should show in the textbox. actually.. I just did … Software Development dataset open-source | |
hello, I'm fairly new to programming in general, and i'm having some trouble figuring out how to use a stack and queue to check to see if a word or certain order of numbers/letters form a palindrome or not. My logic is to read in the original string, push/pop characters … | |
Hi all, I have written a balanced binary search tree as part of an assignment (make a simple Spell Checker). Each node has, among other values, two height ints, leftHeight and rightHeight, to keep track of the heights of any subtrees. My problem is that after a rotation, the heights … Software Development c++ | |
[CODE]#include<stdio.h> #include<string.h> #include<conio.h> struct menuItemType { char menuItem[15]; double menuPrice; } menuList[]= {"Plain Egg",2.50, "Bacon and Egg",3.45, "Muffin",2.20, "French Toast",2.95, "Fruit Basket",3.45, "Cereal",0.70, "Coffee",1.50, "Tea",1.80 },order[10]; void getData(struct menuItemType[],struct menuItemType[],int*); void showMenu(struct menuItemType[],int); void printCheck(struct menuItemType[],int ); int main() { int items = 0; printf("Welcome to HiFi's Restaurant\n"); printf("\n"); printf("******* … Software Development c data-structure | |
Hi, Just a form where I want to put a default value for a combobox: private sub form_load() me.combobox1.defaultvalue = 3 end sub The property defaultvalue is giving an error, 'method or data member not found'. what do you think? Software Development visual-basic | |
I'm supposed to write this c++ that take in 01 and on. for example: 01010101 but not 0,1,10,011,110. Can someone help me figure out what I need to do to fix the problem. [CODE]#include <iostream> #include<stdlib.h> // for the exit(1) function using namespace std; char text[300]; char ToBeChecked; char lexical(); … Software Development c++ | |
[CODE] #include<iostream> #include<vector> #include<string> using namespace std; struct Item{ string itemName; double cost; }; class User{ public: User() : itemList(0) {}; User(string a, string b) : fN(a), lN(b) {}; void addItem(Item a) {itemList.push_back(a);} vector<Item> getItems() const {return itemList;} void printUserInfo(); private: string fN; string lN; vector<Item> itemList; }; class Convention{ … Software Development c++ | |
Please i need help in leap year. My problem is, all of the month has a date of 1-31, except for feb. after i choose feb, as my month ( i'm using combo box ) , it removes the date from 29-31, and if i choose a leap year, it … Software Development vb.net |
The End.