132,726 Archived Topics

Remove Filter
Member Avatar for
Member Avatar for meistrizy

Thanks in advance for your help. Ok...the last part of this program is where I am stuck. I am supposed to read data in from a file and sort by gender. But the output is supposed to read department, gender, first, last names, job title and salary -- then to …

Software Development c++ data-structure
Member Avatar for meistrizy
0
215
Member Avatar for hhilo2002

Hi all, I have been reading on the net searching for what others alternatives do i have besides singleton and i came across the following site:- [URL="http://www.bigroom.co.uk/blog/better-without-singletons"]http://www.bigroom.co.uk/blog/better-without-singletons[/URL] There is a paragraph stating:- [B]To accomplish this(singleton effect), create the class as a normal, non-singleton, class and enforce the single-instance only behaviour …

Software Development c++
Member Avatar for thoughtcoder
0
255
Member Avatar for sweetApple

Does anyone know of any open source libraries that provide a simple grid (2d matrix) structure- for simple game navigation? I am running into a lot of problems with the one I created for my ai project and it would be nice to have something reliable to work with. Thanks!

Software Development c++ open-source
Member Avatar for ArkM
0
115
Member Avatar for cherryduck

Hi everyone, I'm trying to create a simple Java game, The Last Space Invader, where you control the last space invader and the tank automatically tracks and shoots at you. The code for my invader is as follows: [CODE]import javax.swing.*; import java.awt.*; import java.io.*; import javax.imageio.*; import java.awt.event.*; public class …

Software Development java java-swing
Member Avatar for cherryduck
0
499
Member Avatar for namour84

can anyone help me with this program write in c++ a defintion of a complex class for complex numbers.Each object of this class will represent a complex number x+y*j storing the real part x and the imaginary part y as float in private section. Include a constructor, a destructor, access …

Software Development c c# c++
Member Avatar for ArkM
0
104
Member Avatar for harrykokil

hi guys.. i implemented a stopwatch and as i run my software, the stopwatch starts. what i want is to implement a method to start the stopwatch and another method to stop the stopwatch. can u give me an example of this please? thanks..

Software Development python
Member Avatar for harrykokil
0
1K
Member Avatar for k2k

hi, would someone please point out what is wrong with my ActionListener setup? [code] // in my menu class, parse JScrollPane and JTable to the showTable constructor in the ShowTable Class showTableMItem.addActionListener(new ShowTable(scrollPane, table)); [/code] [code] /* * set local JScrollerPane and JTable to be the JScrollPane and JTable from …

Software Development java java-swing
0
77
Member Avatar for neutralfox

Hello guys, I want to know if its possible to use the same socket to transfer two things at the same time. [code] // set up input stream for objects input = new BufferedReader(new InputStreamReader(clientsoc.getInputStream())); // set up output stream for objects output = new PrintWriter(new OutputStreamWriter(clientsoc.getOutputStream())); output.println(nickName + " …

Software Development file-stream java socket-programming
Member Avatar for neutralfox
0
175
Member Avatar for thehivetyrant

I'm struggling on how to do this. For example. [code] for i in range (1 ,100): if i % 3 == 2: print i, " mod ", 3, "= 2"[/code] i think i need to understand what this does more. Firstly what does % mean? [B]if i is the square …

Software Development python
Member Avatar for thehivetyrant
0
3K
Member Avatar for thehivetyrant

wow it's me again! i have: [code] i=0 while i<11: print i, print '' i=i+1[/code] this gives the answer: 0 1 2 3 4 5 6 7 8 9 10 i need to give the answer. * * * * * * * * * * * * * * …

Software Development python
Member Avatar for thehivetyrant
0
103
Member Avatar for abhi_elementx

hi. I get a NillpointerException. Here's my code: [CODE] private void Login_ButtonMouseClicked(java.awt.event.MouseEvent evt) { String usrname = uname_TextField.getText(); String pass = passwd_PasswordField.getText(); String pwrd = pass.toString(); String args[] = null; boolean auth_flag = false; try{ R = S.executeQuery("select uname, passwrd from Employee_Master;"); while(R.next()){ if(usrname.equals(R.getString("uname"))){ if(pwrd.equals(R.getString("passwrd"))){ this.dispose(); [B]args[0] = R.getString("uname")[/B]//causing nullpointerexception …

Software Development java java-swing
Member Avatar for BestJewSinceJC
0
115
Member Avatar for Prateek Parmar

