Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

"Lies, damned lies, and statistics"

The earliest instance of the phrase found in print dates to a letter written June 8, 1891, published June 13, 1891, The National Observer p. 93(-94): NATIONAL PENSIONS [To the Editor of The National Observer] London, 8 June 1891 "Sir,--It has been wittily remarked that there are three kinds of falsehood: the first is a 'fib,' the second is a downright lie, and the third and most aggravated is statistics. It is on statistics and on the absence of statistics that the advocate of national pensions relies....."

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

what version of .net is the sbs 2003 running?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

What version of MS-Windows did you wrikte the program on? Visual Studio 2012 uses .NET Framework 4.0 or newer, so you might have to install .NET 4 on that XP computer.

More info here. It will tell you what version of .NET your IE browser is using. You might visit that link from your XP computer too to find out what version of .NET it has installed.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I realized that stdio functions (and thus their fstream counterparts) use size_t to indicate the position in a file,

If you use win32 api function WriteFile() and ReadFile() then it uses 64-bit addresses which is two size_t integers.

You will find there is no such thing as unbound storage because the size of any one file is bound by the operating system parameters and hard drive size.

A file of files would require that I open and close each file every time I need it right?

Not necessarily -- you can have multiple files open at the same time.

The issue is that as far as I know, its when you close the file that you actually save it.

You can force the os to flush data to the file. stdio.h is fflush(stream) while fstream is stream.flush()

My second question then is: is there any way to NOT have to re-open those files every time I need them?

If you close the file then you will have to open it again. But why close it? Just leave it open for as long as the program needs to use it. As I said before you can have a lot of files open at the same time, the limit is pretty large.

My third question then is: is there any way to get the file name out of a FILE structure in stdio.

No. I've had that same question years ago. FILE …

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

A while back a cop near here chased a perp on the highway, reaching about 180 km/h (100mph) before giving up, she got fired the next day for reckless endangerment of the public

A couple years ago a cop was speeding down the interstate at 120+ MPH struck a car and killed two teen-aged girls in it. The cop didn't get fired -- just sentenced to probation (link).

Have you watched a show where a computer geek was pounding away at a computer and you could see that the computer was not plugged in?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

you should call WaitForSingleObject() instead of Sleep(). Also you need to validate ShellExecute() did not return an error number.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Form what all I read on google it's not possible to boot from other than the first installed drive. So, I'm just forgetting that idea, reinstalled Windows to consume the entire hard drive. I told my sone to put me in a padded room if I ever try that again :)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

some compilers have an option to produce an assembly code. What compiler do you use?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

There's no such thing as an integer with only 2 bits -- maybe you mean bytes instead of bits.

The number of bytes in an integer depends on what computer hardware architecture and compiler you are using -- c and c++ language do not specify how many bytes are in an integer -- it only says there is one byte in a char data type. Some 16-bit compilers such as Turbo C uses sizeof(int) is the same as sizeof(short) and sizeof(short) is two bytes. When you move to a 32-bit compiler such as modern gcc and Visual C++ you will find that sizeof(int) is the same as sizeof(long), which is 4 bytes while sizeof(short) is 2 bytes.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The other day I installed a second internal hard drive so that I can put ubuntu on it. The primary hd has windows 7. Using the Ubuntu windows installer everything installed without a problem. When I rebooted I got a lot of error messages during bootup and finally the boot manager menu. I selected Ubuntu but it fails to start -- tells me to insert a disk. Selected Windows and it booted without a problem.

I checked bios bootup settings and it appears to me to be ok. Isn't it possible to have a bootable second hard drive, or do all operating systems have to be on the same primary hd, just in different partitions?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Yesterday I crashed my Windows 7 when I attempted to install debian in another partition. Today I reinstalled Windows 7 by repartitioning and reformatting the hard drive. After reinstalling Chrome I noticed it retained all my previous bookmarks and settinbs. How can that be? Does Chrome keep that somewhere in a cloud? I didn't do anything other than reinstall Chrome a few minutes ago.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Met-RX Big 100 Colossal Brownie I don't buy them by the box because if I did the whole box would be gone in two days! So I by them individually, about one per month from WalMart.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

