Passmark 26 Light Poster

As it is only 3 lines of code do you need a function?

const int MAXROW = 4;
const int MAXCOL = 10;

int main()
{
  int a [MAXROW][MAXCOL];
  for (int row = 0; row < MAXROW; row++)
    for (int col = 0; col < MAXCOL; col++)
      a[row][col] = rand () % 10;
}
Passmark 26 Light Poster

but she'll graduate with a chemistry degree...

I had to do organic and inorganic chemistry to get a degree in computer science (and maths, physics, astronomy and philosophy).

At the time I thought it was dumb, but 20 years on, I don't regret doing it. It is useful from time to time.

Except for philosophy, which really was dumb :)

All science students should learn some computing IMHO. They'll use it.

Passmark 26 Light Poster

I am only new here, but is really surprising (and saddening) how many people just post up their assignments hoping someone else will do the ALL the work.

As an employer of IT graduates I get to read a lot of CV's an interview a lot of candidates. And to be frank the majority of them are rubbish and it is easy to see why.

It only takes 5 mins in an interview to work out who are the people who 'don't have a clue'. So while you might pass your assignment, by copying the work of others, ultimately you still won't get a good job in IT. The sham will be exposed during the first few interview questions.

For a laugh I ask the computer science graduates how a computer works. I get answers like, 'you push the power button, then type on the keyboard to make it work'. Roughly the same answer a 10 year old would give. Needless to say some of the interviews are very short and end in tears.

So better to either make half an effort to study the material, or give up now and do someone that is more suited to your skills.

Passmark 26 Light Poster

It depends on what software you are using, and what you do with your PC.

If you are using apps that use a lot of RAM (e.g. Photoshop with multiple large images) then you need as much RAM as you can get, regardless of if it is marginally slower. Because any RAM will be 10x faster that swapping to disk when you run out of RAM.

If you aren't fully using the 2GB you have today. Then the extra speed is better. And you shouldn't give up the dual channels.

Passmark 26 Light Poster

I would sell 2 of the the 512MB sticks on Ebay and with the proceeds buy an additional 1GB stick to match your spare 1GB stick. The cost difference would be small (maybe $30?) and you get 3GB in dual channel.

Passmark 26 Light Poster

No point asking me, I am hopelessly bias. I wrote the initial code for the Zoom product (and own the company :-) ). Needless to say, I think it is pretty good. Not perfect yet, but pretty good.

Passmark 26 Light Poster

I don't think it is supported. A replacement might be fscanf() + some extra code, but it really depends on what you are doing with with vfscanf.

Passmark 26 Light Poster

It seems this assignment was set by Professor Chris Szalwinski who runs the Structured Programming course at the School of Computer Studies at Seneca College in Toronto. Maybe someone should E-Mail him, to let him know what his students are doing :-/

Ancient Dragon commented: nice work :) +23
Passmark 26 Light Poster

Having lot of incoming links (i.e. a popular site) helps a lot to get your forum indexed. Using a forum package that is SEO friendly from the start also helps.

You can also create a Google Site Map which lists all the pages on your site (including the forum posts).

Despite the advice above, having a robots.txt file normally doesn't help get a site indexed. As Google states, "If you want search engines to index everything in your site, you don't need a robots.txt file (not even an empty one)".

Passmark 26 Light Poster

This should be easy to do. Take a look at the Zoom Search Engine. You can add search to an intranet, web site or CD. The pages being searched don't need to be accessible to the public.

In particaular see this support question on the site. Q. How do I index protected parts of my website requiring user authentication?

Passmark 26 Light Poster

I have never written a line of Python code in my life. So I am superbly qualified to answer this post.

But I am guessing the os.system call just calls the operating system to execute the file supplied as the argument. So it won't return anything to the browser.

But you don't need Python for this. You can replace all this with the following HTML code.

<html><head></head>
<body>
<a href="resume.pdf">Resume(.pdf 25kb)</a>
</body></html>
Passmark 26 Light Poster

Any tool that allow you to simply manage content on a web site, without needing to do the HTML coding, is really a CMS.

Blogs packages are really just a sub-set of CMS tools. They are generally less flexible than full CMS systems. But often easier to use.

Passmark 26 Light Poster

but a quad core 1.83 will outperform a 3ghz dual core

This is a generalization, that is only true in some circumstances. It really depends on what software you are running.

Passmark 26 Light Poster

It would take a post several pages long to detail all the problems and inefficiencies in this code. I don't know where to start. It is a mess. A real mess.

But the good news is that at least you had an attempt at writing some code.

But here are a few pointers (unintentional bad 'C' pun there).

1) You don't need a struct if you only have 1 member of the struct.

2) Use toupper to replace all those ungainly boolean expressions.
Replace
if (y=='a'||y=='A')
with
y= toupper (y)
if (y=='A')

3) Use case statements rather than if then else, as appropriate.

4) Don't use x,y,z,a,b, as variable names. Use meaningful names, like Row and SeatLetter.

5) If your seats are arranged in a grid, use a two dimensional array to model them.

6) Use a for loop to initialize the values. You have to imagine how your code would work if you had 900 seats instead of your current 20 seats.

7) Replace that massive if then else block with one line of code that directly sets the value, like
Seats[x][y-'A'] = '*';

Passmark 26 Light Poster

I think they're both valid terms. Hyperthreading is a form of multithreading.

Hyperthreading was a term Intel made up for a hardware feature they included on their P4CPUs which allowed multiple threads (and processes) to run partially in parallel on the CPU.

Hyperthreading was like having one and a half cores.

But it didn't work very well. Multiple threads got in each others way when they needed the same part of the CPU at the same time. Plus the cache wasn't well designed for multiple threads, they would end up throwing each others data out of the cache. This actually decreased performance in some cases. This resulted in some software companies issuing advice to disable hyperthreading.

