Member Avatar

hey I'm making my own adventure text game and I need help. [CODE]def getEnergyAndMana(magicExp, energyExp, maxYourMana, bonus, energyLevel, bonus1): magicLevel = 0 if magicExp >= 0: magicLevel = 0 maxYourMana = 50 + bonus if magicExp >= 550: magicLevel = 1 maxYourMana = 100 + bonus if magicMax >= 1150: magicLevel = 2 maxYourMana = 150 + bonus if magicExp >= 1750: magicLevel = 3 maxYourMana = 200 + bonus if magicExp >= 2350: magicLevel = 4 maxYourMana = 250 + bonus if magicExp >= 3050: magicLevel = 5 maxYourMana = 300 + bonus if magicExp >= 3750: magicLevel = …

Member Avatar
+0 forum 2
Member Avatar

Hello folks, I'm getting the error message "Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /var/www/login.php on line 9". I've been at it for hours and my eyes are starting to bleed, I would greatly appreciate a code-weary traveller could spot my mistake. Here's the first 10 lines of my page. The inconspicuous.inc file just defines $host, $password etc. [code=php]<?php session_start(); include("inconspicuous.inc"); switch (@$_POST['do']) { case "login": $connect=mysql_connect($host, $user, $password, $database) or die("Couldn't connect to server."); $sql="SELECT loginID FROM member WHERE loginID='$_POST[fusername]'"; $result=mysql_query($connect, $sql) or die(mysql_error() "Query FAIL."); $num=mysql_num_rows($result);[/code] Thanks in advance, Darren.

Member Avatar
+0 forum 4
Member Avatar

Hi! I'm just started learning C++ and i tried to do a calculator for fun. I did not succeed :$ There is an error here that i cannot find... Please, if you find it let me know :icon_smile: [CODE]#include <iostream> #include <cmath> using namespace std; int main() { double num1; double num2; char sign; cout << "Once you enter a number press \"ENTER\"" << endl; cin >> num1; cin >> sign; cin >> num2; cout << "The result is "; if (sign == '+'){ cout << num1+num2; } else if(sign == '-'){ cout << num1-num2; } else if(sign == '*'){ …

Member Avatar
-1 forum 3
Member Avatar

Hi, I am still new to C++ and I am having a little trouble compiling the following code, and couldn't figure out what went wrong: [CODE]#include <iostream.h> #include <string.h> using namespace std; float x = 5.0f; int _65Num = 65; int mian() { string str = "Hello World!"; cout << str << endl; cout << x << "" << str << endl; cout << "65Num = " << _65Num << endl; }[/CODE] The question ask me to identify the problem which I tried to correct as much as I can but I still get some problem while compiling... The original …

Member Avatar
+0 forum 4
Member Avatar

Hi guys... I know little to nothing about this and i was told to run this command, but I got this error when I did...does any know the correct syntax for this? I appreciate your help and thank you in advance! Error SQL query: CREATE TABLE wp_wpmq( id int( 11 ) NOT NULL AUTO_INCREMENT , email varchar( 100 ) NOT NULL default '', subject varchar( 100 ) NOT NULL default '', message text NOT NULL default '', headers text, attachments text PRIMARY KEY ( id ) ) MySQL said: Documentation #1064 - You have an error in your SQL syntax; …

Member Avatar
+0 forum 1
Member Avatar

