43,549 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for Yeen

I understand the basic principle of recursion, but I'm having trouble implementing it in practice. I understand this first case perfectly fine. It works because n is constantly getting closer to 0. [CODE]def faculty(n): # Base case if n == 0: return 1 # Recursive call else: return n * …

Software Development python
Member Avatar for Ene Uran
0
127
Member Avatar for SoulMazer

Okay, so I'm having a little trouble. Let's say I run "scriptA.py" and it has a GUI (Tkinter) and it is running in its mainloop. I want to create a "scriptB.py" that can end "scriptA.py"; would there be a way to do this regardless of the OS it is on …

Software Development gui python tkinter
Member Avatar for SoulMazer
0
269
Member Avatar for DeadJustice

I have a seg fault I can't seem to be rid of. Basically I'm building an AVL tree and I'm stuck on the insert method. gdb says it is occuring on the line with: while( temp != NULL && temp->key != k ){ Would someone please help? Thank you in …

Software Development c++
Member Avatar for DeadJustice
0
201
Member Avatar for sexyzebra19

I have 2 main if statements inside this for loop (lines 7 and 56). I'm trying to get so that if after all the iterations are complete, i.e. j = 51 the first and second if statements are not satisfied, then it will print out an error message. I have …

Software Development c++
Member Avatar for GrubSchumi
0
101
Member Avatar for Mitja Bonca

