199,114 Archived Topics

Remove Filter
Member Avatar for
Member Avatar for Chunkymonkey

Hi everyone, I'm new to daniweb and seems cool there are alot of nice helpful people on here. With my dad we are trying to script a simple poker game on python(and tkinter). There are 4 players ( 1 real and 3 artificiel intelligence players), each AI should be able …

Member Avatar for Chunkymonkey
0
184
Member Avatar for niladri.user

Can anyone send me a simple, understandable javascript code for form validation, including e-mail validation,name validation , password validation etc. pls! send me in hurry!!!:'(

Member Avatar for peter_budo
0
81
Member Avatar for Mackjan

Hi I try to copy a list to another list but it dosent work[code] def kopi(x,y): i=0 for i in range (1,len(x)-1): x[i]= y[i-1] i+=1 print y [/code] I dont know what is the problem with my code. thanks alot for your help.

Member Avatar for vegaseat
0
110
Member Avatar for FreezeBlink

Hey. I'm working on a simple project that requires a way to find all the empty grid cells accessible along a path that's <= n cells long (an analogy would be TBS movement), and I've got an [i]almost[/i]-working piece of code for it. Here's the function I wrote: [code=Python]def findArea(distance,origin,gridUsed,emptyChar): …

Member Avatar for vegaseat
0
142
Member Avatar for Micko

