199,114 Archived Topics

Remove Filter
Member Avatar for
Member Avatar for brylle
Member Avatar for sellemaster

Hey, I'm trying to create a simple Yatzy game in C++ (I'm new to programming) anyway here is my code: void gameMechanics(int& numberOfPlayers) //NumberOfPlayers are not used in this function at this point. { int diceResult = 0; int fiveDices[4]; string throwDices; cout << "Throw dices?(y/n): "; getline(cin, throwDices); if(throwDices …

Member Avatar for sellemaster
0
161
Member Avatar for ramadan10

i have just started learning c++ and i like to know after writing a c++ code how do u process it to become a software so that you can intsall it in another computer and use it

Member Avatar for ramadan10
0
198
Member Avatar for gwolf1

Can someone help me complete my code? I am having trouble with it and I need some input. //#include "bigint.h" #include <stdio.h> #include <stdlib.h> #include <assert.h> #include <string.h> /* Create and implement a bigint data structure that can represent integers whose size is limited only by the memory capacity of …

Member Avatar for gwolf1
0
349
Member Avatar for rotten69

Hi there, I was reading a book on the plane and something interesting came to my mind that needs an answer. The length property of objects is a read/write value. Let's say, you've got an array that has 6 elements in it and you change its length to 10 as …

Member Avatar for Troy III
0
288
Member Avatar for Stefano Mtangoo

I have done alot of OOP for long now (with C++/Java/Python etc) but world of JS is confusing. I wanted to try it by writting Ajax library (I know there are libs but this for JS OOP familiarization) and found confusing. No class keyword et cetera. What is happening? Am …

Member Avatar for Troy III
0
159
Member Avatar for rotten69

Hi everyone, The function I've got works perfectly but the problem is that it displays the message quickly and then the message disappears for some reason. Am I doing something wrong?? function validateForm(){ var input0 = document.getElementById('input0').value; var input1 = document.getElementById('input1').value; var input2 = document.getElementById('input2').value; var input3 = document.getElementById('input3').value; var …

Member Avatar for Troy III
0
227
Member Avatar for rotten69

Hi everyone, I am looking for an editor or plugin for Komodo or Eclipse that provides me with the CakePHP function autocompletion and syntax correction as well. Thank you all.

Member Avatar for rotten69
0
192
Member Avatar for dinohead

Hello I need to do it in ansi c Can't seem to get it to work at the moment. unsigned char *s scanf("%x", &s); I then want to do if statements based on the amount of characters contained in the variable s. Whats the easiest way to get this? An …

Member Avatar for rithish
0
137
Member Avatar for WolfShield

Hello everyone, I am working my way through the Forger's Win32 tutorial and am on the "Creating a Simple Application" part currently. I am using C++ (instead of C in the tutorial) and the WinGW compiler. When I compile the below code I get this error: main.cpp: In function 'LRESULT …

Member Avatar for ravenous
0
584
Member Avatar for rahul.ch

A question that I came across: Q: Can you pass a double to a method when it's argument is a float? A: No. Regardless of the double value, a double-sized variable is too big to fit in a float, so it can't be implicitly cast. Doubt: Shouldn't narrowing happen implicitly?

Member Avatar for JamesCherrill
0
208
Member Avatar for Steve97

Program PRG3; Var { Declaring Varaibles } FileIn:text; FileOut:text; SECTION_NUMBER:string[5]; STUDENT_ID:string[9]; LAST_NAME:string[20]; FIRST_NAME:string[10]; RAW_SCORE:real; STUDENT_COUNT:integer; AVERAGE_SCORE:integer; AVERAGE_GRADE:integer; Percent:real; more_rec:boolean; {end of file flag} Computed_grade:integer; Grade:real; procedure read_record; begin if not Eof(fileIn) then readln(SECTION_NUMBER,STUDENT_ID,LAST_NAME,FIRST_NAME,RAW_SCORE) else more_rec := False end; {read record} procedure print_header; begin writeln(fileout,Space(14),'COMPUTE GRADE'); writeln(fileout,space(17),'SECTION','SECTION_NUMBER'); writeln(fileout); writeln(fileout,space(9),'LAST_NAME',space(11),'FIRST_NAME',' RAW_SCORE',' COMPUTED_GRADE'); …