hii i am new learner of java.. I just want to know that it is necessary to declare a default constructor if we are declaring parameterised constructor..

Software Development java
Member Avatar for verruckt24
0
92
Member Avatar for neutralfox

Hello friends, Got a new question, can someone explain to me how to put an HTML link in my Java program. Example ... "Click here to visit the developer website". So when someone will click on the link, the web page should automatically open in the browser. I searched on …

Software Development html-css java web-browser
Member Avatar for neutralfox
0
105
Member Avatar for FREEZX

Why am i getting a segmentation fault when i try to compile this code? [CODE=c++]#include <iostream> using namespace std; int main() { bool x; string odgovori; cin>>odgovori; int xd[2], rez=0, vkupno=0, odlen=odgovori.length(); xd[1]=1; for(int i=0; i<odlen; i++) { if(odgovori[i]=='O') { if((xd[1]==1)&&(x==false)) { rez=rez+1; x=true; } else{ xd[2]=xd[1]*2; rez=rez+xd[2]; xd[1]=xd[2]; } …

Software Development c++
Member Avatar for FREEZX
0
86
Member Avatar for f.ben.isaac

How good this code in terms of clarity, readability, and overall design? Easy to understand them or not? Note: i put system("pause") which is not recommended. cin.get() is a better one in case you didn't know. [B]First: Port Scanner[/B] [CODE]/**program description: * * this is a simple port scanner * …

Software Development c++ os-x
Member Avatar for cikara21
0
159
Member Avatar for queensrose

Hi guys! I've worked so hard on this really long program. I think I'll just post the relevant subprograms. I hope it's still easy to understand. This is just before the main function. [code] #include <iostream> #include <iomanip> #include <conio.h> #include <string> using namespace std; //function prototypes int cashier(); //generates …

Software Development c++
Member Avatar for unbeatable0
0
139
Member Avatar for jesseb07

