199,114 Archived Topics

Remove Filter
Member Avatar for
Member Avatar for vishal1949

I want to find the average score of a LinkedList. My code is [CODE]/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package bowlinggame; import java.util.LinkedList; import java.util.TreeSet; public class BowlingGame { public static void main(String[] args) { TreeSet <String>PlayerNames …

Member Avatar for singh_soorma94
1
1K
Member Avatar for vishal1949

I am making a program of vehicles and i have to make a car garage class. In the class the max amount of vehicles that could enter are 20 or 25000 lbs. I wrote the charstack and the pop() and the push() but dont know how to limit it to …

Member Avatar for raymagosi
1
272
Member Avatar for newbie14

Dear All, I have function where I read from a mysql table a set of value. Part of my codes is like this [CODE]echo "<tr id='gridRow'> <td >$count</td> <td> <input type='checkbox' onClick=selectAndUpdate('$row1[size]')></td> <td> {$row1[SerialNo]}</td> <td> {$row1[InHouseBranding]}</td> <td> {$row1[BrandCode]}</td> <td> {$row1[size]}</td> <td> {$row1[Pattern]}</td> <td> {$row1[EntryStatus]}</td> </tr>";[/CODE] A sample row generated is …

Member Avatar for vibhaJ
1
99
Member Avatar for techlawsam

[CODE]// This is traditionally the first program written using System; namespace HelloWorldProgram { class HelloWorld { static void Main() { Console.WriteLine("Hello World!"); } } }[/CODE] I dont get why the statements in the body end with a " ; " but nothing is placed at the end of method headings. …

Member Avatar for Momerath
1
143
Member Avatar for SurrounD

Hey guys, Im new to Java and i am trying to wrap my head around arrays and what not. What i am trying to do is create an array for a puzzle which is 4x4 and has the numbers 1 to 16 so far i have got this [code]public class …

Member Avatar for SurrounD
1
144
Member Avatar for vishal1949

I am new to programming and I don't know how to make interfaces. My code is : [CODE]public class CarsDescription { /** * @param args the command line arguments */ public static void main(String[] args) { interface Domestic {} interface Import {} interface Japanese extends Import {} interface German extends …

Member Avatar for Ezzaral
1
352
Member Avatar for Ene Uran

Just a simple console blackjack game. The bread and butter code was written with lots of comments, so you can improve on it. Really, the most important part is figuring out when an ace is 11 in value and when it is a 1 in value, so you don't bust.

Member Avatar for s4bb4t
1
8K
Member Avatar for mason79

Good evening to all. I was hoping that any one available, could assist me, with my assignment for matlab. I have never done any programming before, and require assistance with respect to designing a game(snakes and ladders). I would really appreciate any assistance. thank you mason

Member Avatar for Aviras
1
70
Member Avatar for scorpionz

Hi this is ScorpionZ can anyone have an idea like I have a div box with its 'id' and an Text area When i click on my Div box I get this the ID through Javascript and Print it on Text area Here is a little piece of code [code=html] …

Member Avatar for maniac23
1
738
Member Avatar for xinwei

Hi all, I'm doing a elevator simulation project but i met some issues. First, I wish to align my buttons on the left to the horizontal lines. I tried to setting setMinimumSize, setMaximumSize, setPreferredSize but it didn't help. Second, if I re-size the window, the buttons on the left seems …

Member Avatar for xinwei
1
756
Member Avatar for Niles64

Hi Everything in Python is treated as an object, so [CODE] i=5 i.imag [/CODE] makes sense, i.e. the variable [I]i[/I] has some associated methods. But why doesn't the following example work? [CODE] 5.imag #error [/CODE] One would think that it should work, since the integer "5" is an object just …

Member Avatar for Niles64
1
117
Member Avatar for The Buzzer

hello guys, here is another problem on filing. it creates the intended files and it is saving as well. but the problem is the numbers become invisible this time in those files. it is showing . . . (dots) instead of even numbers or odd numbers. Anyone has got any …

Member Avatar for raptr_dflo
1
137
Member Avatar for ptaylor965
Member Avatar for Gribouillis

How to create a png image containing a fragment of source code ? Well, don't do it yourself, the [url=http://pygments.org]pygments module[/url] contains all the necessary tools. The example below shows how to produce a png image from python code, but pygments supports lexers for many other languages and its formatter …

1
517
Member Avatar for betny

[CODE]public void readArguments(String[]args ) { String [] readArray = new String[ 10 ]; Scanner readscanner=new Scanner(System.in); // read values from keyboard into array System.out.println("Enter your arguments or type Exit to exit the loop"); for ( int i = 0 ; i < readArray.length ; i ++) { if(readArray[i] =="Exit" ) …

Member Avatar for hfx642
1
230
Member Avatar for vishal1949

I making a small office word like program. I have four things. A menu bar containing File>Open,Save,Exit. I want to create a short cut for open, save. Could someone help me how to do that. this is my code [CODE]namespace Texteditor { public partial class Form1 : Form { public …

Member Avatar for nick.crane
1
130
Member Avatar for fashxfreak
Member Avatar for prit005
1
104
Member Avatar for S.N.Mazumder

I prepared a simple database in ms excel. Now I want to link it with ms visual basic 6.0. I want to enter data in ms visual basic form and it will update my excel database/ spreadsheet. How to link a record in ms excel with visual basic 6.0 ? …

Member Avatar for rexgb_34
1
6K
Member Avatar for vishal1949

I am making a project using windows form application. i made two other window forms (vehicle.cs and Input.cs). i want to obtain the value from the textbox in input.cs and use it in vehiicles.cs. is There any way to do this. I am trying to make a for loop but …

Member Avatar for vishal1949
1
177
Member Avatar for Labdabeta

I know that this [ICODE]#define QUOTE(X) #X[/ICODE] turns X into a c-string version of whatever is passed to it. my question is if there is a way to do this in reverse ie: [ICODE]#define DEQUOTEANDCALLFUNCTIONORCLASSWITHGIVENNAME(X) (X#)()[/ICODE] is this possible?

Member Avatar for mike_2000_17
1
183
Member Avatar for TrustyTony

What does this print statement produce and why? Learned it today, I still must be a newbie. [CODE]print('%0*d' % (3, 7))[/CODE]

Member Avatar for Purkinje
1
195
Member Avatar for sirlink99

I am making a game where random obstacles appear. The obstacles will move towards you. I currently have this code to animate the obstacles. [CODE] for (int i = 0; i < obstacle.size(); i++){ // animate walls obstacle.elementAt(i).x -= 1; } [/CODE] My vector multiple instances of the Walls class …

Member Avatar for stultuske
1
113
Member Avatar for gry

Hi, I tried a auto-comment bot for wordpress(in my website) and coded it. My plan is that I write names in names.txt file and sample comments in comments.txt file(a name or comment per line) and it will add a random comment with a random name into Wordpress's database in wp_comments …

Member Avatar for G&G Designing
1
284
Member Avatar for Sorcher

How am i supposed to insert a word into a blank row? [CODE]$sql = "INSERT INTO ue-userfile WHERE id='$imageid' AND userid='$userid' (`albumname`) VALUES('$newalbum')";[/CODE] ? [CODE]$sql = " INSERT INTO `ue-userfile` ( ``, ``, ``, ``, ``, ``,``,`albumname` ) VALUES ('{$albumname}')";[/CODE] ? God damn annoying to not find any solution on …

Member Avatar for Sorcher
1
82
Member Avatar for mrnutty

Just for exercise, if people want to give it a go; see how creative one can be. [b]Problem Statement:[/b] Given a list of data from a file( or user input which ever) as such: [code] char 1 char 2 char 26 char 27 char 52 char 53 [/code] output the …

Member Avatar for iamthwee
1
151
Member Avatar for vishal1949

I am making a program where i have to write a recursive function that reverses a string. I am a new programmer and need help. The function should return a String and take only one argument, also a String. [CODE]import java.io.*; public class RecursiveFunction { public static void main(String [] …

Member Avatar for JeffGrigg
1
402
Member Avatar for n8thatsme

Ok, my problem is that I'm reading from a file 3 values, a last name, first name and salary, for example: Key Bobby 43000 I have an array of objects for each person, so I neeed to read this file and assign the last name, first name, and salary to …

Member Avatar for mike_2000_17
1
4K
Member Avatar for Peter4n31

Memory Validator reports a problem: Accessing C++ object functions with a pointer to a deleted object. It is pointing to prefDir = preferredPath; in Loader.h Public: is defined: [CODE] std::vector<std::string> preferredPaths; [/CODE] in Loader.ccp [CODE] CDirLoader::GetFileExtHandle(not related params) std::string prefDir; for(size_t i=0;i<preferredPaths.size();++i) { const std::string& preferredPath=preferredPaths[i]; if (!preferredPath.empty()) prefDir = …

Member Avatar for Narue
1
158
Member Avatar for vishal1949

I was writing a program that involves the console inputting integers and strings. For my project i prompt the user to enter the number of strings he would like. Then i prompt the user to enter the strings so i could order them alphabetically. I am supposed to use any …

Member Avatar for Muralidharan.E
1
591
Member Avatar for preci_gonzales

hello. is ther anyone who can help me in vb.net? topic is how to send sms from pc to mobile... thanks! preci:-|

Member Avatar for nikiskay
1
2K
Member Avatar for Gribouillis

This snippet defines a context [icode]autofilename()[/icode] to create an existing temporary file with a new name in python. Unlike the methods in the [icode]tempfile[/icode] module, it only gives a filename which exists within a 'with' block, instead of an open file. This is useful for example when a program needs …

Member Avatar for Gribouillis
1
302
Member Avatar for 47pirates

I'm trying to display a total integer value taken from the Jtable cells and want to display the sum in the last cell so for that i need to covert the final sum to object or are there any other solution...any help will be thankful!!!

Member Avatar for mKorbel
1
182
Member Avatar for sfrederick1

Hey guys, I was trying to implement a twitter feed script into my website to display my most recent tweet, and it works fine, but the links are broken. Go to [URL="http://sfrederick.com"]http://sfrederick.com[/URL] to see what I mean. Here is the script: [CODE] <? $username = "sfrederick1"; $prefix = "Latest Tweet: …

Member Avatar for atrueresistance
1
235
Member Avatar for Paladine
Member Avatar for ordinary jam

i'm trying to add two fractions via a function and it works. the problem is that i have to print the fraction in the main( and i have absolutly no idea how to do that) other than that the program works fine. [CODE]#include<stdio.h> #include<conio.h> #include<iostream.h> int frac(int,int,int,int); void main() { …

Member Avatar for mrnutty
1
1K
Member Avatar for Lord Soth

ShowDriveSerialNo shows it with ShowMessage GetDriveSerialNo returns a string. You don't need both.

Member Avatar for hingman
1
1K
Member Avatar for delphi7

How to create a custom webbrowser in minutes with many added features. It took me several months to create this tutorial so I hope many people will find it useful. Every care has been taken to make this code as accurate as possible, should there still be any mistake then …

Member Avatar for delphi7
1
556
Member Avatar for alwaysLearning0

Mike_2000_17 and Narue Just a thought: You should write a beginner's tutorial on C++0x for Daniweb. That will be a great way to promote this site. I can also contribute on some easier topics!!.

Member Avatar for mike_2000_17
1
161
Member Avatar for sergent

Hello, I am making a program that will draw a ramps for a bike game. It does that by making many lines which form a ramp or other figures. For one of the ramps I have a small problem. In the game if something is too smooth, it will slip …

Member Avatar for sergent
1
278
Member Avatar for hfx642

I have a few JSpinner(s) and I'm trying to change the button sizes. I know how to change the font of the SpinnerModel(s), but not the button sizes. Can someone please point me in the right direction? TIA!

Member Avatar for hfx642
1
1K
Member Avatar for zachf632

So I have recently been learning java and everywhere I go I hear that java is a slow language compared to C or c++. I know that when it came out in the 90's that it was a lot slower, but I was wondering how much slower is it today. …

Member Avatar for pseudorandom21
1
211
Member Avatar for AngelicOne

I know it's a good way to catch an exception but why not just make it into a simple if..else statement and run a block of codes then used die to stop the code following it from executing or echo to enable the scripts following it from executing. What's the …

Member Avatar for pritaeas
1
198
Member Avatar for aphpdeveloper

Hello, I am stumped on a problem im having, and I get the feeling that the solution is quite simple yet requires knowledge of certain functions. Basically I am creating a guestbook which allows users to post comments, however I am trying to create an admin approval system so that …

Member Avatar for aphpdeveloper
1
263
Member Avatar for TrustyTony

Breakin news item from [url]http://python.org/download/releases/3.2.1/[/url] (hope the input from command line will also be fixed) Python 3.2 is a continuation of the efforts to improve and stabilize the Python 3.x line. Since the final release of Python 2.7, the 2.x line will only receive bugfixes, and new features are developed …

Member Avatar for bumsfeld
1
501
Member Avatar for caut_baia

Hi guys.Does anyone who studied the implementation of stringstreams know if : [code] char c; std::stringstream ss; ss << std::fstream ("file.xml",std::ios::in).rdbuf();//this is eqaul in terms of speed while (ss.get(c)) {} //with this? std::ifstream f("file.xml"); while (f.get(c)) {} //or this? [/code] Thanks a lot.

Member Avatar for caut_baia
1
109
Member Avatar for TrustyTony
Member Avatar for Archenemie
1
707
Member Avatar for meleo

After spending abut 8 hours frustrated (and growing very grumpy) :) I found a solution and wanted to share. On my site, I use cPanel. I found a couple of posts that saved me some serious headaches so I decided to share them here to hopefully help someone else. I …

Member Avatar for meleo
1
128
Member Avatar for ravenous

Hi, Firstly, sorry about the large amount of code in this question. OK, so I'm making a C++ wrapper for the [URL="http://www.gnu.org/software/gsl/manual/html_node/Matrices.html"][icode]gsl_matrix[/icode][/URL] struct and its associated functions. To make my approach a bit easier to extend to other kinds of gsl structs, I have a template base class called [icode]gsl_base[/icode], …

Member Avatar for ravenous
1
384
Member Avatar for solomon_13000

I simulated a load balancing concept using java code. It works well when two services access the display method concurrently. However if there are more than two request then this algorithm is likely to fail. Therefore how could I solve this problem? Your help is kindly appreciated. Thank You. [CODE] …

Member Avatar for nmaillet
1
171
Member Avatar for Shizuo

We have given an individual assignment about a simple atm program which withdraw and check balance, sounds simple? here's the twist, the atm database have money inside with denominations 1,000bill, 500bill and 100bill ,20 pieces each , so once the user withdraw cash, it should output how many 1000,500,100 bill …

Member Avatar for Shizuo
1
117

The End.