132,726 Archived Topics

Remove Filter
Member Avatar for
Member Avatar for dhvl2712

I wrote a simple .py program for [code="python"] def main(): print ("Hello World") [/code] That's it. I saved it as hello.py But when i try to run it I get this error: [code="python"] >>> hello.py Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> hello.py NameError: name 'hello' …

Software Development python
Member Avatar for leegeorg07
0
527
Member Avatar for smcp

So I'm basically completely screwed at the moment. I'm enrolled in a higher level course at my school (an Artificial Intelligence class) despite the fact that I'm new to my major (computer science) and have very little programming experience (just C++, that's all). I was just wondering, has anyone around …

Software Development python
Member Avatar for adam1122
0
107
Member Avatar for harish92

I don't understand why my linear search program in pascal is not working... Some help will be appreciated. [code]program Project2; {$APPTYPE CONSOLE} uses SysUtils; Type TStudent = Record Name : String[15]; End; Var Name : array [0..3] of string=('Fred','Jack','Chris','Ali'); inputname : string; n : integer; begin Name[0] := 'Fred'; Name[1] …

Software Development pascal
Member Avatar for FlamingClaw
0
1K
Member Avatar for sivak

i have one employee tabel with 4 coloums emp name emp id employee salary tax john 001 30k smith 112 15k joe 113 45k i have to fill tax coloum =25% when salary >=30k otherwise just -- can any one tell me the query ?

Software Development sql
Member Avatar for JerryShaw
0
86
Member Avatar for danishamman

Q.no.1: What is the difference between zero and null values? Q.no.2: If we have double data type then why we use long data types? Q.no.3: How arrays make coding easy in C++? Q.no.4: If we are given 1-dimensional array. How can we code through single dimensional array?

Software Development c++
Member Avatar for siddhant3s
0
155
Member Avatar for JLopeman

I cannot get this program to compile. It is bombing at the Outfit::Outfit constructor. I am getting an error stating that it is missing argument list and also illegal left operand type. Can someone point me in the right direction? Cheers - Jason [code=c++] // Outfit class contains Dress and …

Software Development c++
Member Avatar for JLopeman
0
125
Member Avatar for BlueNN

I'm trying to get my little user-input program to recognize that words aren't numbers. Without any logic parameters the program just crashes when you put in anything but a number, I'm attempting to allow the user to try again and put in a number using a while loop, but I …

Software Development python
Member Avatar for adam1122
0
114
Member Avatar for queensrose

Hi! I'm supposed to input a large integer value(long int) and output it like this: e.g. input: 123456789 output: 123,456,789 I'm supposed to use recursion for this. I just need suggestions or partial codes - not a full code (I want to learn, not copy). I'm a newbie, and I …

Software Development c++
Member Avatar for Duoas
0
175
Member Avatar for jam7cacci

Hi! I was wondering if someone could help me figure out what may be wrong in my installing process or in my compiler... I was installing Visual Studio 6.0 C++ and everything went well until I started compiling and this is what it shows: --------------------Configuration: try - Win32 Debug-------------------- Linking... …

Software Development c++ visual-studio
Member Avatar for jam7cacci
0
149
Member Avatar for MaQleod

I'm fairly new to python and object oriented programming in general, so I'm having a little trouble figuring out why this doesn't work this is the error I'm getting for the code below: Error: 'str' object has no attribute 'insert' [CODE]filetolist = FileReadToList("test.txt") print filetolist[0] def FileCountLines(s_filename): f = open(s_filename) …

Software Development python
Member Avatar for MaQleod
0
7K
Member Avatar for punitdam

I am trying to connect Mysql5.1 from Perl 5.8.8 on RHEL5 as follows: [code] $dsn="DBI:mysql:database=mysql"; $dbh=DBI->connect($dsn, 'root', 'root', 'mysql',{RaiseError => 1}); [/code] When I try to run perl containing above connection, it gets connected to Mysql and fetches data but displays following warning. [QUOTE]DBI->connect using 'old-style' syntax is deprecated and …

Software Development perl
Member Avatar for punitdam
0
531
Member Avatar for dollycharm

Using the following data, create a well-formed XML file... Please see attached file. can you help me with xml coding with that attached file? I really need it ASAP.