Member Avatar for pritaeas
0
194
Member Avatar for Reverend Jim

This is a short bit of code that shows how to implement sorting on columns in a details-mode ListView. Suggestions for improvement are always welcome. One possible improvement would be to modify the column headers to indicate which column is being sorted and in which direction.

0
2K
Member Avatar for 111100/11000

#include <iostream> #include <string> #include <cmath> using namespace std; //global varibals: char entered_characters[9999]; int direction_of_rotor1; int direction_of_rotor2; char alphabet_of_rotor1[26]; char alphabet_of_rotor2[26]; char rotor1_backward(char Letter); char rotor1_forward(char Letter); char rotor2_backward(char Letter2); char rotor2_forward(char Letter2); char print(char print_char); int main() { cout << "This is enigma machine:" << endl; cout << "*NOTE:This …

Member Avatar for WaltP
0
217
Member Avatar for mithunan7

Hello world, I am stumped, someone please help me with some code. I have created a purl, example: www.mydomain.com/purl However, I want people to first go to www.mydomain.com. On the homepage, I want people to enter their phonenumber (which is the purl) in a textbox. I am looking for a …

Member Avatar for mithunan7
0
156
Member Avatar for <M/>

I wrote the code for a jquery slider... it doesn't seem to work... can someone tell me why it doesn't work??? Could it be because jquery is installed wrong or it can't find it? Here is my code (I did this all in 1 file) <title>Slider</title> </head> <script src="jquery-1.7.2.js" type="text/javascript"></script> …

Member Avatar for JorgeM
0
164
Member Avatar for sokolov

I am new to python but have experience with Java. I am creating a bouncing ball program which throuhg a for loop creates a large sum of bouncing balls. I appreciate any help! Thank you import time from random import randint x0 = 10.0 y0 = 10.0 ball_diameter = 15 …

Member Avatar for TrustyTony
0
1K
Member Avatar for achilleus1234

I currently found a piece of code on a website but i can't get it to work it always reports fail. Pls help. Private Function FindImage(Image1 As Bitmap, Image2 As Bitmap) As Point For y = 0 To Image1.Height - Image2.Height - 1 For x = 0 To Image1.Width - …

Member Avatar for Reverend Jim
0
324
Member Avatar for weirdCreature7

