Re: Entropy (was Re: how to generate random negative numbers)

2009-08-12 Thread Francois Bottin

Eric De Mund wrote:

Ron,

John Hasler:
] echo $(( $(( $RANDOM - $RANDOM )) % 3 ))

Ron Johnson:
] Does this burn through entropy faster than other methods?

Yes. Twice as fast. And, more importantly, it's mathematically
incorrect. It does not have the same probability density function as:

echo $(( $(($RANDOM % 5)) - 2))


To be complete, (( $(($RANDOM % 5)) - 2)) is not perfect either, but 
closer to perfection if $RANDOM is a true random generator.


To simplify things, let's assume that the numbers we work on are 4 bits 
long. The possible values are:

$RANDOM  ->  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
$RANDOM % 5  ->  0  1  2  3  4  0  1  2  3  4  0  1  2  3  4  0
You see that 0 has a higher probability than the other values.

If Max is the biggest int that can be generated by $RANDOM, and N is the 
number of different values we need, we should throw away any value of 
$RANDOM that is >= int(Max / N) * N.


Just my 2 cents ;-)

François.


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org




Re: *****SPAM***** Re: Re: cupsys does not print: update

2008-04-26 Thread Francois Bottin

Mark Maas wrote:


If so, each new person joining and emailing this list will get this very
disturbing message from this guy. What can we do to "enlighten" him?


You may subscribe his address to any mailing list that asks confirmation 
through mail: the responder doesn't change the subject...


François.


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: Debian attack on Mac OS X?

2004-10-21 Thread Francois Bottin
Selon Peter Callas <[EMAIL PROTECTED]>:

> I was suggested to contact this address by someone at
> [EMAIL PROTECTED] Can any one please help with this problem:
>
> Recently when I try to use 1.2.3 (v125.9) or Internet Explorer 5.2 on
> Mac OS X 10.3.5 I cannot access *any* web sites correctly. I either get
> "Not Found. The requested URL /search was not found on this server.
> Additionally, a 404 Not Found error was encountered while trying to use
> an ErrorDocument to handle the request. Apache/1.3.29 Server at
> www.cerne.no-ip.org Port 80"
>
> or else I get the following page appearing even though the address is,
> for example, http://www.google.com (ie. the address bar shows as I typed it)
>
> [default apache page on Debian]
>
> [...]

I guess it is the response from a machine that is incorrectly used as proxy.

If you do not need a proxy, then disable its use in IE (I have no idea how you
can do this)
If you need a proxy, copy the config you have in netscape as you said it is
working. Do not forget the port number.

If it is not a proxy config problem... I have no clue what it could be.

HTH,

François.

--
Francois BOTTIN
--
"How kind," the PFY sighs. "But where will I go?"
"Somewhere where they know nothing about computing...
where they wouldn't know a RAM chip from a potato chip!"
"But I don't want to visit Microsoft!" he whines.
  The BOFH 1998 - Simon Travaglia (bofh.ntk.net)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: .deb dependancy hell

2004-01-28 Thread Francois Bottin
Selon Richard Hoskins <[EMAIL PROTECTED]>:

> On unstable, i386.
> 
> Kind of reminds me of RPM:
> 
>[EMAIL PROTECTED]:~$ sudo dpkg -r libgphoto2-2
>dpkg: dependency problems prevent removal of libgphoto2-2:
> libgphoto2-port0 depends on libgphoto2-2.
>dpkg: error processing libgphoto2-2 (--remove):
> dependency problems - not removing
>Errors were encountered while processing:
> libgphoto2-2
> 
>[EMAIL PROTECTED]:~$ sudo dpkg -r libgphoto2-port0
>dpkg: dependency problems prevent removal of libgphoto2-port0:
> libgphoto2-2 depends on libgphoto2-port0 (>= 2.1.4-1).
>dpkg: error processing libgphoto2-port0 (--remove):
> dependency problems - not removing
>Errors were encountered while processing:
> libgphoto2-port0
> 

apt-get remove libgphoto2-2 libgphoto2-port0

or even better, use aptitude...

François.

-- 
Francois BOTTIN
--
"How kind," the PFY sighs. "But where will I go?" 
"Somewhere where they know nothing about computing...
where they wouldn't know a RAM chip from a potato chip!" 
"But I don't want to visit Microsoft!" he whines.
  The BOFH 1998 - Simon Travaglia (bofh.ntk.net)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: 2 networks

2003-09-24 Thread Francois Bottin
Quoting Christoph Simon <[EMAIL PROTECTED]>:

> On Wed, 24 Sep 2003 12:13:06 +0200
> Francois Bottin <[EMAIL PROTECTED]> wrote:
> 
> > Personnaly, I use netenv but I'm planing to change it soon (I don't want
> > to have to choose the config during the booting phase). A quick
> > apt-cache search returned the following packages:
> 
> Did you check out the mapping facilities of /etc/network/interfaces?
> There is some almost cut-and-paste code in /usr/share/doc/ifupdown/examples
> for just this situation.
> 

