22 Solved Topics

Remove Filter
Member Avatar for Nathaniel10

I want to increase my knowledge of PHP by learning about classes. I wrote the following very simple test program. It works. But I would like to know improve it. I plan on writing more complex test programs and that won't be the time to iron out smaller issues. Thanks …

Member Avatar for diafol
0
443
Member Avatar for Nathaniel10

Hello All, My old computer crashed. I installed XAMMP on my new computer. My old PHP files don't run. I learned that the reason is that register_globals feature has been deprecated and is now permanently Off by default. My old files were written in a 'register_globals=On' environment. I understand that …

Member Avatar for Nathaniel10
0
357
Member Avatar for Nathaniel10

I have a form with several inputs. One has a sub-input based on the condition of the original input. An example is: <input onChange="javascript:addRow()"/> The JS function works. function addRow() { Dynamic HTML code ... } However, if the original input is modified a second time, the JS function executes …

Member Avatar for Troy III
0
203
Member Avatar for Nathaniel10

I have a problem that includes finding the maximums and minimums of certain variables in sequence. I want to nest the max() and min() functions as follows. $variable5 = min(max(($variable1 - $variable0), 0), $variable3); The PHP manual says/suggests that this type of nesting is possible. However, the code doesn't run …

Member Avatar for Nathaniel10
0
370
Member Avatar for Nathaniel10

I have a script in which I would like new code to appear based on the response to a question. I am using 'onChange' to trigger the event. The difficulties I am having are that: 1) The format of the form changes after the event. I would like the new …

Member Avatar for Nathaniel10
0
129
Member Avatar for Nathaniel10

I am teaching myself C++ and amd now trying to simple programs related to data structures. I wrote this code for a simple stack. It is not working. I am frustrated and tired so I cannot think through the issue. There are two main problems with which I need help. …

Member Avatar for Nathaniel10
0
122
Member Avatar for Nathaniel10

I would like to express a superscript and a subscript in the same vertical space. For example, consider a variable called X with a subscript 1 that is squared. I have searched for examples of what I want to do but cannot find anything close. [code] X<sub>1</sub><sup>2</sup> [/code] The above …

Member Avatar for Nathaniel10
0
101
Member Avatar for Nathaniel10

I am organizing my site to make it easier and faster to maintain. I keep a small version of my site on my laptop running Apache/PHP. I successfully organized and recoded things to the way I wanted. Upon uploading the file to my live site, I ran into several problems. …

Member Avatar for Nathaniel10
0
169
Member Avatar for Nathaniel10

Hi. This is not a frequently browsed category, but there is no place else for my question. I am organizing my site to make it easier and faster to maintain. I keep a small version of my site on my laptop running Apache/PHP. I successfully organized and recoded things to …

Member Avatar for Nathaniel10
0
226
Member Avatar for Nathaniel10

I was already thinking along ARKoenig's suggestion and revised my code to use arrays. It was working pretty well until I made some minor changes. Now it loops non-stop without any prompt for the player to make a play. I am sure it is a small error, but I can't …

Member Avatar for Nathaniel10
0
165
Member Avatar for Nathaniel10

Is it possible to have an array as a class member? It is part of my Wumpus Hunt exercise. I want to do the following: [code] class Room { blah blah; }; int main() { for (i = 0; i < 3; i++) { Room adjacent[i]; blah blah; } [/code] …

Member Avatar for Nathaniel10
0
111
Member Avatar for Nathaniel10

Stroustrup has an exercise in which the reader writes a program for the wumpus hunt game. A first draft of my code is below. It compiles and runs partly correctly. If you choose to move to a different room the program runs as expected. If you choose to shoot at …

Member Avatar for SgtMe
0
179
Member Avatar for Nathaniel10

I have a difficulty I need help to overcome. I am developing a program that uses more than 1 class. Variables defined in one class are used in other classes. For example: [code] class X1 { private: int a; int b; public; X1() { a = 10; b = 20; …

Member Avatar for Nathaniel10
0
153
Member Avatar for Nathaniel10

An exercise that Stroustrup wants the reader to do is understand the output of the following program. [code] #include "../../std_lib_facilities.h" struct X { int val; void out(const string& s, int nv) { cerr << this << "->" << s << ":" << val << "(" << nv << ")\n"; } …

Member Avatar for Nathaniel10
0
87
Member Avatar for Nathaniel10

OK. I thought I understood pointers and such but this exercise is revealing that I do not. The task is to read characters into an array created on free store memory (heap), then print them out using the reference and dereference operators. My code (below) compiles and runs but does …

Member Avatar for Nathaniel10
0
126
Member Avatar for Nathaniel10

An exercise in Stroupstrup's book is to write a program involving memory allocation with an infinite loop and let it run until it crashes. He says the crash will be due to [i]memory exhaustion[/i]. He also suggests researching the topic. I did and am frightened by what I found. The …

Member Avatar for Nathaniel10
0
1K
Member Avatar for Nathaniel10

I am trying to do an exercise from Stroustup's book. The task is to create an array of 7 ints, assign its address to another variable, then print out the array value and the address. My code is below. [code] int main () { int p0[7] = {0, 0, 0, …

Member Avatar for Nathaniel10
0
86
Member Avatar for Nathaniel10

I manage a small website. I went over the logs this morning and found a page reference on the site that should not have been there. It was of the format "/xmlrpc.php". I did a search for the term and found the XMLRPC website. I didn't understand what was written …

Member Avatar for Nathaniel10
0
120
Member Avatar for Nathaniel10

I manage a small website. I went over the logs this morning and found a number of pages or page references on the site that should not have been there. Most were of the format "/_vti_bin/". I did a search for the term and learned about the Front Page debacle. …

Member Avatar for Nathaniel10
0
160
Member Avatar for Nathaniel10

I hope this is the correct forum for this question. I manage a small website. The site uses a database with MySql. When I launched the site, around 3 years ago, the PHP code I wrote had minimal security and validation in PHP because I relied on javascript validation for …

Member Avatar for hielo
0
144
Member Avatar for Nathaniel10

I am doing an exercise from Stroustrup's book. It is the drill from chapter 10 on input and output streams. The program I wrote compiles but crashes when it reaches the prompt for the output file name. My IDE (VC++ Express) simply says there is an unhandled exception yielding a …

Member Avatar for Nathaniel10
0
157
Member Avatar for Nathaniel10

I tried to do an excercise from Stroupstrup's book. The reader is asked to reverse the order of elements in a vector so that if originally vector[0] = 1, vector [1] = 2, and vector[2] = 3, then new vector has newvec[0] = 3, newvec[1] = 2, and newvec[2] = …

Member Avatar for Nathaniel10
0
194

The End.