Schol-R-LEA 1,446 Commie Mutant Traitor Featured Poster

Actually, the align type doesn't impact the maximum size of the segment. In real mode, a segment has a maximum size of 64K, regardless of any other factors, and segments are always aligned on 16-byte pages. In other memory modes, things get more complex, and you can have segments of up to 4Gb in size.

Schol-R-LEA 1,446 Commie Mutant Traitor Featured Poster

Basically, the function returns the difference between the lower number and the higher number, if and only if the lower number is the first number. The 2 is to account for the fact that both the lower number is being incremented and the higher decremented when they are passed to the recursive call.

Schol-R-LEA 1,446 Commie Mutant Traitor Featured Poster

Ordinarily, I would simply direct you towards Google, but after quickly checking the results myself I find that there aren't many such resources to be found. This online textbook is probably the best resource I was able to find.

Schol-R-LEA 1,446 Commie Mutant Traitor Featured Poster

OK, here's the thing: Python, by itself, is not a language designed specifically for web-page design, the way the (for example) PHP or Javascript are. It can be used for this purpose, but you need to import some particular tools for it, namely the cgi module.

What CGI stands for is Common Gateway Interface, and it is a way to let the HTTP server run programs on the server automatically when the program file is requested, rather than serving it to the browser. Python is just one of the languages that can be used with CGI. The HTTP server, for it's own part, usually needs to have the CGI script in a specific directory and has other settings for how it has to be handled so that it knows that the Python source file is a CGI script and not some general program.

Schol-R-LEA 1,446 Commie Mutant Traitor Featured Poster

OK, then. Assuming that we're talking about 16-bit code, a simple linked list node in MASM might look like this:

node STRUCT
    data WORD ?
    next WORD ?
node ENDS

Of course, the structure itself isn't the only important factor; it's how you use it that counts. The structure is more or less a template or pattern for a particular interpretation of a block of memory. In the case of a linked list, generally speaking this memory will be allocated at run time from the operating system.

Schol-R-LEA 1,446 Commie Mutant Traitor Featured Poster

Before we go further, can you tell us which assembler you're working in? There are significant differences in how different assemblers handles structures.

Also, if you're working in linked lists, we'll also need to know the operating system, as you'll need to use the system calls for memory allocation and deleting.

This thread may help you understand how structures in assembly work, though it uses a specific assembler/emulator (SPIM, a MIPS emulator) for its examples; more advanced assemblers such as MASM and Netwide Assembler have built-in support for structures that is comparable to languages such as C.

Schol-R-LEA 1,446 Commie Mutant Traitor Featured Poster

Certainly. Nested if:s are a common thing, though you generally don't want the nesting to go too deep for the sake of readability.

Schol-R-LEA 1,446 Commie Mutant Traitor Featured Poster

Odd... the code as given works fine on my system, in both the 2.6 and 3.0 interpreters. What version of Python are you using?

You might want to try using list() instead of [] when initializing meanBelow, as that's a little more explicit, but they both should work the same way in any version of the language I know of.

Schol-R-LEA 1,446 Commie Mutant Traitor Featured Poster

Hold on here. Getting the mean (or average) is a fairly simple thing in and of itself:

import math

def mean(*alist):
    return sum(alist) / float(len(alist))

What you're doing doesn't seem to be aimed at just getting the mean of a list of values, however. What is item for, and just what should this function of yours return?

Schol-R-LEA 1,446 Commie Mutant Traitor Featured Poster

I tested this on my system (Ubuntu Linux 10.4, compiled with GCC 4.4.3) and it does print the child process' PID, but the Fibonacci print does fail even with the correct prototype and argument types. The problem appears to be in either computeFibonacci() or printFibonacci().

BTW, with the Unix C compiler (or the GCC compiler, either one), it should be possible to set the name of the compiled executable to something other than just 'a.out' using the '-o' option. For example:

cc forkfib.c -o forkfib

Alternately, you can just use 'mv' to rename the file.

Schol-R-LEA 1,446 Commie Mutant Traitor Featured Poster

You are declaring the function 'Iterator& operator++()' twice, once on line 41 and again on line 56. Since they have the same signature, there is no way for the compiler to disambiguate the two versions (which were probably not intentional anyway), so it gives an error.

Schol-R-LEA 1,446 Commie Mutant Traitor Featured Poster

There are a few different options, actually. Generally, what you download from the Ubuntu website is an ISO which you would then burn to a CD. Once you did that, you could either run Ubuntu from the CD, or install it permanently on the system.

If you install it, it can overwrite Windows, replacing it completely. If you don't want to do that, you can try re-partitioning the drive so that you can set up a separate Linux partition which will let you dual boot; the problem is that there's a risk of damaging the Windows partition doing that, so if you wanted to try that you should make sure to back everything up before trying, and be prepared to re-install Windows if you need to.

If you have a free drive bay, and can afford a new drive, you might want to get a separate drive to install into the system, and install Linux on that. That's probably the best solution if you can do it.

There are also ways to install Ubuntu inside of Windows, but I can't give too many details about that offhand.

Schol-R-LEA 1,446 Commie Mutant Traitor Featured Poster

The problem lies in the while() loop in inventoryValue(); the index variable, i, is never getting incremented, so it loops indefinitely on the zeroth element of the array. I would recommend changing it to a for() loop to make the intent clearer, in any case:

int inventoryValue(carType cars[], int currentCarCounter)
{
    int sum=0;
    for(int i = 0; i<currentCarCounter; i++)
    {
        sum+=cars[i].cost*cars[i].numberOnHand;
    }
    return sum;
}