Working with unsigned/signed types

brian at brianshirk.com brian at brianshirk.com
Wed Dec 20 01:25:36 EST 2006


That seems like it'll do the trick quite well.



As far as the future generations go, there's no question as to whether it would

last if it were on my site - there are always changes being made to it and I'm

not expecting it to be very stable over the course of time, especially since it

would confuse the heck out of a bride trying to find her pictures if she stumbled

on it...  Is there a repository of some sort available for this sort of thing

anywhere?



Thanks!

-Brian





On Tue Dec 19 22:07 , Ben Finney <bignose+hates-spam at benfinney.id.au> sent:



>brian at brianshirk.com> writes:

>

>> The first part of the question is fairly basic - in C, working with

>> signed integers, the MSB (is that still the right term?) is used to

>> denote positive and negative, and the following bits increase

>> towards positive infinity, correct?  Such that in C, adding one to

>> 0x7fffffff would cause the number to go around to -0x7fffffff (or

>> whatever that is), giving -1 for 0xffffffff?

>>

>> Secondly, (and this is my weak point as a programmer) to re-insert

>> the data after, what would be the most efficient way to pull

>> everything back apart into individual characters for putting it all

>> back into the files?  I could probably figure out something that

>> would work, but I wouldn't be so sure as to its reliability.

>

>I think, from the above, that you want to read about the 'struct'

>module in the standard library.

>

>    http://docs.python.org/lib/module-struct.html>

>

>> Third, being a photographer now rather than a coder, I'd like to

>> give back the modules I'm writing to the community (it looks like

>> very little of the sort exists), but would rather not worry about

>> them in the future...  Is there a good way to go about this?

>

>Ideally, find someone who will actively maintain the code into the

>foreseeable future; maybe a user of the code with more interest in

>programming than you.

>

>Failing that, find a place to put it online for the foreseeable

>future, and notify repositories like Freshmeat

>http://freshmeat.net/> of its existence and location.

>

>The most important thing to do is to explicitly license the rights to

>modify and redistribute freely for all people who receive the code, so

>they never have to try to track you down for permission.

>

>Choose a permissive license like the Expat license

>http://www.jclark.com/xml/copying.txt> if you want to allow

>people to do just about anything except claim you didn't write it;

>choose a copyleft like the GNU General Public License

>http://www.gnu.org/copyleft/gpl.html> if you want to ensure

>nobody can redistribute under more restrictive terms in future.

>

>Make each file clearly marked so that the grant of license is clear,

>and include the text of the license terms in an obvious file in the

>source code package. See the addendum of the GNU GPL for how this is

>best done, even if you end up not choosing that particular license.

>

>Thanks for thinking of the future hackers :-)

>

>-- 

> \      "...one of the main causes of the fall of the Roman Empire was |

>  `\        that, lacking zero, they had no way to indicate successful |

>_o__)               termination of their C programs."  -- Robert Firth |

>Ben Finney

>

>-- 

>http://mail.python.org/mailman/listinfo/python-list

>








More information about the Python-list mailing list