43,549 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for rrvs331

So I made this coin flipping program. It generates a random number between 1 and 2, and checks to see how many "flips" it would take for it to get 15 flips in a row. However, every time I run it, I get the same number, 13505, every single time! …

Software Development c++
Member Avatar for rrvs331
0
233
Member Avatar for Dom83

Hey, I have been struggling with a problem on a project Im working on. I have 3 ints, day, month, year and I want to put them into a string I use for another function to search through a file. so lets say day = 20 month = 11 year …

Software Development c++
Member Avatar for Dom83
0
112
Member Avatar for donths

[QUOTE] Please! need help in removing (or set the element value to 0) one element of an array based on the string value that is passed to the remove method. The array contains string names read from a file. I don't know if I should post the entire code on …

Software Development java
Member Avatar for donths
0
105
Member Avatar for Jaydenn

Hello, I have made two textboxes and a button, you type into the second textbox and it's content gets displayed on the first texbox when you click the button, and also creates a new line so I can type as much as I want without it clearing. I want to …

Software Development
Member Avatar for Jaydenn
0
151
Member Avatar for BobRoss

Sorry, the thread title should read "File paths with spaces" Hello everyone. I am finalizing this little shift cipher program that reads a plain text file line by line, encrypts it, and writes it to a cipher text file. I'm just having difficulty when a user enters file paths with …

Software Development c++ file-system
Member Avatar for jonsca
0
111
Member Avatar for Tales

How can I initialise a Datetime^ variable with current Date? I have this idea but I'm not sure: [ICODE] Datetime^ curDate = gcnew DateTime::Now; [/ICODE] Anyone?

Software Development c++
Member Avatar for Tales
0
163
Member Avatar for PDB1982

I have my coding idea laid out, but I think there is an easier way, plus I can't really get it to work, because I don't know how to accommodate for duplicated values. Here is my data: [code] Enter name of file students StudentID LastName FirstName Q1 Q2 Q3 Mid …

Software Development c++
Member Avatar for jonsca
0
118
Member Avatar for lotrsimp12345

here is my code main [CODE] #include <iostream> #include "account.h" using namespace std; int main() { account a; return 0; } [/CODE] account.h [CODE] #include <iostream> #include "Lentext.h" #include "Deltext.h" #include <string> using namespace std; class account { private: char account_Number[11]; char name[1000]; char address[1000]; char city[16]; char state[3]; char …

Software Development c++
Member Avatar for lotrsimp12345
0
138
Member Avatar for lrh9

I'm wondering if it's possible to change the border color of a tkinter entry widget border. I don't think it is, because no such option exists in relevant documentation. You can change the width, but that just results in the whitespace being recessed - creating a raised 3d border. If …

Software Development python tkinter
Member Avatar for Ene Uran
0
12K
Member Avatar for xcorpionxting

I am building a program requiring making some classes with inheritance. I can't seem to be able to access the members of the class objects. My code looks like this: [CODE]#include <iostream.h> #include <stdlib.h> #include <time.h> class Animal{ public: int number; int legs; Animal(){ number = rand()%9; } }; class …

Software Development c c# c++
Member Avatar for xcorpionxting
0
177
Member Avatar for samarudge

