Because Puppys are the friskiest breed of mongrels in this dimension
you can expect the students to be setting the pace . . .

Help

What have I started?

1. This year Puppy will be ARM'd and dangerous as we become Raspberry Pi enabled
2. The first language used on http://puppylinux.org/wikka/PARM
PARM will probably be bash script, leading to Bacon when we get a compiler with the Devx
3. Your ability to write tutorials with the language of your choice, is a good way of developing for the new generation

. . . must be time for a little rant . . . I remember the day I created a BASIC tutorial in Pascal for my students. Most adult students were only interested in using Word (A DOS program in ye olde days) and other applications but one guy got it. Programming is not for everyone but everyone can do a few basics . . .

Hi Lobster!
Your Hackers' School is great. I notice that you have put a link to my Python blog - thanks for that!

I am interested in learning a bit more BASH scripting. I have been dipping into "The Shellcoders Handbook" and "Hacking: The Art of Exploitation". I got rather out of my depth with the second of these! Very interesting though!
mark_________________My System:Arch-Arm on RPi!
"RacyPy" puplet on Toshiba Tecra 8200. PIII, 256 MB RAM.
RaspberryPy: Lobster and I blog about the RPi.

I'm reading (and trying to learn from) Schildt's "Java: The Complete Reference". I've got a bit lost in the section on bitwise operators.
Can anyone explain "two's complement" to me. I don't see how swapping all the bits and adding one would make the computer see it as a negative number. Also, what is the "high-order bit"?

I have a feeling I won't necessarily need to know all this, but still ...
_________________My System:Arch-Arm on RPi!
"RacyPy" puplet on Toshiba Tecra 8200. PIII, 256 MB RAM.
RaspberryPy: Lobster and I blog about the RPi.

Thanks for the reply SFR - what you wrote certainly fits in with what I have read about this - but I still don't see how

Quote:

11111111 = -1

Isn't "11111111" 255?

I'm clearly missing something very obvious - I'll try to work it out later.

Let's say we have the binary number 7 - "00000111"
So we do "two's complement" and that gives us: "11111001".
So the left-most bit means -128, and then we add 64, 32, 16, 8 and 1 to get -7.
I get that. But how does the computer know that we don't mean 249?

Computer doesn't know that
For CPU 11111001 may mean 249 as well as -7.
The beautiful thing is that when we add another 1, we'll get:
249 + 1 = 250
-7 + 1 = -6
11111010 = 250 = -6
so whatever you do, the result is always correct regardless if it's interpreted as positive or negative value.
The programmer decides how to interpret and display the result.