[wplug] cores
Tom Rhodes
trhodes at FreeBSD.org
Sun Mar 2 16:51:36 EST 2008
On Sun, 2 Mar 2008 16:16:56 -0500
Tom Rhodes <trhodes at freebsd.org> wrote:
> On Sun, 2 Mar 2008 14:46:41 -0500
> "Michael Semcheski" <mhsemcheski at gmail.com> wrote:
>
> > On Sun, Mar 2, 2008 at 11:23 AM, Tom Rhodes <trhodes at freebsd.org> wrote:
> >
> > > Python is the worst, most useless programming language I have
> > > seen and I DARE ANYONE to argue with me. :P
> > >
> >
> > I know I'm going to take flack for this, but I have a five word retort.
> >
> > perl - the write only language.
> >
> > But, your jabs at python will not affect me. I refuse to argue the merits
> > of an interpreted language.
> >
>
> I don't like perl either. But at least with perl, I could probably
> take a cidr block, convert it to binary, and then generate netmasks
> on the fly. Every attempt I've made in python to do this has
> ended in utter failure (because apparently you can't do bitwise
> operations on ctypes). In C it's just this:
>
> uint32 cidr2nmbin(uint32 n) = (uint32)(~0) << (32 - n);
>
> If perl is unable to do that (as apparently python can't) then it's
> just as useless ...
Following up to my own post, that above is wrong and I really
need to pay more attention. This version works:
uint32 cidr2nm(uint32 n) { return ~0 << (32 - n); }
--
Tom Rhodes
More information about the wplug
mailing list