hello, quick question regarding template classes and pointers. I'm making a linked list kind of container system, and I'm running into trouble with it when I (don't know if the terminology is 100% correct here) declare an instance of it. An example would be best to explain what's happening: I …

Software Development c++ data-structure linked-list
Member Avatar for jesseb07
0
6K
Member Avatar for nschessnerd

So im using this code to start a thread... [code=cplusplus] namespace Monitor4vc { public ref class Stats { public: Stats() { } ~Stats(){} void set(int prid, String ^url, String ^pst, String ^pth){ pid=prid; httpUrl=url; post=pst; path=pth; } void start(){ thread=_beginthread(OpenProc,0,NULL);//Error } private: ArrayList playing; ArrayList quitp; HANDLE thread; int pid; …

Software Development c++
Member Avatar for Ancient Dragon
0
136
Member Avatar for tasosa

Hi all; i have some problem with my code.. I want to read txt file which include : rectangle 0 0 1 1 orange rectangle 0 1 1 1 green rectangle 0 2 1 1 white rectangle 0 3 1 1 orange rectangle 0 4 1 1 white rectangle 0 …

Software Development c file-system
Member Avatar for jephthah
0
192
Member Avatar for Usura

Hey i have a weird problem when im trying to print out elements in my temp pointer array, at the bottom where im just using cout to print random indexs of temp, it will only work if i comment out temp[1]... anyone have any idea why? if its not commented …

Software Development c++ ios
Member Avatar for Clockowl
0
115
Member Avatar for uscuba2_2001

My exposure to arrays and pointers are bit limited. And concatened strings even less ( it was not covered in my class so I had to google it. ) So I know there are errors. I can not use any of C string libary functions. Thoughts? [code=c] #include <stdio.h> char …

Software Development c
Member Avatar for iamthwee
0
138
Member Avatar for harrykokil

how can i create 50 apples at different positions on screen without having to each time call the constructor 50 times? [icode] import Tkinter as tk from Tkinter import * import time class Apple(object): def __init__(self, a,b,c,d): self.rect = canvas.create_oval(a,b,c,d) root=tk.Tk() canvas = tk.Canvas(root, width=300, height=300, bg="#FFFFFF") canvas.pack() for x …

Software Development apple python tkinter
Member Avatar for lllllIllIlllI
0
150
Member Avatar for sciwizeh

Hello, I have a question, when does a global variable get destructed? ex. [code=c++]#include <iostream> using namespace std; class simple { public: int *i; simple(int ni){ i = new int(ni); } ~simple(){ delete i; } } simple simple1(10); //for simplicity no command line int main(){ cout<<*(simple.i) } [/code] when will …

Software Development c++
Member Avatar for ArkM
0
3K
Member Avatar for toko

Right now i am using the method where i put the picture in a picbox, then save it as a .bmp then use SystemParametersInfo function to set the picture. I do not like this because of one main reason: it takes huge amount of ram for a simple program such …

Software Development vb.net
Member Avatar for waynespangler
0
143
Member Avatar for iammfa

Hi all, what is the bug in the following code: [code=cplusplus] #include <iostream> #include <string> int main() { string str = "Hello World!" cout << str << endl; cout << float x = 5.0f * str << endl; int 65Num = 65; cout << "65Num = " << 65Num << …

Software Development c++
Member Avatar for stephen.id
0
140
Member Avatar for hurbano

i have my program doing what i want it to do untill it gets close to the end. the ouput that is transferred to the word document is not right. i have random charactes appearing before the "Date:". how can i fix this minor problem?? Thanks [code=cplusplus] #include <iostream> #include …

Software Development c++
Member Avatar for hurbano
0
168
Member Avatar for geek-girl

Hi, I'm pretty new to java and I'm not asking for anyone to do any coding for me. I just need pointing in the right direction. How do I go about printing out the objects of an array sorted alphabetically by name without altering the original array. I know I …

Software Development java
Member Avatar for BestJewSinceJC
0
165
Member Avatar for smsamrc

i have to do a java program to perform polynomial operations. i can manage those operations part. but i have a problem when storing the terms of the polynomial in to a linked list. for example when it is given polynomial("4 2 5 3 6 0"); // 4x^2+5x^3+6 may be …

Software Development java linked-list
Member Avatar for smsamrc
0
2K
Member Avatar for artemis_f

Hi I am beginning to learn wxPython a little with the "wxPython in Action" book but I haven't managed to figure out this one thing I really want to do and am hoping someone can help me. I want to do something like create an Ellipse to which I can …

Software Development python
Member Avatar for artemis_f
0
351
Member Avatar for cam875

Is this the best datatype to use for doing calculations for extremely large numbers such as computing pi . Or am I going to need to create my own algorithm for handling extremely large numbers? how does software like superpi handle such a large number, im assuming its all split …

Software Development algorithm c++
Member Avatar for cam875
0
99
Member Avatar for hhilo2002

Hi all, I am quite confused about the usage of both. Both of them seems to enable a variable to be shared consistently between classes. Is the following true? [B]Namespace[/B]-used for defining some constant values that you want to share in your application. [B]Static variable[/B]-used to maintain a consistent value …

Software Development c++
Member Avatar for Ancient Dragon
0
5K
Member Avatar for Matzbyy

Hi, so my problem is that when I write a program, and then try to debug it, there comes a error, on VC++ 6.0 there is "Cannot execute program" And in VC++ 2008 express edition it says, that there ain't the file I'm trying to debug. Here's the output; 1>------ …

Software Development c++
Member Avatar for Ancient Dragon
0
98
Member Avatar for want_to_code

1. [code] #include<stdio.h> int main() { int function(int); int t=function(1); printf("\tt=%d",t); t=function(2); printf("\tt=%d",t); t=function(3); printf("\tt=%d",t); return 0; } int function (int a) { int t; t = a<<2 + a; return t; } [/code] the output is t=8 t=32 t=96 i am not able to figure out why this is …

Software Development c
Member Avatar for Aia
0
174
Member Avatar for gretty

Hello I have just started learning programming & this problem is really stumping me. I have to do a syracuse sequence (explained below) & I know my code below is very wrong, (it needs to use for statements in there) but can you give me any advice on what to …

Software Development c++
Member Avatar for Shabtai
0
522
Member Avatar for paramu

I have a clarification, with my project I added a dataset ,is having dataset [xsd] file name- DataSet1 and datatable table name -datatable1, also it's having the fields "id,item" with my form I have coding Dim ds As New DataSet1 Dim t As DataTable = ds.Tables.Add("datatable2") t.Columns.Add("id", Type.GetType("System.Int32")) t.Columns.Add("Item", Type.GetType("System.String")) …

Software Development dataset vb.net
Member Avatar for paramu
0
311
Member Avatar for ganmo

Hello, I've written couple of overloaded operators in my file containing Set declarations. I want to use these operators within the declaration file. However it seems it isn't used. Instead it uses the standard operators. e.g. i have two overloaded operators say <= and == [code=cpp] bool Set::operator<=(const Set& b) …

Software Development c++
Member Avatar for ganmo
0
130
Member Avatar for kcomeby

Hello and first sorry for my very bad english. i have little knowledge about c and c++ but im trying to learn win32 programming with c++. its little hard and im very new at that. im trying to do very very simple thing: i have an main window, 1 button, …

Software Development api c++
Member Avatar for stephen.id
0
183
Member Avatar for mathueie

Hi I am using eclipse.I got error.I am using g++ complier. *.o : file not recognized: File format not recognized collect2: ld returned 1 exit status Please any one help me..[B][/B]

Software Development c++ file-system
Member Avatar for tux4life
0
5K
Member Avatar for Dextergaisie

Hello everyone, please i need your help very urgently. I am working on a data management application and am using the data control and the standard report system. The following is an example of data collected. Name Age Birthday ( Day/Month) , Gender Samuel 23 2/5 Male John 22 3/5 …

Software Development visual-basic
Member Avatar for vb5prgrmr
0
117
Member Avatar for serkan sendur

hi guys, i have a pocket pc application where i scan some barcodes, i want to stop scanning when i open a new form. do you have any ideas how to stop it?

Software Development
Member Avatar for Ramy Mahrous
0
171
Member Avatar for 1shadow1

Please can someone help me out on an issue that I ma having with delphi. Aim is to read an INI file then take certain values only and display them under listbox or memo. Lets say for an example my ini files looks like this [setup] Device = Sector= [set] …

Software Development delphi pascal
Member Avatar for FlamingClaw
0
118
Member Avatar for killhha

i was wondering if it would be possible to use a timer in pascal. like for instance you have 10 seconds to answer a question. iv been thinking and i cant figure out how to do it. does anyone know how?

Software Development pascal
Member Avatar for FlamingClaw
0
3K
Member Avatar for fadia

hi guys,, i've this homework that i have to submit tomorrow.. and unluckily I didn't know how to do it.. it says : Write a program that outputs "Al Eid Song" words.. "The five days of Al Eid" Use a [B]switch statement [/B]to display the following output for the 5 …

Software Development c++
Member Avatar for karthik.c
0
128
Member Avatar for metal_butterfly

I wrote a program which will send a message to multiple clients(i.e, broadcasting) that are connected to a server.Once when the client receives a message from the server ,the client should read a file in the server and display it in the client.The client which responds (i.e, client wants all …

Software Development c client-server
Member Avatar for metal_butterfly
0
112
Member Avatar for custurd12

my program won't even run so i must have missed something drastically but i don't see it.... anyway, Create a class called Factor that has a public method called calculateFactor. The method has two two arguments of type integer and checks whether the smaller of the two integers is a …

Software Development java
Member Avatar for stephen84s
0
148
Member Avatar for skhan23

All questions involve this portion of a program: [CODE] if (y>x and y<z)or(y<x and y>z): print("You have entered Condition 1") elif not(x!=y and y!=z): print ("You have entered Condition 2") else: print ("You have entered Condition 3")[/CODE] 1. If x = 10 and y = 10, what is the value …

Software Development python
Member Avatar for adam1122
0
102
Member Avatar for curly3top

Write a program that reads in an array of type int. Provide facility to either read this array from the key board or from a file, at the user's option. If the user chooses file input, the program should request a file name. You may assume that there are fewer …

Software Development c
Member Avatar for smeezekitty
0
154
Member Avatar for cam875

Im having a problem with the while loop in my code, if I change what X2 is being compared to to anything other than 0 it doesnt hit the while loop, I am hoping its just some weird mistake. Thanks in advance for any help. [CODE] X2 = 0.5; while …

Software Development c++
Member Avatar for cam875
0
107
Member Avatar for redmaverick

[CODE]public abstract class CircleShape { public double radius; public CircleShape(){} public CircleShape(double radius) { this.radius=radius; } public void setradius(double radius){ this.radius=radius; } public String toString() { return "radius"+ radius; } abstract String getDisplayText(); } [/CODE] [CODE]public class circle extends CircleShape{ private double area; public double area() { return radius*radius*3.14; } …

Software Development java
Member Avatar for BestJewSinceJC
0
2K
Member Avatar for Laik

I am going to make OS. And I need help with GUI...how to make an GUI ?...I am not on Windows so CreateWindowEx() doesn't exist.

Software Development c++ gui
Member Avatar for adam1122
0
127

The End.