43,549 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for kbullard516

Alright, I'm trying to import data from a text file into an array, the data represents different properties of buildings that are to be drawn on a panel. I have 3 classes, Building3 which represents an individual building, CityPanel3 which represents the panel that the buildings are drawn upon (also …

Software Development java java-swing
Member Avatar for hkansal
0
141
Member Avatar for jimjimjimz

Hi, I have built a text based adventure game. The last thing I have to do (this is for an assignment), is ask the user if they want to play again. So, I thought the code below would probably be the best way to do it, seeing as I don't …

Software Development c++
Member Avatar for jimjimjimz
0
136
Member Avatar for kelechi96

Ok I need to know how to set my class to read only the values after the = sign. Here's my class so far. [CODE] #include <iostream> #include <string> #include <fstream> using namespace std; class Config { int pos; string search; public: char * confname; void configsearch () { fstream …

Software Development c++
Member Avatar for kelechi96
0
170
Member Avatar for Rahul8389

hi friends , is there is any code to find root directory off a system

Software Development vb.net
Member Avatar for Teme64
0
109
Member Avatar for kn2790

Hi, Doing a project in vb.net whereby i have different levels of users accessing the system, i have established a connection with the database where all the info will be stored but got stuck when trying to retrieve the data.. i am using and oledb connection At the log-in form …

Software Development microsoft-access open-source vb.net
Member Avatar for Teme64
0
277
Member Avatar for Stefano Mtangoo

Hello all, I'm trying to link two files but I get error "multiple definition of `funny_words()' " I don't know what to do, as I'm new to C++. I'm reading PROGRAMMING IN C++ by P.B. Mahapatra and the topic is PREPROCESSOR. I have to learn how to Link headers, and …

Software Development c++
Member Avatar for Stefano Mtangoo
0
154
Member Avatar for onemanclapping