Wow! That's great! I must have lived in a cave during the last few releases of
ifupdown :-/ That's the drawback of this OS when you don't have to reinstall
everything when a new release is out.

I found the last example quite interesting (pinging several machines to find out
where we are) but it's unusable in my case: 2 of the networks I frequently
attach to use the same subnet (192.168.1.0/24) with dhcp and I use different
configurations on them. Hence I think the "arp approach" of the other tools is
preferable in this case. A solution would be to change the scripts to use arp.

But then I would face another problem: the new laptop that my company just gave
me has an integrated 100baseTX interface (mine uses a pcmcia card) and I also
have a pcmcia wifi card... I fear this will be difficult to configure this (one
with auto and the other without). In the description of laptop-net it is said:
The package can automatically: [...] disable the network interface when the
network cable is removed, and enable it when the cable is inserted; [...]
I did not try this package, but I think that according to this description, it
is perhaps best suited in complicated situations. Any experience there?

François.

PS: is there a tool to send arp requests? arp(8) is only able to list the kernel
table. I know that if I just ping the machine before I will have the wanted
entry in the arp table, but is there a way to have the same result without the
"ping overhead"?

-- 
Francois BOTTIN
--
"How kind," the PFY sighs. "But where will I go?" 
"Somewhere where they know nothing about computing...
where they wouldn't know a RAM chip from a potato chip!" 
"But I don't want to visit Microsoft!" he whines.
  The BOFH 1998 - Simon Travaglia (bofh.ntk.net)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: 2 networks

2003-09-24 Thread Francois Bottin
Quoting Martin Wegmann <[EMAIL PROTECTED]>:

> Hello, 
> 
> I have two networks (at home & at uni) and every then and now I do 
> netcardconfig change my IP and so on but on the long term it is quite tedious
> 
> - Is there a way to set up two network systems and swaping between them by 
> executing one sinlge command?
> 
Hello,

Personnaly, I use netenv but I'm planing to change it soon (I don't want to have
to choose the config during the booting phase). A quick apt-cache search
returned the following packages:

divine - Automatic IP configuration detection for laptops
intuitively - Automatic IP configuration detection for laptops
laptop-net - Automatically adapt laptop ethernet
laptop-netconf - network detection and configuration program for laptops
whereami - Automatically reconfigure your (laptop) system for a new location

HTH.

François.

-- 
Francois BOTTIN
--
"How kind," the PFY sighs. "But where will I go?" 
"Somewhere where they know nothing about computing...
where they wouldn't know a RAM chip from a potato chip!" 
"But I don't want to visit Microsoft!" he whines.
  The BOFH 1998 - Simon Travaglia (bofh.ntk.net)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: OT: Why is C so popular?

2003-08-28 Thread Francois Bottin
Quoting Mark Roach <[EMAIL PROTECTED]>:
> if you'll settle for optional bracketing, I think python might be for
> you ;-)
> 
> if cond:
> # {
> block
> # }
> else:
> # {
> block
> # }
> 

Compare it with SUN's recomendations for Java (but useable also for C):
if (cond) {
block;
} else {
block;
}

In this case I find it much better than the GNU Coding Standards, and there is
only one line more than Python...

François.

-- 
Francois BOTTIN
--
"How kind," the PFY sighs. "But where will I go?" 
"Somewhere where they know nothing about computing...
where they wouldn't know a RAM chip from a potato chip!" 
"But I don't want to visit Microsoft!" he whines.
  The BOFH 1998 - Simon Travaglia (bofh.ntk.net)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: OT: Why is C so popular?

2003-08-27 Thread Francois Bottin
Quoting Ron Johnson <[EMAIL PROTECTED]>:
> On Wed, 2003-08-27 at 06:34, Paul Johnson wrote:
> > On Wed, Aug 27, 2003 at 03:59:27AM -0500, Ron Johnson wrote:
> > > 3 - "I learned C in college, and C lets me write in 1 long line 
> > > that which takes 3 easy-to-read lines in Fortran.  Thus, C is great,
> > > and all other languages suck!". Fortunately, this attitude is also
> > > diminishing.  Unfortunately, nowadays "s/C /Perl /".
> > 
> > Wouldn't it be easier to read if you wrote it s/C/Perl/ ?
> 
> So that it wouldn't change Choo-choo to Perlhoo-choo.  I wasn't
> just thinking of that one paragraph...
> 
Then: s/\bC\b/Perl/g ;-)
(Yes, I also added a g at the end to not only substitute the 1st occurence)

Francois.

-- 
Francois BOTTIN
--
"How kind," the PFY sighs. "But where will I go?" 
"Somewhere where they know nothing about computing...
where they wouldn't know a RAM chip from a potato chip!" 
"But I don't want to visit Microsoft!" he whines.
  The BOFH 1998 - Simon Travaglia (bofh.ntk.net)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]