I'm sorry... I seem to remember using the word 'sanely' ... and by that I
didn't mean intoducing bitwise operator and bitmasks in python. I thing
&0xFFFFFFFF to insert an ip address is, well, FAIL.
"Jay Pipes" <[email protected]> wrote:
>On Thu, Mar 25, 2010 at 6:22 PM, Monty Taylor <[email protected]> wrote:
>> On 03/25/2010 02:47 PM, Eric Day wrote:
>>>
>>> Of course with binary you waste at least one extra byte since it needs
>>> to pack the size too, so doing signed int and managing the last bit
>>> would be most efficient.
>>
>> Of course, in all fairness - asking people to do the bit swap magic for this
>> from languages which are not C is like telling people to use a Ruby on Rails
>> ActiveResource API from a non-ruby language. (can you tell my frustration of
>> the day?)
>>
>> I have no idea how I'd do this sanely in Python, for instance.
>>
>
>jpi...@serialcoder:~$ python
>Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55)
>[GCC 4.4.1] on linux2
>Type "help", "copyright", "credits" or "license" for more information.
>>>> the_signed_int = -1
>>>> print the_signed_int
>-1
>>>> the_unsigned_int= the_signed_int & 0xFFFFFFFF
>>>> print the_unsigned_int
>4294967295
>
>-jay
>
--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help : https://help.launchpad.net/ListHelp