Multithreading is more of a software / operating concept for having multiple light weight tasks executing at the same time. It isn't a hardware feature. Meaning you can have multiple threads on any CPU.

With the right software, quad core CPUs (and 8 core, dual CPU quads) thrash the pants off dual core and single core CPUs. But at the moment there isn't much of the 'right' software around. This is slowly changing.

I would predict that almost all of the games that come out in 2009 will make good use of quad core CPUs. As will mainstream CPU intensive programs like Photoshop.

Passmark 26 Light Poster

I would echo soccerrm1 thoughts.

I was the same as you 20 years ago. At the time I was also worried about which Uni options will get the most money. But whatever you do the money will be OK, so the money isn't that important.

Do what you like.

Becuase you like it, you will be good at it. Becuase you are good at it someone will pay you, the expert, to do it.

But here is a MUCH more important tip. You don't get rich working for the man.

Passmark 26 Light Poster

This is because the storable range of long is larger than int.

Actually this is not true on most systems.

unsigned long, 4 bytes
0 to 4,294,967,295

unsigned int, (also) 4 bytes
0 to 4,294,967,295

Even in 64bit programming (on Windows with Visual Studio) they are the same size and hold the same range of values.

Passmark 26 Light Poster

The definition of the problem is not clear (at least to me).

Given the decimal integer, 523456

Is the answer
1) 3
Becuase there are 3 odd digits (5,3, & 5)

2) 2
Becuase there are 2 unique odd digits (5 & 3)

3) 7
Becuase there are 7 unique odd numbers (5, 3, 523, 52345, 23, 2345 & 345)

4) 261728
Becasue there are 261728 odd numbers before 523456. (1,3,5,7,9,11,13...523455)

Or something else?

invisal commented: Good point you are making +3
Passmark 26 Light Poster

You need to supply more information. What O/S and what CPU?

If you are writing a DOS application (with an x86 CPU running in real mode), then pointer values in RAM will be a physical addresses.

But if you are working in Linux or Windows with a x86 CPU then your CPU will be in Protected Mode. And addresses will not be physical addresses, but virtual addresses.

To translate from virtual addresses to physical addresses I think you need to write a device driver.

Then you need to worry about endianness, which can vary between CPU types and effect the byte ordering in pointers.

But I am guessing you might not really know what you are asking for when you refer to physical addresses and in fact just be refering to pointers in general, which are really virtual address pointers, for most O/S and most CPU types?.

Passmark 26 Light Poster

Developing a good game requires a fairly large budget. For example Crysis cost about $20,000,000 to make, and involved about 300 people.

What is your budget?

Passmark 26 Light Poster

My understanding is that Chilisoft ASP only supports classic ASP. And even then it only implements a subset of the ASP functions.

In short, it isn't very useful.

I also think it is now called, "Sun Java System Active Server Pages". And not Chilisoft.

Passmark 26 Light Poster

You can compare the Core 2 E4500 and the Athlon X2 6000+ here.

The newer E4600 will be slightly faster than the E4500, but the 6000+ should still be better than both.

Passmark 26 Light Poster

You can find the USB specifications here.

There is also this book. USB Complete. it isn't a perfect book but easier than reading the approximately 1000 pages that make us the USB specification.

Passmark 26 Light Poster

Initialize uChoice

char uChoice = '\0';

Then add a loop. For example,

while (uChoice != 'Q') {
  switch(uChoice)
  ...
  ...
}
Passmark 26 Light Poster

I've got some bad news for you. Your existing code isn't using linked lists at all. It is using an array!

Before you can delete from a linked list you need to actually create a linked list.

Here is an introduction to linked lists.

Passmark 26 Light Poster

If you have Visual Studio Team System (the expensive edition) then there is an excellent code profiler built into it.

The code profiler will tell you how long each and ever function in your application took to execute. You could do the same thing by hand by starting and stopping high resolution timers, but it would be tedious.

There is no one solution or data structure to make your code faster. It takes some thought, elegant design and a reasonable understanding of computer science in general. The code profiler will tell you which functions are taking all the execution time and thus where to spend your effort doing optimisations.

Passmark 26 Light Poster

Try using a 'for' loop.
Also, as this *should* be a very small piece of code, there is no need to declare your own functions. It should look more like this,

#define ROLLS	4
#define DIESIDES	6
int main()
{
    int num[ROLLS];
    int min = DIESIDES+1;
    int total = 0;
	
    srand((unsigned)time(NULL));
	
    for (int c = 0; c < ROLLS; c++) {
        if ((num[c] = rand() % DIESIDES + 1) < min)
            min = num[c];
        total += num[c];
    }
    printf ("%d\n", total-min);
    return 0;
}
Passmark 26 Light Poster

Spiders that index your site (like Googlebot) will not have any direct knowledge that the same database is in use. Databases like SQL generally allow remote access via TCP/IP, so it is technically possible to share a database between multiple sites.

BUT, Google might notice that both your sites contain very similar content (regardless of if you share a database or not). And one or both of the sites might be penalized as a result.

Passmark 26 Light Poster

You can use the Windows API function SetCommState to control the high level RTS/CTS control line behaviour in Windows.

Use EscapeCommFunction () to manually set RTS/CTS and GetCommModemStatus () to test the current state of RTS/CTS.

Not so sure about Linux.

Passmark 26 Light Poster

Just use use the built in C library QuickSort function.

qsort (myArray, 10, sizeof (int), compare)

int compare ( const void *arg1, const void *arg2 ) {
if ((int) *arg1 > (int) *arg2)
return 1;
}