132,726 Archived Topics

Remove Filter
Member Avatar for
Member Avatar for P!th

I heard this forum was a wonderful place to ask programming related questions. So here I am, I'd like to know if anybody has a solution to a problem I'm having. I'm currently planning on creating a game on Python, and I've decided to make use of a joystick in …

Software Development python
Member Avatar for P!th
0
234
Member Avatar for daudiam

I downloaded data from google.com/favicon.ico and saved it in a file "icon.png" using the following: [CODE]URL url=new URL("http://www.google.com/favicon.ico"); InputStream ss=url.openStream(); byte bytes[]=new byte[100000]; int offset = 0; int numRead = 0; while (offset < bytes.length && (numRead=ss.read(bytes, offset, bytes.length-offset)) >= 0) { offset += numRead; } FileOutputStream out=new FileOutputStream("icon.png"); out.write(bytes);[/CODE] …

Software Development java qt
Member Avatar for daudiam
0
199
Member Avatar for modaslam

Can any one help me to optimize this code. Or possible to alter and make it more simple The out put i need to get is [CODE] 1 212 32123 ....... [/CODE] this is the code [CODE] main() { int i,j,k,n=4,val,flag=0; for(i=0;i<n;i++) { for(j=1;j<n-i;j++) putchar(' '); val=i+1; flag=0; for(k=0;k<2*i+1;k++) { …

Software Development c
Member Avatar for heznenkiah
0
110
Member Avatar for nix_xin

Create a program that will accept 20 numbers and arrange them in ascending order. The program should determine the distinct numbers and the number of occurrences for each number (or the frequency). Display the supplied values, the distinct numbers and the frequency of each distinct numbers. Your program should use …

Software Development java
Member Avatar for Xufyan
0
177
Member Avatar for totalwar235

currently i am writing a text based RPG but, when i call for the fight my rand() either does not seed each time or it glitches to continuously gets the "Boar". if you could please take a look at it and see if the problem is in the coding, i …

Software Development c++ gaming
Member Avatar for totalwar235
0
146
Member Avatar for nobodycool

Hey folks, plugging away at a new program for class and I have run into a little snag, or rather a fairly major one for my pea sized brain. We are working on constructing a sorted linked listed that will store author names as well as a sorted book list …

Software Development java linked-list
Member Avatar for ~s.o.s~
0
1K
Member Avatar for softbrianes

[CODE]def egcd(a,b): u, u1 = 1, 0 v, v1 = 0, 1 while b: q = a // b u, u1 = u1, u - q * u1 v, v1 = v1, v - q * v1 a, b = b, a - q * b return u, v, a …

Software Development python
Member Avatar for Schol-R-LEA
0
103
Member Avatar for simransuri

[code]import java.util.*; public class Account { int choice,initbal,amt,total,withdraw; int ch; void Initbal() { Scanner sc=new Scanner(System.in); System.out.println("Enter Initial Balance (>200) : "); initbal=Integer.parseInt(sc.nextLine()); while(initbal<200) { System.out.println("LOW BALANCE!!!Balance should be greater than Rs.200"); System.out.println("Enter again : "); initbal=Integer.parseInt(sc.nextLine()); } } void Detail() { Scanner sc=new Scanner(System.in); System.out.println("***************MENU***************"); System.out.println("1. Deposit"); System.out.println("2. Withdrawl"); …

Software Development java
Member Avatar for JamesCherrill
0
177
Member Avatar for yamini222

Hi, I'm trying to execute this but it says "cannot implicitly convert int to bool". [CODE]for (i = 0; i < k; i++) { for (j = 0; j < m; j++) { c[i][j] = counts[i] ? c1[i][j] / counts[i] : c1[i][j]; } }[/CODE] Is there anyway that I can …

Software Development
Member Avatar for ddanbe
0
97
Member Avatar for usep

INPUT's: 1) Name 2) Current date (month, day, year) 3) Birthday (month, day, year) The output will be the person's age in years, months, and days. See example below: Input name: shane Input current date: Month (1-12): 9 Day (1-31): 25 Year (yyyy): 2010 Input birthday: Month (1-12): 9 Day …

Software Development c++
Member Avatar for usep
0
128
Member Avatar for RickSMO

I'm having a horrible issue with this exercise in this book. It sees no errors unless I try to run it or go into debug mode. in Debug mode it says " line 39 Input string was not in a correct format." If I run it without debugging, it crashes …

Software Development c# visual-studio
Member Avatar for RickSMO
0
137
Member Avatar for Nidhi S.

i want to retrieve images from access database and display in grid layout. i have displayed 1 image successfully but how can i do this for all images together.i have stored images as BLOB

Software Development java
Member Avatar for Nidhi S.
0
98
Member Avatar for rowley4

This code generates all permutations of the numbers 0, 1, 2,...., n-1. I am trying to get it to use recursion to do this. I am not compiling. I do not show errors, but I am not getting it to work. Can anyone see where I am going wrong? [CODE]import …

Software Development java
Member Avatar for JamesCherrill
0
99
Member Avatar for Ee Juan

Question: Each year the HSE Unit receives accident count reports from a 10 departments across the university. To summarize these reports, the department provides a frequency distribution printout that gives the number of departments reporting accident counts in the following ranges: 0 - 19 20 - 39 40 - 59 …

Software Development c++
Member Avatar for Ee Juan
0
163
Member Avatar for JBD2

Has anybody here made a progarm like VNC, or A remote access program? Because I'm trying to make one, and I was wondering if somebody had some code or something that I could work with. Thanks. JBD2

Software Development visual-basic
Member Avatar for McDedz
0
947
Member Avatar for jay_el_em

Hi all I am a beginner programmer, and I think I might have bitten off more than I can chew.I've done some small projects, and then decided to do a simple banking app, just as a learning exercise. Problem is I don't know where to begin, and I've not created …

Software Development asp.net c c# c++ gui
Member Avatar for Mitja Bonca
0
108
Member Avatar for bee90

I am practicing the inheritance concept od oop in c++. It seems like a simple program but the linking error my compiler Dev C++ 4.9.9.2 version is giving me, makes it look sooo annoyingly difficult. Error is: [CODE] [Linker error] undefined reference to `vtable for Cd' [Linker error] undefined reference …

Software Development c++ oop
Member Avatar for bee90
0
188
Member Avatar for bigwhiteegg

This is the main part of a project I assume all other header and cpp file are correct cuz most of them are copy from books n the professor when I run it, "right after the input" the program sort of stopped, pop out a error message, then keep running …

Software Development c++ queue
Member Avatar for bigwhiteegg
0
107
Member Avatar for neoraghav

Hi, Need help to know, how to diaplay a count down timer in the dialog box using MFC. and when the timer ends the dialog should colse........ Please provide suggestion......

Software Development c++ display
Member Avatar for neoraghav
0
282
Member Avatar for shibin09

i created a program in c# with database sql server 2005.it worked in windows xp.but i don't know how to install my software in windows 7 .i coudn't install sql server2005 or sql servr 2005 64 bit in windows 7. help me plz ..very urgent

Software Development sql
Member Avatar for Mitja Bonca
0
102
Member Avatar for pacers10

I think i have the function for mean but i also need to figure out below mean. This what i have so far.[CODE]import math def mean(alist): belowMean = alist mean = sum(alist) / len(alist) if mean <= alist: belowMean = item return belowMean [/CODE]

Software Development python
Member Avatar for Schol-R-LEA
0
95
Member Avatar for sasucker

For my assignment this week, I was supposed to create a program that would read in names from a file, sort them, then output the names sorted. I attempted to do it as a insertion sort, and seemed to have failed miserably... if anybody could point me in the right …

Software Development c++ ios
Member Avatar for llk
0
2K
Member Avatar for Danny_501

Hi all, I'm making a client server program in Linux. I use fork() to create a child process of the server to handle a new client. When a client disconnects it should kill the child process. At the moment the program is able to kill the fist client(server) that connects, …

Software Development c client-server
Member Avatar for Danny_501
0
114
Member Avatar for aram25

Hello All I'm new to VB and i need help on how to rename text file with textbox contents. I have a textbox and i would like to make it so once a button is clicked the text file is renamed according to the contents in the textbox. I am …

Software Development vb.net
Member Avatar for aram25
0
665
Member Avatar for burcin erek

the program is running well but concept is wrong. you should find number 0-100 until 10 trials. if failed, and want to play again unfortunately program is terminated why ? [CODE]#include <cstdlib> #include <iostream> #include <windows.h> using namespace std; int sayiturev (int aralik) // generating number 1-100 { srand(GetTickCount()); int …

Software Development c++
Member Avatar for burcin erek
0
289
Member Avatar for ghingghing

i am new fr this site and i guess i will get some help fr here we have a project on our finals and we need to make a program of payroll using menu with the output of employee name, update employee record. display employee record, delet record and exit …

Software Development c++
Member Avatar for ghingghing
0
131
Member Avatar for beatenbob

This is my school's assignments and I'm a beginner in C++.. I'm trying to write a program which prompts strings input from user. Say if user enters "My name is blabla", the program should print the exact same thing without ignoring the characters after the whitespace. I tried using a …

Software Development c++
Member Avatar for WaltP
0
163
Member Avatar for aviavyne

I'm a beginner at c++ and i was given a certain assignment. A person enters a digit, and then this digit is multiplied by 4, but if the multiplied number is greater than 9 then we add its digits, and if the addition still give you greater than nine, then …

Software Development c++
Member Avatar for WaltP
0
139
Member Avatar for yowsh

Please help me translate this nested for loop to assembly [CODE]for(int i=0, k=0; i<8; i=i+4, k++){ for(int j=i; j<=i+4; j++){ temp[j-(4*k)]=binary[j]; } }[/CODE]

Software Development assembly
Member Avatar for Schol-R-LEA
0
178
Member Avatar for Mittwaffen

I'm in a rough situation, i'm currently re-reading all of my textbooks to assist me with this work, however I am really in a rough spot being time limited I really want to get somewhere from what I have (and fix what I have). What I need to correct/add. -I …

Software Development c c# c++
Member Avatar for Schol-R-LEA
0
113
Member Avatar for Protoroll

I am writing a toString method for my Nursery class but am having trouble getting everything working properly. I have to go through the ArrayList and call the toString method for each individual tree and then the sum for all of the trees prices. Here is what I got so …

Software Development java
Member Avatar for NormR1
0
91
Member Avatar for Coder98

[code]using System; public class BonusProduction { public static void Main() { int FName, LNAME; double LastYearProduction; double ThisYearProduction; Console.WriteLine("Enter your first name"); FName = Convert.ToInt32(Console.ReadLine()); Console.ReadLine("Enter your last name"); LNAME = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Enter Last Year's Production"); LastYearProduction = Convert.ToInt32(Console.ReadLine()); if(LastYearProduction < 0) Console.WriteLine("Invalid"); { Console.WriteLine("Enter This Year's Production"); ThisYearProduction = …

Software Development
Member Avatar for Schol-R-LEA
0
149
Member Avatar for pacers10

I am having trouble trouble figuring out this problem any help would be appreciated. The problem wants you to change english into pirate language. Using the string split and join methods. This is what i have so far. [CODE]import copy def wordReplace (wordText): wordDict = { "hello" : "avast" , …

Software Development python
Member Avatar for Schol-R-LEA
0
81
Member Avatar for Qabane

Hey Guys I don't get what I need to add Im fairly new in Java. this is my code but it gives me these below the line errors below [code]import javax.swing.*; public class Movies { private String name; private double price; private int year; public Movies { name=""; price=0.0; year=0; …

Software Development java java-swing
Member Avatar for Akill10
0
178
Member Avatar for amittal2089

Hi After posting the form i dont see anything in STDIN however if i submit the form as GET request then i can see the value in $ENV{QUERY_STRING}. I will really appreciate if anybody can help me in this issue. Thanks Arun Mittal

Software Development first-post perl
Member Avatar for richieking
0
49
Member Avatar for Mahaa

Hi all, I am pretty new to this PERL programming. I have heard that anything could be done with PERL's magic... So out of my own interest, I have started learning perl language, to ease my project works(sort of Automation stuffs). I have PERL V5.10.1 installed in my PC,and am …

Software Development perl unix web-browser
Member Avatar for richieking
0
2K
Member Avatar for close_encounter

I've been hitting my head against a wall here trying to figure out what stupd thing I'm doing wrong. I know its right in front of me but can't grasp it and my chapter for multiforms is pathedically short. What I'm trying to accomplish is for the user to select …

Software Development apple display vb.net
Member Avatar for close_encounter
0
110
Member Avatar for srikanth2321

Hi all, I'm trying to implement K-means on a database.I have a table like this: The main task is to group id's and return them based on similarity in intensities depending on the number of clusters that the user want to see them. [CODE]id I1 I2 I3 I4 I5 1 …

Software Development dataset
Member Avatar for srikanth2321
0
134
Member Avatar for royalx

Hi guys, I'm kind of stuck on a problem I was assigned. Pretty much we're trying to reverse words in a sentence. As in, input = Hi I am new to Java to: Java to new am I Hi I've tried this [CODE]String[]Tyler = new String[Sentence.length()]; Tyler[0] = Sentence; for(int …

Software Development java
Member Avatar for Katana24
0
107
Member Avatar for Protoroll

I have two constructors that are pretty much exactly the same except that one also takes in a boolean value. I want the constructor with four parameters to the call the other one in order to get the the first three. Here is what I have so far. [CODE] public …

Software Development java
Member Avatar for ~s.o.s~
0
106
Member Avatar for poojabi

pls tell what is the difference between this two 1)taking a initger (or any fundamental data type) pointer in the main function and then send it to some funtion as parameter. int *p; function(p); 2)taking a intiger and sending its adress to any function. int p; function(&p); will both do …

Software Development c data-structure
Member Avatar for poojabi
0
142
Member Avatar for rob3097

I figure my formulas are wrong and need tweaking. Can someone help[CODE]package mortgage_calculator; /* Write the program in Java (without a graphical user interface) using a loan amount of $200,000 with an interest rate of 5.75% and a 30 year term. Display the mortgage payment amount and then list the …

Software Development display java user-interface
Member Avatar for kramerd
0
159
Member Avatar for aviavyne

I need to write a new code which can do the following: Write a function-driven program that gives the new ID for a 4-digit integer entered from the keyboard. The new ID is formed in the following procedure: The last four digits of a social security number (SSN) will have …

Software Development c++
Member Avatar for myk45
0
149
Member Avatar for XodoX

I'm trying to do the following using a linked list. [quote] delete("is",2) print 1:This 2:is 3:an 4:an 5:icorrect 6:sntence delete("an",3) print 1:This 2:is 3:an 4:icorrect 5:sntence delete("icorrect",4) print 1:This 2:is 3:an 4:sntence insert("incorrect",4) print 1:This 2:is 3:an 4:incorrect 5:sntence delete("sntence",5) insert("sentence",5) print 1:This 2:is 3:an 4:incorrect 5:sentence neighbors("is") 2:is previous:This …

Software Development c++ linked-list
Member Avatar for myk45
0
96
Member Avatar for ceyesuma

I have a java app that used to use a property and I am not sure with the changes I've made to the class path how to find the driver. I thought I was using the exact same installation but I can't find the driver. Can someone please tell my …

Software Development apache java microsoft-windows
Member Avatar for ~s.o.s~
0
497
Member Avatar for NewOrder

[CODE]import java.io.*; public class EnumEx3 { /** * @param args */ public static void main(String[] args) { Fishs fishs=Fishs.AMNON; System.out.println(fishs.getX()); } } enum Fishs { BURI(20), AMNON(50); private int x; private Fishs(int x) { this.x=x; } public int getX() { return x; } } [/CODE] i have that code and …

Software Development java
Member Avatar for ~s.o.s~
0
117
Member Avatar for slvrmoon32

I need to create a Car class that has the following fields: brand, model, and speed. Each of the fields should have accessor and a mutator methods. In addition the class should have methods that allows the user of the Car class to accelerate and to brake. Accelerating or braking …

Software Development java
Member Avatar for Beauty1304
0
228
Member Avatar for thm

I'm trying to write a matrix multiplication program that takes in an int N on command line, creates two NxN matrices A & B, randomly populates them with ints, and then computes the result of multiplying A and B. I wanted to avoid malloc, but the first version started segfaulting …

Software Development c first-post matrix-multiplication
Member Avatar for thm
0
323
Member Avatar for mitrious

I wrote these functions and when I call them they're not working ... and I don't know why. here is the code for the functions [code=c]istream& read_notes(istream& in, vector<double>& nt) { if(in){ nt.clear(); double x; while(in, x){ nt.push_back(x); } in.clear(); } return in; } istream& read_info(istream& is, Info& inf) { …

Software Development c++
Member Avatar for mitrious
0
178
Member Avatar for corrwee

Hi, guys I'm having trouble writing this word count program in python3. I've been able to find alot of help for past versions but nothing for 3. It is just a simple word count program, with a user input sentence. So far I have [CODE] def main(): print ("This program …

Software Development python
Member Avatar for griswolf
0
239

The End.