199,114 Archived Topics
Remove Filter ![]() | |
Im really confused, I had this recursive add function working but my teacher wants us to be able to use ++ instead of + 1... anyone know why im getting a segmentation fault on this, i feel like this is a really dumb mistake. [code=C] int add( int n, int … | |
I have two Windows forms. Form1 has a button which, when clicked on, opens up Form2 (which looks like a drop down/combobox type of control). Form2 is a grid of buttons that look like a telephone keypad. When one of these buttons is clicked on, Form2 closes and the text … | |
I am using OpenGL and i am trying to get this simple program to work, here is my code; [code=c++]void DrawScene ( void ) { glClear ( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); glMatrixMode ( GL_MODELVIEW ); glLoadIdentity ( ); //Triangle glPushMatrix ( ); glTranslatef ( -1.0f, 1.0f, 0.0f ); glBegin ( … | |
Hi What is require is to get the path of current working directory.I m working on windows-XP. Is any function avaliable in c/c++ i could find on net #include <unistd.h> char *getcwd(char *buf, size_t size); But not working i don't know why. Can u provide small code of how to … | |
I am trying to: [B]Implement an iterative Python function which returns the sum of the first n integers[/B] so far i have this: [code] i = 0 total = 0 def sum(n): while i <> n: total = total + 1; i = i + 1; return total [/code] then … | |
I am trying to implement a breadth first search tree. I need to be able to go up and down the tree, and on each layer there can be varying amounts of nodes on each one. My problem is I've never made a tree before, and i don't know how … | |
Hi, all its me again! Still stuck with the STL function usage. but this time face the sort function problems! here is my class: [CODE=C++] class A { public: A( const string& filename ) { ifstream file(filename.c_str()) ; string word; while( file >> word) { _word_list.push_back(word); } } StringIntVector topNWords(size_t … | |
Hi Im trying to display image binary data but its not working. I have the code below but on the line: newimage = System.Drawing.Image.FromStream(ms) i keep getting the error 'Parameter is not valid' [code] Dim obj As Byte() obj = StringToByteArray(ImageString) Dim ms As New MemoryStream(obj) Dim newimage As System.Drawing.Image … | |
[code=python]#!/usr/local/bin/python #Scott Landau #CS 380 #Assignment 1 Programming Portion in Python #Created - 4/6/09 #Last Edited - 4/7/09 #n is going to be equal to 4 for this queens problem. n = 4 #Assigning the empty list to initialState. initialState = [] #Making an allDirections list. allDirections = [[-1,0],[1,0],[0,-1],[0,1],[-1,-1],[-1,1],[1,-1],[1,1]] #declare … | |
I have a program to find the [B]Sin[/B] value of a given value(in radian) . It is working properly , but i want a better program or can u please give me a small explanation about my code . please ... in my program n=2; // what is this meaning … | |
I am pulling a name, address, phone number from a text file. The items are delimited with a comma. I pull them into a variable. How can I pull them in or parse them out? I'm not sure if this is a tuple or a list or what, but when … | |
What are and how do I use vectors ? I have read some tutorials on them but I don't understand fully how they work. | |
Hi everyone. Having some issues with my program I need to make for an assignment. There is a part that needs to be able to look for upper-case letters within a html tag ( which is located in a text file) It then has to say where in the file … | |
Hello, I developed an application in VC++ an now I want to compile it using GNU++ to be run on a ubuntu server (where I am actually trying tocompile it). After some syntax/usage corrections I get an error which I totally don't understand (and I don't have it in VC++, … | |
Stuck by another problem about the vector, map functions the topnwords function is to find the top n times words occurrence Here is my code: [CODE=c++] //stringvector is the type-- //typedef vector< pair < string, int > > StringIntVector; StringIntVector TextUtil::topNWords(size_t n) const { map<string, int> freq; for(size_t i=0; i<_word_list.size(); … | |
The following is a statement from a program on linked lists given to us in class. I do not understand why I have to add & for address when what is passed is a pointer which means it is passed by reference.: void CharNode::headInsert(CharNode* &head, char *d) { head = … | |
Hello everyone! I have a table with titles that have a link to delete the record. Clicking on the link, redirects the user from (members.php) to a page (delete.php )where it says that the title is deleted and the user can click another link to return to the table. The … | |
Hello. I am trying to write a doubly linked list that uses data from a class. I have this class that I would like to use... [code] #include <iostream> #include <string> using namespace std; class Book { private: int PubYear; //Variables string Title, Author, Genre, Publisher; public: Book( ){}; //Default … | |
hi, this is embarrassing, for whatever reason I am getting "Don't know how to make target driver.o" whenever i type make. There is only one file named "driver.cpp" in the directory that i have to compile. I am staring at tutorials and don't understand why this won't work. heres whats … | |
I am constructing some sort of a status bar which allows the user to update their status while in a social network. It consists of an entry field and a 'update' button beside it. What I hope to do is upon activation of the button 'update' the contents in status … | |
Having an issue where both my xml and xsl are parsing fine (when viewed in firefox) but when combined together, throw an error: Error loading stylesheet: Parsing an XSLT stylesheet failed. (I noticed a suimilar post but was reccommended by the system to start a new thread, as it was … | |
below is a method describes polynomial multiplication. all the insertTail() and insertFirst() are in the normal format of linked lists. can anyone please show me why it doesnt give me the right multiplication. [CODE] public static void mulpolynomial(String poly1, String poly2) { String[] pp1 = poly1.split(" "); String[] pp2 = … | |
Hi, all i have one assignment about using some of the STL to read from .txt file and count the words and find the topnwords etc. So i implement my class like that: [CODE=c++] class A { public: A( const string& filename ) { ifstream file( filename.c_str() ) ; string … | |
i am facing several problems.... first one is: how do i typedef a structure i've seen many ways to do it but im not quite sure which one is the right one. this is what i think how it goes (but dont know why it goes that way) [code=C] typedef … | |
Hello I have created a sucsessful prime number finder however I wish to retrive the start number from a file the last line shows how I tried to do this however it failed any solutions ? [code=C++]/* By Kelechi Nze My first prime project*/ #include <windows.h> #include <iostream> #include <fstream> … | |
Hi guys. Im doing an assignment, I am getting on ok with it but I am sadly really stuck at the moment. The part I am stuck on involves counting html tags in a text file. I have thought of a method of doing this but unfortunately I have no … | |
Hi everyone, A very specific question.. I've got a ConfigurationElement class that has some configuration elements. At the moment, the config is something like this.. [CODE]<Hello> <A name="blah" /> <B name="bleh" /> <C name="blih" /> </Hello>[/CODE] ..but I need to have only one of either B or C. So I … | |
Please tell me what do you think of the written code below, is it easy to follow? Does the code tells you what it does, or you have struggled realizing whats going on? and so on. Feel free to give suggestions, tips, advices and criticize! This will help me and … | |
Hi, I have a client application that communicates with other server modules residing on other machines. In client application, I need to know the IP address of the machine it is running on, so that it would communicate its IP to the server module(which could be separated from client by … | |
Hi, Does anyone know how to view the allegro library. I wanted to make some changes which can help my game. Thanks | |
What computer science books do you have in your shelf? Can you make a list? | |
How do i associate a particular information such as Picture or comments to a logged in User. I want to do it such that when a particular user is logged in, it displays his or her pictures or albums and comments associated with his account. but i dont seem to … | |
Going through one of my old .c file I have a line as follows: scanf("%i", &tside); I would like to convert it c++ code. Can someone show me how to do that? Sincerely, greg022549 | |
hi, i want to validate checkboxes where each checkbox has a different name 1.atleast one checkbox should be select. 2.not more than 4 checkboxes should be selected. can any one tell me how to validate this. | |
Can some suggest a good way to cleanup the HTML that is output when a perl script is run using the CGI module? I tried to install HTML::Tidy, but couldn't as i was missing libtidy. And I don't want to go through 700 lines of code and putting up loads … | |
1. Simple calculator - nothing fancy [code]/**program description: * * simple calculator written for beginners. * This program asks user to enter an arithmetic * expression that contains two numbers and one * operator. User will be given the result of the * calculation. Operators allowed to be used * … | |
Hi, I'm writing a small app in wxpython, on a linux box. I just want to display a graphic and play a short ogg when a gui button is clicked. Started out as a memory card game, now I just want to display the graphic and play a sound when … | |
Please give me the logic or a simple program to convert a Roman letter to Numeral . Please....... | |
Hi Im trying to submit a form , which holds another form tags inside (i must do it this way) the problem is that this doesn't work on IE, while it works perfect on Firefox the button seems to have no effect on the page... its like it is not … | |
Hi mates :) how are you? I hope everything is all-right.. ;) I have a small question, it is my HW to be honest here is the question: "Write a method that calculates the following equation: f(x) = 1 if x = 0,1 √ f(x-1) + √ f(x-2) if x … | |
I'm making a small web application in python. Transferring control from one python page to another can be done by form submit or onclick button.This happens at an event. But I'm searching for a functionality in python similar to 'server.transfer' in asp which is not event dependent. Please Help. | |
Hello, I'm working on a website and needed some help with my php. My website basically allows a user to register for an account then add a college course to their page through scheduler.php I have three sql scripts: accountInformation, course, and account_courses. I need account_courses to hold the two … | |
Hi all, I am getting result in an array from some webservice and i have created User Interface to see these results with each result have a check box with it. what i want to do is to insert only that record in DB that user will check in check … | |
Hi there, I am trying to implement a confirmation dialog box before deleting a record in a table that have. I created a MYSQL table called manager with columns: [B]Table manager[/B] [I]managerID firstName lastName Department[/I] I use a while loop to display the records of every manager in the database … | |
Hi all, i want to do pagination using jquery...I am not good in jquery but i would like to learn...so can u please send me the code... Thanx in advance | |
this simple cout statement and i do not know why. the outputs are mixed up and i get some random numbers i didnt even input.please help [code=cplusplus] #include <iostream> #include <string> using namespace std; int main() { string Pname, CEmployer; int age; cout<<"Patients Name:"<<endl; getline (cin, Pname); cout<<"Age:"<<endl; cin>>age; cout<<"Current … | |
Hi, I want to retrieve a key value for the option selected in the drop down box,and i also want to you to tell me how to use that key value [code=php]<select name="role" style="width: 145px">'; $result=selecttbl("ugname","ugroup"); while($nt=mysql_fetch_array($result)) { print'<option>'.$nt[ugname].''; print'</option>'; } print'</select></td>[/code] | |
I want to create a program that asks the user to enter two vector (size and direction), and calculates its addition through turning it into components (using OOP). here's what I've got so far (I don't know how to fix the errors), I'm not sure what's wrong/ to do next … | |
hi. this is my first post here, my name is jen, someone in my class told me about this site and how helpful all you guys are and im so lost i thought id come try and see if someone can help me understand :( i dont even know where … | |
Hi, I am only beginning C#, so bear with me. I have been given this program to write. This is the question: Write a C# application called WRITENUM that inputs a number between 0 and 2,000,000,000 inclusive and outputs that number in textual form, as we would say it or … |
The End.