43,549 Solved Topics
Remove Filter ![]() | |
hey, I got a question regarding functions returning a linked list. Here's the data structure of my linked list (just in case it deviates from the standard way of doing it) [CODE] template <class T> class Link { private: unsigned int size; Link<T> *nextRow; Cell<T> *firstCell; public: Link(); ~Link(); //functions … Software Development c++ data-structure linked-list | |
Provided the following template: [code=cplusplus] template <class T> class MyTemplate { private: T myData; public: MyTemplate(const T &data) : myData(data) {} bool Contains(const T &); }; [/code] Is there a way to ensure at compile time that the argument T derives from another class? I want T to derive from … Software Development c++ linked-list | |
Hi All, As you've probably read a million times, I am a newbie to java programming and need some help with uni assignment. I need to know how to numerical update a Textarea by clicking on a button. This would be a lot simplier if I could do it one … Software Development java java-swing | |
I am an infant attempting to learn to crawl through Java. I have been learning for just over four weeks now, and have been doing relatively well. However, I am now on arrays, and find myself not only floundering, but drowning! My text seems extremely difficult to understand, and I … Software Development java | |
I'm a first semester CINT student and I'd like to add some "bling" to my final project. I want to add blinking text to my final forms clearform button. My code so far: [code]Private Sub orderForm_Load(ByVal sender As System.Object, ByVal e As _ System.EventArgs) Handles MyBase.Load 'disabling the animation on … Software Development vb.net | |
How do I have the algorithm below to sort my list in opposite direction (right to left) instead of left to right. Also, how do I make it sort simultaneously or alternatively in both directions? Thanks. [code=python] def bubblesort(l): for passes in range(len(l)-1, 0, -1): for index in range(passes): if … | |
hi I'm doing an exercise from a book, where I created a project called "Example.cs". When I wrote the code, here are the steps involve: 1. Select New Item. This causes the Add New Item dialog to be displayed. Select Code File and then change the name to Example.cs, 2.Next, … Software Development file-system ide | |
I am getting further with my Property to let program, but i need help working out the above error, it happens when the user selects the option to delete a property from the text file. The user is supposed to be able to enter in a number and that deletes … Software Development java | |
Is there anyway to compare lists or check to see how many of the objects in one list are the same as the other list? eg: L1 = [dog, cat, john, moo] L2 = [dog, cow, moo, stuff] there is two of the same "things" in it I'm trying to … Software Development python | |
Hi, Here's my code [code] #include<iostream> #include<fstream> #include<string.h> #include<math.h> #include<stdlib.h> #include<stdio.h> using namespace std; int cIndex(char *x,char **featlist,int len) { int i; for(i=0;i<len;i++) if(strcmp(x,featlist[i])==0) return i; } int main(int argc,char *argv[]) { std::ifstream featFile(argv[1],ios::in); std::ifstream trainFile(argv[2],ios::in); // std::ofstream svmFile(argv[3],ios::out); char line[20000]; char feat[100]; char **featlist; int i=0,len=0,fl=0,j; char* x; int … | |
hi,i m making a windows forms application and i want to make a treeview which displays input of textbox Under the Parent Node . i have tried searching over the internet,but nothing seems to be working. i have added the parent nodes from the properties tab,but how do i change … | |
[QUOTE]Hi I have an INSERT INTO SQL that keeps on retuning an Syntax error in Insert Into. I cant seam to see where the error is, can anyone Help. This is my SQL.[/QUOTE] [ICODE]Dim DesignSQL As String = "INSERT INTO Design_tbl (CustmrID,[User],Builder,Model,Type) values ('" & _ CustID & "', '" … Software Development vb.net | |
Plink is a command-line version of PuTTY, a Windows SSH client program. I am trying to get the output from plink to display in a textbox within a VB form. I can get it to work but I must hit the ENTER key twice before it shows anything, everytime. So … Software Development vb.net | |
how do I get the maximum, minimum and the average of an array? this may be different but how do I get to stop inputting number in an array. for example if the array is 20 and i only need 10 of them. i think its something about EOF but … Software Development c | |
Hi, Following code snippet show the maximum number of nodes to be created. I execute this code and show the count : 7874 My problem is that I want to create more node than 7874. I have compiled this code by Turboc version 3.0 on Windows XP. [CODE]#include <stdio.h> #include … Software Development c++ | |
hi everyone! I have two files, main.py and sprite_class.py. sprite_class.py is in a separate folder called lib. here's a quick diagram: ------------------------------------ /folder engine/ main.py /folder lib/ sprite_class.py ------------------------------------ ...sprite_class.py contains a class called Sprite: [CODE] # sprite class class Sprite(): def __init__( self, start_x, start_y, image_path ): self.x = … Software Development python | |
Hey everybody, I need a bit of help please. I need to create an 8086 application that will draw a line between two points on the screen that you click on. It's using Bresenham's line algorithm to do the calculations between the two points. I'm using Tasm and Tlink to … | |
Hey guys, How would I partially specilize a template in a manner as below? Is that even possible? I have these two functions: [code=cpp] bool node::read(const char *filename) { ifstream f(filename); if (!f.good()) return false; bool success = read(f); f.close(); return success; } bool node::write(const char *filename) { ofstream f(filename); … Software Development c++ | |
Well, I don't want to do lot of copy-paste in my code, so, I'm just wondering - is it possible to have two different names of one functions(I prefer that function name describe what is used for): ex: [CODE]int do_my_client(int info) { blah blah blah; .... .... return inf; } … Software Development c++ client-server | |
Hi there, I am having a problem with the following code: [CODE]#include <iostream> #include <string> #include <fstream> using namespace std; int findRows( string line ); int main() { string line; int rows = findRows( line ); cout << "Number of rows: " << rows << endl; } int findRows( string … Software Development c++ file-stream | |
Following is my client code....I am receiving data of equal size of JPG file... so if anyone can help me out with reading buffer properly and writing it in to jpg file at client side ================================================ do { memset(buffer,0x0,BUFFER_SIZE); // init line rc = read(sd, buffer, BUFFER_SIZE); if( rc > … Software Development c socket-programming | |
Hi, I am expected to use sscanf function in a program, but I couldn't understand how it works. Can you explain it with an easy example? Thanks -- newbiecoder Software Development c | |
I'm having a problem with the substr function. I want it to be dynamic in a for loop as follows: [code="perl"] for ($i = substr $bin, $sub, 1 ; $sub < $len2 ; $sub++){ [/code] You can probably guess what this code is meant to do. I want to read … Software Development perl | |
Hi, I've written a program that reads object information from an ASCII file (exported from 3dsmax) so that an object/objects can be reproduced in OpenGL. It works fine at the minute and can read multiple objects from a single file but what I want to be able to do is … | |
Hello everyone, first little explanation about what i want my program to do: i use wget to download a webpage but instead of downloading it into a file i want the webpage sourcecode in a variable so that i can parse it and put it in a database later. Now … Software Development c++ | |
Hi, I dont know much about programming, however I have a c++ program(i didnt write it) that I need to use it to do some experiments. When I compile the program I get this errror. [code] dynn.cpp: In function ‘void make_near()’: dynn.cpp:374: error: name lookup of ‘j’ changed for new … Software Development c++ | |
Hi, I have a question with ofstream, is there anyway to ask the user for a file name, then create the file, and write to it? Like: [CODE] string file; cout << "Enter filename:"; getline(cin, file); ofstream ofile; ofile.open(file); ofile << (stuff....); ofile.close; [/CODE] ...except that doesn't work properly.:S Thanks … Software Development c++ | |
I need to perform a sha-1 hash on a byte array. The byte array needs to be hashed with all combinations of a minimum of 4 bytes to a maximum of all 9 bytes of the following bytes: 00 01 02 03 04 05 06 07 08 So the following … Software Development | |
Hello, Im currently writing code for a program that translates a line of text from English into German then back again. Its a big loop that needs to be executed the same number of times as words in the text. I'm almost there but there doesn't seem to be anything … Software Development python | |
the code seems to be fine dont know why its not working. when i execute the same sql directly in database it works fine. the error is get is oledbexception was unhandled syntax error in from clause. please help me thanks is advance. Private Sub Button2_Click(ByVal sender As System.Object, ByVal … Software Development dataset open-source vb.net | |
I've gotten about 90% of this program done, but I can't seem to figure out how to do one last operation in it that is needed. What I'm having a hard time figuring out, is how to make a total for each person in the file? I'm sure it's deceptively … | |
I am new to Win32 API and am having trouble setting up the menu. Here is what I have at the moment (my new way of doing the main.cpp code is from another member) but I cannot understand where to put in the function call for the menu.. main.cpp [code] … Software Development api c gui windows-api | |
ok so i wanted to make a number randomiser like so: [CODE]#include <iostream> #include <windows.h> using namespace std; int main() { srand((unsigned)time(0)); int random_integer; for(int index=0; index<20; index++){ random_integer = (rand()%60)+1; MessageBox(NULL, "Random Number: ", "Bingo",MB_OK | MB_ICONINFORMATION); Sleep(2000); } return 0; } I want to put the randon_integer result … Software Development c++ | |
I have two files and I would like to call addition function from functions.cpp in main.cpp. But I get error: [COLOR="Red"]In function `int main()': error: `addition' has both `extern' and initializer error: initializer expression list treated as compound expression warning: left-hand operand of comma has no effect error: `addition' cannot … Software Development c++ | |
Hey everyone, I'm writing a program with a Tkinter GUI for my job and I was wondering whether there is a way to create an icon on my desktop to start it so I don't have to start Idle and run the program from that (computer un-savvy people will need … | |
Im writing this program that draws a bar graph showing an investment growth. and this error keeps coming up and i cant figure it out. this is the syntax that python keeps telling me. Traceback (most recent call last): File "C:\Python26\lala.py", line 68, in <module> main() File "C:\Python26\lala.py", line 47, … Software Development python | |
I am embedding Python 3.0.1 on Windows, using MSVC 2008 sp1. I do not pass FILE* structs to Python, so I think compiler version differences is not a problem. The following code has a problem, in that the "txt" string that comes out at the end only contains the character … Software Development python | |
Hey, I'm writing a function that searches for an id in an array of a structure, for some reason it returns -1 everytime, so I was just hoping another set of eyes could help me clarify this. [code=cplusplus] int searchAr(student studentar [], int size, int searchid) { int i; for(i … Software Development c++ | |
I am new to C++ and am trying to do this [CODE]void rolodex::createCard(){ char* userData = "\0"; cout << "\n\nEnter first Name - "; cin >> userData; currentCard.setFirstName(userData); cout << currentCard.getFirstName(); count++; } [/CODE] when I try to execute it gives me an unhandled exception, access violation error What am … Software Development c++ | |
I'm new to C++, and I have a function, [inlinecode]char* parse( char* buf, char* find_this )[/inlinecode] which finds an instance of [inlinecode]find_this[/inlinecode] inside of [inlinecode]buf[/inlinecode]. Once it finds that, it looks ahead in the [inlinecode]buf[/inlinecode] text, (which is actually JSON formatted) finds the value in the text, and it returns … | |
I'm trying to figure the topic out. To begin, lets say I have different sets of points in a file with the following format: 2 //1st number represents number of points within set 3, 4 //following lines are points 5, 6 3 3, 4 5, 6 6, 2 ..etc I … Software Development java | |
I am trying to execute this program, but I am getting errors this is the code [CODE] import java.util.*; public class DateUtils { static final int MILLS_IN_DAY = 24*60*60*1000; public static Date getCurrentDate() { GregorianCalendar currentDate = new GregorianCalendar(); currentDate.set(Calendar.HOUR,0); currentDate.set(Calendar.MINUTE,0); currentDate.set(Calendar.SECOND,0); return currentDate.getTime(); } public static Date createDate(int year, … Software Development java | |
Hi, I'm trying to write a code for Caesar Cipher, I don't seem to be able to get it right, I'm having no compiling errors, but there're some real logical errors, the encryption function is working fine, but I'm having troubles with the decryption. I'd love it if someone helps … Software Development c++ encryption | |
Hello, I need a little help for word multiplication, according to my notes, to multiply a word, we should put the multiplicand in AX, the multiplier in a register or memory variable and the result should appears in AX(low) and DX(high). The problem is how to get the product ? … Software Development assembly | |
Hello! I'm trying to swap some characters in this form, in Linux+NASM: abc -> cab -> bca -> abc I tried the following method [code] section .data string: db 'abc',10 strlen: equ $-string section .text global _start _start: mov ebx,1 add ebx,string mov string, [ebx] [/code] But it gives me … Software Development assembly | |
[URL="http://rapidshare.com/files/222099783/PAS.zip.html"]http://rapidshare.com/files/222099783/PAS.zip.html[/URL] Can somebody help me check y the system stated overflow when i process... Software Development visual-basic | |
So I am trying to create a mirror image that is horizontal. I am having trouble getting the actual image to mirror because I am not sure how to go about doing this. I am using PIL 1.1.6 and Python 2.5.4, if that matters. So far I have: [code=python] def … Software Development python | |
Hey guys, I have a class with a friend function and a member function with the same name. Calling the friend function from the member function gives me an error: it looks for <classname>::<function> while the friend function is of course simply <function>. In this case, MinGW GCC says: [code] … Software Development c++ | |
Just a quick question. No rush to answer, it is not important, I might discover it later myself, but just in case someone knows it: I have been trying to create a [URL="http://java.sun.com/javase/6/docs/api/java/lang/reflect/Method.html"]Method[/URL] object using this method: [URL="http://java.sun.com/javase/6/docs/api/java/lang/Class.html#getMethod(java.lang.String,%20java.lang.Class...)"]Class.getMethod(String name, Class<?>... parameterTypes)[/URL] like this: [CODE] obj.getClass().getMethod(methodName, Class.forName(methodType)) [/CODE] My problem is … | |
Hi I spent several hours yesterday trying to fix an error with one of my classes. I have a clas which handles all the resources of a game, and they are all declared as public. When a function of the same rseource class is called by another class, its meant … Software Development vb.net |
The End.