hello guys this is my first attempt in C++ and i am getting an error :( the programs is made to read 20 numbers and find how many of them are even (like 2,4,6,20,40) [CODE] #include <iostream> using namespace std; int c[20]; int s = 0; int i = 1; int main() { cout << "Enter the numbers followed by the ENTER key\n"; loop: cin >> c[i]; if(c[i]%2=0)[COLOR="Red"] //line with error[/COLOR] {s++;} i++; if (i<=20) goto loop; cout << "done!\n Number of values: "; cout << s; system("PAUSE"); return 0; } [/CODE] [COLOR="red"]and the error:[/COLOR] [code]In function `int main()' line …

Member Avatar
+0 forum 2
Member Avatar

I was working on the being of a cash register and I was testing this portion of my code. It compiles, but when I input my first items name I get a windows error and the program ends. I would appreciate any help an/or explanation. [CODE]#include <iostream> // allows output and input #include <iomanip> //allows i/o manipulation #include <stdlib.h> #include <fstream> // allows file i/o #include <string> // allows the use of strings //declares variables int current_input_number; int number_of_items; main() { using namespace std; system("COLOR 0a"); // changes color //declares an array of strings string item_name[number_of_items]; cout << "How many …

Member Avatar
+0 forum 3
Member Avatar

Hi, I have used the following code (this is from HeadFirst Java Book) [CODE] import java.awt.*; import javax.swing.*; import javax.sound.midi.*; import java.util.*; import java.awt.event.*; public class BeatBox { JPanel mainPanel; ArrayList<JCheckBox> checkboxList; Sequence sequence; Sequencer sequencer; Track track; JFrame theFrame; String[] instrumentNames = {"Bass Drum", "Closed Hi-Hat", "Open Hi-Hat", "Acoustic Snare", "Crash Cymbal", "Hand Clap", "High Tom", "High Bongo", "Maracas", "Whistle", "Low Conga", "Cowbell", "Vibraslap", "Low-mid Tom", "High Agogo", "Open Hi Conga"}; int[] instruments={35,42,46,38,49,39,50,60,70,72,64,56,58,47,67,63}; public static void main (String[] args) { new BeatBox().buildGUI(); } public void buildGUI() { theFrame = new JFrame("Cyber BeatBox"); theFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); BorderLayout layout = new BorderLayout(); JPanel …

Member Avatar
+0 forum 3
Member Avatar

Hey, how's it going? I decided to pick up Python for the heck of it and have been having some trouble creating this Card Deck class. All this class is supposed to do is initialize a deck, and then draw a card at total random: [code] import random class CardDeck(): suit = ["Spades","Clubs","Hearts","Diamonds"] number = ["Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King", "Ace"] def DrawCard(): randomsuit = random.randrange(0,3) randomnumber = random.randrange(0,12) print ("You drew the " + number(randomnumber)+ " of " + suit(randomsuit) +"!") CardDeck.DrawCard() [/CODE] Each time I try this, the IDLE returns: "NameError: …

Member Avatar
+0 forum 7
Member Avatar

[COLOR="Green"][B]Well, that's it, i'm trying to compile a dialog box:[/B][/COLOR] [CODE] case WM_COMMAND: switch(LOWORD(wParam)) { case ID_HELP_ABOUT: { int ret = DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_ABOUT), hwnd, [COLOR="Red"]AboutDlgProc);[/COLOR] if(ret == IDOK){ MessageBox(hwnd, "Dialog exited with IDOK.", "Notice", MB_OK | MB_ICONINFORMATION); } else if(ret == IDCANCEL){ MessageBox(hwnd, "Dialog exited with IDCANCEL.", "Notice", MB_OK | MB_ICONINFORMATION); } else if(ret == -1){ MessageBox(hwnd, "Dialog failed!", "Error", MB_OK | MB_ICONINFORMATION);[/CODE] [COLOR="green"]And i get this error:[/COLOR] [CODE]C:\\my\\pc\\programmain.cpp 'AboutDlgProc' was not declared in this scope[/CODE] [COLOR="green"]I'm using wxDevC++ does anyone knows the reason i get this error??[/COLOR] ( My headers are: #include <windows.h> #include "resource.h" , do i need …

Member Avatar
+0 forum 6
Member Avatar

Can anyone out there tell me why my Windows Live apps refuse to upgrade? Error message 0X80004004.:@ All of the windows Live apps used to work. Now, all I have left is WXL Mail, which I never use anyway. This has been an ongoing problem for over a year. The WXL Team doesn't or won't answer my queries, but they send me surveys on how well they performed in answering them! This is rude and screwed. Anyway, There is nothing wrong on my end, I have checked and rechecked. My PC and Security are fine. Sorry for going on so …

Member Avatar
+0 forum 1
Member Avatar

Hello, im trying to use a function inside another function and getting an error: The function: [CODE]# Function that recieves number of characters and calculate cost of advertising def costAd(numChar): if numChar >= 15: cost = 35.00 else: cost = 35.00 + ((numChar - 15) * 3.55) return cost costAd()[/CODE] Function where im using it on: [CODE]from costAd import * def main(): costMsg = 0.00 totalCost = 0.00 # apply for loop, with range of 11 for x in range(1,11): msgLen = input("Enter the length of message" + str(x)+ ": ") costMsg = costAd(msgLen) totalCost += costMsg print "For 10 …

Member Avatar
+0 forum 7
Member Avatar

My computer has crashed again!! (for the 3rd time!!) and it says "BOOT DISK ERROR PLEASE INSERT SYSTEM DISK" which I have done...Windows XP....Now its sayin it cant set it up,as it cant find the drivers!!!...help me PLEASE! I'm gonna throw it thru the window soon ! If anyone can help me,I would eternally be grateful to you,if you can explain in simple terms what i need to do,as im not "technically" sound with computers...sorry

Member Avatar
+0 forum 2
Member Avatar

ok i got a Fujistu Siemens ESPRIMO Mobile V5505 worked fine til now... then all of a sudden it won't start.. like the battery is dead... nothing happens.. nothing at all ...not one beep or sound then when i conect the power adapter it starts beeping repeatedly .. no pattern of beeps .. just the same sound in a loop and the LEDs from the LAN port and Modem port flash with the beeps. nothing else happens. I'm sure it's somekind of error code but i can't tell what it is.. please give me some insight

Member Avatar
+0 forum 1
Member Avatar

Hello, I am a complete beginner at Java and I'm having a problem with something I don't understand at all. I'm trying to complete some homework in which I need to finnish off writing a small program which reads a text file and checks brackets in the file. Basically, it creates a stack, reads some file, and whenever it encounters an opening bracket "{", "(" or "[" it pushes it to the stack. Whenever it encounters a closing bracket it checks the top of the stack to see whether the opening bracket on top matches the closing bracket. Whilst I …

Member Avatar
+0 forum 2
Member Avatar

Hi, So I am currently working on a homework assignment for my data structures class, basically C++, and I am having some troubles converting a working c++ program to use a template. [code] #include <iostream> using namespace std; /* -------------------------------------------------------------------------- */ /* */ /* SECTION: DECLARATIONS */ /* */ /* -------------------------------------------------------------------------- */ template<class T> class TClass { public: // constructor TClass(); //destructor ~TClass(); //to compute the minimum of two integers int min(int,int); //to compute the minimum of two floats float min(float,float); //to compute the minimum of two characters char min(char,char); //to compute the maximum of two integers int max(int,int); //to …

Member Avatar
+0 forum 1
Member Avatar

Hi, i have a problem, i am using a library given by my university to create a game, these are my classes and cpp files, and i am getting this error: error C2512: 'Board' : no appropriate default constructor available, pls help. [code] class Board { protected: GWindow &Gwin; int coorX; int coorY; int x,y,x2,y2,x3,y3,d; int BoxX[20]; int BoxY[20]; bool gotBox; //int BlackX[5]; //int BlackY[5]; public: Board(GWindow &); void createBoard(); void selectBox(); }; #include "board.h" class Ship : public Board { private: GWindow &Gwin; string shipName; int shipX,shipY; int shipHP; int shipType; int i; public: Ship(GWindow &); void getShip(string,int,int,int); void …

Member Avatar
+0 forum 7
Member Avatar

Hi, I'm trying to connect to a web service using excel. I have currently no issues logging into the web service and also fetching data using one of the methods. But the two other methods, I get the error that states that it had run into an error restoring data. There are 4 main method. The first method logs me into the system, and returns a token. With this token, I have to send this data to retrieve other data. The second one, and third one return lists depending on my log on ID, and the fourth return a full …

+0 forum 0
Member Avatar

Hi, I am working on the jquery slideshow script, which i had borrowed from some famous jquery plugin and customized so nicely so as to look just as par my requirement .Its working perfectly fine in the Internet Explorer but failing to even call the event on click in firefox and that's too without notification of any error in the error console. Now I feel the lack of any debugging tools for jQuery...

Member Avatar
+0 forum 9
Member Avatar

Hello, I have compiled a GCC plugin successfully, but I get error when linking: [CODE]$ make /opt/imo/bin/g++ -g -fplugin=../libimo/libimo.so -o test main.cpp cc1plus: error: Cannot load plugin ../libimo/libimo.so ../libimo/libimo.so: undefined symbol: _ZN11NodeFactory10CreateNodeEN4BEEV4KindERKNS0_7ASTNodeES4_RKSt6vectorIS2_SaIS2_EE make: *** [default] Error 1 [/CODE] I know that the plugin works fine for other Ubuntu users, so I don't understand what could be the cause of this error on my system. I read on the Internet that "undefined symbol" error means that the linker can not find the line where a specific object was defined in the code. Is there a way to trace down where the …

Member Avatar
+0 forum 4
Member Avatar

[CODE]Private Sub Form_Load() s = InputBox("please enter staff id") t = InputBox("please enter your password") Set db = OpenDatabase("C:\Program Files\Microsoft Visual Studio\VB98\my new prj\prj1.mdb") Set rs = db.OpenRecordset("staffper", dbOpenDynaset) Set ro = db.OpenRecordset("timetable", dbOpenDynaset) Set rm = db.OpenRecordset("staffattend", dbOpenDynaset) Set rt = db.OpenRecordset("staffmsg", dbOpenDynaset) Set rp = db.OpenRecordset("staffpass", dbOpenDynaset) 'rs.MoveLast 'While rs.Fields(6) <> s And rs.BOF = False 'rs.MovePrevious 'Wend 'If rs.BOF = True Then 'MsgBox ("check your id") 'End If 'ro.MoveLast 'While ro.Fields(40) <> s And ro.BOF = False 'ro.MovePrevious 'Wend 'If ro.BOF = True Then 'MsgBox ("check your id") 'End If 'ro.MoveLast 'lab: If (ro.Fields(40) <> s) Then …

+0 forum 0
Member Avatar

hi all, I have a php script that saves what the user types in into a text file using fwrite, and displays it on another page using file_get_contents. When putting in a pound sign (£), it saves the following to the text file: £ Any idea how I can stop this from happening and instead get the pound sign working properly? Max.

Member Avatar
+0 forum 3
Member Avatar

Hi i'm running windows xp and after a while i keep getting a blue screen. the latest info i got when rebooting, in the windows has recovered from a serious error was; BCCode : 4e BCP1 : 00000007 BCP2 : 0000BEF2 BCP3 : 00062F20 BCP4 : 00000000 OSVer : 5_1_2600 SP : 3_0 Product : 768_1 This is becoming severely disruptive now. Any help greatly appreciated

Member Avatar
+0 forum 7
Member Avatar

Hi all. Just today I had been on the computer for some hours. I turned it off, and then on again, and got an error saying that the NTLDR is missing. I did my research and apparently I need to restore my XP Home Edition with my Windows XP CD. I might have it, but i'm not sure. Is there any way I can download it? Also, is the Windows XP CD the same as the Windows XP Boot CD? Finally, if I do a system restore with my CD, it'll erase all of my files? Are there any ways …

Member Avatar
+0 forum 5
Member Avatar

im trying to add a new records to database access but when i click the button submit it say's Syntax error in INSERT INTO statement, OledbException was unhandled da.Update(ds, "MSHS") = syntax error INSERT INTO here's my code [CODE]Public Class StudentRegistrationForm Dim inc As Integer Dim con As New OleDb.OleDbConnection Dim dbprovider As String Dim dbsource As String Dim ds As New DataSet Dim da As OleDb.OleDbDataAdapter Dim sql As String Private Sub StudentRegistrationForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load dbprovider = "Provider=Microsoft.ACE.OLEDB.12.0;" dbsource = "Data Source=C:\MSHS.accdb" con.ConnectionString = dbprovider & dbsource con.Open() sql = "SELECT * …

Member Avatar
+0 forum 3
Member Avatar

Afternoon all, Having a bit of an issue with messenger, any help would be great before it slowly sends me insane! Brief history of the issue, was getting another error code, so after a week I Googled it and saw copious suggestions that I solve remove it then reinstall. Having removed Messenger, it would not reinstall as apparently I already had it on my laptop. Used Zapmessenger, installed great. Went to login for the first time on new Messenger, and got the 8007007e error message. Tried a different login, same error. (both logins work fine on my BlackBerry though). Googled …

Member Avatar
+0 forum 4
Member Avatar

[CODE=c] #include<stdio.h> void astrcat(char s[], char t[]); //to concatenate two string main() { int i=0,p=0,q=0,c; char s[100],t[100]; while((c=getchar())!='\n') s[p++]=c; while((c=getchar())!='\n') t[q++]=c; astrcat(s,t); while(s[i]!='\0') printf("%c",s[i++]); return 0; } void astrcat(char s[],char t[]) { int i, j; i = j = 0; while (s[i] != '\0') /* find end of s */ i++; while ((s[i++] = t[j++]) != '\0') /* copy t */ ; } [/CODE] The above code works fine but show some additional symbols after the concatenated string. I've checked it several times but am unable to spot the error. Pls run this code on ur system and let me …

Member Avatar
+0 forum 3
Member Avatar

[CODE] #include<stdio.h> void reverse(char s[], int i); main() { int i,c; char s[1000]; for(i=0;(c=getchar())!='\n';i++) { s[i]=c; c=getchar(); } void reverse(s,i); [B] //getting error in this line[/B] return 0; } void reverse(char input[], int n) { int i; for(i=n;i>=0;--i) { printf("%c", input[i]); } } [/CODE] i am writing a program to reverse the input string, with the help of a function "reverse". However, my program doesn't compile. Pls tell me the cause of the error , as i have tried a lot to spot it but fails. I'm new to programming.

Member Avatar
+0 forum 6
Member Avatar

So I have this C code which is supposed to check if words from a input.txt are in a dictionary.txt document that I have created. Words in both texts are separeted by comas ej. dog,house,car@ and end with the "@" char. So far I have adjusted the code and it compiles but it does not run properly ie it starts but then is shuts down. I would like to know if there is something missing or wrong with the code. Any help would be appriciated thx. Here is the code: [code] #define WORDS_IN_DICT words_in_file(DICT) #include<stdio.h> #define WORD_AMOUNT 5 #define LETTERS_PER_WORD …

Member Avatar
-2 forum 6
Member Avatar

Hi and I have the below php-gtk script but for some reason it is reporting the error "Not enough storage is available to process this command." in the command console but the application still loads. It only happens when I try to import a 1.75MB text file for processing. Does anybody know why regex and str replace on a 1.75MB file causes this error or how to increase its storage. Please advice. [CODE]<?php ini_set('memory_limit','256M'); if (!class_exists('gtk')) { die("Please load the php-gtk2 module in your php.ini\r\n"); } function func_generate() { //reword button clicked. return true; } function func_open() { global $wnd, …

Member Avatar
+0 forum 2

The End.