bought Windows 8 as XP is poor with SSD's

You should have upgraded to Windows 7, not 8. I bought Windows 8 and couldn't get Microsoft Office 2012 to work on it, so I reinstalled Windows 7 and have Windows 8 in a desk drawer never to see the light of day again. A lot of companies are probably still using XP for the same reason -- they have invested too much money in software that works correctoly on XP and won't install or work correctly in Windows 7/8.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Have you seen what Arizona is getting?

Arizona's heat is very dry -- it feels a lot cooler than the actual temperture. I love Tucson for that reason (I lived there for 3 years). It's only 95 F there today, a cool day.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

IE6 is very old -- it may not know how to display the page. What version of MS-Windows is your computer running?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Check if the computer has .NET Framework 4.0 installed.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

it's raining right now. I'm happy about it because I have not had to water my lawn yet this year. Last year at this time we were in a big drought.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The reason you got such snide remarks is because you didn't ask for help, all you did was post your assignment and expected us to do it for you. If you want help with something you don't undersand then you have to tell us what you don't understand. We can't read you mind.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

One way to do it is to first allocate the number of rows you want, then for each row allocate the columns. As you can see the memory for the array is not contiguous.

int rows = 5;
int cols = 10;
int **array = malloc(rows, sizeof(int));
for(int i = 0; i < rows; i++)
   array[i] = malloc(cols, sizeof(int));

display(array,rows,cols);

how are we able calculate the adress of a[3][4] given the address of a[0][0] ? how are we able calculate the adress of a[3][4] given the address of a[0][0] ?

That's not possible with my code above

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Even a simple list by country or a pie chart would be interesting.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Don't install preview on top of Windows 8 on a computer that you intend to use for other than development purposes -- you can't restore it back to Windows 8 without losing all the data and registery settings. If you want to look at Windows 8.1 Preview then install it on another partition so that you can easily remove it later.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

That was my price or just the assignments he posted. Others will cost most.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I just installed SharpDevelop. It looks almost identical to Visual Studio IDE.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I will do your homework for you after you deposit $10,000.00 USD in my PayPal account.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Until web becomes 100% secure I don't see many people and companies relying entirely on it. It's difficult to believe companies will give up their company secrets to use web-based programs. Yes there is room for web-based programs, but there is also going to be a lot of PC desktop programs in the forseeable future. So if you are starting an education program pick the type of programming/scriptiong you like best because you can't go wrong.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Probably just bug fixes.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You have an array of 10, but the loop counter only counts to 4. Any reason for that?

here's what I wrote but it's not working..

what's not working? It should print something on the screen every time you enter a number that is greater than any previous number entered.

If all you want the program to do is tell you only one time what the highest number is, you will need another loop. First loop like you have it but delete line 10. After that loop finished write another loop that scans all the array looking for the largest number. When that loop is finished then print the largest value like you did on line 10.

so you program should do this:

  • Loop to enter data into the array
  • Loop to find largest value in the array
  • Print the largest value
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

printf("%u %s",&"hello",&"hello");

You don't need the & symbol because character arrays are ALWAYS passed by addfess. When you use the & in the above it will pass the address of the address, which is not what you want.

printf("%p %s","hello","hello");

Also note that %p prints the address of the string

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I wan't able to get email working with WampServer so I uninstalled it and installed Uniform Server, which has SMTP by default, and works well (or at least good enough for my purposes)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I'm beginning to think it is not possible from my compuer. I used the instructions here and it doesn't work. All I get is this error and no mail is sent. Strange, the warning indicates the smtp host is localhost, but in php.ini I changed it to mail.gmail.com and port 587

Warning: mail() [<a href='function.mail'>function.mail</a>]: Failed to connect to mailserver at &quot;localhost&quot; port 25, verify your &quot;SMTP&quot; and &quot;smtp_port&quot; setting in php.ini or use ini_set() in C:\wamp\www\testmail.php on line 8
Call Stack

I'm using this php script to test

<?php 
echo 'Attempting to send email'; 

mail(
     '<snipped>',
     'Works!',
     'An email has been generated from your localhost, congratulations!');
echo 'mail sendt'; 

?> 
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

