43,549 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for Bobon

Hey lads, I have a small problem re inheritance. The 1st piece of code is the superclass which contains hour and minute. The 2nd piece of code which is the subclass, contains the int second. The 2nd piece inherits the code from the 1st piece. Now when seconds go over …

Software Development java
Member Avatar for Bobon
0
74
Member Avatar for musikluver4

[code] import java.io.*; public class SortDoubleArray { public static void main(String[] args) throws IOException { double[] doubleValue = new double[10]; Input(doubleValue); ascendingSort(doubleValue, doubleValue.length); descendingSort(doubleValue, doubleValue.length); } public static void Input(double[] array) throws IOException { BufferedReader dataIn = new BufferedReader (new InputStreamReader(System.in)); String[] numbers = {"first", "second", "third", "fourth", "fifth", "sixth", …

Software Development java
Member Avatar for litchi
0
224
Member Avatar for asmhelp

Hello, I'm having a problem trying to trying to store a local variable in my asm program. I push 3 parameters: nbrElts (number of elements in the array), nbrArray (the address of the array), and result1 (the average). I'm trying to divide by the number of elements that I push …

Software Development assembly storage
Member Avatar for asmhelp
0
169
Member Avatar for Krzysztow

Hello everyone, I have a problem and almost found a solution, for example this: [url]http://www.parashift.com/c++-faq-lite/multiple-inheritance.html[/url]. However in my case I cannot solve it in a proposed way and will explain it shortly why... So basically, I have a BaseView, that derives from QWidget like this: [code=c] class BaseView: public QWidget …

Software Development c++
Member Avatar for Krzysztow
0
86
Member Avatar for Pynolathgeen

I'm programming my own game at the moment, its connecting to a server and the server sends some spawn info and eventual other players who are connected. When a player moves, and an other player is also connected, the client of Player2 crashes. I don't know what is causing this, …

Software Development c++ client-server
Member Avatar for Pynolathgeen
0
115
Member Avatar for mjacqu3

I'm new to Assembly and trying to write a program that requires a simple graphic display: a 10x10 grid of "|##|" . I need to make changes to it and redisplay it every so often. I can get it to display perfectly once but the second time I call the …

Software Development assembly
Member Avatar for mjacqu3
0
135
Member Avatar for dondajr

Hi guy, i have this little program: [CODE] #include <stdio.h> #include <stdlib.h> #include <time.h> #include <string.h> #include <unistd.h> //Obtem o nome do buffer de trade baseado na hora char *btfile() { char *fname; fname = malloc(14); time_t t = time(NULL); struct tm *lt; lt = localtime(&t); strftime(fname, 14, "%m%d%H%M.tbf", lt); …

Software Development c motherboards-cpu-ram
Member Avatar for dondajr
0
147
Member Avatar for SasseMan

Hi, I have really weird layout problem. I have a class VerticalGridPanel, which uses GridBagLayout to place components top to bottom, left to right, nothing special. Then I have a List of components, which i want to add a part of to a VerticalGridPanel. I then want to add another …

Software Development java
Member Avatar for SasseMan
0
291
Member Avatar for lrolsto1

I habitually compile after every change I make, i had all of 5 minutes to start a project and this will not compile!!: [CODE] public class Battleship{ public static void main(String[] args){ int boardInput = parseInt(args[0]); } }[/CODE] I get this error: Battleship.java:19: cannot find symbol symbol : method parseInt(java.lang.String) …

Software Development java
Member Avatar for lrolsto1
0
123
Member Avatar for DanielaCrisan

[code] private void button1_Click(object sender, EventArgs e) { n = Convert.ToInt32(textBox1.Text); for (; i < n; i = i + 2) { textBox2.Text = textBox2.Text + " " + Convert.ToString(i); ; } } [/code] I an mentioning that i,n=0; is located in the declarations zone of InitializeComponent(); I get the …

Software Development c c# c++
Member Avatar for Diamonddrake
0
151
Member Avatar for oggiemc

Can someone please tell me what im doing wrong in this program..im gettin a compiler error saying: C:\Dev-Cpp\projects\proto.cpp In function `int main(int, char**)': 46 C:\Dev-Cpp\projects\proto.cpp a function-definition is not allowed here before '{' token 46 C:\Dev-Cpp\projects\proto.cpp expected `,' or `;' before '{' token C:\Dev-Cpp\projects\Makefile.win [Build Error] [proto.o] Error 1 The …

Software Development c
Member Avatar for oggiemc
0
125
Member Avatar for Accendo

This program I thought was working fine. It reads something I type in then it's supposed to break up the words (or random letters) separated by a " " and pop them into array [B]arr[/B]. It works, well sometimes... I don't know what's stopping it and them other times allowing …

Software Development java java-swing
Member Avatar for Accendo
0
171
Member Avatar for sachintha81

People, I need help with this problem. I have a string like the following. [CODE]<JDF ID="n20090409EQ0001" Type="Product" JobID="000004-01" xmlns="http://www.CIP4.org/JDFSchema_1_1" Status="Waiting" Version="1.3" xsi:type="Product" JobPartID="B30" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:scr="htt://new.scr.url/abc" Activation="Active".......[/CODE] It continues like that. From it, I need to extract ALL the occurrences which start with "xmlns:" For example, you have these three tags …

Software Development
Member Avatar for fesmaeili
1
167
Member Avatar for Lolalola

Hi, i have error in line: "student.Add(info);" Error 1 Use of unassigned local variable 'info' [code="C#"] public struct Students { public string Name; public int ID; public string Date; }; static void Main(string[] args) { ArrayList student = new ArrayList(); Students info; info.Name = "Marko"; info.ID = 12; student.Add(info); foreach …

Software Development
Member Avatar for Lolalola
0
66
Member Avatar for checho

i have the next string array {10100100, 11010000, 01000001, 11011000, 00000000, 10111100} how can i convert it to byte[]. i tried bitconverter and some encoding options it didnt work. Any ideas?

Software Development
Member Avatar for checho
0
158
Member Avatar for David22

Hey guys. Can anybody tell me what is wrong with this line of SQL? I keep getting a syntax error message. Here is the line: [CODE]prepStat = connection.prepareStatement("INSERT INTO WeatherHistory (Date, Location, Overview, Temperature, WindDirection, WindSpeed, Pressure) VALUES ('"+date+"','"+location+"','"+temp+"','"+windDir+"','"+windSpd+"','"+pressure+"')");[/CODE] All the field names and variables exist correctly, so I really …

Software Development java sql
Member Avatar for csjbot
0
99
Member Avatar for PierlucSS

I've been working on something with alot of iteration (foreach) and now that everything is working I'd like to optimize it by changing it to link. Currently I am trying to translate this foreach code to LINQ [CODE] int count = 0; foreach( string file in Directory.GetFiles( path )) { …

Software Development asp.net xml
Member Avatar for PierlucSS
0
145
Member Avatar for ganesanronaldo

hey guys... Thanks for your help in my previous post. Havin another problem in my stack assignment this time.. Have done how much i could but there is a lil error in it.. Possible in the [B]convertip[/B] function... Hope i can get the help needed.. Thanks in advance...=) [CODE]#include <stdio.h> …

Software Development c
Member Avatar for ganesanronaldo
0
146
Member Avatar for charlieruns

To be honest...I am horrible at java. I just got a job and have missed class a few times because of it and im supposed to create a project that can read the number of lines, words, characters, average words length, and letters in a file. I am trying to …

Software Development file-system java
Member Avatar for javatechgirl
0
1K
Member Avatar for jiraiya

Hi all, Does anyone know of a way to scan a character from the command line without the enter key having to be pressed? For example, the user would type 'a', which is then picked up and scanned by the program and stored, etc. The only way of scanning input …

Software Development java
Member Avatar for jiraiya
0
142
Member Avatar for DAVe3283

I am writing a C# application that opens multiple child forms to edit specific records in a database. When closing a child form, it asks if the user wants to save the data. However, if the main form is closed, all child forms are closed without prompting. It would seem …

Software Development
Member Avatar for Geekitygeek
0
817
Member Avatar for DaveTran

How should I order my parameters in a class? I believe that I everything should be in alphabetical order, but what of grouping of different access modifiers. - const - public - private What order should they be arranged in?

Software Development
Member Avatar for Geekitygeek
0
133
Member Avatar for prashanth s j

Hi all, I have got a regular expression of the form: "tcp:"+'[0-9]+' It works fine when using the re.search( ) module. But if I want to grep for a line in a file that contains the pattern required, then the things wont work. Grep sees the regualr expression as tcp:+[0-9]. …

Software Development python
Member Avatar for prashanth s j
0
146
Member Avatar for pato wlmc

Forget it, i just solved it, jeje, sorry. Thanks, and god bless you

Software Development api c++ windows-api
0
101
Member Avatar for digitalsindhx

I have created simple database project, using vb.net, ado.net, oledb, datatable, datagridview. My program is working nice, I just need Help with how to add, delete, update and edit records. Can any one please and please help me in this case, or can provide any good tutorial or source code …

Software Development vb.net
Member Avatar for digitalsindhx
0
506
Member Avatar for bigbags911

it works but instead of it reverseing the characters i want it to do this "This is a test.” should be reversed to read: “test. a is This” i want it to do all this in a text file [code]import java.io.*; import java.util.*; public class reverse{ public static void main(String[] …

Software Development java
Member Avatar for bigbags911
0
133
Member Avatar for chetanbasuray

I need to check the income for a particular department for a certain period of time. My inputs are the two dates between which the income has to be calculated,and the department name,the department name is the primary key for my table I need to show the transactions for the …

Software Development
Member Avatar for chetanbasuray
0
96
Member Avatar for jenjenjenjen

Hey guys and gals. Like I said in my last post I am in college. Well I wrote a program and a friend who majored in computer science said that my program will work... Well it does but doesnt do like I want. I am in need of advice using …

Software Development java
Member Avatar for kvass
0
66
Member Avatar for mommie

Trying to finish my program for binomial coefficients. It compile but it keeps giving me 0 which is not correct. I think it may be a problem with my for loops but I can't figure it out. Here is the pseudocode: [CODE]/* pseudocode for Binomial Coefficients */ int binomial(int n, …

Software Development c++
Member Avatar for VernonDozier
0
100
Member Avatar for ShaggyB

hey, I've just joined daniweb - usually just search around on the net till i find solutions to coding problems but this time i'm stuck.... probably a simple problem but nonetheless... Anyway, I'm making a program that connects to an access database, retrieves data and the data is taken into …

Software Development dataset
Member Avatar for ShaggyB
0
111
Member Avatar for micmagicfly

What is wrong with the following code segment? [CODE] const int limit = 100; int eprep[limit]; int examp[limit]; for (int index = 0; index <= limit - 1; index++) { eprep[index] = 0; examp[index] = 0; } if (eprep == examp) cout << "Equal"; [/CODE] At first I thought it …

Software Development c++
Member Avatar for Banfa
0
96
Member Avatar for Violet_82

Hi there, could anybody tell me how to compile a program and run it using Visual C++ 2005? This is what I have done: -File, New, Project; -In the menu, I choose Win 32 and then Win 32Console application; then I give a name to the project and save that …

Software Development c++
Member Avatar for Violet_82
0
167
Member Avatar for BigPandaCake

What I'm working on is a video rental project in visual basic 2008. I have a local database which contains info on DVDs, Members and a table for current rentals. [B]The columns i have in the current rentals table are:[/B] MemberID | DVDID | DaysOnRent | DateRented | DueDate | …

Software Development mssql sql vb.net
Member Avatar for BigPandaCake
0
187
Member Avatar for micmagicfly

What is the side effect in the following function? [CODE] int ExamPrep (int param1, int& param2) { if (param2 = param1) return param2; else if (param2 > param1) return param1; else return param1 * param2; } [/CODE] A side effect is defined as the result of an operator, expression, statement, …

Software Development c++
Member Avatar for Spartan-S63
0
130
Member Avatar for ITgirl2010

This is the question i was given --------------------------------------------------- Here is a program that prompts the user to enter a student’s marks, and then prints out whether they have passed or failed a unit. '''calculate a students grade given their final mark''' def calcFinal( asg1, asg2, exam ): final = asg1 …

Software Development python
Member Avatar for snippsat
0
165
Member Avatar for garyinspringhil

I'm a newbie so please be patient... :) [CODE]def canvas(self): import qt self.setCaption('My Canvas') c = qtcanvas.QCanvas(self) # <- gives the canvas a parent QObject c.resize(315, 207) v = qtcanvas.QCanvasView(self) v.setGeometry(QRect(200,590,321,211)) lay = qt.QVBoxLayout(self) lay.addWidget(v) v.setCanvas(c) l = qtcanvas.QCanvasLine(c) l.setPen(qt.QPen(qt.Qt.black)) l.setPoints(10,10,390,390) l.show() v.show() c.update() l1 = qtcanvas.QCanvasLine(c) l1.setPen(qt.QPen(qt.Qt.red)) l1.setPoints(20,60,10,230) l1.show() …

Software Development python qt
Member Avatar for garyinspringhil
0
139
Member Avatar for rumpleteaser33

Hi I'm doing a project where I need to have people register by entering a username and password. When they click register I want them to be added to the database, but I'm having trouble doing this. Can anyone help? This is my first time using VB. This is the …

Software Development microsoft-access vb.net visual-basic
Member Avatar for rumpleteaser33
0
238
Member Avatar for alcx88

I am not sure what this means and I get it all the time. Can someone help me fix this code? [ char add_account(account_t a[]) 7 { 8 int i, N=1000000; 9 char ch; 10 char str1, str2; 11 int m=20; 12 13 for(i=0;i<N;i++) 14 { 15 if(a[i].number==0) 16 { …

Software Development c
Member Avatar for jephthah
0
2K
Member Avatar for corby

hi in my drive file this is what my constructor looks like. im passing an array to it the constructor so that i can assign it to set[num]. what i want to know is what would this look like in the header file? drive-file: [CODE]IntegerSet::IntegerSet( int a[]) { for ( …

Software Development c++ file-system oop
Member Avatar for Sodabread
0
209
Member Avatar for Yeen

I have to use a queue in an solitaire assignment, but I'm having some trouble using the linked list Queue class that I made. It won't take arrays at all. [code] class Testing { public static void main (String [] args) { Queue testlist = new Queue(); // testing Queue …

Software Development java linked-list queue
Member Avatar for lafigueroa
0
795
Member Avatar for shahab_qureshi

[COLOR="Red"][B]we want to add functionality like "run" in windows.[/B][/COLOR] [COLOR="Green"]add one text box and button under button write this code [/COLOR] --> [CODE] System.Diagonestics.process.Start(TexBox1.Text);[/CODE] now run it. here you have to give name of processes. for example process name for windows media player is [I][I][B][COLOR="Green"]wmplayer[/COLOR] [/B]so when you write this …

Software Development
0
45
Member Avatar for majestic0110

Hi all just a quick question, what code do I use to make user input of RETURN(enter button) defaulting to an OK button on a windows form? thanks for your time.

Software Development
Member Avatar for shahab_qureshi
0
132
Member Avatar for SgtMe

Hi guys! I am in the process of making a game...similar to this one: [url]http://www.miniclip.com/games/nfl-lateral-collateral/en/[/url] I am using the following code to detect key presses: [CODE] pygame.event.pump() key = pygame.key.get_pressed() if key[pygame.K_LEFT]: ... [/CODE] How can I detect if a key is released? I have seen this done with using …

Software Development python
Member Avatar for tbone2sk
0
14K
Member Avatar for MyrtleTurtle

This is my first question here. My latest assignment is to create a random walk program using a 2-d array. The program worked fine until I tried to put this code into a function: [CODE] for(int i = 0; i < 100; i++){ //reset field of flowers for each attempt …

Software Development c++
Member Avatar for Fbody
0
246
Member Avatar for eyal27

Hii !! I try to update excel file by using Odbc and Oledb objects with out success. my problem when i try to update string in cell that the Odbc "think" this cell is have different datatype. how can i force the Object to put string at cell that have …

Software Development open-source
Member Avatar for eyal27
0
962
Member Avatar for tkpanther

I have been given an assignment to create a random race program where 2 different lines race. How the lines travel is determined by a random number generator, but that is not the issue I currently have. I am suppose to create a window that is 500x600, with the x- …

Software Development python
Member Avatar for ssmokincamaro
0
194
Member Avatar for BrandonB

Hey all, I'm busy with an assignment for which a question, due to being too complicated, has been cancelled (i.e. no longer required to be done). The lecturers told us that if we still included this question in our assignment answers, they would give us the marks for it if …

Software Development c++
Member Avatar for Fbody
1
573
Member Avatar for JellyTurf

[CODE]import java.util.Scanner; public class ticTacToe { public static char[][] board = new char[3][3]; public static getMove(int turnNumber) { char choice = ' '; if (turnNumber % 2 == 1) { //x's turn System.out.println("X's Turn."); char choice = 'x'; System.out.println("Which row and column would you like to choose? (enter number for …

Software Development java
Member Avatar for phoenix911
0
212
Member Avatar for JohnPhilipps

Good afternoon, I am having a hard time understanding how to use the "Friend" function prototype and the Friend function to move my rectangle. My programm with just the constructors, the properties and the functions work corectly until I put the "friend" function prototype and function. I would so much …

Software Development c++
Member Avatar for JohnPhilipps
0
469
Member Avatar for sfurlow2

For my project, we're supposed to read data from a text file (circlemath.txt) and the program should output data for the circle to a text file (circoutput.txt). The input file contains data specific for class Circle (x-coordinate, y-coordinate, radius, ascii character), and each line has the form (Circle1 data, operator …

Software Development c++ ios open-source os-x
Member Avatar for sfurlow2
0
107

The End.