Hi, I downloaded the open source project Guitar Tuner ([url]http://sourceforge.net/projects/guitartuner/[/url]) Inside it there is an index.html file, a TunerApplet.jar file and a TunerApplet.java file (As well as some images and GPL etc.) When i open index.html the applet displays as it should however if I try to recompile (Even without …

Software Development java open-source
Member Avatar for samarudge
0
127
Member Avatar for uv2009

Hello all, I would be grateful for your advice regarding something I tried to do using unique() but it didn't work. I have a two dimensional numpy array that looks like that (but much larger): >>> pop_A1 array([[10, 2, 10], [10, 9, 10], [10, 9, 10], [10, 9, 10], [10, …

Software Development python
Member Avatar for uv2009
0
149
Member Avatar for railmaster7

I'm having trouble with some syntax errors, and also wanted to get an opinion of what I've written will work as needed. I'm writing an awk report script to organize data from a file and calculate the amount of sales. There are 3 kinds of lines that we will need …

Software Development shell-scripting
0
63
Member Avatar for Dokino

hello, I'm writing calculator with Python and i came across few problems. First problem is that if user enters letters it would ask him to reenter them i thought i could do it like this [code=python]try: class num: x = float(raw_input("number\n")) numb = num() except: bull = False else: bull …

Software Development python
Member Avatar for Dokino
0
130
Member Avatar for RichardCrickets

Hello daniweb, I am new to java and am trying to wrap my head around parsing XML with Java. I've decided to try DOM with Xerces to start because it seems pretty simple, however I am getting NoClassDefFound errors. I'm sure it's something really simple that I have overlooked due …

Software Development apache ide java java-netbeans xml
Member Avatar for Ezzaral
0
1K
Member Avatar for EvaDo

Hi!totally new, i did an undergrad in non-python related science, and I'm trying to move into incorporating python into my postgrad, so my questions right now are fairly basic. I basically want to run muscle (a sequence alignment tool) on a large number of files.how do i start a python …

Software Development python
Member Avatar for Gribouillis
0
182
Member Avatar for dark1806

hi i need a litle help.....i must write a program that search for a string in a text file and return the line in the text file were string was found...string its an argv....i wrote this code but it returns the whole text file when i search for something [CODE=c] …

Software Development c
Member Avatar for Narue
0
91
Member Avatar for nola_Coder

I'm working on a Floyd's Algorithm type Java program. What I have done so far is represent a directed graph in a 2d array, and I am trying to transform that into a 2d array representing the graph's paths of length 2. I planned for it to fill the adj2[][] …

Software Development algorithm java
Member Avatar for nola_Coder
0
170
Member Avatar for student88

hi all .. just want to ask if anyone have an idea how can i move image down throug keyboard cursors up an down .. i know that there is the keydown event and the keyup event but really i don't know how to write the code .. other qusetion …

Software Development
Member Avatar for student88
0
184
Member Avatar for lewashby

In the following code, could someone please explain these if statements? elif 5 <= unhappiness <= 10:, & elif 11 <= unhappiness <15:, they have two arguments, one on each side which is something I haven't seen before. Also, what the one to the far right for anyway? Also, this …

Software Development python
Member Avatar for masterofpuppets
0
154
Member Avatar for procomp65

Hi I have a data logger that records different lenghts of data. I download it in my application and create graphs. I need to show a progressbar to indicate how long the download is going to take. I get data from the logger to indicate how long the data run …

Software Development
Member Avatar for procomp65
0
703
Member Avatar for silveram

Can you convert the object returned by jTable.getValueAt(Row,Col) to an integer?

Software Development java
Member Avatar for javaAddict
0
92
Member Avatar for kaydub123

I need to write: Starting weight of food (in lbs:ozs)=8:9 into a python 3.0, I'm very new to this and what I came up with was: Starting_weight_of_food_in_lbs{:}ozs=input("Enter Starting_weight_of_food_in_lbs{:}ozs") print("Starting_weight_of_food_in_lbs{:}ozs entered=", Starting_weight_of_food_in_lbs{:}ozs) and I belive i'm way off....any help would be great!

Software Development python
Member Avatar for masterofpuppets
0
136
Member Avatar for Chris11246

Whenever I try to run my program it keeps giving me an overflow error and I dont know why. The problem is shown when i call this sub: [CODE]blueP.shootBall(blueS.x, blueS.y, blueP.ang, blueP.captured, ball.x, ball.y, ball.velx, ball.vely)[/CODE] this is the sub [CODE]Public Sub shootBall(ByVal x, ByVal y, ByVal ang, ByRef caputred, …

Software Development vb.net
Member Avatar for Chris11246
0
71
Member Avatar for P00dle

Hi, In my program, a text file is read in, and certain parts of it are written to a XML file. There are special characters(e.g. &) that need to be escaped, so I need to escape all of them. How can I manage to do this?

Software Development java xml
Member Avatar for P00dle
0
88
Member Avatar for patriciuuu

I'm trying to make a SMTP Checker using Python. The checker will do the following things: The code will take a list of smtps accounts (ex: host,user,pass) and will try to send an email to a email you will specify in the code. If it's successful (the send of the …

Software Development email python
Member Avatar for nure
0
392
Member Avatar for daviddoria

Consider two classes, PersonClass and LawyerClass. If LawyerClass derives from PersonClass, you can create a PersonClass* as a LawyerClass, like [code] PersonClass* Person = new LawyerClass; [/code] then you can convert it to a LawyerClass* with [code] LawyerClass* Lawyer = static_cast<LawyerClass*>(Person); [/code] However, if you don't know that the person …

Software Development c++
Member Avatar for daviddoria
0
5K
Member Avatar for talor

Hi, I searched all over, but can't seem to find a way to submit a username and password in a website. I tried filling in the fields using WebRequest and Post, but that didn't work (or I don't know how to use it correctly... :$). Does anyone know another way …

Software Development
Member Avatar for shamseena
0
130
Member Avatar for NicholasE

Hi all, I would like to make a for loop in which should do the following: To print the string n[i] twenty times then the string s[i] only one time. Then leave a gap and continue this until the n reaches n599 and s goes to s30. n0 n1 n2 …

Software Development python
Member Avatar for NicholasE
-1
89
Member Avatar for P00dle

I get a ArrayIndexOutOfBoundsException. The cause is this snippet: [CODE]public static void main(String[] args) { //command line param try { [B]if (args[0] != null) {[/B] if (args[0].equals("printer")) { printToFile = false; } } } catch (Exception oob) { oob.printStackTrace(); }[/CODE] I don't give the program any parameters when I start …

Software Development java printer
Member Avatar for P00dle
0
77
Member Avatar for hajiakhundov

Hi everyone. I am creating a small windows form application using Visual C++; and I would need to delay a loop by a second. Sleep() doesn't work.(Not sure why) Is there a way I can use the timer? Any suggestions on how can I do that? Thanks in advance. :)

Software Development c++
Member Avatar for hajiakhundov
0
137
Member Avatar for Samyx

I am trying to implement an interface so that the main program would work. Any light? I am having a difficult time trying to understand interface :/ [code] interface ArithmeticOperator { // Returns the result of applying the operator to operands a and b. double operate (double a, double b); …

Software Development java
Member Avatar for javaAddict
0
87
Member Avatar for windermere

Here is the LinkedList.h file: [CODE]// LinkedList.h -- class for a linked list as a data structure template <class DataType> struct Node { DataType info; Node<DataType> *next; }; // LinkedList maintains a current position in list after each function call // If an object of a struct is used for …

Software Development c++ data-structure linked-list
Member Avatar for bamcclur
0
184
Member Avatar for vtsmokey88

The fact thats it an AVL tree probably doesn't matter. I have a printTree method in my tree class and I'm trying to print the nodes in the form of the tree. I've successfully printed the nodes the correct way but now I'm trying to label the nodes by their …

Software Development java
Member Avatar for vtsmokey88
0
103
Member Avatar for songweaver

Hey guys, I have been working on this problem for a while and wanted to see if you could spot what the problem is. This form is used so I can add a customer to the list which calls up another form for the adding. And also has an option …

Software Development vb.net visual-studio
Member Avatar for phatJacob07
0
106
Member Avatar for AutoPython

I have a limit of 30-45 dollars to buy an editor (with Python support, obviously) . Here's what I would like. Customizable syntax highlighting (like the kind in Notepad++). Auto indent, so it autmatically indents 4 spaces after a ':' character. Good code completetion. A built in IDE. Preferably like …

Software Development ide python
Member Avatar for Gribouillis
0
174
Member Avatar for ramjeev

Difference between Runnable interface & Thread class?Which one to use, though both seems to be same? As per my knowledge,runnable can be implemented in such a case that already it has some hierarchy -Thanks in advance

Software Development java
Member Avatar for ramjeev
0
152
Member Avatar for vinochick

I have most of the program written, but I'm stuck on the 2 dimensional array. Here is the code I have so far: [CODE]#include <iostream> using namespace std; //function prototype int calcTotal(); int main() { //declare variable and array int total = 0; int sales[6][2] = {{12000, 10000}, {45000, 56000}, …

Software Development c++ display
Member Avatar for vinochick
0
115
Member Avatar for Diamonddrake

I have inherited from a picturebox and modified it to allow a selection rectangle to be drawn. Everything works well, except I would like for it to work in all sizeModes. center is simple, normal is simple. but I cant' seem to get "Zoom" to work. I have used reflector …

Software Development
Member Avatar for Diamonddrake
0
117
Member Avatar for Kirielson

Hello, I've checked a recent Game of Life thread and unfortunately it did not address my problem. I'm trying to manipulate life based on how many cells have life. I'm assuming that it's the way that I'm doing the counting that is messing up the problem but it could also …

Software Development c++
0
72
Member Avatar for mitchstokes225

This is what is asked of me. "Create a flowchart and write a complete C++ program that declares a 2 dimensional integer array of size 10 rows and 10 columns. The program should use two nested for loops to fill the array with the even numbers beginning with 2 in …

Software Development c++
Member Avatar for mitchstokes225
0
1K
Member Avatar for rzhaley

hello i am trying to calculate an interest table and have made my code but cannot get the program to add from the existing principal balance to the new amount to calculate the interest gained over n amount of years. any help would be awesome. heres my code [CODE]using System; …

Software Development
Member Avatar for jonsca
0
123
Member Avatar for confusedndazed

[B]Hello everyone!!![/B] I have the following pseudocode and I'm not exactly sure how/where to plug it into my code. I am still very lost concerning programing so please bear with my ignorance...:) /* pseudocode for Binomial Coefficients */ int binomial(int n, int k) { If (n < k) Then return …

Software Development c++
Member Avatar for confusedndazed
0
97
Member Avatar for katharnakh

im confused with [I]__call__() [/I] method defined within the class. [I]__init__() [/I] is used as constructor, and is called when we create an instance of the object. when does [I]__call__() [/I] method get called even though we not specify it explicitly... please help..........

Software Development python
Member Avatar for snippsat
0
17K
Member Avatar for checker

This is what I intended to do [CODE] class person: "class to represent a person" def _init_(self): self.name = "" self.age = 0.0 self.sqr_age = 0 class ageName: def listAgeName(x,y): # x is name # y is age x = 0 y = 0 listAgeName = [('John', 18)] p = …

Software Development python
Member Avatar for fallopiano
0
125
Member Avatar for hmmmm

im am trying out this code but it keeps giving an error msg but i cant see where the error is...please help [code] query = New OleDbCommand("INSERT INTO studenttable(sname,scourse,syear,ssemestor,sgrade)values('" & TextBox1.Text & " ',' " & TextBox2.Text & " ',' " & TextBox3.Text & " ',' " & TextBox4.Text & …

Software Development vb.net
Member Avatar for SadOldMisterHam
0
165
Member Avatar for DawnOfIkaros

Could someone help me with this? [CODE] ifstream readfromfile("stats.txt"); readfromfile >> lvl >> xp >> str >> spd >> acc >> hp >> endl >> inventory[0] >> endl >> inventory[1] >> endl >> inventory[2] >> endl >> inventory[3] >> endl >> inventory[4] >> endl >> inventory[5] >> endl >>inventory[6] >> …

Software Development c++
Member Avatar for programmersbook
0
245
Member Avatar for NargalaX

I'm trying to make custom panels, but I can't even set the styles without getting errors [CODE]MainForm.SetStyle(System.Windows.Forms.ControlStyles.DoubleBuffer, true); MainForm.SetStyle(System.Windows.Forms.ControlStyles.AllPaintingInWmPaint, false); MainForm.SetStyle(System.Windows.Forms.ControlStyles.ResizeRedraw, true); MainForm.SetStyle(System.Windows.Forms.ControlStyles.UserPaint, true); MainForm.SetStyle(System.Windows.Forms.ControlStyles.SupportsTransparentBackColor, true); [/CODE] Throws errors saying [CODE] An object reference is required for the non-static field, method, or property 'System.Windows.Forms.Control.SetStyle(System.Windows.Forms.ControlStyles, bool)' (CS0120) [/CODE]

Software Development
Member Avatar for DdoubleD
0
147
Member Avatar for solitaryy

I have a vector filled with names such as John Doe Jane Doa etc. I need to write a function which deletes what is input via the user [CODE]void delete(vector<string>&name) { string FName, LName; cout<<"Enter first name and last name to be deleted"; cin>>FName>>LName; }[/CODE] ie input: John Doe and …

Software Development c++
Member Avatar for solitaryy
0
278
Member Avatar for guccitan88

I'm sure I'm missing something simple, but would like to ask if someone could set me on the right path. We have to write a program that requests the hours worked in a week, and a pay-rate, and then prints the gross earnings, taxes and the net pay. [CODE] #include …

Software Development c++
Member Avatar for guccitan88
0
167

The End.