1,076,001 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?

Posts by FC Jamison Contributing to Articles being Marked Solved

OK...that worked on my server when I named the original document index.shtml. The shtml extention was required so that I could add the SSI (server side include) directives to the existing page.

FC Jamison
Posting Pro in Training
Team Colleague
446 posts since Jun 2004
Reputation Points: 92
Solved Threads: 21
Skill Endorsements: 0

So should the code look something like this?

<html>
<head>
<title>EngineeringNotes.net</title>
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>


<!--#include file="header.html" -->

<div class="page"><!-- start page -->

	<!--#include file="sidebar.html" -->

	
	<div class="content"><!-- start content -->
		<h2>About this Site</h2>
		<p>
		This site is inteded to provide a "crash course" in many subject areas
		related to electrical engineering. The primers are not at all designed
		to
		be a replacement for a formal course in these topics. The target
		audience is a serious student who feels that it is worth their time
		outside of class to make sure they are getting the "big picture" and
		seeing the value of the subject rather than simply learning the mechanics of "doing problems". 


	</div><!-- end content -->
	
</div><!-- end page -->

</body></html>

With the header.html file as...

<div class="header">
	<div id="logo">
		<h1>EngineeringNotes.net</h1>
	</div>
	<div class="menu">
		<ul>
			<li><a href="mailto:daviddoria@gmail.com">Contact Me</a></li>
			<li><a href="phpBB3">Forums</a></li>
			<li><a href="Ideology.html">Ideology</a></li>
		</ul>
	</div><!-- end menu -->
</div><!-- end header -->

...and the sidebar.html file being...

<div class="sidebar"><!-- start sidebar -->
		<h2>EE Topics</h2> 
		<ul>
			<li><a href="Notes/EE/PatternRecognition.pdf">Pattern Recognition</a> </li>
			<li><a href="Notes/EE/ImageProcessing.pdf">Image Processing</a> </li>
			<li><a href="Notes/EE/ComputerVision.pdf">Computer Vision</a> </li>
			<li><a href="Notes/EE/ComputerGraphics.pdf">Computer Graphics (stub)</a> </li>
			<li><a href="Notes/EE/SignalsAndSystems.pdf">Signals and Systems</a> </li>
			<li><a href="Notes/EE/Communications.pdf">Communications</a> </li>
		</ul>
		

	</div><!-- end sidebar -->
FC Jamison
Posting Pro in Training
Team Colleague
446 posts since Jun 2004
Reputation Points: 92
Solved Threads: 21
Skill Endorsements: 0

I am not seeing a problem at all in IE7.

FC Jamison
Posting Pro in Training
Team Colleague
446 posts since Jun 2004
Reputation Points: 92
Solved Threads: 21
Skill Endorsements: 0

You're going to have to be a bit more descriptive with your problem.

After opening a text file from where? What does ftp have to do with the text file?

What exactly are you trying to do?

FC Jamison
Posting Pro in Training
Team Colleague
446 posts since Jun 2004
Reputation Points: 92
Solved Threads: 21
Skill Endorsements: 0

You could try something like this:

CSS

#button1 {
  width: 50px;
  height : 25px;
  overflow : hidden;
  background-image: url('/images/image.jpg');
}

#button1:hover {
  background-image: url('/images/imageon.jpg');
}

HTML

<div id='button1'>
 &#160;
</div>
FC Jamison
Posting Pro in Training
Team Colleague
446 posts since Jun 2004
Reputation Points: 92
Solved Threads: 21
Skill Endorsements: 0
FC Jamison
Posting Pro in Training
Team Colleague
446 posts since Jun 2004
Reputation Points: 92
Solved Threads: 21
Skill Endorsements: 0

Just glancing at the code, would this modification work?

unsigned int getVolume() {
     setVolume();
     return Volume;
}
FC Jamison
Posting Pro in Training
Team Colleague
446 posts since Jun 2004
Reputation Points: 92
Solved Threads: 21
Skill Endorsements: 0

We really need to see a working page so we can identify the problem.

My guess is that there is some object that is getting moved to a different position and is bumping everything else down.

FC Jamison
Posting Pro in Training
Team Colleague
446 posts since Jun 2004
Reputation Points: 92
Solved Threads: 21
Skill Endorsements: 0

Can you give us a link to the page so we can look at it?

FC Jamison
Posting Pro in Training
Team Colleague
446 posts since Jun 2004
Reputation Points: 92
Solved Threads: 21
Skill Endorsements: 0

I had a midterm problem similar to this last year.

The question was

3) Write a function using the following structure and prototype.

struct stat
{
    float avg;
    float median;
    float *mode;
    int nModes;
};

stat *avgMedMode(int *,int);

