199,114 Archived Topics
Remove Filter ![]() | |
| |
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 … | |
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 | |
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 … | |
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 … | |
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 … | |
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 … | |
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. | |
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 … | |
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 … | |
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? | |
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'); … | |
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. | |
![]() | #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 … |
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 … | |
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> … | |
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 … | |
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 - … | |
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 … ![]() | |
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 = … | |
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 | |
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. … | |
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 … | |
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 … | |
class Nines { public static void main(String[] arguments) { for (int dex = 1; dex <= 200; dex++) { int multiple = 9 * dex; System.out.print(multiple + " "); } } } | |
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 … | |
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 … | |
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! … | |
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 … | |
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 … | |
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 … | |
/** @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; … | |
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 … | |
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", … | |
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(); | |
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 … | |
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 >> … | |
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 … | |
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 … | |
Which of the following statements will display "Problem!" if bit 2 of flags is a '0'? | |
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 … | |
Hi budy can you explain anyone which i have writen in the article title | |
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; … | |
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'); … | |
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 … | |
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) … | |
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 … | |
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 … | |
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 :) | |
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 … |
The End.