Software Development xml
Member Avatar for xml_looser
0
111
Member Avatar for golden3159

Hey, guys im stuck on this problem. I'm supposed to make a base pyramid in the format: --------* ------*** ----***** Basically, it takes user input and subtracts two on the next line. (e.g. 5, 3, 1) Right now I can only make it go down one by one, I know …

Software Development c++
Member Avatar for Lerner
0
96
Member Avatar for MoOou

I have a question I did not understand if anyone of you understood it please explain to me [B]suppose that m and n are integers and m is nonzero. Recall that m is called a divisor of n if n=mt for some integer t; that is, when m divides n, …

Software Development c c# c++
Member Avatar for Lerner
0
292
Member Avatar for jagsrocknfl

I am currently at Kutztown University enrolled in Computer Science II. I am struggling to finish writing the actual cpp for the program, the implementation and header files are finished. Here are the instructions of the program: Recall that a polynomial is a sum of terms in the form, f(x) …

Software Development c++ data-science linked-list
Member Avatar for Lerner
0
2K
Member Avatar for NirmalRS

Hi! I am final year student doing my project on visual C++. As a part of my project i need to merge number of .avi files in to single .avi file. Could some 1 please advice me on a library that i could use to do that. Thanking you, Nirmal

Software Development c++
Member Avatar for NirmalRS
0
103
Member Avatar for daviddoria

I have used boost's progress bar (it outputs ***** from 0 to 100% complete) to track the progress of long loops. It would also be nice to be able to see a counter along with that, like if I run 1000 tests, the *'s will go from 0 to 100%, …

Software Development c++
Member Avatar for daviddoria
0
115
Member Avatar for danishamman

Plz tell me the advantages of using "while" and "do-while" loop in C++

Software Development c++
Member Avatar for Narue
0
2K
Member Avatar for BlueNN

I've just started in Python and I'm still feeling my way around, I tried to create a quick program to display "Welcome to Python!" without the quotes. The entirety of the code is this: [code]print('Welcome to Python!')[/code] However, when I double-click on the .py file Python opens up for less …

Software Development python
Member Avatar for BlueNN
0
145
Member Avatar for redhotspike