The function takes in an integer array and the size of the array.
Then returns a pointer to a structure containing the average, median
and mode. I will input a small array to test this out so ask for
how many inputs to fill the array, then the values to place into the
array. Make sure you delete the dynamic array creation for the mode
when you exit the problem.

My solution (as a module of the entire midterm program) is as follows:

// Frank C. Jamison
// April 08, 2006
// CIS 17A - Section 43052
// Borland C++ Builder Enterprise Suite Version 6.0
// Purpose:  Midterm Examination Program 3
// Midterm Examination

#include <iostream>
using namespace std;

// Structure Declarations - Midterm Program 3
struct stats {
  float avg;
  float median;
  int  *mode;
  int   nmodes;
};

// Function Declarations - Midterm Program 3
stats *avgMedMode(int *, int);
int   *createArray(int);
void   displayStats(stats);
int    findHighFrequency(int*, int);
int    findNumModes(int *, int, int);
float  getArrayAverage(int *, int);
void   getArrayElements(int *, int);
float  getArrayMedian(int *, int);
int    getModeArray(int *, int, int *, int);
void   programHeader3();
void   sortArrayElements(int *, int);

// Function Declarations - Multiple Files
void clear();
bool validLoNum(int, int);
void wait();


//*****************************************************************************
// FUNCTION: MIDTERM PROBLEM 3                                                *
//*****************************************************************************
void problem3() {

  // Variable Definition
  int numElements;

  // Display program header
  programHeader3();

  // Get and validate number of integers to calculate
  do {
    cout << "\n\tNumber of integers: ";
    cin  >> numElements;
  } while (!validLoNum(numElements, 1));

  // Create dynamic array to hold integers
  int *intArray = createArray(numElements);

  // Get integer array elements
  getArrayElements(intArray, numElements);

  // Dynamically allocate memory for stats structure and set structure
  // variables
  stats *arrayStats = avgMedMode(intArray, numElements);

  // Display Integer Array Statistics
  displayStats(*arrayStats);

  // Free dynamically allocated memory
  delete [] arrayStats->mode;
  delete [] intArray;
  delete arrayStats;
}

//*****************************************************************************
// FUNCTION: MIDTERM PROBLEM 3 - Create Structure and Set Variables           *
//*****************************************************************************
stats *avgMedMode(int *arrayPtr, int numElements) {

  // Variable Definition
  int highFrequency;

  // Dymanically create stats structure
  stats *statStruct = new stats;

  // Sort survey results in ascending order
  sortArrayElements(arrayPtr, numElements);

  // Find highest integer frequency
  highFrequency = findHighFrequency(arrayPtr, numElements);

  // Find the number of modes in the array
  statStruct->nmodes = findNumModes(arrayPtr, numElements, highFrequency);

  // Dynamically create new array to hold mode of integer array
  int *modeArray = createArray(statStruct->nmodes);

  // Add modes to mode array
  *modeArray = getModeArray(modeArray, highFrequency, arrayPtr, numElements);

  // Set structure pointer to mode array
  statStruct->mode = modeArray;

  // Find the median value of the integer array
  statStruct->median = getArrayMedian(arrayPtr, numElements);

  // Find the average value of the integer array
  statStruct->avg = getArrayAverage(arrayPtr, numElements);

  return statStruct;
}

//*****************************************************************************
// FUNCTION: MIDTERM PROBLEM 3 - Dynamically Allocate Memory for Integer      *
//           Array                                                            *
//*****************************************************************************
int *createArray(int numElements) {

  // Dynamically allocate memory for integer array
  int *array = new int[numElements];

  // Return pointer to dynamically allocated memory for integer array
  return array;
}

//*****************************************************************************
// FUNCTION: MIDTERM PROBLEM 3 - Display Integer Array Statistics             *
//*****************************************************************************
void displayStats(stats arrayStruct) {

  // Display program header
  programHeader3();

  // Display integer array statistics
  cout << "\n\tInteger Array Statistics\n";
  cout << "\n\tArray Average:   " << arrayStruct.avg << endl;
  cout << "\n\tArray Median:    " << arrayStruct.median << endl;
  
  // If the array mode is set to -1, report that there is no mode
  if (*arrayStruct.mode == -1)
    cout << "\n\tArray Mode:      None";

  // If the array mode is not set to -1, display the array mode
  else {
    cout << "\n\tArray Mode:      ";

    for (int i = 0; i < arrayStruct.nmodes; i++)
      cout << arrayStruct.mode[i] << " ";
  }

  // Wait for user to hit [Enter] to continue
  wait();
}