I did an application, published and installed it. In my User`s Start Menu there is created a new folder with y shortcut to my application.exe inside. What`s bothering me is the name if this folder. It has a name, that I don`t know how and where to change it. I …

Software Development visual-studio
Member Avatar for Mitja Bonca
0
87
Member Avatar for LucarioWill

[CODE]import java.util.Scanner; public class MathTutor { Scanner input = new Scanner(System.in); int numQuestions; int choice; int numCorrect; public MathTutor (){ numQuestions = choice = numCorrect = 0; } public int getNumQuestions(){ { System.out.print("How many questions? "); numQuestions = input.nextInt(); if (numQuestions < 1) { System.out.println("Invalid - must ask at least …

Software Development java
Member Avatar for LucarioWill
0
3K
Member Avatar for blahbla

i have a problem : Write the definition of a function, isReverse , whose first two parameters are arrays of integers of equal size, and whose third parameter is an integer indicating the size of each array. The function returns true if and only if one array is the reverse …

Software Development c++
Member Avatar for blahbla
0
220
Member Avatar for Darth Vader

If I have two dates like this, I wonder how it will be possible to count how many of these days that are: Monday,Tuesday,Wednesday,Thursday,Friday The dates are for example: 11/01/2009 11/18/2009

Software Development
Member Avatar for Darth Vader
0
121
Member Avatar for Clawsy

Hi, I first convert the image on the server application in bytes: [code] //server public void sendImage(File file) throws IOException { ByteArrayOutputStream baos=new ByteArrayOutputStream(1000); BufferedImage img=ImageIO.read(new File(file.getAbsolutePath())); ImageIO.write(img, "jpg", baos); baos.flush(); os.write(baos.toByteArray());// this is a "new DataOutputStream(clientSocket.getOutputStream());" System.out.println("Done! Length is:"+baos.toByteArray().length); baos.close(); } [/code] Then my application freezes when trying to …

Software Development client-server image java
Member Avatar for Clawsy
0
223
Member Avatar for Behi Jon

Hi, When I want to run a program in eclipse, I get "Binary not found" error . I have MinGW in c: root and I have added C:/mingw/bin to environment path .

Software Development c++ ide
Member Avatar for Behi Jon
0
75
Member Avatar for hanntaa

im using a JFileChooser to find a file from anywhere on the system and load it but i also need to be able to export the data within my program to an unknown location, how would i go about doing that?? is it simular to the JFileChooser? any help would …

Software Development java
Member Avatar for hanntaa
0
106
Member Avatar for Darth Vader

I am looking for how it is possible to calculate the difference in minutes for a date and time. This example will cover the problem. [B]20091118 18:15 20091125 01:35[/B] I know this is possible using Date functions and TimeSpan but trying to find examples but cant find an example of …

Software Development
Member Avatar for Darth Vader
0
108
Member Avatar for ffs82defxp

Its not running [CODE]import math import os cls = os.system("cls") title = os.system("title Pythagorean Theorum Solver") def MainLoop(): cls print "Enter 3 coordinate plane points (x - y) format" print "" firstPair = input("--> ") SecondPair = input("--> ") MathPart() def MathPart(): '''structure of the formula: squareRoot of --> (x-y)^2 …

Software Development os-x python
Member Avatar for vegaseat
0
143
Member Avatar for hanntaa

Hey guys iv got this project to make an address book that has all kinds of functions and iv got them all working apart from one bit, it needs to be able to read a file when it opens as well as import other data from other files. The data …

Software Development file-system java
Member Avatar for hanntaa
0
212
Member Avatar for Fire_Michel

i am making a program need 128 button when u click on button color of button change to red when you click it a gain it back to normal color is there a way to code one button and the other take the same function thank at all

Software Development
Member Avatar for Fire_Michel
0
152
Member Avatar for reza.adinata

Hallo all, I have a question for implementing Inheritance in C++. I think I miss the concept of inheritance C++ somehow, because the second class can not take the parameter from the first class.. I need to use a class Carbol and Carbol2. In Carbol2, I need to add a …

Software Development c++
Member Avatar for programmersbook
0
121
Member Avatar for Mattpd

Sorry, solved my own problem. [CODE] #include <time.h> time_t current = time(NULL); char date[11]; strftime (date, 11, "%m/%d/%Y", localtime (&current)); [/CODE]

Software Development c
0
71
Member Avatar for BrendaByrne

Hi, yes I'm a student with homework problems, but I am trying. I need to display various shapes in a picture box, and am trying to do so via a combobox that the user can select from. My problem is clearing a previous selection when a new selection is made. …

Software Development vb.net
Member Avatar for BrendaByrne
0
114
Member Avatar for Valaraukar

Hi, I have created a generic linked list in which different objects can be added to a list as long as they inherit from my object class. My problem is this: I am able to add nodes and find nodes etc. but I can't figure out how to return an …

Software Development c++ linked-list
Member Avatar for GrubSchumi
0
134
Member Avatar for ShadyTyrant

I am designing a module to perform some actions for a library database application. The methods are not implemented yet but I was wondering what you all think about nested classes in this situation. Design One [CODE=Python] #!/usr/bin/env python # File: .py # Author: shadytyrant@gmail.com # Date: 2009-11-25 # Notes: …

Software Development database-design python
Member Avatar for ShadyTyrant
2
262
Member Avatar for Darth Vader

Hi, I wonder what the way is to remove dublettes from a List. ? I have filled a List like this: [code] List<String^>^ List1 = gcnew List<String^>(); List1->Add("123"); List1->Add("124"); List1->Add("123"); [/code]

Software Development c++
Member Avatar for Darth Vader
0
123
Member Avatar for murid

I try to create an forgot password application. in the application, in order to get user password, user must do some input. there is 4 input : Username, Name, Security Question, and Security Answer. [CODE]Try If TextBox8.Text <> "" Then kueri = "select Username, Pass, Nama, SecQue, SecAns from Account …

Software Development vb.net
Member Avatar for Smith5646
0
111
Member Avatar for lewashby

In the following program, I'M getting the following error message when I try to run it. [COLOR="Red"]TypeError: object.__new__() takes no parameters[/COLOR] [CODE] # Classy Critter # Demonstrates class attributes and static methods class Critter(object): """A virtual pet""" total = 0 def status(): print "\nThe total number of critters is", Critter.total …

Software Development python
Member Avatar for pythopian
0
551
Member Avatar for "Alex"

For example Im trying to make the user input his name, last name, and salary and then make it display " First Name is" followed by what they put in as their first name "Last Name is" followed by what he put as his last name... and now im getting …

Software Development c++ display
Member Avatar for Narue
0
133
Member Avatar for furblender

Completely frustrating - I have been googling for a solution for this for a couple of hours now. I have this little bit of code that I wish to read a text file into a Python Dictionary. I used this dictionary format internally within the another piece of code I …

Software Development file-system python
Member Avatar for furblender
0
3K
Member Avatar for jacline

Hi everyone, I write a project about a banking system . In homework professor told us that "Your code must not have any memory leaks. You will lose points if you have memory leaks in your program even though the outputs of the operations are correct." How can I check …

Software Development c++
Member Avatar for jacline
0
106
Member Avatar for Calaesto

Hi, No excuses: my problem is that I can't get my code to check if a certain record exists in a MSA database. My code needs to check if the database contains a row where 2, 3 or 4 specified fields exist. But, as mentioned, at the moment it only …

Software Development c#
Member Avatar for Calaesto
0
1K
Member Avatar for Alba Ra

I wonder (as I couldn't find [I]anything[/I] either on DaniWeb or anywhere else) why should one use XML and XSLT rather than plain XHTML? I couldn't find a rationale arguing for the use of XML and XSLT in connection with dynamic web content stored in a database. Zend does provide …

Software Development xml
Member Avatar for Alba Ra
0
279
Member Avatar for wmsigler

My heapsort is not functioning the way it should, and I was wondering if perhaps one of you could help point me in the right direction. Much thanks in advance should you care to look! :) If it helps anyone, I posted it on pastebin.org with syntax highlighting: [url=http://www.pastebin.org/55997]http://www.pastebin.org/55997[/url] Source …

Software Development c++ open-source
Member Avatar for wmsigler
1
167
Member Avatar for kalodakilla

Hi, I'm just starting to learn how to create custom controls in C# but I'm having a problem with the toolbox here. After creating and compiling the custom control in the Library project, i add new project to the solution to test my new control, so i add reference like …

Software Development
Member Avatar for kalodakilla
0
181
Member Avatar for persianprez

I know I can go back and edit all my output with %f.3 is there code to do this for all output?

Software Development python
Member Avatar for vegaseat
-2
88
Member Avatar for Musafir

I need to make a score table function which keeps a track of the points. the first player to reach 11 points wins, however the game must be won by aleast a 2 point margin. the players points should be displayed on two halves of the graphic window. for example: …

Software Development python
Member Avatar for vegaseat
-3
282
Member Avatar for Nikhar

Hey guys...Can you please help me explain what does returning an istream object mean. I am currently studying Accelerated C++ and at many places a function returns istream object. What does it mean? For example:- [CODE]istream& read(istream& is, Student_info& s) { // read and store the student's name and midterm …

Software Development c++
Member Avatar for Nikhar
0
2K
Member Avatar for Kruptein

How can I start a launcher from python? if I do: [icode]os.system("~/localhost")[/icode] it just returns a number (probably a process id or something) if this is not possible, how can I start from python a terminal window and execute a code in that terminal? (without closing the python script) Thanks …

Software Development python ubuntu
Member Avatar for Kruptein
0
203
Member Avatar for Mitja Bonca

I have done and published application and this is what I got just after the installation: What can be wrong? PLATFORM VERSION INFO Windows : 5.1.2600.196608 (Win32NT) Common Language Runtime : 2.0.50727.3603 System.Deployment.dll : 2.0.50727.3053 (netfxsp.050727-3000) mscorwks.dll : 2.0.50727.3603 (GDR.050727-3600) dfdll.dll : 2.0.50727.3053 (netfxsp.050727-3000) dfshim.dll : 2.0.50727.3053 (netfxsp.050727-3000) SOURCES Deployment …

Software Development microsoft-office
Member Avatar for DdoubleD
0
359
Member Avatar for Lukezzz

If you would convert these 3 examples to a string you would get an errormessage as no of the numbers are valid numbers. How would it be possible to do a check programatically if the number is a valid number before a conversion ? [code] String^ GetValue = ""; GetValue …

Software Development c++
Member Avatar for fjrivash
0
140
Member Avatar for tincho87

Hi everyone, sorry about my english. Im having a problem and i don't know how to fix it. I have a plugin-based application that i'm developing. Every plugin has a reference to a dll that has different static classes with functions. When i run the application with all the dlls …

Software Development microsoft
Member Avatar for tincho87
0
154
Member Avatar for dumrat

I declared this inside one function: [CODE] void function() { .... static const int iLimit = GetLimit(); int iL = a_MyArray[iLimit]; .... } [/CODE] The code compiles ok in g++. What I want to know is whether the GetLimit function will be called only once (At the first call to …

Software Development c++
Member Avatar for dumrat
0
94
Member Avatar for lepass_7

Hi guys i am trying to catch the close event(press the X button) on a window form. I try this [code] private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e) { // Display a MsgBox asking the user to save changes or abort. if(MessageBox.Show("Do you want to save changes to your text?", "My …

Software Development
Member Avatar for Geekitygeek
0
141
Member Avatar for HelloMe

Hello everyone... I have a problem on the last part of my codes. This programm supposed to accept several kind of courses and its corresponding grades. So far so good... but when it comes to display the courses and the grades and its remarks of passed or failed, the programm …

Software Development c++
Member Avatar for Seten
0
125
Member Avatar for snakay

Hi, What is the best way of reading multiple aggregate data ? like so; [code] select id,sum(data1),sum(data2),sum(data3) from table1 group by id [/code] I know with ExecuteScalar you can get one aggregate data, but what about if you have more than one. I tried ExecuteReader and I'm getting exception [code] …

Software Development
Member Avatar for snakay
0
107
Member Avatar for ujjval dave

I am new in vb.net so i don't know how to take a print from a vb form. thanks for this printing code.

Software Development vb.net
Member Avatar for kvprajapati
0
103
Member Avatar for nobodycool

Hello there, I am working on an assignment for school and I am having a hard time understanding the concept of an array of objects. I am required to create an array of Music objects so that I can search through them via a binary search and make changes as …

Software Development java
Member Avatar for javaAddict
1
147
Member Avatar for srujanasadula

A string variable taking any kind of string has a value "yjava_jboss.log4j_file_appender_pattern_layout='%d .//- %x %-5p [%c] %m%n' " at some point of time during execution. It is to greped on a file that contains with value. I used grep "$STR" <filename> ,where STR during execution takes value as shown above. …

Software Development shell-scripting
Member Avatar for srujanasadula
0
130
Member Avatar for RoyMicro

I have a class which is used as a object for my reportviewer control in C#. The Datatable in that class is used by the control to show a table. I have two issues. 1 How to create a varibale in that class that can be accessed by the reportviewer? …

Software Development
Member Avatar for kvprajapati
0
113
Member Avatar for PDB1982

How do I make an array to find the largest portion of another array? I am trying to find the candidate that received the largest amount of votes from the following file: Johnson 5000 Miller 4000 Duffy 6000 Robinson 2500 Ashtony 1800 here is my code: [code] #include <iostream> #include …

Software Development c++
Member Avatar for Clinton Portis
0
134
Member Avatar for adams161

Hi, i've started making a simple breakout game with java swing. This is just for fun and to learn more about java and swing. I got a frame and a panel and a mouse listener. I draw a paddle on the screen and it moves as the mouse moves. I …

Software Development java java-swing
Member Avatar for adams161
0
105
Member Avatar for Musafir

The function has two parameters, one giving the side-length and the other giving the length of the shortest line. The function should draw as many lines of the spiral that fit inside the window def spiral(lenght,side): for i in range(1,side+1,5): lenght.forward(i) lenght.right(90) I made a start of the code, please …

Software Development python
Member Avatar for woooee
0
116
Member Avatar for T-Dogg3030

I am trying to do a command line switch with an if statement. The problem I am running into is when I am using a letter, it wont recognize it. When I use a number, no problem. I think there are a few different ways to solve this. Can anyone …

Software Development c++
Member Avatar for programmersbook
0
101
Member Avatar for Stefano Mtangoo

Hi, I have done this code to learn ArrayList. I keep getting errors. Basically I want to accumulate names in list and when user types 'n' at prompt, it prints out names. What is wrong? [CODE=java]package mtangoo; import java.util.ArrayList; import java.util.Scanner; public class MainClass { public static void main(String args[]){ …

Software Development java
Member Avatar for Stefano Mtangoo
-1
327

The End.