On 31/05/2020 18:01, Evan Schalton wrote:
I think you're arguing both sides of the argument -- numpy arrays do
have a lot of similar, related operations (because numpy uses them
internally -- since they're more efficient) which means they're not
fringe.
I'm advocating that the built-in list clas
On 5/31/2020 12:24 PM, Evan Schalton wrote:
I'm less strictly interested in the & operator explicitly working with a bit
int, but think it'd be great if the was a built-in filter something like:
[1,2,3,4] & [0,0,1,1] => [3,4] OR
[1,2,3,4] & [False, False, True, True] = [3,4]
Leaving numpy
I think you're arguing both sides of the argument -- numpy arrays do have a lot
of similar, related operations (because numpy uses them internally -- since
they're more efficient) which means they're not fringe.
I'm advocating that the built-in list class add the efficient, convenience
methods
Evan Schalton wrote:
> Peter,
>
> This isn't a ram consideration as much it's a logical consideration. There
> are a lot of ways to handle this, I REALLY don't want to use a package
> here. Bit masking is incredibly useful for permutations/combinatoric
> algorithms. I can create my own class wrap
Peter,
This isn't a ram consideration as much it's a logical consideration. There are
a lot of ways to handle this, I REALLY don't want to use a package here. Bit
masking is incredibly useful for permutations/combinatoric algorithms. I can
create my own class wrapper or functions, and optimize,
evan.schal...@gmail.com wrote:
> I frequently use binary as bool placeholders and find myself filtering
> lists based on those bools, this seems to have a similar semantic meaning
> as the bit wise ^ or __xor__ operator and could add syntactic sugar to the
> base list class.
>
> Use Case:
>
> Co
@MRAB,
Yes -- good point, it should be the __and__ operator.
do I need a new class? No, but based on this use case and other formatting
techniques adding a filter method to the list class that takes in either bit
mask or bool list would streamline a lot of code and not change any existing
func
On 2020-05-30 23:52, evan.schal...@gmail.com wrote:
I frequently use binary as bool placeholders and find myself filtering lists
based on those bools, this seems to have a similar semantic meaning as the bit
wise ^ or __xor__ operator and could add syntactic sugar to the base list class.
Use C
On Mon, Dec 18, 2017 at 5:00 AM, Wild, Marcel, Dr
wrote:
> Hello everybody:
> I really don't know anything about Python (I'm using Mathematica) but with
> the help of others learned that
>
> g=expr2bdd(f)
>
> makes the BDD (=binary decision diagram) g of a Boolean function f. But
> what is th
On 30/05/2014 00:25, rasikasriniva...@gmail.com wrote:
Of course Cut and paste issue. Anyhow, i will look at the struct module.
cheers, srini
Please let us know how you get on, please don't top post, and please
either use the mailing list
https://mail.python.org/mailman/listinfo/python-
Of course Cut and paste issue. Anyhow, i will look at the struct module.
cheers, srini
On Thursday, May 29, 2014 7:09:21 PM UTC-4, MRAB wrote:
> On 2014-05-29 23:08, rasikasriniva...@gmail.com wrote:
>
> > friends
>
> >
>
> > I have a pair of simple python programs as follows:
>
> >
>
>
On Thu, May 29, 2014 at 5:09 PM, MRAB wrote:
> On 2014-05-29 23:08, rasikasriniva...@gmail.com wrote:
>> the received data for the messages 9 thru 13 are not as expected.
>>
>> I wonder if anyone can see what I am doing wrong?
>>
>> Appreciate any hints. thanks, srini
>>
> I don't understand why y
On 2014-05-29 23:08, rasikasriniva...@gmail.com wrote:
friends
I have a pair of simple python programs as follows:
#!/usr/bin/python
# broadcast.py
import socket
from ctypes import *
import random
class PurgeData(Structure):
_fields_ = [("press",c_int), ("ticks",c_int), ("volume",c_float)
BTW - My environment is:
H:\>python
Enthought Canopy Python 2.7.6 | 64-bit | (default, Apr 11 2014, 20:31:44) [MSC v
.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
--
https://mail.python.org/mailman/listinfo/python-list
In <9004a556-958f-4d1d-81a7-4d1b73134...@googlegroups.com> cerr
writes:
> Traceback (most recent call last):
> File "gateway.py", line 2485, in
> main()
> File "gateway.py", line 2459, in main
> cloud_check()
> File "gateway.py", line 770, in cloud_check
> gnstr_dict[src] = gn
On 07/30/2013 01:29 PM, cerr wrote:
Hi,
In my application I have followingf lines:
print curr_mac
print hexlify(buf)
binmac = unhexlify(curr_mac)
tmpgndict[binmac] += buf
curr_mac being a 3Byte MAVC address in ASCII and I want t
> I'm trying to update to both 2.7.3 and Numpy 1.7.0.
Updating Python is from python.org
If you're on 64bit windows, see http://www.lfd.uci.edu/~gohlke/pythonlibs/
--
http://mail.python.org/mailman/listinfo/python-list
On 21/03/2013 4:00 PM, Dave Angel wrote:
On 03/21/2013 03:40 PM, Colin J. Williams wrote:
How do I find the binaries on Source Forge?
I'm trying to update to both 2.7.3 and Numpy 1.7.0.
Colin W
Best answer might depend on what OS you're running, and what
implementation of Python you're after
On Thu, Mar 21, 2013 at 8:40 PM, Colin J. Williams wrote:
> How do I find the binaries on Source Forge?
>
> I'm trying to update to both 2.7.3 and Numpy 1.7.0.
>
> Colin W
> --
> http://mail.python.org/mailman/listinfo/python-list
You don’t. First off, nobody really likes nor uses SourceForge to
On 03/21/2013 03:40 PM, Colin J. Williams wrote:
How do I find the binaries on Source Forge?
I'm trying to update to both 2.7.3 and Numpy 1.7.0.
Colin W
Best answer might depend on what OS you're running, and what
implementation of Python you're after.
Why would you look on SourceForge for
On 02/14/2013 11:18 AM, Megha Agrawal wrote:
Hello All,
I am a newbie to python language. I need your help in implementation
of Binary tree in python. I have a count of nodes and I need to draw a
binary tree. Suppose if count is 5 then tree will look like
1
On 10/11/10 5:16 AM, Paul Biegel wrote:
Hi,
I have a question related to read a binary vtk file. This file has been created
using Matlab by
the command "fread". However, this file must be processed further within Python.
It is not
known to me which codec is used to encode this file. It starts wit
In article <0a4c9b21-6eff-461a-b15c-415d1408d...@semanchuk.com>,
Philip Semanchuk wrote:
[...]
> Thanks to all who replied on this topic. A little more background --
> these binaries are just a convenience for our users and we don't have
> to cover every possible permutation of Python, only t
On Jul 26, 2010, at 5:19 PM, Ned Deily wrote:
In article ,
Christian Heimes wrote:
[Philip Semanchuk wrote:]
Specifically, I'm concerned with binaries created by SWIG for a C++
library that our project uses. We'd like to ship precompiled
binaries
for Linux, OS X and Windows for Python 2.5
In article ,
Christian Heimes wrote:
> [Philip Semanchuk wrote:]
> > Specifically, I'm concerned with binaries created by SWIG for a C++
> > library that our project uses. We'd like to ship precompiled binaries
> > for Linux, OS X and Windows for Python 2.5 and 2.6. I'm hoping that it
> > i
On 7/26/10 2:40 PM, MRAB wrote:
Philip Semanchuk wrote:
Hi all,
Does Python guarantee binary compatibility across major, minor and/or micro
versions? I looked through the docs and even with Google's help I wasn't able
to find any official statements on this subject.
Specifically, I'm concerned
> Specifically, I'm concerned with binaries created by SWIG for a C++
> library that our project uses. We'd like to ship precompiled binaries
> for Linux, OS X and Windows for Python 2.5 and 2.6. I'm hoping that it
> is sufficient to create binaries for each Python for each platform (3
> *
Philip Semanchuk wrote:
Hi all,
Does Python guarantee binary compatibility across major, minor and/or
micro versions? I looked through the docs and even with Google's help I
wasn't able to find any official statements on this subject.
Specifically, I'm concerned with binaries created by SWIG
On Mar 30, 1:52 pm, MRAB wrote:
> John Nagle wrote:
> > aditya wrote:
> >> On Mar 30, 10:49 am, Raymond Hettinger wrote:
> >>> On Mar 30, 8:13 am, aditya wrote:
>
> To get the decimal representation of a binary number, I can just do
> this:
> int('11',2) # returns 3
> But dec
Chris
On Tue, Mar 30, 2010 at 11:14 AM, John Nagle wrote:
> aditya wrote:
>
>> On Mar 30, 10:49 am, Raymond Hettinger wrote:
>>
>>> On Mar 30, 8:13 am, aditya wrote:
>>>
>>> To get the decimal representation of a binary number, I can just do
this:
int('11',2) # returns 3
But d
John Nagle wrote:
aditya wrote:
On Mar 30, 10:49 am, Raymond Hettinger wrote:
On Mar 30, 8:13 am, aditya wrote:
To get the decimal representation of a binary number, I can just do
this:
int('11',2) # returns 3
But decimal binary numbers throw a ValueError:
int('1.1',2) # should return 1.5,
On 2010-03-30, John Nagle wrote:
> Hex floats are useful because you can get a string representation of
> the exact value of a binary floating point number. It should always
> be the case that
>
>float.fromhex(float.hex(x)) == x
Until you try running your program on a machine that repre
On Mar 30, 10:49 am, Raymond Hettinger wrote:
> On Mar 30, 8:13 am, aditya wrote:
>
> > To get the decimal representation of a binary number, I can just do
> > this:
>
> > int('11',2) # returns 3
>
> > But decimal binary numbers throw a ValueError:
>
> > int('1.1',2) # should return 1.5, throws e
aditya wrote:
On Mar 30, 10:49 am, Raymond Hettinger wrote:
On Mar 30, 8:13 am, aditya wrote:
To get the decimal representation of a binary number, I can just do
this:
int('11',2) # returns 3
But decimal binary numbers throw a ValueError:
int('1.1',2) # should return 1.5, throws error instea
On Tue, 30 Mar 2010 08:28:50 -0700, Patrick Maupin wrote:
> On Mar 30, 10:13 am, aditya wrote:
>> To get the decimal representation of a binary number, I can just do
>> this:
>>
>> int('11',2) # returns 3
>>
>> But decimal binary numbers throw a ValueError:
>>
>> int('1.1',2) # should return 1.5,
On Mar 30, 10:49 am, Raymond Hettinger wrote:
> On Mar 30, 8:13 am, aditya wrote:
>
> > To get the decimal representation of a binary number, I can just do
> > this:
>
> > int('11',2) # returns 3
>
> > But decimal binary numbers throw a ValueError:
>
> > int('1.1',2) # should return 1.5, throws e
On Mar 30, 10:37 am, Benjamin Kaplan wrote:
> On Tue, Mar 30, 2010 at 11:13 AM, aditya wrote:
> > To get the decimal representation of a binary number, I can just do
> > this:
>
> > int('11',2) # returns 3
>
> > But decimal binary numbers throw a ValueError:
>
> > int('1.1',2) # should return 1.5
aditya wrote:
To get the decimal representation of a binary number, I can just do
this:
int('11',2) # returns 3
But decimal binary numbers throw a ValueError:
int('1.1',2) # should return 1.5, throws error instead.
Is this by design? It seems to me that this is not the correct
behavior.
int
Doh!
Well the problem is that int's are integers. So yeah, you can't even do
that with normal value "int ('2.1')" will also throw an error. And
floats don't support radix conversion, because no-one really writes
numbers that way. (At least computer programmers...)
On 3/30/2010 11:43 AM, Shash
On Mar 30, 8:13 am, aditya wrote:
> To get the decimal representation of a binary number, I can just do
> this:
>
> int('11',2) # returns 3
>
> But decimal binary numbers throw a ValueError:
>
> int('1.1',2) # should return 1.5, throws error instead.
>
> Is this by design? It seems to me that this
The conversion is not supported for decimal integers AFAIK, however
'0b123.456' is always valid. I guess you can always get a decimal number
convertor onto Python-recipes
On Tue, Mar 30, 2010 at 9:05 PM, Grant Olson wrote:
> On 3/30/2010 11:13 AM, aditya wrote:
> > To get the decimal represent
On Tue, Mar 30, 2010 at 11:13 AM, aditya wrote:
> To get the decimal representation of a binary number, I can just do
> this:
>
> int('11',2) # returns 3
>
> But decimal binary numbers throw a ValueError:
>
> int('1.1',2) # should return 1.5, throws error instead.
>
> Is this by design? It seems t
On 3/30/2010 11:13 AM, aditya wrote:
> To get the decimal representation of a binary number, I can just do
> this:
>
> int('11',2) # returns 3
>
> But decimal binary numbers throw a ValueError:
>
> int('1.1',2) # should return 1.5, throws error instead.
>
> Is this by design? It seems to me tha
On Mar 30, 10:13 am, aditya wrote:
> To get the decimal representation of a binary number, I can just do
> this:
>
> int('11',2) # returns 3
>
> But decimal binary numbers throw a ValueError:
>
> int('1.1',2) # should return 1.5, throws error instead.
>
> Is this by design? It seems to me that thi
decimal binary number is not included AFAIK
On Tue, Mar 30, 2010 at 8:43 PM, aditya wrote:
> To get the decimal representation of a binary number, I can just do
> this:
>
> int('11',2) # returns 3
>
> But decimal binary numbers throw a ValueError:
>
> int('1.1',2) # should return 1.5, throws err
Jordan Apgar wrote:
Hi all,
I'm trying to transfer a binary file over xmlrpclib. My test file is
a .jpeg file. I can transfer all the data over but when I go to open
the .jpeg I get "Error interpreting JPEG image file (Invalid JPEG file
structure: SOS before SOF)"
here's the code:
=
Hendrik van Rooyen wrote:
On Wednesday 22 July 2009 12:03:44 superpollo wrote:
can i do something like the above, but using a *binary* number? (e.g.
00101101 instead of 45) ?
00101101 is not hex 45.
hex 45 is 01000101
whoopsie daisie!
chr(int('01000101',2))
'E'
much obliged.
by
On Wednesday 22 July 2009 12:03:44 superpollo wrote:
> can i do something like the above, but using a *binary* number? (e.g.
> 00101101 instead of 45) ?
00101101 is not hex 45.
hex 45 is 01000101
>>> chr(int('01000101',2))
'E'
>>>
- Hendrik
--
http://mail.python.org/mailman/listinfo/python-
superpollo wrote:
hello clp.
i can insert a hex value for a character literal in a string:
>>> stuff = "\x45"
>>> print stuff
E
>>>
can i do something like the above, but using a *binary* number? (e.g.
00101101 instead of 45) ?
Language Ref 2.4. Literals
--
http://mail.python.org/mailma
superpollo wrote:
hello clp.
i can insert a hex value for a character literal in a string:
>>> stuff = "\x45"
>>> print stuff
E
>>>
can i do something like the above, but using a *binary* number? (e.g.
00101101 instead of 45) ?
bye
There's no way to get a binary value directly into a lit
superpollo wrote:
> i can insert a hex value for a character literal in a string:
>
> >>> stuff = "\x45"
> >>> print stuff
> E
> >>>
>
> can i do something like the above, but using a *binary* number? (e.g.
> 00101101 instead of 45) ?
There are binary number literals since 2.6 and there is th
2009/7/22 superpollo
> hello clp.
>
> i can insert a hex value for a character literal in a string:
>
> >>> stuff = "\x45"
> >>> print stuff
> E
> >>>
>
> can i do something like the above, but using a *binary* number? (e.g.
> 00101101 instead of 45) ?
(Python 3)
>>> bin(45)
'0b101101'
>>> in
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512
Hi Dave,
I've solved this now using ipaddr. ipaddr will be in the stdlib as soon
as its developers realize there are actually not one, but two proposals
to fix the remaining issues waiting for their input.
Anyway, since ipaddr:r68, you can do the f
> Adam Olsen (AO) wrote:
>AO> The Wayback Machine has 150 billion pages, so 2**37. Google's index
>AO> is a bit larger at over a trillion pages, so 2**40. A little closer
>AO> than I'd like, but that's still 56294995000 to 1 odds of having
>AO> *any* collisions between *any* of the file
On Fri, 17 Apr 2009 11:19:31 -0700, Adam Olsen wrote:
> Actually, *cryptographic* hashes handle that just fine. Even for files
> with just a 1 bit change the output is totally different. This is known
> as the Avalanche Effect. Otherwise they'd be vulnerable to attacks.
>
> Which isn't to say
In message , Nigel
Rantor wrote:
> Adam Olsen wrote:
>
>> The chance of *accidentally* producing a collision, although
>> technically possible, is so extraordinarily rare that it's completely
>> overshadowed by the risk of a hardware or software failure producing
>> an incorrect result.
>
> Not
On Apr 17, 9:59 am, SpreadTooThin wrote:
> You know this is just insane. I'd be satisfied with a CRC16 or
> something in the situation i'm in.
> I have two large files, one local and one remote. Transferring every
> byte across the internet to be sure that the two files are identical
> is just n
On Apr 17, 9:59 am, norseman wrote:
> The more complicated the math the harder it is to keep a higher form of
> math from checking (or improperly displacing) a lower one. Which, of
> course, breaks the rules. Commonly called improper thinking. A number
> of math teasers make use of that.
Of cou
On Apr 17, 5:30 am, Tim Wintle wrote:
> On Thu, 2009-04-16 at 21:44 -0700, Adam Olsen wrote:
> > The Wayback Machine has 150 billion pages, so 2**37. Google's index
> > is a bit larger at over a trillion pages, so 2**40. A little closer
> > than I'd like, but that's still 56294995000 to 1 od
On Apr 17, 4:54 am, Nigel Rantor wrote:
> Adam Olsen wrote:
> > On Apr 16, 11:15 am, SpreadTooThin wrote:
> >> And yes he is right CRCs hashing all have a probability of saying that
> >> the files are identical when in fact they are not.
>
> > Here's the bottom line. It is either:
>
> > A) Sever
Adam Olsen wrote:
On Apr 16, 11:15 am, SpreadTooThin wrote:
And yes he is right CRCs hashing all have a probability of saying that
the files are identical when in fact they are not.
Here's the bottom line. It is either:
A) Several hundred years of mathematics and cryptography are wrong.
The
On Thu, 2009-04-16 at 21:44 -0700, Adam Olsen wrote:
> The Wayback Machine has 150 billion pages, so 2**37. Google's index
> is a bit larger at over a trillion pages, so 2**40. A little closer
> than I'd like, but that's still 56294995000 to 1 odds of having
> *any* collisions between *any* o
Adam Olsen wrote:
On Apr 16, 11:15 am, SpreadTooThin wrote:
And yes he is right CRCs hashing all have a probability of saying that
the files are identical when in fact they are not.
Here's the bottom line. It is either:
A) Several hundred years of mathematics and cryptography are wrong.
The
Adam Olsen wrote:
On Apr 16, 4:27 pm, "Rhodri James"
wrote:
On Thu, 16 Apr 2009 10:44:06 +0100, Adam Olsen wrote:
On Apr 16, 3:16 am, Nigel Rantor wrote:
Okay, before I tell you about the empirical, real-world evidence I have
could you please accept that hashes collide and that no matter ho
On Apr 16, 4:27 pm, "Rhodri James"
wrote:
> On Thu, 16 Apr 2009 10:44:06 +0100, Adam Olsen wrote:
> > On Apr 16, 3:16 am, Nigel Rantor wrote:
> >> Okay, before I tell you about the empirical, real-world evidence I have
> >> could you please accept that hashes collide and that no matter how many
On Apr 16, 11:15 am, SpreadTooThin wrote:
> And yes he is right CRCs hashing all have a probability of saying that
> the files are identical when in fact they are not.
Here's the bottom line. It is either:
A) Several hundred years of mathematics and cryptography are wrong.
The birthday problem
On Thu, 16 Apr 2009 10:44:06 +0100, Adam Olsen wrote:
On Apr 16, 3:16 am, Nigel Rantor wrote:
Okay, before I tell you about the empirical, real-world evidence I have
could you please accept that hashes collide and that no matter how many
samples you use the probability of finding two files th
On Apr 16, 8:59 am, Grant Edwards wrote:
> On 2009-04-16, Adam Olsen wrote:
> > I'm afraid you will need to back up your claims with real files.
> > Although MD5 is a smaller, older hash (128 bits, so you only need
> > 2**64 files to find collisions),
>
> You don't need quite that many to have a
On Apr 16, 3:16 am, Nigel Rantor wrote:
> Adam Olsen wrote:
> > On Apr 15, 12:56 pm, Nigel Rantor wrote:
> >> Adam Olsen wrote:
> >>> The chance of *accidentally* producing a collision, although
> >>> technically possible, is so extraordinarily rare that it's completely
> >>> overshadowed by the
On 2009-04-16, Adam Olsen wrote:
> The chance of *accidentally* producing a collision, although
> technically possible, is so extraordinarily rare that it's
> completely overshadowed by the risk of a hardware or software
> failure producing an incorrect result.
Not when
Adam Olsen wrote:
On Apr 16, 3:16 am, Nigel Rantor wrote:
Adam Olsen wrote:
On Apr 15, 12:56 pm, Nigel Rantor wrote:
Adam Olsen wrote:
The chance of *accidentally* producing a collision, although
technically possible, is so extraordinarily rare that it's completely
overshadowed by the risk
On Apr 16, 3:16 am, Nigel Rantor wrote:
> Adam Olsen wrote:
> > On Apr 15, 12:56 pm, Nigel Rantor wrote:
> >> Adam Olsen wrote:
> >>> The chance of *accidentally* producing a collision, although
> >>> technically possible, is so extraordinarily rare that it's completely
> >>> overshadowed by the
Adam Olsen wrote:
On Apr 15, 12:56 pm, Nigel Rantor wrote:
Adam Olsen wrote:
The chance of *accidentally* producing a collision, although
technically possible, is so extraordinarily rare that it's completely
overshadowed by the risk of a hardware or software failure producing
an incorrect resu
On Apr 15, 12:56 pm, Nigel Rantor wrote:
> Adam Olsen wrote:
> > The chance of *accidentally* producing a collision, although
> > technically possible, is so extraordinarily rare that it's completely
> > overshadowed by the risk of a hardware or software failure producing
> > an incorrect result.
Adam Olsen wrote:
The chance of *accidentally* producing a collision, although
technically possible, is so extraordinarily rare that it's completely
overshadowed by the risk of a hardware or software failure producing
an incorrect result.
Not when you're using them to compare lots of files.
Tr
On Apr 15, 11:04 am, Nigel Rantor wrote:
> The fact that two md5 hashes are equal does not mean that the sources
> they were generated from are equal. To do that you must still perform a
> byte-by-byte comparison which is much less work for the processor than
> generating an md5 or sha hash.
>
> I
On Apr 15, 8:04 am, Grant Edwards wrote:
> On 2009-04-15, Martin wrote:
>
>
>
> > Hi,
>
> > On Mon, Apr 13, 2009 at 10:03 PM, Grant Edwards wrote:
> >> On 2009-04-13, SpreadTooThin wrote:
>
> >>> I want to compare two binary files and see if they are the same.
> >>> I see the filecmp.cmp functi
Grant Edwards wrote:
We all rail against premature optimization, but using a
checksum instead of a direct comparison is premature
unoptimization. ;)
And more than that, will provide false positives for some inputs.
So, basically it's a worse-than-useless approach for determining if two
files
Martin wrote:
On Wed, Apr 15, 2009 at 11:03 AM, Steven D'Aprano
wrote:
The checksum does look at every byte in each file. Checksumming isn't a
way to avoid looking at each byte of the two files, it is a way of
mapping all the bytes to a single number.
My understanding of the original question
On 2009-04-15, Martin wrote:
> On Wed, Apr 15, 2009 at 11:03 AM, Steven D'Aprano
> I'd still say rather burn CPU cycles than development hours (if I got
> the question right),
_Hours_? Calling the file compare module takes _one_line_of_code_.
Implementing a file compare from scratch takes abo
On 2009-04-15, Martin wrote:
> Hi,
>
> On Mon, Apr 13, 2009 at 10:03 PM, Grant Edwards wrote:
>> On 2009-04-13, SpreadTooThin wrote:
>>
>>> I want to compare two binary files and see if they are the same.
>>> I see the filecmp.cmp function but I don't get a warm fuzzy feeling
>>> that it is doin
On Wed, Apr 15, 2009 at 11:03 AM, Steven D'Aprano
wrote:
> The checksum does look at every byte in each file. Checksumming isn't a
> way to avoid looking at each byte of the two files, it is a way of
> mapping all the bytes to a single number.
My understanding of the original question was a way t
On Wed, 15 Apr 2009 07:54:20 +0200, Martin wrote:
>> Perhaps I'm being dim, but how else are you going to decide if two
>> files are the same unless you compare the bytes in the files?
>
> I'd say checksums, just about every download relies on checksums to
> verify you do have indeed the same fil
Hi,
On Mon, Apr 13, 2009 at 10:03 PM, Grant Edwards wrote:
> On 2009-04-13, SpreadTooThin wrote:
>
>> I want to compare two binary files and see if they are the same.
>> I see the filecmp.cmp function but I don't get a warm fuzzy feeling
>> that it is doing a byte by byte comparison of two files
On Apr 13, 8:39 pm, Grant Edwards wrote:
> On 2009-04-13, Peter Otten <__pete...@web.de> wrote:
>
> > But there's a cache. A change of file contents may go
> > undetected as long as the file stats don't change:
>
> Good point. You can fool it if you force the stats to their
> old values after you
On 2009-04-13, Peter Otten <__pete...@web.de> wrote:
> But there's a cache. A change of file contents may go
> undetected as long as the file stats don't change:
Good point. You can fool it if you force the stats to their
old values after you modify a file and you don't clear the
cache.
--
Gra
SpreadTooThin wrote:
On Apr 13, 2:37 pm, Grant Edwards wrote:
On 2009-04-13, Grant Edwards wrote:
On 2009-04-13, SpreadTooThin wrote:
I want to compare two binary files and see if they are the same.
I see the filecmp.cmp function but I don't get a warm fuzzy feeling
that i
On Mon, 13 Apr 2009 15:03:32 -0500, Grant Edwards wrote:
> On 2009-04-13, SpreadTooThin wrote:
>
>> I want to compare two binary files and see if they are the same. I see
>> the filecmp.cmp function but I don't get a warm fuzzy feeling that it
>> is doing a byte by byte comparison of two files t
Grant Edwards wrote:
> On 2009-04-13, Grant Edwards wrote:
>> On 2009-04-13, SpreadTooThin wrote:
>>
>>> I want to compare two binary files and see if they are the same.
>>> I see the filecmp.cmp function but I don't get a warm fuzzy feeling
>>> that it is doing a byte by byte comparison of two
On Apr 13, 2:37 pm, Grant Edwards wrote:
> On 2009-04-13, Grant Edwards wrote:
>
>
>
> > On 2009-04-13, SpreadTooThin wrote:
>
> >> I want to compare two binary files and see if they are the same.
> >> I see the filecmp.cmp function but I don't get a warm fuzzy feeling
> >> that it is doing a by
On 2009-04-13, Grant Edwards wrote:
> On 2009-04-13, SpreadTooThin wrote:
>
>> I want to compare two binary files and see if they are the same.
>> I see the filecmp.cmp function but I don't get a warm fuzzy feeling
>> that it is doing a byte by byte comparison of two files to see if they
>> are t
On Apr 13, 2:03 pm, Grant Edwards wrote:
> On 2009-04-13, SpreadTooThin wrote:
>
> > I want to compare two binary files and see if they are the same.
> > I see the filecmp.cmp function but I don't get a warm fuzzy feeling
> > that it is doing a byte by byte comparison of two files to see if they
On 2009-04-13, SpreadTooThin wrote:
> I want to compare two binary files and see if they are the same.
> I see the filecmp.cmp function but I don't get a warm fuzzy feeling
> that it is doing a byte by byte comparison of two files to see if they
> are they same.
Perhaps I'm being dim, but how el
On Apr 13, 2:00 pm, Przemyslaw Kaminski wrote:
> SpreadTooThin wrote:
> > I want to compare two binary files and see if they are the same.
> > I see the filecmp.cmp function but I don't get a warm fuzzy feeling
> > that it is doing a byte by byte comparison of two files to see if they
> > are they
SpreadTooThin wrote:
> I want to compare two binary files and see if they are the same.
> I see the filecmp.cmp function but I don't get a warm fuzzy feeling
> that it is doing a byte by byte comparison of two files to see if they
> are they same.
>
> What should I be using if not filecmp.cmp?
W
[EMAIL PROTECTED] wrote:
On Jun 24, 10:38 am, Mark Dickinson <[EMAIL PROTECTED]> wrote:
Interestingly, unlike hex and oct, bin doesn't add a trailing
'L' for longs:
bin(13L)
'0b1101'
I wonder whether this is a bug...
Strange in 2.6, but I know at least in 3.0 that all integers are C
eliben:
> Python's pack/unpack don't have the binary format for some reason, so
> custom solutions have to be developed. One suggested in the ASPN
> cookbook is:http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/111286
> However, it is very general and thus inefficient.
Try mine, it may be fa
And:
# return as a string
def itob_string(integer, count = 8):
return "".join(str((integer >> i) & 1) for i in range(count - 1,
-1, -1))
# return as an iterator (i.e [0, 0, 0, 0, 1, 0, 1, 0])
def itob_list(integer, count = 8):
return [(integer >> i) & 1 for i in range(count - 1, -1, -1)]
On Jun 24, 10:38 am, Mark Dickinson <[EMAIL PROTECTED]> wrote:
> On Jun 24, 9:03 am, eliben <[EMAIL PROTECTED]> wrote:
>
> > What would be the quickest way to do this ? I think that for dec2bin
> > conversion, using hex() and then looping with a hex->bin lookup table
> > would be probably much fast
eliben <[EMAIL PROTECTED]> wrote:
> I'm interested in converting integers to a binary representation,
> string. I.e. a desired function would produce:
>
> dec2bin(13) => "1101"
>
> The other way is easily done in Python with the int() function.
>
> Perl has a very efficient way to do dec2bi
1 - 100 of 190 matches
Mail list logo