//*****************************************************************************
// FUNCTION: MIDTERM PROBLEM 3 - Find Highest Integer Frequency               *
//*****************************************************************************
int findHighFrequency(int* arrayPtr, int numElements) {

  // Local Variable Definitions
  int currentHigh   = 1,
      frequency     = 1,
      highFrequency = 1;

  // Check the frequency of each element in the array
  for (int i=1; i < numElements; i++) {

    // If the current element has the same value as previous element,
    // add 1 to frequency
    if (arrayPtr[i] == arrayPtr[i - 1])
      frequency += 1;

    // If the current element has a different value than the previous,
    // set the value of currentHigh to frequency and reset frequency to 1
    else {
      currentHigh = frequency;
      frequency = 1;

      // If value of currentHigh is greater highFrequency, set value of
      // highFrequency to currentHigh
      if (currentHigh > highFrequency)
        highFrequency = currentHigh;
    }

    // If all elements in the array have the same value, set value of
    // highFrequency to frequency
    if (frequency > highFrequency)
      highFrequency = frequency;
  }

  // Return the highest integer frequency
  return highFrequency;
}

//*****************************************************************************
// FUNCTION: MIDTERM PROBLEM 3 - Find Number of Modes in Integer Array        *                                                           *
//*****************************************************************************
int findNumModes(int *arrayPtr, int numElements, int highFrequency) {

  // Variable Definitions
  int frequency = 1,
      numModes  = 0;

  // Check the frequency of each element in the array
  for (int i=1; i < numElements; i++) {

    // If the current element has same value as previous element,
    // add 1 to frequency
    if (arrayPtr[i] == arrayPtr[i-1]) {
      frequency += 1;

      // If frequency has the same value as highFrequency, add 1 to
      // numModes
      if (frequency == highFrequency)
        numModes += 1;
    }

    // If current element has a different value than the previous
    // element, reset frequency to 1
    else
      frequency = 1;
  }

  // If there is only one element in the array, set numModes to 1
  if (numModes == 0)
    numModes = 1;

  // Return the number of modes in the array
  return numModes;
}

//*****************************************************************************
// FUNCTION: MIDTERM PROBLEM 3 - Get the Average Value of the Integer Array   *                                                         *
//*****************************************************************************
float getArrayAverage(int *arrayPtr, int numElements) {

  // Local Variable Definitions
  float average = 0.0;

  // Get the sum of all array elements
  for (int i = 0; i < numElements; i++)
    average += arrayPtr[i];

  // Divide the sum of the array elements by the number of array elements
  average = average / numElements;

  // Return the average value of the integer array
  return average;
}

//*****************************************************************************
// FUNCTION: MIDTERM PROBLEM 3 - Get Elements for Integer Array Pointed To    *
//*****************************************************************************
void getArrayElements(int *arrayPtr, int numElememts) {

  // Display program header
  programHeader3();

  // Get and validate integer for each array element
  for (int i = 0; i < numElememts; i++) {

    do {
      cout << "\n\tEnter an integer for Element " << (i + 1) << ": ";
      cin  >> arrayPtr[i];
    } while (!validLoNum(arrayPtr[i], 0));
  }
}

//*****************************************************************************
// FUNCTION: MIDTERM PROBLEM 3 - Get the Median Value of the Integer Array    *                                                        *
//*****************************************************************************
float getArrayMedian(int* arrayPtr, int numElements) {

  // Variable Definitions
  int   middle,
        midpoint1,
        midpoint2;
  float median;

  // If there are an even number of elements, calculate the average of
  // the two middle elements
  if (numElements %2 == 0) {
    midpoint1 = (numElements / 2);
    midpoint2 = midpoint1 - 1;
    median    = (arrayPtr[midpoint1] + arrayPtr[midpoint2]) / 2.0;
  }

  // If there is an odd number of elements, get the middle element
  else {
    middle = (numElements / 2);
    median = arrayPtr[middle];
  }

  // Return the median value
  return median;
}

//*****************************************************************************
// FUNCTION: MIDTERM PROBLEM 3 - Get the Modes of the Integer Array           *
//*****************************************************************************
int getModeArray(int *modeArrayPtr, int highFrequency, int* arrayPtr,
                 int numElements) {

  // Variable Definitions
  int frequency   = 1,
      modeElement = 0;

  // If the integer array has no mode, return -1
  if (highFrequency == 1)
    return -1;

  // If the integer array has a mode, add mode values to the mode array
  else {

    // Get mode elements from the integer array
    for (int i=1; i < numElements; i++) {

      // If the value in the current array element is the same as the
      // previous element, add 1 to frequency
      if (arrayPtr[i] == arrayPtr[i-1]) {
        frequency += 1;

        // If the current frequency is the same as the high frequency,
        // add the value in the current element to the mode array
        if (frequency == highFrequency) {
          modeArrayPtr[modeElement] = arrayPtr[i];
          modeElement += 1;
        }
      }

      // If the value in the current array element is not the same as
      // the previous element, reset the frequency counter to 1
      else
        frequency = 1;
    }

    // Return the mode array
    return *modeArrayPtr;
  }
}