Working on a simulation which closely resembles waiting in a line at a bank. Program runs the simulation based on the user's inputs of # of servers, simulation time, average time between arrival, and transaction time. Here's what I have so far: [code] /*~~~prog3.cpp~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | Author: …

Software Development c++ queue
Member Avatar for redhotspike
0
240
Member Avatar for BobLewiston

I've tried, but I haven''t been able to find the namespace containing the dgDetails class for the DataGridView control. Can anybody tell me where it is? BTW, this is for C#.

Software Development
Member Avatar for JerryShaw
0
112
Member Avatar for rEhSi_123

Hello everybody, Ran into a bit of trouble! During compilation I get the following error: [code] fatal error C1083: Cannot open include file: 'login.h': No such file or directory [/code] The login.h does exist in my directory folder. Please let me know where I have gone wrong. I am attaching …

Software Development c++
Member Avatar for rEhSi_123
0
151
Member Avatar for henryxxll

Hey guys: I'm trying to write a python script to execute a Linux program, with several arguments set by the user, like so: [CODE=python] import os variable_input=int(input("Input Number Argument: ")) os.system("/path/to/program"," -argument1 ",variable_input) [/CODE] However, the os.system() command doesn't allow more than one input, so I tried this: [CODE=python] import …

Software Development python
Member Avatar for henryxxll
0
3K
Member Avatar for amit_ciem

hi......i m doing kmeans clustering program for my final year college project. I need the source code in C. please helpme......its urgent.

Software Development c
Member Avatar for Ancient Dragon
0
85
Member Avatar for FallenGenesis77

I was wondering how I would go about saving data within an executable, I'm not exactly sure If I happen to be wording this right so I will elaborate. For example lets say I had an application that would ftp upload specified files, but I did not want to use …

Software Development c++
Member Avatar for MosaicFuneral
0
244
Member Avatar for vsha041

Hi, I am trying to write a program, in which it will ask the user to enter a string of length exactly 9. I have got a dictionary file with me which contains over two hundred thousand words. My job is to output all the possible words between lengths 4 …

Software Development algorithm apple c c# c++
Member Avatar for iamthwee
0
115
Member Avatar for sommanatt

How do I get the memory usage of my c++ program? Which instruction that i can put in my program and it can tell the size of memory that my program used? Thank you

Software Development c++
Member Avatar for myle
0
3K
Member Avatar for lauren316

Here's my code: [code] #include <iostream> #include <string> #include <stack> using namespace std; int main() { string input; cout << "Enter text for palindrome checker. No spaces or punctuation please." << endl; getline(cin, input); stack<char> stackOne; for(char i = 0; i < input.length(); i++) stackOne.push(input[i]); stack<char> stackTwo; for(char j = …

Software Development c++
Member Avatar for lauren316
0
156
Member Avatar for ganmo

Hi, I have some problem to implement the constructors from set.h. There was no problem to implement the empty constructor. But as for: Set(int a[], int n); I have some problem. It is supposed to use insert() function from node.cpp. And since the class Set is friend a friend to …

Software Development c++ linked-list
Member Avatar for Lerner
0
133
Member Avatar for jacline

a GUI application that presents a game based on a 4 by 4 matrix of buttons.One of the buttons (selected at random) "hides" the prize. A status bar at the top of the window shows the number of guesses. When the prize button is pressed, the status bar shows "You …

Software Development gui java java-swing
Member Avatar for jacline
0
807
Member Avatar for avishekgc_22

Ok, so heres the thing. Firstly I use windows operating system and the Borland C++ software. My program has to do the following:- 1> Open a source code, which is in .cpp format. 2> Monitor the flow of execution and print a message for every occurrence of a semicolon [;] …

Software Development c++ open-source operating-system
Member Avatar for tux4life
0
177
Member Avatar for power_computer

I have to do this user defined function return type: double parameters: one (1) type: ifstream (by reference); variable used to read the file description assume the file has already been opened successfully in main() read through the file, average the numbers and return the average to main() to be …

Software Development c++
Member Avatar for power_computer
0
116
Member Avatar for ivatanako

[code]import java.io.*; public class getLowestValue { public static void main(String[]args) throws Exception { DataInputStream input=new DataInputStream(System.in); System.out.println("Get lowest value "); int a[]=new int[10]; int x =0, i=0, j=0, tmp=0; // display and get inputs [5] for (x=0;x<5;x++){ System.out.print(x+" Enter a number: "); a[x] = Integer.parseInt(input.readLine()); } // sorting for (x=0;x<5;x++){ …

Software Development java
Member Avatar for jasimp
0
213
Member Avatar for edb500

Hi there I have the following problem! Please help! [code=cplusplus]class Base { //private methods void printMyType() { cout << "this is base type" << endl; } //public methods void printAllInfo() { cout << "this An accout" << endl; printMyType(); } }; //end base class class derived : public Base { …

Software Development c c# c++
Member Avatar for edb500
0
89
Member Avatar for senaddor

This is not a homework problem. I am studying binary search trees and trying to understand how the code works. I have the code, it works, but I want to understand it completely. I have made comments of what I think code does and in the lines that I don't …

Software Development c++
Member Avatar for tux4life
0
138
Member Avatar for mhalls

Hi I am trying to read a txt file into a 15x30 multi dimensional array. I am having a few problems with the code. This class is embedded within a class and the cout << seat[i][j] seems to work within the loops when I'm reading in the file. When testing, …

Software Development c++
Member Avatar for StuXYZ
0
108
Member Avatar for MyRedz

help.why can't my coding loop properly.,..i notice it can't show the loop of ptrpers[j] ? what did i do wrong.? it didn't show back the input i put on earlier. [CODE] #include<iostream> using namespace std; class person { protected: char name[40]; public: void setname() { cout<<"Enter Name:"; cin>>name; } void …

Software Development c++
Member Avatar for MyRedz
0
130
Member Avatar for syuk

DEAR JAVA EXPERTS. can u help me? i dont know how to do the next move.... i want to write code that can make each object of the class Book can hold the following information about a book: title, up to four authors, publisher, ISBN, price, and number of copies …

Software Development java java-swing
Member Avatar for BestJewSinceJC
0
218
Member Avatar for ahmedlibrian

Hi all, Well I am new here in Daniweb. First of all hi to all. I have a small problem but it takes me so long to find out its solution but still no use. Actually I am writing an update query in my vb.net page for my website. Here …

Software Development vb.net
Member Avatar for ahmedlibrian
0
210
Member Avatar for saramv

Hi Guyz, There is two questions please help out in making program. Q)write a program using conditional operators to determine whether a year entered through the keyboard is a leap year or not. Q)write a program to print out all Armstrong numbers between 1 and 500.if sum af cubes of …

Software Development c
Member Avatar for ddanbe
0
132
Member Avatar for Zcool31

I'm trying to implement a linked list class in a manner similar to STL. Everyithing seems to work fine, but when I try to implement an output operator to let me see what is inside the collection quickly, it starts acting wierd. Note that I use the iterator inside the …

Software Development c++ linked-list
Member Avatar for Zcool31
0
247
Member Avatar for thebunk

I am trying to output a table which lists a customer's payments whilst keeping a running total. A section of my XML is as follows: [CODE]<Accounts> <Payment> <CustomerID>1</CustomerID> <Date>2009-03-16</Date> <Amount>22</Amount> </Payment> <Payment> <CustomerID>4</CustomerID> <Date>2009-02-12</Date> <Amount>35</Amount> </Payment> <Payment> <CustomerID>2</CustomerID> <Date>2009-05-17</Date> <Amount>41</Amount> </Payment>[/CODE] I have included the following code to sort the …

Software Development xml
Member Avatar for xml_looser
0
138
Member Avatar for ARYT

Hi everyone This should be one of our last assignments. Well, not sure, but most probably. As the title implies, we're supposed to write a program using multi-dimensional arrays for a 6x6 matrix multiplication. Here's what I've done. It's almost OK; except the most important part which is the final …

Software Development algorithm c++ matrix-multiplication
Member Avatar for GreenDay2001
0
525
Member Avatar for MohitManocha

hello every one. i would like to tell you that i am real biggener so please reply accordingly. any kind of help would be appriciated. i was trying to clean a specific registry key's value through my application. i have added a button now i want that on click event …

Software Development microsoft vb.net
Member Avatar for pratik30.ei
0
1K
Member Avatar for tomtetlaw

my inheritence isnt working, it says saveAttributes isnt defined: [code=python]#!/usr/bin/env python #==========================================# # Copyright Tom Tetlaw & Shadwick (c) 2009 # #==========================================# import pickle as pk from formatting import * from locations import * from gclasses import * from gfuncs import * from items import * from objs import * …

Software Development python
Member Avatar for tomtetlaw
0
81
Member Avatar for tomtetlaw

i made a file reader but it always returns corrupted: [code=python] def load(charactor): fout = open(charactor + '.actor', 'r') fout.seek(0) actor_type = None attrs = [] for index, line in enumerate(fout.readlines()): if index == 0: actor_type = line.replace('{', "").strip() if index == 1: if line == 'attributes': if not line …

Software Development python
Member Avatar for tomtetlaw
0
86
Member Avatar for nassim87

i need the solution to this 3 programs i c++ : 1. Write a program that inputes frome the keyboard an integer x and calculates the sum of all numbers from 1 to x. 2. Write a program that uses a for-loop to output the power of 2 from 2 …

Software Development c++
Member Avatar for ithelp
0
83
Member Avatar for raul15791

This may sounds stupid. I'm new to VB.net. My problem is that all the size of my picture box kept running. 1. I'm not sure is it because i set the form's backbgroundimagelayout to "Stretch" and all Picturebox's sizemode to "Stretch Image". 2. When i start my app on another …

Software Development vb.net
Member Avatar for densman
0
209
Member Avatar for adling11

hi every body i need your help please in a program in assembly i've to make a program that contains a listof names of students and theirs points (like: jack 15) and we order the list once by alphabetical order and the second time by descendent point please i need …

Software Development assembly
Member Avatar for rahul8590
0
75
Member Avatar for tomtetlaw

can someone give me a tut on how to read files like this: [code]charactor { name = "name" race = "human" ## ect.. }[/code] any and all help will be appreciated :)

Software Development python
Member Avatar for lllllIllIlllI
0
71

The End.