Re: OT: PHP 32 bit numbers security issue

2011-01-06 Thread Uri Even-Chen
On Thu, Jan 6, 2011 at 11:49, Nadav Har'El  wrote:
> On Thu, Jan 06, 2011, Uri Even-Chen wrote about "Re: OT: PHP 32 bit numbers 
> security issue":
>> By the way, although I know hardware can be used to calculate floating
>> point operations, I would prefer to use software - because of the
>> ability to be flexible and let the user or programmer define the
>> number of bits necessary for accuracy and the exponent.  I think
>> calculating integer operations is enough for hardware - the rest can
>> be done by software.
>
> What you're describing is exactly what was common on cheap computers of
> the 1980's.
>
> The 8086, Intel's circa 1978 CPU that is the ancestor of all of today's
> PC CPUs, didn't have floating-point instructions. But clearly, the software
> floating point performance wasn't good enough, because two years later, in
> 1980, intel came out with the 8087, but these so-called "math coprocessors"
> were still not common at the time.
>
> A book about the assembly language of another cheap computer from the same 
> era,
> the Commodore 64, contains the following quote about why the commodore 64 did
> floating-point in software: "you pay a tremendous amount for having floating-
> point instructions, because computers which have them are so much more
> expensive than microcomputers".
>
> Fractint (http://en.wikipedia.org/wiki/Fractint) is an example of a project
> that came out in the era (1988) when the math coprocessors were still not
> common, and they did everything humanly possible to avoid using floating-point
> operations, and use integers instead (the word "int" even appears in the
> project's name).
>
> So, sure, if your application is a desktop calculator, performance is not
> important, and convenience and accuracy is what matters, so go with arbitrary
> precision in software. But if your application really depends on calculating
> quickly, doing arbitrary precision in software instead of floating-point in
> hardware is just about the worst thing you could do to your application...

When I was programming Apple 2e machine language during the 1980s, the
CPU couldn't even multiply or divide - this was done with software.
The CPU could add or subtract, but only 8 bit integers.  I guess this
was prehistory...

Uri Even-Chen
Mobile Phone: +972-50-9007559
E-mail: u...@speedy.net
Website: http://www.speedy.net/

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: kvm for monitoring BIOS on motherboards without serial console

2011-01-06 Thread Alon Barzilai

look for KVM over IP.

what I found  have 8 ports, big (rack mounted) and it's not cheap at all.
if you find a cheap small one let me know, I will buy one too.

Alon.




On 01/06/2011 11:02 AM, Kfir Lavi wrote:

Hi all,
I have a computer router that I need to monitor from my laptop.
It has problem to boot. So I need to connect an external monitor to it.
Currently I don't have a monitor.
My laptop runs Linux, so I'm looking for a connector VNC like,
that will do VGA to my laptop that has usb and ethernet (no serial).
If it is possible to buy it here in Tel Aviv, it would be best.
It should be very simple for connecting just one computer and just for 
monitoring the BIOS.

No need for graphics and such.

Regards,
Kfir


___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: OT: PHP 32 bit numbers security issue

2011-01-06 Thread Nadav Har'El
On Thu, Jan 06, 2011, Uri Even-Chen wrote about "Re: OT: PHP 32 bit numbers 
security issue":
> By the way, although I know hardware can be used to calculate floating
> point operations, I would prefer to use software - because of the
> ability to be flexible and let the user or programmer define the
> number of bits necessary for accuracy and the exponent.  I think
> calculating integer operations is enough for hardware - the rest can
> be done by software.

What you're describing is exactly what was common on cheap computers of
the 1980's.

The 8086, Intel's circa 1978 CPU that is the ancestor of all of today's
PC CPUs, didn't have floating-point instructions. But clearly, the software
floating point performance wasn't good enough, because two years later, in
1980, intel came out with the 8087, but these so-called "math coprocessors"
were still not common at the time.

A book about the assembly language of another cheap computer from the same era,
the Commodore 64, contains the following quote about why the commodore 64 did
floating-point in software: "you pay a tremendous amount for having floating-
point instructions, because computers which have them are so much more
expensive than microcomputers".

Fractint (http://en.wikipedia.org/wiki/Fractint) is an example of a project
that came out in the era (1988) when the math coprocessors were still not
common, and they did everything humanly possible to avoid using floating-point
operations, and use integers instead (the word "int" even appears in the
project's name).

So, sure, if your application is a desktop calculator, performance is not
important, and convenience and accuracy is what matters, so go with arbitrary
precision in software. But if your application really depends on calculating
quickly, doing arbitrary precision in software instead of floating-point in
hardware is just about the worst thing you could do to your application...

-- 
Nadav Har'El| Thursday, Jan  6 2011, 1 Shevat 5771
n...@math.technion.ac.il |-
Phone +972-523-790466, ICQ 13349191 |New! Divorcee Barbie! Comes with all the
http://nadav.harel.org.il   |usual accessories, plus all of Ken's stuff

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: OT: PHP 32 bit numbers security issue

2011-01-06 Thread Uri Even-Chen
On Thu, Jan 6, 2011 at 00:31, Nadav Har'El  wrote:
> It is pointless to make such generalizations, that speed of numeric
> calculation is no longer important. Many applications, including video
> encoding/decoding, games, and much more, basically do calculations in a
> tight loop, and they simply don't need 1024 bits (let alone unlimited)
> precision. They want to have a certain precision, and perform calculations
> fast and with low energy requirements.
>
> What I do agree with you, though, is that there is no longer a reason why
> modern languages should not have built-in unlimited precision integers
> ("bigints") as an *option* in addition to the regular faster types like
> "int", "long", etc. Once upon a time, adding a "bigint" library to a
> language meant that the compiler was bigger, the library was bigger, and
> the book was thicker. With todays gigantic software, nobody cares about
> these things any more.
>
> The question of unlimited precision real numbers (aka "floating point")
> is more complicated - how will you represent simple fractions (like 1/3)
> whose base-10 expansion is infinite? What will you do about results of
> math functions (e.g., log(), sin(), sqrt() etc.) that are irrational?
> Will your number system also start supporting simple fractions and symbolic
> formulas to retain the perfect precision for as long as possible? Pretty
> soon you'll end up with Matematica 
> (http://en.wikipedia.org/wiki/Mathematica)..
> I think a more sensible approach for real numbers is something like what
> "bc" does, i.e., support an arbitrary, but pre-determined, precision.

I think letting the user define the number of bits used for accuracy
and exponent is a good start.  If I need 256 bits for accuracy it
would be fine, but defining 1,000,000 for accuracy should work too
(even if slower).  By the way, I read somebody calculated the first
trillion (1,000,000,000,000) decimal digits of the number e!
[http://www.numberworld.org/digits/E/] and 5 trillion digits of pi!
[http://www.numberworld.org/misc_runs/pi-5t/details.html]

If there is special need for 100% accuracy, rational numbers can be
represented by the fraction of two integers, for example 1/3 will be
represented as 1/3 and 0.1 will be represented as 1/10.  All the main
operations and comparisons can be done with this rational
representation.

If you need to calculate an irrational function, there is no choice
but to specify the accuracy you need.  In this case you can use
floating point, or the rational representation - but the result will
not be 100% accurate.  But even when using floating point, there are
ways to prevent results such as 2.1 from appearing,
this happened to me for example in Java (using eclipse) when I
calculated addition of decimal numbers, such as 0.01, which don't have
a finite binary representation in floating point.  A good compiler can
prevent this, by rounding numbers to less digits than the accuracy
they are represented.

By the way, although I know hardware can be used to calculate floating
point operations, I would prefer to use software - because of the
ability to be flexible and let the user or programmer define the
number of bits necessary for accuracy and the exponent.  I think
calculating integer operations is enough for hardware - the rest can
be done by software.

Uri Even-Chen
Mobile Phone: +972-50-9007559
E-mail: u...@speedy.net
Website: http://www.speedy.net/

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


kvm for monitoring BIOS on motherboards without serial console

2011-01-06 Thread Kfir Lavi
Hi all,
I have a computer router that I need to monitor from my laptop.
It has problem to boot. So I need to connect an external monitor to it.
Currently I don't have a monitor.
My laptop runs Linux, so I'm looking for a connector VNC like,
that will do VGA to my laptop that has usb and ethernet (no serial).
If it is possible to buy it here in Tel Aviv, it would be best.
It should be very simple for connecting just one computer and just for
monitoring the BIOS.
No need for graphics and such.

Regards,
Kfir
___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il