39 Discussion / Question Topics

Remove Filter
Member Avatar for Nathaniel10

Last week the New York Times semed to skewer Amazon over the stress it places on its workers. I read today that Dustin Mosokvitz confirms such high stress work environments and confesses that his health deteriorated while at Facebook as a result. I don't work in IT but I hope …

Member Avatar for jkon
0
248
Member Avatar for Nathaniel10

In my continuing quest to improve my understanding of OPP in PHP, I have developed another project. It is closer to my field and a real life project I hope to develop, than my previous post using geometric shapes. This draft program is the simplest version. I want to increase …

Member Avatar for Nathaniel10
0
199
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 have searched for and read through over 50 examples of linked lists. I can barely make heads or tails out of them. Some are in C, some are in Java, some use templates, most only discuss theory and display flowcharts but have few explained examples. I need serious help! …

Member Avatar for Nathaniel10
0
299
Member Avatar for Nathaniel10

I am teaching myself C++ and wrote a program that does the queue data structure. It runs corectly. I would like some feedback on how I can improve the program to make it run faster, use fewer lines of code, or be clearer to someone else. I haven't added my …

Member Avatar for Nathaniel10
0
87
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 am developing my own project for the practice. I am having a great deal of difficulty conceptualizing the classes I want. The scenario is that of 2 countries, each capable of producing 2 goods, using 2 factors of production. Specifically, Lower Mongolia and Upper Mongolia have certain amounts of …

Member Avatar for Nathaniel10
0
124
Member Avatar for Nathaniel10

I have made revisions to my program. I gave up on the idea of using functions that return arrays. That was far too complicated for the expected benefit. This latest version compiles and runs correctly with all of the provisions required by the exercise. What remains is feedback on the …

Member Avatar for Nathaniel10
0
148
Member Avatar for Nathaniel10

This is part of my Wumpus Hunt program. Suggestions were to clean up the main() part of the program by creating functions. I am working on that and ran into this difficulty (for me). The functions that relate to the rooms of the game need to return an array. I …

Member Avatar for arshad115
0
232
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

An exercise is to write a program that shows how memory is allocated to stack variables compared to heap variables. I ran the following code. [code] #include "../../std_lib_facilities.h" int main () { char c = ' '; char ch0[10]; char *ch = new char[10]; char *init_ch = ch; cout << …

Member Avatar for Nathaniel10
0
157
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

This is a follow-up exercise to the one related to reference and dereference operators. Stroustrup asks the reader to modify that program to handle an array overflow. He wants us to specifically use the realloc() function. I read the tutorial here but didn't understand the example. I read other web …

Member Avatar for Ancient Dragon
0
98
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 in Stroustrup's book. The task is to create two arrays (with different values) and pointers to each array, and copy the first array to the second using the pointer and reference operators. My code is below. [code] #include "../../std_lib_facilities.h" int main () { …

Member Avatar for Nathaniel10
0
74
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 would like to place a caret (^) above certain characters in my text. The text decoration options I find are underline, overline, and strike-through. I also find ASCII characters with carets but theses are only vowels, and I would like any character to have a caret. Is it possible …

Member Avatar for aquilax
0
88
Member Avatar for Nathaniel10

I am reading the first chapter on graphics in the Stroustrup book. He explains that we students will need to download the files of a GUI toolkit in order to run programs containing graphics. He recommends the "Fast Light Tool Kit, FLTK" because the book's programs are based on that …

Member Avatar for usagi
0
114
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

Me Again! This program is for exercise 5) of chapter 9 in Stroustrup's book. It was a challenge for me. I gave up on trying to use [code]getline()[/code] because it required substantial parsing of the line before I could use the input. I will add it when I am more …

Member Avatar for mrnutty
0
131
Member Avatar for Nathaniel10

I did exercise 2) of chapter 9 in Stroustrup's book. That chapter is about classes, its members, enumerations, constructors, etc. This is my first attempt at writing a program with classes containing public and private members that are both data variables and functions. It compiled and ran correctly,BUT. The exercise …

Member Avatar for Nathaniel10
0
91
Member Avatar for Nathaniel10

An exercise is to write a program that generates random numbers within user specified limits. The program I wrote is as follows and it runs correctly. [code] #include "../../std_lib_facilities.h" void randnum(double lower, double upper, int n) // Generate 'n' random numbers uniformly distributed { // between lower and upper limits. …

Member Avatar for mrnutty
0
183
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
Member Avatar for Nathaniel10

I am learning C++ from the Stroustrup book "Programming Principles and Practice". I have been doing the exercises in each chapter. I have gotten stuck on chapter 6. I understand the concepts of classes, constructors, functions, and 'throw and catch' error handling, but seemingly not well enough to actually write …

Member Avatar for Nathaniel10
2
141
Member Avatar for Nathaniel10

Hi!, I am doing the exercises in Stroustrup's book, Programming: Principles and Practice Using C++. The 6th chapter uses a simple calculator to demonstrate Tokens and grammars. I realize that there are other calculator questions in the forum, but I did not find one that dealt directly with mine. An …

0
40

The End.