when you run your program does it produce correct results?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I installed WampServer on my Windows 7 Ultilate computer the other day and WordPress yesterday. I attempted to test WP registration in my web site but I never received the registration confirmation email. Is this not possible on localhost? If it is how do I go about getting email to work?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

but like this (pointers to functions), what else i need to typedef like this ?

You don't NEED typedef's at all. They are useful at times, not are never required.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

There's a hyoooge assumption that pointers to functions are equivalent to pointers to int. Very risky, and non-portable at best.

Agree, but it's a solution on systems where the sizes are the same. I don't think I ever had a reason to do that in any program I wrote over 20+ years. But that doesn't mean someone else hasn't.

As for being risky -- using vargs is always risky because it's impossible for the compiler to validate parameter types with actual arguments whether they are pointers or POD.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Oh I see now. You could do something like below. I just copied the code from the link I gave previously and added pointer to a function. According to standards this may not be portable especially on systems where sizeof(pointer) is not the same as sizeof(function pointer).

/* va_arg example */
#include <stdio.h>      /* printf */
#include <stdarg.h>     /* va_list, va_start, va_arg, va_end */
#include <iostream>

int foo()
{
    std::cout << "Hello from foo\n";
    return 1;
}

int FindMax (int n, ...)
{
  int i,val,largest;
  va_list vl;
  va_start(vl,n);
  largest=va_arg(vl,int);
  for (i=1;i<n;i++)
  {
    val=va_arg(vl,int);
    largest=(largest>val)?largest:val;
  }
  //
  // extract pointer to a function
  int (*fn)() = (int (_cdecl *)())va_arg(vl,int*);
  // now call that function
  fn();
  va_end(vl);
  return largest;
}

int main ()
{
  int m;
  m= FindMax (7,702,422,631,834,892,104,772, foo);

  printf ("The largest value is: %d\n",m);
  return 0;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You don't need permission from web sites to post reviews, if you did then no one would be able to give bad reviews. I don't know about Google Adsense.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

unless I missed it that page says nothing about typedef. The example program certainly doesn't use it.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

By the time the program reaches line 15 the address of ptr_array has been changed to somewhere beyond the end of the array. If you want to print the first item in the array then you need to reset the pointer back to the beginning, like you did on line 5.

You can't print the entire array at one time like you are trying to do on line 15. Create a loop similar to line 7 and instead of cin on line 10 use cout.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

the place where i have read this said that this is wrong

Then you read the wrong article -- see the example here

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

still expect punch cards paper tape

I haven't worked with those since 1964!

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Write a program that defines an array of integers

int a[5];

and a pointer to an integer

int *ptr;

Make the pointer point to the beginning of the array.

ptr = &a[0];

Now you should be able to finish the rest. Hint: to move the pointer to the next member of the array all you have to do is increment the pointer, much like you would increment an integer.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You might also check the documentation for the specific compiler you want to use, for example if you use Microsoft Visual Studio then read this article. I'm sure GCC has a similar page.

christinetom commented: Thanks for the help +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The reason for waiting until the array is filled before sorting is because your idea is just too slow. First you have to find the spot where to insert the new value, then move all data from that place to the end of the array. This is acceptable if there is only one or two values to be inserted, but not when you want to build an entire array from scratch.

Since you are new to c++ and programming I suggest you but your idea on the back burner for now and just concentrate on learning the language. You can always revive it at some future date after you have gained more experience.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

One way might be to use the % (mod) operator in the loop (function Calculate returns the result of the calculation 1/M!XM

int M = 5; // some value
int Result = 1 - X;
for(int i = 1; i <= M; i++)
{
    if( (i%2) == 0)
       Result += Calculate(i);
    else
       Result -= Calculate(i);
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I am running 64-bit Windows 7 and McAfee with no such Action Center messages. I also have a custom-built PC.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

void main() should not exist either, but it does in many compilers.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You mean the icon in the taskbar when the application is running? Why would you even be concerned about that? An MFC application has a dialog or window that is visible to the user then why not the icon in the task bar?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Visual Studio 2012 produces warning that it is a non-standard extension. The solution is to make it a pointer.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I use google chrome the most, but sometimes IE when I visit web sites that support only IE. I don't actually see much difference between the two.