A newbie here I am having an error with this code. If I logged in with correct username and password the "Sorry please log in" is appearing not the home page :( I am having a hard time to check if the user has log in or not when opening …

Member Avatar for diafol
0
172
Member Avatar for Veronika9

Hi guys, I read about this problem but can't figure what should I change. Can you please help? Here's my code: <?php // Title: Contact Form - Dolce Forno GB // Updated: 9/8/2012 // Author: Veronika Horvathova //Validation code if (empty($_POST) === false) { $errors = array(); //variables $name = …

Member Avatar for addme
0
220
Member Avatar for Dylxy

I am looking for good C# .NET 4.0 database tutorials. I want to learn working with a database in C#, i already know SQL from another language PHP. Thnx

Member Avatar for king03
0
244
Member Avatar for mtho

Hi guys. I want to insert an advert after the first article on my blog. It's not a wordpress or other generic blog. I have an idea on how i should do it but it just doesn't work when i try. I use a do-while loop to call the articles. …

Member Avatar for mtho
0
101
Member Avatar for alaa sam

Hi everyone well currently I am working on a simple malloc and free implementation but I am facing some problems . I get a segmentation fault this is my output inserting node 0 0xc87000 inserting node 1 0xc87014 inserting node 2 0xc87028 inserting node 3 0xc8703c inserting node 4 0xc87050 …

Member Avatar for alaa sam
0
213
Member Avatar for Gé48

Hello I am new here as well as with vb2008xpress and I have a question. I have a datagridview with 12 columns and 30 rows I want to use as a scoreboard for a game (no need to input or save data). Columns are for the players and rows for …

Member Avatar for arcjamesneo
0
268
Member Avatar for chotep

class Nines { public static void main(String[] arguments) { for (int dex = 1; dex <= 200; dex++) { int multiple = 9 * dex; System.out.print(multiple + " "); } } }

Member Avatar for chotep
0
171
Member Avatar for triumphost

I currently use this to serialize data, write it to shared memory so that another program can reconstruct it and use it: template<typename T> void Serialize(unsigned char* &Destination, const T &Source) { CopyMemory(Destination, &Source, sizeof(T)); //Destination += sizeof(T); //Not sure if to add this or not. } template<typename T> void …

Member Avatar for triumphost
0
106
Member Avatar for yeeitsneo

soooo. i saw a working code for a hindu arabic - roman numeral converter. the thing is. i need to fully understand the code. so i need someone who could explain the code clearly to me. line by line as for me to fully understand the program. newbie here. you …

Member Avatar for yeeitsneo
0
500
Member Avatar for gorybmovie

I keep getting this error message when I try to 'login' to my php member system that I'm creating. Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\acrd\includes\header.php:24) in C:\xampp\htdocs\acrd\login.php on line 21 Here is line 21 header('Location: index.php'); Here is my code. Please help! …

Member Avatar for gorybmovie
0
197
Member Avatar for JarrodIsSuperman

Hey guys, Having an issue with a webpage I am building. I can get it to save the name of the image, however when I echo it out and im trying to include it as an img src tag it tells me I have a syntax error. I think this …

Member Avatar for JarrodIsSuperman
0
529
Member Avatar for hughesadam_87

Hi, I have an object subclass that I am using with a cusom __repr__() method. class NewClass(object): def __repr__(self): return ', '.join('%s=%s'%(k, v) for (k,v) in self.__dict__.items()) This works fine (leaving out some more details about my program): test=NewClass(a=1,b=2) print test a=1, b=2 But what I really want for reasons …

Member Avatar for hughesadam_87
0
184
Member Avatar for Frensi

I'm learning about Classes and this thing is driving me crazy. Whenever I run this, it will use the __del__ object even though I never used del droid1, del droid2, or del droid3. Can someone please help? class Robots: '''Represents a robot, with a name.''' #A class variable, counting the …

Member Avatar for Gribouillis
0
311
Member Avatar for jingxian.fs

/** @file Graph.h */ #ifndef GRAPH_FLIGHTFINDER #define GRAPH_FLIGHTFINDER #include <iostream> #include <fstream> #include <sstream> using namespace std; //graph implementation class FlightGraph { //A Node class to create pointer for graph implementation class Node { public : string name; double cost; Node * next; // constructor Node() { name=" "; next=NULL; …

Member Avatar for Ancient Dragon
0
567
Member Avatar for jadzrev13

Hi Everyone, I am a beginner in PHP and would need your help with this. I get this problem: Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in database.php on line 207 Here is my code: include("constants.php"); class MySQLDB { var $connection; //The MySQL database connection var …

Member Avatar for ryantroop
0
341
Member Avatar for BBMoretti

i have a listview and a combobox. i need to display all my column headers from the listview as items on my combobox. also i need to "sort" the data of my listview according to the selected item on my combobox. ex: my listview contains the column headers, "name", "address", …

Member Avatar for Reverend Jim
0
164
Member Avatar for deepak jois

Session.Clear(); Response.Buffer = true; Response.ExpiresAbsolute = DateTime.Now.AddDays(-1D); Response.Expires = -1500; Response.CacheControl = "no-cache"; //----- Second Technique : To Stop Caching of Secure Pages. Response.Cache.SetCacheability(HttpCacheability.NoCache); FormsAuthentication.SignOut(); if (Session["UserName"] == null) { Response.Redirect("login.aspx"); } Session.Clear();

Member Avatar for hericles
0
80
Member Avatar for rotten69

Hi everyone, I was in a group meeting for a project and my group members were talking about minimizing the number of tables and having two big tables and one or two small tables connected to the main big ones. The question is : What is better to have less …

Member Avatar for rotten69
0
133
Member Avatar for im abcd

So I have coded this program on formula method . #include <iostream> #include <cstdlib> #include <cmath> using namespace std; int main() { int a , b , c ; cout << " Enter the values of a , b , c " << endl; cin >> a ; cin >> …

Member Avatar for im abcd
0
424
Member Avatar for wilddrummer

Hi all, thanks in advance for the help. I have placed an "X" on the first JButton and what I need it to do is this... Once the user has clicked the button with the "X" it needs to disappear and reappear on a different button. This process needs to …

Member Avatar for NormR1
0
235
Member Avatar for dawsonrose

Hello, I've a file which contains names and grades of students, and I'd like to write a program which can sort their grades (like midterm 1,midterm 2) according to user choice. I wrote as far as the choice part and opening the file, yet I don't know how to make …

Member Avatar for WaltP
0
788
Member Avatar for jere.saw

Which of the following statements will display "Problem!" if bit 2 of flags is a '0'?

Member Avatar for WaltP
0
53
Member Avatar for jd9211

Hi, I have EntityDataSource1 and i am allowing user to edit Primary Key column. the column is 5 characters code (string) that user has to enter. I am using telerik Grid and inline editing. Obviously if duplicate is entered it will thow this error, but i am confused, where in …

Member Avatar for jd9211
0
153
Member Avatar for kathir100
Member Avatar for JamesCherrill
0
256
Member Avatar for thechampp

Hello everyone, I have task "Write a program that calculates N!/K! for given N and K (1<N<K)." I want to ask is this the right solution ? using System; class NandKFactorials { public static double fact(double x) { double result = 1; for (int i = 1; i <= x; …

Member Avatar for sepp2k
0
98
Member Avatar for han2503

I've been getting this error after I insert the require_once('login.php') I've checked both files and I don't have any empty lines after the php closing tags as is usually the case with this error This is the code [CODE]<html> <head> <title>Home</title> </head> <body> <link rel="stylesheet" type="text/css" href="style.css"/> <?php require_once('login.php'); require_once('appvars.php'); …

Member Avatar for huded
0
369
Member Avatar for adishardis

I'm trying to get a flot graph to show my jsonencoded array seen below: [["aa",71],["ab",69],["ac",66],["ad",61],["ae",79],["af",78]] In the array the first is what i want on the xaxis and the second is the corresponding value. Right now my flot graph outputs an empty chart and I'm thinking that the array need …

Member Avatar for adishardis
0
1K
Member Avatar for glao

I am trying to implement periodic boundary conditions for 2d lattice. I did: int boundary2d(int xpos,int ypos,int stepx,int stepy){ int x=4,y=4; //grid size int **matrix; //the grid matrix int i=stepx+xpos; int j=stepy+ypos; if (i<0) { do { i+=Nx; }while (i>Nx-1); } if (i>Nx-1) { do{ i-=Nx; }while(i>Nx-1); } if (j<0) …

Member Avatar for glao
0
1K
Member Avatar for logicaweb

I'm trying to make multiplication in web shop that will show real price: **discount * tax * product price * 1 piece= real price** But I just don't know how to do it, I try 1 million things, spend about 48h just to make it, but, without success, no matter …

Member Avatar for logicaweb
0
327
Member Avatar for powerdink

Hello, Please help. Below is my assignment and the code I've got so far. I'm still getting errors on overloading the member function on the printDay and prevDay. Design and implement a class dayType that implements the day of the week in a program. The class dayType should store the …

Member Avatar for Brandon5122
0
6K
Member Avatar for majimboo04

how to code this.. in 200 to 1 i need to decrease by 3 and displaying odd or even numbers.. can you help me.. ty :)

Member Avatar for ravenous
0
88
Member Avatar for devianleong

function returnnotify(){ $result = mysql_query("SELECT * FROM rentcustomer WHERE Expiredtime = CURDATE()"); $count = mysql_num_rows($result); if ($count >= 1){ echo $count; }else{ echo "0"; } } now when I run the code above ,it will prompt out this error: Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in …

Member Avatar for pritaeas
0
253

The End.