hi, I have to do a program that generates 'n' different combinations of 7 different numbers between 1 and 49, so I did this: [CODE]import java.util.*; public class Totoloto { public static void main(String[] args) { System.out.print("Quantas apostas?"); Scanner s = new Scanner(System.in); int n=s.nextInt(); int[][] apostas = geraApostas(n); for(int …

Software Development java
Member Avatar for onemanclapping
0
157
Member Avatar for amegahed3

Hi All, I'm a C++ beginner, and I face the following problem: There's a .txt file that has some number written successively in the 15th line of the file. Each number (that could be a one or 2 digits number) is separated by a space from the preceding and succeeding …

Software Development c++ file-system
Member Avatar for amegahed3
0
136
Member Avatar for lyvenice

[url]http://i198.photobucket.com/albums/aa158/runningstyle/02/ly.jpg?t=1240109941[/url] how do i go about writing a code to display the answer in a label?

Software Development display
Member Avatar for nmaillet
0
112
Member Avatar for handytxg

Hi guys, I have list of class contain list of another class. [code] MyMessages class { ID list <myPackets> Packets; } myPackets class { Seq Text } [/code] I need advice which one is the right way to set myMessages class?? [code] void set_myMessages(const int &ID, list <myPackets> Packets) [/code] …

Software Development c++
Member Avatar for handytxg
0
181
Member Avatar for jlanglopez

I'm writing a program that simulates road traffic, I have a vector of integers inside a structure, which is itself the elements of a vector. Everything works fine except the iterator i use to delete elements of the inbedded integer vector seems to be going out bound and then when …

Software Development c++
Member Avatar for jlanglopez
0
88
Member Avatar for lyvenice

how do i go about doing this in visual studio 2005. I am able to display in the label with only one text box information, but i want the label to display multiple text box information in same label This is what i use to display one textbox information in …

Software Development display visual-studio
Member Avatar for brainbox
0
2K
Member Avatar for daviddoria

Does anyone have a good 2 line summary of WHEN to use perl/python/bash/etc? To do easy-ish things, they can clearly all be used, but there is likely an ideology behind each that indicates WHEN/WHY to use them. For example, I use VB if I want easy GUI, c++ if I …

Software Development gui perl python
Member Avatar for leegeorg07
0
136
Member Avatar for rEhSi_123

Hello Guys! Need some help. I basically want to align my menu to center. I have tried the following: 1 . SetConsoleCursorPosition(); 2. gotoxy(); ....etc But none what so ever works..... Here is my code menu: [code=c++] void printMenu() { void Bottomline(char *text); void Headline(char *text); void EmptyLine(); int ans; …

Software Development c++
Member Avatar for rEhSi_123
0
118
Member Avatar for max.yevs

so i was trying to make a very simple counter (although not sure if that's what you call it) [code]import time a = 0 def main(): time.sleep(5) b = a + 1 print (b) del(a) a = b del(b) main() main()[/code] i know this is very unefficient and there is …

Software Development python
Member Avatar for max.yevs
0
137
Member Avatar for curtissumpter

I wrote this simple java program to test the repaint mechanism in Java for my Eclipse IDE (not that it works on XCode either). The repaint() mechanism is not repainting, it does not erase the code previous to it in the graphic. It should according to everything I've read. Help …

Software Development ide java java-swing
Member Avatar for toucan
0
3K
Member Avatar for Rohinir

Hi all, I have set CheckedListbox multicolumn property =true. I wants to add two columns in checklistbox first one will contain Groupname and second column will contain descr . How can i add items in these two columns ?

Software Development vb.net
Member Avatar for Teme64
0
3K
Member Avatar for Nawsheen

I am a begginer in vb.net. Actually i am having problems to do my homework. I will be posting both the question and my answer. [B]Question[/B] Create a small program that allows you to enter a number. If the number is greater than 100, you will see the "You win …

Software Development vb.net
Member Avatar for Nawsheen
0
125
Member Avatar for nimbusania

Hi, I'm having trouble with 'stringBuilder'. this the snippet of code: [CODE]using (StreamReader sr = new StreamReader("file.txt")) { word = sr.ReadLine(); listBox1.Items.Add(word.ToString()); label1.Text = word.Length.ToString(); StringBuilder sb = wr.GetStringBuilder(); [COLOR="Red"]sb.Remove(0,word.Length);[/COLOR] }[/CODE] it gives this error: "Index was out of range. Must be non-negative and less than the size of the …

Software Development
Member Avatar for thoughtcoder
0
138
Member Avatar for xXxWiredxXx

hi.. is it possible.. when i type a letter "S" all the records begins with "S" will be shown or highlighted? its like when you register in a website.. in choosing country section.. thanks

Software Development visual-basic
Member Avatar for xXxWiredxXx
0
51
Member Avatar for turbomen

Dear Sir, After finishing the 1st part, I still have many problem of the question. Program Student_millionaire; {$APPTYPE CONSOLE} { } uses SysUtils, OurCrt; Var User_Choice:Integer; Procedure ContestantsList; Begin WriteLn('1 pressed,listing all the contestants...'); ReadLn; End; Procedure Generate10finalists; Begin WriteLn('2 pressed,generating the 10 finalist''s numbers...'); ReadLn; End; Procedure UpdateFinalists; Begin …

Software Development pascal
Member Avatar for FlamingClaw
0
116
Member Avatar for anjaly grace

//This code works for turbo c++ //Solution for strongly connected components or Kosaraju's algorithm //for nitc students //I use this because there is no other way i know how to do post a //code. ///////code:- #include<iostream.h> //#include<math.h> #include<conio.h> //int time; //time=0; char color[10]; int s[10]; int f[10]; int nn; int …

Software Development algorithm c++
-1
87
Member Avatar for tivrfoa

Hi! I'm using IDLE. [CODE]Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> test = 1 >>> if test: print "ok" SyntaxError: invalid syntax (<pyshell#2>, line 2) >>> [/CODE] Does someone can help me? Thanks.

Software Development python
Member Avatar for tivrfoa
0
173
Member Avatar for max.yevs

i made another extremely simple script, but i've looked through all the random python commands(10.6) and can't figure out how can i write a nonunique random script? as in all the random numbers can be the same? like random.sample? say i have a list [1,2,3,4] and i want to pick …

Software Development python
Member Avatar for max.yevs
0
128
Member Avatar for max.yevs

yet another quick question... I wrote this at the end of a script [code]y = 1 n = 0 i = input("Again? Y/N: ") if i is 0: print ("Good bye!") exit if i is 1: execfile ("program2.py")[/code] now of course if i is 0, they won't be able to …

Software Development python
Member Avatar for adam1122
0
108
Member Avatar for txwooley

I am working on a function to find the slope of a line if given x1, y1 and x2, y2. Not too hard. But I need the results to be floating point not integers even though the x and y inputs are integers. I have : [code=python] def slope(x1, y1, …

Software Development python
Member Avatar for txwooley
0
134
Member Avatar for BruenorBH

I am trying to create radio buttons in Dev-C++ using C. I am new to Win32 API programming also. What I have done so far is create the main app window, added textboxes, check boxes and a few radio buttons. The only issue I have now is that You cannot …

Software Development api c c# c++ gui windows-api
Member Avatar for BruenorBH
0
316
Member Avatar for neutralfox

Hello everyone, I am currently learning assembly language and I am using MASM 615 but I don't like the interface, can someone recommend me a good assembler. The assembler should make the same work as MASM 615 . Which assembler is easy to use and have intellisense if possible. In …

Software Development assembly
Member Avatar for neutralfox
0
203
Member Avatar for ning2009

Hi, there I have the code (from Jice) using List below [CODE=syntax] targetlines=["*beam section,section=%s, elset=%s, material=%s", "%s", "%f, %f, %f"] resultlines=[targetlines[0] % (dResult['SEC'],section_type,mat_data), targetlines[1] % section_data, targetlines[2] % (math.sin(float(dResult['ANG'])*math.pi/180), math.cos(float(dResult['ANG'])*math.pi/180), 0)][/CODE] , which worked well However when I modified it to [CODE=syntax] targetlines=["*element,type=b31, elset=%s", "%s", "*beam section,section=%s, elset=%s, material=%s", "%s", …

Software Development python
Member Avatar for ning2009
0
96
Member Avatar for Mearah

Hey, is there somebody who tried to use pyOpenGL with wxPython? I want to have a GUI, where I have a frame integrated, that shows a 3D image computed by an OpenGL algorithm build in the PyOpenGL environment. Mearah

Software Development algorithm gui opengl python
Member Avatar for Mearah
0
683
Member Avatar for max.yevs

so i was trying to make a very simple counter (although not sure if that's what you call it) [code=python]import time a = 0 def main(): time.sleep(5) b = a + 1 print (b) del(a) a = b del(b) main() main()[/code] i know this is very unefficient and there is …

Software Development python
Member Avatar for adam1122
0
146
Member Avatar for k2k

hi, i have a JFrame... one menuBar placed on a JPanel.. and then two JPanel with different things (let me call them ActionPanelOne, and ActionPanelTwo). i put the JPanel (with JMenuBar) North of the JFrame, and menuIteam will call the 2 ActionPanel individually to come up. my problem is: Once …

Software Development java
Member Avatar for k2k
0
182
Member Avatar for txwooley

I have an assignment to: "Wrap this code in a function called compare(x, y). Call compare three times: one each where the first argument is less than, greater than, and equal to the second argument." So I came up with this: [code=syntax] def compare(x, y): if x < y: print …

Software Development python
Member Avatar for txwooley
0
111
Member Avatar for songweaver

Hey guys, I am working on a fraction program where you can add, divide, subtract, multiply, and divide and it uses addressing. Anyway I got it to work except when I added an error message if to make sure that the 2nd Numerator, 1st and 2nd Denominator are not zero. …

Software Development c++
Member Avatar for songweaver
0
90
Member Avatar for halfnode

[CODE=Cplusplus]#include "STDAFX.H" #include <iostream> #include <iomanip> #include <string> #include <fstream> #include <cstdlib> using namespace std; class Subject { private: string code; int cu; char pf; public: Subject(void); void setCode(string); void setCU(int); void setPF(char); }; class Student { private: string name; int count; int totalCU; Subject subjects[4]; public: Student(void); void setName(string); …

Software Development c++
Member Avatar for halfnode
0
196
Member Avatar for txwooley

I am trying to learn Python. I have browsed through a few tutorials and tried to follow them until they get too complex and I try to find another one to give a different perspective. I am currently trying (and very much enjoying) the very basic "How to Think Like …

Software Development python
Member Avatar for txwooley
0
105
Member Avatar for Bladtman242

Hi, which C# enviroment (i like to keep compiler, editer and debugger in the same program) can you guys recommend?

Software Development c c# c++
Member Avatar for Bladtman242
0
168
Member Avatar for scarebyte

Hi guys, I have a question concerning the following code I have written for a final project in an entry level C++ course. My task requires 3 level hierarchy (which i have) and use of polymorphism. The program works in this state, but I dont think I am actually exercising …

Software Development c++
Member Avatar for scarebyte
0
769
Member Avatar for ning2009

Hi, there Let me put my resource line and target lines here firstly resource line: 56 J=7224,164 SEC=CON450X450 ANG=45 target lines: *beam section,section=R, elset=CON450X45056,material=con2 0.45,0.45 0.707107,0.707107,0 I have a dictionary below (created using woooee's code) Frame_Section contains {'CON450X450': [['MAT', 'CONC2'], ['SH', 'R'], ['T', '.45,.45']], 'B400': [['MAT', 'CONC2'], ['SH', 'R'], ['T', …

Software Development python
Member Avatar for ning2009
0
213
Member Avatar for konczuras

Hello Everybody! I'm trying to catch the entering event (when the control becomes active in a form) of an hScrollBar. It would be used for an undo/redo process, and whenever I click on it, or just tabbing to it or anything else, the enter event won't fire. Anybody got some …

Software Development
Member Avatar for konczuras
0
83
Member Avatar for oracle123

Hi all, I am a newbie to C programming world. In my program I want to log information into a log file whose file name should be filename_date_time I am using following code to write information but need help in changing the file name from filename to filename_date_time. [CODE] #include …

Software Development c file-system
Member Avatar for jephthah
0
4K
Member Avatar for dulahdaglace

i want to read to a 2d-array from a file, but for some reason the file is not opening (at least thats what the output says) [code=cplusplus] #include <fstream> #include<string> #include <iostream> using namespace std; int main(){ string filename; cout<<"Please type the name of the file"; cin>>filename; fstream file(filename.c_str());//same result …

Software Development c++
Member Avatar for dulahdaglace
0
244
Member Avatar for want_to_code

[code=c] // a code which prints "hello world" #include<stdio.h> int main() { (&printf)("hello world"); return 0; } why does the above code work? #include<stdio.h> int main() { char str1[]="hello"; int j=762; char str2[]="hello"; if(str1==str2) printf("true %d\n",--j); else printf("\nfalse %d\n",j--); return 0; } [/code] //the above code prints "false 762", why? …

Software Development c
Member Avatar for Nick Evan
0
299
Member Avatar for Clockowl

Hey guys, How do you handle exceptions in your programs? For instance, I have this function: [code=cpp]bool load_file(const char *filepath, std::string &dest) throw (std::bad_alloc, std::runtime_error) { using namespace std; ifstream file; file.open(filepath, ios::binary); if (!file.good()) { throw runtime_error("Couldn't open the file"); } //get filesize in bytes from ifstream //seek end, …

Software Development c++ ios
Member Avatar for Clockowl
0
108
Member Avatar for neutralfox

Hello everyone, Actually I want to learn more about thread, can we have more than one "run" for thread in a program ? [code] package ignisftpv20; import javax.swing.JFileChooser; import java.io.*; import java.net.*; import javax.swing.JOptionPane; public class FTPClient extends javax.swing.JFrame implements Runnable { JFileChooser fileChooser = new JFileChooser(); File fileUpload; ObjectInputStream …

Software Development java java-swing
Member Avatar for BestJewSinceJC
0
264
Member Avatar for everard

I have two MFC Window Form. The main window will call the second window to process a necessary input then the result generated by the second window should appear in the main window's edit box. But the problem is I don't know how to do it. Does anyone knows how …

Software Development c++
Member Avatar for everard
0
95
Member Avatar for Merovingian

I need to execute the following SQL command from within VB: [CODE]CREATE LOGIN [rx] WITH PASSWORD=N'rx', DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF[/CODE] I've been trying to find info for days but everything always deals with updating tables etc If someone could show me the connection string and have to execute the statement …

Software Development sql vb.net
Member Avatar for Teme64
0
123
Member Avatar for lancevo3

Hey guys I need to copy multiple string arrays into one array to use to display output. I need to copy the name, addr, telephone, carinfo, payment array to the output array. How would I go about doing that. [code=cplusplus] #include <iostream> #include <iomanip> #include <fstream> using namespace std; void …

Software Development c++
Member Avatar for Ancient Dragon
0
111
Member Avatar for max.yevs

alright i know you're tired of explaining simple things to me, but i've looked around and really can't figure how to do this... i'm trying to write a simple python script like when you type in a number for n, and press enter, it finds n+2? i thought it will …

Software Development python
Member Avatar for jlm699
0
115
Member Avatar for TuX4020

Hi all, So I've got an assignment of creating a priority queue using a heap data structure. I've read lots of pages online about the heap data structure, but I keep coming up with questions. In my class, I got the impression that a heap was structured similarly to a …

Software Development c++ data-structure queue
Member Avatar for jrw0267
0
138

The End.