Hi to all, after two months I decided to give Python one more chance. Here is a little code snippet about counting number of words in text file. (Under word I assume any combination of letters and numbers delimited by standard separators " .,\n\t" [code] file = open ( "Test.txt", …

Member Avatar for vegaseat
0
5K
Member Avatar for Black Magic

Hey, I have noticed when you use srand or rand you write: [CODE=C++]rand() % 99 + 1[/CODE] I was wondering about the 1, is it just tradition to use it or is it from 1-99? Just because i was wondering how i could make it between say 20 and 40 …

Member Avatar for CoolGamer48
0
88
Member Avatar for iamnoangel26

Umm i just want to ask how to use an array and when to use them. I just cant get what my teacher is telling. Maybe someone can give me a new idea. That's all thanks :)

Member Avatar for gazoo
0
215
Member Avatar for Azurea

Hi guys, I have a simple question. I'm trying to import my modules from a different folder (the different folder is in the same place as the the program I'm importing from), but I don't know how. I've looked on Google, but I've had no luck so far. My question …

Member Avatar for Azurea
0
89
Member Avatar for estoyer

Greetings all, I've been asked to create a database to track and report testing progress of a large number of IO points for an industrial plant. I can't seem to come up with an elegant way to split up the data, so I'd appreciate input from folks with more experience. …

Member Avatar for amigura
0
185
Member Avatar for CodeBoy101

How do I read a file thats in a folder, but is in the same folder as the exe.? And how do I do this no matter what folder the root folder is placed in?

Member Avatar for CodeBoy101
0
339
Member Avatar for tymk

Running 64-bit Fedora 8 on HP laptop with AMD Turion 64bit/dual core, developing in Eclipse, compiling with g++. The [icode]clock();[/icode] function always returns 0. Any ideas why this is so? I have had no problems using the rest of the [icode]ctime[/icode] library. [code=cpp] #include <ctime> using std::clock; #include <iostream> using …

Member Avatar for Salem
0
5K
Member Avatar for Mark515
Member Avatar for CFrances

I'm new to Python and I'm working on a craps game. I got the basic code down, but I need to simulate a total of 200 games and track the number of wins. I need a counter in my program, but I can't figure out how to do this. Here's …

Member Avatar for CFrances
0
3K
Member Avatar for samudebr

I am desing a POS resturant system, is it possible to add a timer at the buttom of a button so that when the first order is entered the timer will start ?

Member Avatar for tgreer
0
193
Member Avatar for Onixtender

Hi, I have a problem creating one part of the program, Lets say we have a line (from data file): 333 hou 23se 444 bi 4g and the program should change to : house big deleting first number if there is one ,and changing word parts to numbers, and deleting …

Member Avatar for Onixtender
0
150
Member Avatar for Black Magic

Hey, i was just going to start making a game where srand made a random number between 1&99 and that is the power you would hit of someone else, the one to defeat the other person won, I got some prefix errors etc : [code=c++]#include <conio.h> #include <iostream> using namespace …

Member Avatar for Black Magic
0
157
Member Avatar for Fabioisonfire

Here is the error I'm getting: Parse error: syntax error, unexpected T_STRING in /home/fabio/public_html/vote.php on line 21 Here's the code: [CODE]<?php session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us …

Member Avatar for phper
0
113
Member Avatar for kbehemoth

I have a problem geeks!!! In following program..... [code=c] #include<stdio.h> #include<conio.h> void main() { float f=0.7; clrscr(); if(f<0.7) printf("C+"); else printf("C++"); getch(); } [/code] in the above program when I give the value of f=0.7 and in if statement also I put the same value 0.7 then the output of …

Member Avatar for Salem
0
154
Member Avatar for dreamgirl

Hi, well my question is how to calcuate the total cost for a shop which is as follows [code] Item Quantity Price per unit Total cost 1 2 20 40 3 1 25.50 25.50 [/code] Total 65.50 [code=cplusplus] float total(int qty, int price); { int t; t=qty*price; if ((qty<10.00)&&(price<100.00); return …

Member Avatar for dreamgirl
0
107
Member Avatar for David Wang

I am doing windows forms application in C++, using visual studio 2005. I could reach Form2 from Form1 by clicking a "log-in" button in Form1, after fill in the name in a textbox. Then I would like to show the log-in name in Form2 somewhere. I have got a class …

Member Avatar for mitrmkar
0
301
Member Avatar for its.romi

Added just to help other.... [code=c] #include<stdio.h> #include<conio.h> #include<stdlib.h> void createHashTable(void); void getData(void); void formatting(void); int insertData(int); int collision_OpenHashing(struct hashOpen*& ,int); int generateKey(int); void DispData(void); void DispHash(void); #define dataSize 15 #define empty -1 #define fail 0 #define success 1 struct hashOpen{ int item; struct hashOpen *next; }*head, hashTable[10]; int dataArray[dataSize]; …

Member Avatar for rizrash
0
117
Member Avatar for Brent.tc

Hi, I was wondering how to make a program listen on a port... lests say port 54321. All I want for it to do is listen for any message sent on that port, and then output "54321"... Is this as simple as I think, or is it something that is …

Member Avatar for Laiq Ahmed
0
97
Member Avatar for farifari

hi, Can anyone tell me how to retrieve data from one form to another in VB.net,,,???? Actually I have a form in which i have 5 values with labels and text boxes,I know I can edit n save them,, i have linked this through Data base but i want that …

Member Avatar for charitha_sharma
0
196
Member Avatar for echoestroy

I was wondering how i could set up a random number loop, but have it stop looping when it hits 1 or any other number i assign. i use dev C++ compiler [code] //Damage Roller #include <iostream> #include <cstdlib> #include <ctime> #include <conio.h> using namespace std; int main() { srand(time(0)); …

Member Avatar for echoestroy
0
142
Member Avatar for selvaganapathy

Hi My Question is how to use printer in vb6. I know some of the printer properties. But when printer prints some text it automatically goes to next paper, it is not good for bill printing. any one say how to code printer for bill format

Member Avatar for selvaganapathy
0
118
Member Avatar for RanmaSaotome

okay. i ahve a question, if any one is willing to help me out. aim: recreate a dynamic 'lights out' i want to position controls into a grid like view at runtime, so the result would look something like this: 00 01 02 03 04 05 06 07 08 09 …

Member Avatar for selvaganapathy
0
132
Member Avatar for Princequarles

Hi all, I have a problem reading data from my file for example this is my textfile CODE MARKER //Names of columns in my table PKY KELLYS ELM ELMANS OOC OLIVER QRT QUATAR A user is asked for code, when the code is entered, the corresponding name is displayed eg …

Member Avatar for Salem
0
107
Member Avatar for jimzy2008

I have an assignment for school that involves creating a java program that creates a basic class. I'm getting an error missing return statement, if i try to compile. What could be wrong here?

Member Avatar for VernonDozier
0
95
Member Avatar for y25zhao

Hi, I'm writing a general Node class in C++ right now. I don't know how to make it having an ability to carry a general object. For example, I want my Node class could carry a general Object. It might be a "Book", a "Person" or an integer. I know …

Member Avatar for vijayan121
0
144
Member Avatar for Inny

I use an image resizer/veiwer script That works Great in IE, but I've discovered that the custom page I use for Showing the Images, appears as text in Firefox. How can I make it show as text/html ? It's a simple enough page. page code <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML …

Member Avatar for Inny
0
1K
Member Avatar for Inny

[code] <body onload=function(){document.getElementById("place_holder").src =document.getElementById("imgurl").value;} > <script> function ResizeThem() { maxheight=250; maxwidth= 250; imgs=document.getElementsByTagName("img"); for (p=0; p<imgs.length; p++) { if (imgs[p].getAttribute("alt")=="user posted image") { w=parseInt(imgs[p].width); h=parseInt(imgs[p].height); if (parseInt(imgs[p].width)>maxwidth) { imgs[p].style.cursor="pointer"; imgs[p].setAttribute('alt','Reduced Image - Click to see full size'); imgs[p].onclick=new Function("document.getElementById('imgurl').value = this.src; iw=document.getElementById('this.src','viewer')open();iw.focus()"); imgs[p].height=(maxwidth/imgs[p].width)*imgs[p].height; imgs[p].width=maxwidth; } if (parseInt(imgs[p].height)>maxheight) { imgs[p].style.cursor="pointer"; imgs[p].onclick=new …

Member Avatar for Inny
0
95
Member Avatar for lianaconda

Hi. So, my assignment is to convert an infix expression into a postfix one, and then evaluate it. I already completed the infix to postfix part. I have a small problem evaluating the postfix expression though. The expression deals with booleans, and allows the ! operator. I'm not sure how …

0
85
Member Avatar for Inny

Im using the following script to resize and Automate thumbnails of user posted images on my forum. However I dont like the white background of the new window. Im wondering if its possible to launch the full size image in a customized window with a background image, such as http://h1.ripway.com/Inny/ImageViewer.html …

Member Avatar for Inny
0
315
Member Avatar for Crushyerbones

Basicaly I'm trying to do this [code=C] int create_student(student_data *student){ printf("Nome do aluno:\n"); fgets(student->name,name_limit,stdin); //wtf? printf("Número do aluno\n"); fgets(student->number,name_limit,stdin); printf("Aqui devia estar um nome %s",student->name); return 1; } [/code] Where student is a custom struct, student->name is char array. For some reason it seems to skip the fgets. Replacing with …

Member Avatar for Dave Sinkula
0
107
Member Avatar for NinjaLink

Hey, I'm trying to get my program to run correctly. I can get the black screen to come up after compiling, but it does not say "Press any key to continue...". I'm reading from input file and want to see results in an output file. My ultimate goal is to …

Member Avatar for NinjaLink
0
86
Member Avatar for mousey182

I've tried searching the web and cant find anything to help me. I'm trying to create a 2D java maze application and have come up with the code below. It generates the maze and GUI no problem, and I've worked the code out to create a xPosition and a yPosition …

Member Avatar for chrisclairs
0
1K
Member Avatar for dpfaff

Hello, I am relativly new to programing, and I need some help on a lab project. If anyone out there can explain why I am getting the following errors. 55: inlab was not declared in this scope In funtion void selectionSort(char (*)[25], int) 74:error: Stropy was not declared in the …

Member Avatar for dpfaff
0
173
Member Avatar for eemqjunk

hello, i'm a newbie programmer (and to python, double trouble :) and running into issues reading and writing files. i'm successfully running the code below to manipulate and remove the first few lines of a text file. The text file (file1.txt) is approx. 329kb but when i run the code …

Member Avatar for ZZucker
0
92
Member Avatar for Belo

Hi Members Its the first time iam writing in this forum ,iam a new member from TANZANIA I want to design the LIBRARY MANAGEMENT SYSTEM using VISUAL BASIC 6.0 Can you help me to wite the code for SARCHING BOOKS WHICH ARE STORED IN MY DATABASE AND RETRIEVE IN A …

Member Avatar for Jx_Man
0
88
Member Avatar for panderso

Hi I am doing this simple program in visual basic express Sum.Text = Val(Num1.Text * 3) + Val(Num2.Text) + Val(Num3.Text) - Val(Num3.Text) This allows the user to enter number of wins (which gets x by 3) number of draws and number of losses. I have to limit the user to …

Member Avatar for Jx_Man
0
105
Member Avatar for Black Magic

The title says it all, i was just wondering if i made a simple text based game what would i use? Like I've heard about things called sockets, ports etc? Just in curiosity

Member Avatar for hammerhead
0
79
Member Avatar for Black Magic

Hey, I was just mucking around and made a simple random number generator and made a "love percentage game" but, if you re-open the .exe and type the same names in it gives another completely different percentage, would i save the names to do a file or some kind? [code=c++]#include …

Member Avatar for Black Magic
0
158
Member Avatar for kako13

Hi, I wrote a program to input an INFIX convert it to POSTFIX and then evaluate it. But the function 'evaluarRPN' used for evaluate POSTFIX some time work and some time not, depend of the input. For example: (8*9-8/5+6)*(5-9) = -305, but the program display -308 (8+9) = 17, display …

Member Avatar for kako13
0
290
Member Avatar for Visualogic
Member Avatar for peter_budo
0
82
Member Avatar for sonia sardana

[B][COLOR="Red"]1)[/COLOR][/B] Single Line Textbox can have a horizontal scrollbar-i READ FROM D BUK. But no scrollbar is going to attached with single line textbox. Can a single line textBOX HAVE hor. scrollbar. [B][COLOR="Red"]2)Selstart and SelLength[/COLOR][/B] Private Sub Command1_Click() Text1.SelText = UCase$(Text1.SelText) Label1.Caption = Text1.SelStart Label2.Caption = Text1.SelLength End Sub I …

Member Avatar for choudhuryshouvi
0
210
Member Avatar for spuddy1515

I need help with manipulating my computers clock through a c++ program and i have no idea on how to make the program. Does anyone have any idea on how to do this?

Member Avatar for spuddy1515
0
528
Member Avatar for sreehari.rk

double b = 3.0000; char s[20]; sprintf(s,"%f",b); Here char s[20] is fixed it should take values however small be it.I will be happy if I get tat 20 at runtime as a varible with correct allocation size.Else for small value ter will be wastage of memory.It will allocate 20 for …

Member Avatar for Duoas
0
1K
Member Avatar for eleonora

Hello, I strongly need your assistance what is needed to modify in order the board to inherit the complete functionality of the game. The clienthandler class contains all the methods for playing the game on the terminal [please check the code] Thanks in advance for any help ! [CODE=java] import …

Member Avatar for jwenting
0
128
Member Avatar for Ravenous Wolf

I suppose that this is the wrong place to voice critique of php but does the lack of good php books not make php a bit of a nightmare. i have been on amazon and all the books have a review or two which says something about typos or misleading …

Member Avatar for Ravenous Wolf
0
148
Member Avatar for hyperzero4

I'm a Comp Sci I student in college, and I have an assignment to make a quick sort that can sort vectors up to size 32000 with no problem. So, my program has been having a lot of trouble with big numbers, and every once in a while, I get …

Member Avatar for hyperzero4
0
172

The End.