//*****************************************************************************
// FUNCTION: MIDTERM PROBLEM 3 - Display Program Header                       *
//*****************************************************************************
void programHeader3() {

  // Clear the screen
  system("cls");

  // Display the program screen header
  cout << "\n\n\tMIDTERM PROGRAM 3 - Average, Median, and Mode\n\n";
}

//*****************************************************************************
// FUNCTION: MIDTERM PROBLEM 3 - Sort Elements of Integer Array Pointed To in *
//           Ascending Order                                                  *
//*****************************************************************************
void sortArrayElements(int *arrayPtr, int numElememts) {

  // Local Variable Definitions
  int minIndex,
      minValue,
      startScan;

  // Sort array elements in ascending order
  for (startScan = 0; startScan < (numElememts - 1); startScan++) {

    // Initialize variables
    minIndex = startScan;
    minValue = arrayPtr[startScan];

    // Check next element in the array for a smaller number
    for (int index = (startScan + 1); index < numElememts; index++) {

      // If the next element is smaller, store its value and index
      // number in minValue and minIndex variables
      if (arrayPtr[index] < minValue) {
        minValue = arrayPtr[index];
        minIndex = index;
      }
    }

    // Copy current element to next element and replace current element
    // with stored smaller value
    arrayPtr[minIndex]  = arrayPtr[startScan];
    arrayPtr[startScan] = minValue;
  }
}
FC Jamison
Posting Pro in Training
Team Colleague
446 posts since Jun 2004
Reputation Points: 92
Solved Threads: 21
Skill Endorsements: 0

If this is a form, have you tried

<input type="reset" value="Reset!">
FC Jamison
Posting Pro in Training
Team Colleague
446 posts since Jun 2004
Reputation Points: 92
Solved Threads: 21
Skill Endorsements: 0

Do you mean a dropdown form field?

FC Jamison
Posting Pro in Training
Team Colleague
446 posts since Jun 2004
Reputation Points: 92
Solved Threads: 21
Skill Endorsements: 0

I did this a month or so back for a client.

It will at least give you an idea of how to use an array to populate a table.

Attachments Table_Array.zip (3.81KB)
FC Jamison
Posting Pro in Training
Team Colleague
446 posts since Jun 2004
Reputation Points: 92
Solved Threads: 21
Skill Endorsements: 0
FC Jamison
Posting Pro in Training
Team Colleague
446 posts since Jun 2004
Reputation Points: 92
Solved Threads: 21
Skill Endorsements: 0

Have you tried reinstalling the old version?

If you can't do that...the only other way I know of its to dig it out of the registry. The problem with that is that if you do something wrong...you system could crash completely.

FC Jamison
Posting Pro in Training
Team Colleague
446 posts since Jun 2004
Reputation Points: 92
Solved Threads: 21
Skill Endorsements: 0

Here's the big glaring error I see in your code...

string string;

You can't use "string" as a variable name.

FC Jamison
Posting Pro in Training
Team Colleague
446 posts since Jun 2004
Reputation Points: 92
Solved Threads: 21
Skill Endorsements: 0

Ha.! I remember my C++ instructor promising not to give us a bad grade on an assignment if we promised not to use global variables...lol

FC Jamison
Posting Pro in Training
Team Colleague
446 posts since Jun 2004
Reputation Points: 92
Solved Threads: 21
Skill Endorsements: 0

hmm...off the top of my head, I'd suggest using a JavaScript onclick event to change the background of the specified cell.

You could then have a small image as the background.

How to get it to go away would be a trick, though...perhaps use a timer to revert back to the original background after 10 seconds?

Hey...it's an idea, anyway!

FC Jamison
Posting Pro in Training
Team Colleague
446 posts since Jun 2004
Reputation Points: 92
Solved Threads: 21
Skill Endorsements: 0

I'm not exactly sure what you are asking for here...

Do you have a page you can point me to so I can get a better picture of what you are asking for?

FC Jamison
Posting Pro in Training
Team Colleague
446 posts since Jun 2004
Reputation Points: 92
Solved Threads: 21
Skill Endorsements: 0

This sounds like a hotmail issue.

You will need to contact them.

FC Jamison
Posting Pro in Training
Team Colleague
446 posts since Jun 2004
Reputation Points: 92
Solved Threads: 21
Skill Endorsements: 0
 
© 2013 DaniWeb® LLC
Page rendered in 0.1211 seconds using 2.68MB