43,549 Solved Topics
Remove Filter ![]() | |
I just started to learn C++ after I have been programing in C. I use vim and the GNU compiler in terminal to create my programs. When I was working in C I made a generic one-file Makefile so I did have to write out all the tags/switches every time … Software Development c++ | |
My appologies if this has been answered before but I couldnt find a specific answer/response. Basically Im wondering how I would assure each random number is one that hasnt been produced already. In the program below Im trying to use the random number produced to act as a specific number … Software Development c++ | |
Hi I have a function dela ( ) and I want to call it by user (c) times, but I get an error. [COLOR="Red"]Traceback (most recent call last): File "C:/Python25/My programs/extra_b.py", line 21, in <module> for j in range (c): TypeError: range() integer end argument expected, got str.[/COLOR][code=python] if __name__ … Software Development python | |
I have problems with the map, in the below loop. [CODE] //iterator declared as "it" and map declared as "aMap" //key of a map declared as "key" while(true){ for(it = aMap.begin(); it != aMap.end(); it++){ //some processing if(//some condition){ //some processing aMap.erase(key); it--; } } //some processing //some conditions to … Software Development c++ | |
I have to call a function in the form f(void* params) I would like to pass two vector<double> to this function. I suppose I should make a struct struct MyParam_t { vector<double> myvector1; vector<double> myvector2; }; and then somehow fill it and pass it to the function. Someone recommended that … Software Development c++ | |
I am wondering how a "Managed vector" is declared. I have worked much with: std::vector<string> OneVector; How is the same declared for a Managed type ? What I am trying to do is to translate this to managed: [code] std::vector<string> OneVector; std::string Stuff = "Hello"; OneVector.push_back(Stuff); [/code] At the same … Software Development c++ | |
Hi Everyone , I have some doubts which i have encounteered when i was working on a project of mine, 1)I was wondering whether system("sky.exe") could have variables in it. can i use a string in the place of "sky.exe" something like this [code] string s; s="sky.exe"; system(s); [/CODE] 2) … Software Development c++ | |
This problem has been bugging me for the past few days. I've tried all sorts of different things to get it to work, studied my books, but nothing. It goes like this: Let's say I want my robot to recite the three laws of robotics. I can say, "Recite the … | |
For instance, if you have the following (random example): [code=Python]w = input("Enter width") h = input("Enter height") for x in range(0,w): for y in range(0,h): print x,y if (raw_input("Stop? y/n") == "y"): break[/code] That would only break out of the y loop. You could introduce another variable, and change the … Software Development python | |
Hey, I've been trying to work with wxwidgets so I can start learning GUI's, problem is, it seems like all their libraries are full of errors. I have a hard time believing that a self-respecting group of people would release, as stable, something that would take hours, if not days, … | |
Hi. I am totally new to python. I have a problem that I have been trying to solve without any form of solution. I have a group of files in Directory A that are named like: Text__###__TEXT___###.tif These are dummy files. The real files are in Directory B and are … Software Development file-system python | |
I just want a console to run. When I use this function, I don't ever want the automatic tk window to appear. How would I use this function without any gui? *Also on a side note, what is the python code tag? (python)is it this :P?(/python) | |
hi guys, it's been a while since i used c for anything so here goes a question tha may seem silly. I have 2 variable length arrays.... [code=c] int main() { int n = 5; int m = 6; int before[n][m]; int after[n][m]; array_function( 5, 6, before, after ); } … Software Development c | |
hi all! how can we list all directory as well as file(all hirerchical) in python script by giving the path as input Software Development python | |
I know that this is a simple one but never the less I forget how to do it. How do I create white spaces on my screen. Im writting in DEV-C++. I want my output to look something like this Name title pay Sam Uni student shit I know how … Software Development c++ | |
Hello, I have a question. I work in visual c++ in a document/view arhitecture (SDI application) and i draw some stuff with some opengl functions (cubes, cylinders) but when i hit the "New" menu from the File menu it doesn't erase or clear my drawing I don't know why. Can … Software Development c++ opengl visual-basic | |
Hello, I'm trying to use getch several times in my program, but it is remembering earlier key presses. Is there a function or command I can use to clear the getch buffer? Or am is there something else I am doing wrong? Thank you. C. Software Development c | |
hai. I'm trying to compile a program split up across multiple files. The code is far from complete, but I noticed lots of compiler warnings and errors. This ought to be due to splitting the code up: I thought the preprocessor simply copy and pasted the code into main.c when … Software Development c | |
I am reading a file that is about 20 Mb, this will take about 10 seconds. A few lines from this file look like below. The first value is a date value that go from lower to higher and the second value after the "Comma" is a number. In the … Software Development c++ | |
I have a Pong game with a level editor (as long as you have the source code) where you can put walls where you want. There are also walls that only balls hit by the player can pass through, walls that only balls hit by the Cpu can pass through, … Software Development java | |
I have a quick question that is been bugging me. [CODE]void swap(void *a, void *b) { void *tmp; tmp = a; a = b; b = tmp; }[/CODE] I wrote this intending it to be either able to swap a structure, or just the data defined within a structure. Will … Software Development c data-structure | |
Newbie question; How do I cast a text file to an array, after the file is read using StreamReader? I have read many threads, code etc but I really need my hand held here, I just dont get it (especially using windows forms)...this is part of an assignment.... I've been … Software Development file-system | |
Hey, I made i looked up toupper and made a little program out of it and have come to a little situation, When i enter the space character " " it does not output what i want and it just closes. [CODE=C++]#include <iostream> using namespace std; int main() { int … Software Development c++ | |
Hi people. I was just wondering if I can use _LINE_( by including some header file or so) in devc++ to get the source code line number or _TIMESTAMP_ to get the compile time timestamp. If not is there an alternative? I see compile time errors when I use them … Software Development c++ | |
I'm new to Swing, and still relatively new to Java as a whole, and am having trouble with my first Swing program. I'm trying to make a simple Pong game - it will display the title screen with a "Play" button on it that when pressed starts the game. Here … Software Development java java-swing | |
hi guyzz, i wanted to have two connection using access and mysql in my proj. my access was my main db connection and what ever data in my access will store directly in mysql db when their is internet connection... I declared 2 fuction connection but my problem is the … Software Development mysql visual-basic | |
Hey everyone. I've been working on a homework assignment to simulate a weather station responsible for recording hourly temps and reporting an average temp. I'm supposed to be passing an array to different functions to first get the temps and input them into the array. Then, compute the average temp … Software Development c++ | |
hi i am trying to make a function for calculating the commercial boat fee, so if a boat is commercial, the program will add additional fee to the total sum, and if its not it won't add anything to it. i got the function to run, but all i am … | |
I'm trying to work out what should be a simple composition example. For some reason I can't compile this project though. I get three errors when I try to compile. Errors listed below. Where am I going wrong? 1>c:\documents and settings\user\my documents\visual studio 2008\projects\name\name\ssn.h(5) : error C2011: 'SSN' : 'class' … Software Development c++ visual-studio | |
| |
I am readin a .txt file Line for Line and what I am interested to do is to identify that if the Line do contains any characters as Letters, text, symbols. Exceptions is things like: '\n' ' ' etc... so "" wont be possible here ? So I am trying … Software Development c++ | |
Hi, I wish to do the following things: a) Append the first three lines from the file "file1.txt" at the end of another file "file2.txt" b) Run a program "prog1.cpp" which uses the file file2.txt. c) Delete the three lines appended at the end of the file "file2.txt". and append … Software Development c++ | |
typedef struct iphdr { u_char ip_hl:4, /* header length */ ip_v:4; /* version */ u_char ip_tos; /* type of service */ short ip_len; /* total length */ u_short ip_id; /* identification */ short ip_off; /* fragment offset field */ #define IP_DF 0x4000 /* dont fragment flag */ #define IP_MF 0x2000 … | |
I have some questions, some might seem kind of dumb, but we're studying overloading operators and inheritance/polymorphing. I'm having trouble finding some references on some things to show me how to do this stuff or why I'm doing it a certain way. what kind/type of binary operators can I use … Software Development c++ | |
[CODE] #include<stdio.h> int main() { int i ,j ,a[5]; for(i=0;i<=4;i++) { printf("\n\tEnter the %dst value of the array: ", i+1); scanf("%d", &a[i]); } j = a[0]; printf("\n\tOriginal array entered by the user: "); for(i=0;i<=4;i++) { printf(" %d ", a[i]); if(a[i]<a[i+1]) { j = a[i+1]; } } printf("\n\n\tGreatest no. from the … Software Development c | |
I have developped a program using vb6 used by a college to store students scores in diferent courses. My problem is that i want to create a button users can use to search for a specific record using the students admission number. I do not have much knowlegde in finding … Software Development visual-basic | |
[COLOR="Green"]This case, [/COLOR] [CODE]case 18302: if (playerLevel[19] <= 1) { guard(); addSkillXP(19, 50); isNpc = true; updateRequired = true; appearanceUpdateRequired = true; else if (playerLevel[19] >= 1) { sendMessage("You need a shapeshifting level of 1 to do this."); } break;[/CODE] [COLOR="Green"]I made it by myself, and it gives 100 errors, … Software Development java | |
I am replacing 2 words in a textBox with this code. What happens is that the code scans the textBox and finds 2 words: "one" and "onefour". These two words [B]should [/B]be replaced with: [B]onefour[Calculate][Calculate2] one[Calculate][Calculate2][/B] But instead the replacement will look like below. I know why it happens because … Software Development c++ | |
Hi! :) I want to read each line in my file, and determine if each occuring page tag is included in the validPages array...I've gotten everything except when I retrieve a line with a page tag (readLines()), I can't use that line as a string to compare with my array...even … Software Development python | |
Hi all I am using Dev-C++ . I want , when I press Tab to skip a 3 blank places instead 6 . Thank you for your effort of reading . Software Development c | |
i'm trying to get random numbers in a loop like this [CODE=syntax]#include <stdio.h> #include <time.h> int getRand ( int a , int b ) { return a+rand()%(b-a+1); } int main() { srand ( time( NULL ) ) ; int i; for(i=0 ; i<6 ; i++) printf("%d\n",getRand(0,9)); return 0; }[/CODE] the … Software Development c | |
I've got an issue with lists right now. I've got 2 lists, Checker1 and Checker2, which check for the Ko rule in my game of Go. However, Checker2 should always be checking the board one turn behind Checker1, which checks the board every turn. That way, the Ko rule can … Software Development python | |
I have seen so many classes and inheritance programs but what I cant seem to know is when and why do u end up resorting in this statement [ICODE]#include "NameOfTheClass_h.h"[/ICODE] and I guessed that is when u have separated the class from class main(), that sounds like making your program … Software Development c++ | |
If we write a code like: a=['city','village','town','capital'] a1=len(a) a2=range(a1) for x in a2: a3=a[x] print a3 In this code if we want to store the value of a3 it would store last value always. But in any way can we store all the values? Software Development python | |
Hello, I am trying to install scipy on Ubuntu 8.0.4LTS, and am having some serious issues. I have succesfully downloaded and installed scipy, but when I try and "import scipy" in a program I am returned: ImportError Traceback (most recent call last) /home/tim/Desktop/scipy-0.6.0/<ipython console> in <module>() /home/tim/Desktop/scipy-0.6.0/scipy/__init__.py in <module>() 52 … | |
I got this code here, i wonder why it doesnt put in the file "in.dat" in the same folder. [CODE] #include <stdio.h> #include <stdlib.h> #define N 20 //Number of trials void main(void) { FILE * pFile; float data[N][2]; int i,j ; char overwrite; for(i=0;i <= N ; i++) /* Initinalize … Software Development c file-system | |
Hello I'd like to create a hover effect for JButtons, but i can't find it for the moment. It doesn't have to be antything spectacular, it just has to be visible. Thanks in advance. Greets, K?!. Software Development java | |
Hi all, I am in the process of creating a music library, and want to keep the different layers of implementation separate. My current plan, and understanding has my application divided up like this: 1. GUI Layer, talking to... 2. Music object (and implementation) Layer, talking to... 3. Data Storage … | |
Hi Everyone, I have a C++ program lesson, but i can't to do it. I have a binary file with structured datas. I have to read the datas, and take into a class (structure array). Here is my code: [CODE]#include <iostream> #include <fstream> using namespace std; struct dolgozo { char … Software Development c++ visual-basic | |
hi to everyone, In this semester we are having a class concerning High Performace computing / Parallel processing... In short i have the following questions: --- We are using pthreads and C. I think that i can use pthreads in c++ code but is there any way to use threads … Software Development c++ matrix-multiplication |
The End.