473,473 Members | 2,248 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

creating bitmasks (for bloom filters)

Hi,

Included below is a copy of a message I sent to the py-tutor list. It
didn't garner much in the way of a solution and it was suggested that
this list might be helpful.

Thanks,

-----Forwarded Message-----
From: Aaron Straup Cope <as*@vineyard.net>
To: pytutor <tu***@python.org>
Subject: creating bitmasks (for bloom filters)
Date: Fri, 11 Jun 2004 08:49:20 -0400

Hi,

A quick introduction : I am mostly a Perl hacker, but I am teaching
myself Python because it seems like the right tool for the job in
question. [1] I am not, by any stretch, much of a math weenie.

I am trying to port the Bloom::Filter Perl module [2] for use with my
tool. I know that there is a "pybloom" sourceforge project [3] but
licensing issues aside it's reliance on Unix math libs makes it
problematic for use with a cross-platform GUI tool.

At this point, my not very deep grasp of Python and my poor
understanding of some basic compsci/math principles have combined to
frustrate my efforts.

I was hoping that the the Perl/Python operator and function set would be
similar enough that, with only a few modifications, I could clone the
B:F.pm package pretty much "as is". All other bugs aside, I am stuck
trying to create a bitmask of a key :

"Given a key, hashes it using the list of salts and returns a bitmask
the same length as the Bloom filter. Note that Perl will pad the
bitmask out with zeroes so it's a muliple of 8."

# from the docs for the _make_bitmask method

Specifically, it's not clear to me :

* how to map the various Perl pack/unpack formats to their Python
equivalents (things like Perl's "b*" which is "a bit string, in
ascending bit order inside each byte" where "*" means to use all
the bytes from the input field")

* how to account for the fact that unpack returns a list in Perl and
Python returns a string

* how to pass a salt to the Python sha module

* how to XOR the pieces of an unpacked sha digest (which may simply
be a function of a bad format unpacking stuff)

* A 'vec' [4] function in Python; does one exist?

In short, I don't really have any idea what I'm doing :-(

As much as I relish the challenge purely on the grounds of learning new
stuff I am starting to reach the point of irrational frustration and
wanting to just get this done so I can move on to other things.

The tool should be written in Python because it's the best choice for
the job. The tool needs to be able to read/write Bloom Filters. Python
needs a Bloom Filter library, so I will step up and write it. Except it
appears to be beyond my skill level right now...

Any thoughts, suggestions or clue-bats would be very much welcomed.
Pointers to an already existing implementation that I've missed would be
even better but I'll take what I can get. :-)

Thanks,

---

[1]
http://aaronland.info/weblog/categor...plication_the/
[2] http://search.cpan.org/src/MCEGLOWS/...0.02/Filter.pm
[3] http://cvs.sourceforge.net/viewcvs.py/pybloom/
[4] http://www.perldoc.com/perl5.8.4/pod/func/vec.html

Jul 18 '05 #1
0 1768

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jaakko Holster | last post by:
Lets run following code: ------- snip ------ class Perm { static $read = bindec('001'); static $write = bindec('010'); static $delete = bindec('100'); }
0
by: Ravi Ambros Wallau | last post by:
Hi: I've created a custom control - a grid that uses Infragistics to display some filters, the grid itself, and some buttons. Well, when using this control directly on WebForm, everything works...
3
by: Kim | last post by:
Im making a config file to a C# program in XML. I have save and load functions, but these require a base XML file with its structure to exsist (Im new to XML, so this was the way I it to work)....
3
by: roypython | last post by:
Hello everyone. Your help is very much appreciated. I am trying to create partial replica from the design master. it all goes well until I try to set the filter using: repPartial.Filters.Append...
3
by: roypython | last post by:
Hello everyone. Your help is very much appreciated. I am using MS ACCESS 2003. I am trying to create partial replica from the design master. it all goes well until I try to set the filter using:...
2
by: Jonathan Boivin | last post by:
Hi people, Let me introduce to how I get this error. I have a form which load all my bills representation depending upon filters which each bill is a usercontrol of my own having some...
3
by: Mr 200 | last post by:
Hi all ive just recently started learning java and was happy to find a forum that may be able to give me a little assistance. I have been set an excersize to create a filter processor that relays...
3
by: Redbeard | last post by:
Hi All this is my first time post, be gentle. I am looking at creating a keyword search that searches multiple fields in a Form and then filters records that match the keyword. The Form...
5
MrPickle
by: MrPickle | last post by:
When using bit masks, how do you do "not bitmask", not sure how to explain it so: How could you do this in bitmasks: if(!something)
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.