Need help implementing an algorithm in python

2005-12-05 Thread ech0
I would appreciate any help I can get in finding a solution to the
following problem:

==

Below is a diagram:
http://www.muchographiks.com/algo.jpg

THE PROBLEM

Lets say we have 4 terms (purple represents the terms). Some terms in
these 4 terms combine to to make keywords (if we get the words in these
sub-terms they should equal to the keywords (e.g. terms ['kaiser
chiefs', 'i predict a riot', 'album'] combined make keywords ['kaiser',
'chiefs', 'i', 'predict', 'a', 'riot', 'album']). There will be terms
leftover sometimes, not all terms are used.

POSSIBLE ANSWER?

How it searches for the answer is by combining terms from top to
bottom, then checking to see if the keywords match the combined terms.

We start by with 1 combination (combine two terms). In the diagram, it
shows, t1 (term 1) combining with t2 then t3 then t4 (this is the red
line). If it can't find a match, it continues. It shows t2 combining
with t3 then t4 (dark green). If it can't find a match, it continues.
It shows t3 combining with t4 (light green). If by then it can't find a
match, we do the following:

Now the above example was just 1 combination. It gets more complicated
because we are going to have to keep increasing the number of
combinations by 1 to find a match. We are going to keep doing this
until combinations >= len(keywords). So now its two combinations. t1
will combine with t2 and t3. Check if its a match. If not continue. t1
will combine with t3 and t4. check if its a match. t2 will combine with
t3 and t4. t3 and t4 can't combine by themselves because they are only
two terms so we skip them (we already did 2 term combinations). After
this if theres no match we do 3 combinations... all the way until
combinations >= len(keywords).

==

Here is what I have gotten so far:
http://pastebin.com/450352

I know exactly what to do its just I have no way of translating the
thought into programming code. If anybody can help at all I would
greatly appreciate it.

Thanks.

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


Re: Need help implementing an algorithm in python

2005-12-05 Thread ech0
I'm still in highschool. This is no homework. This is a personal
project for me. I would normally do it myself but this one is just too
complex, thats why I'm asking for help.

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


Re: Need help implementing an algorithm in python

2005-12-05 Thread ech0
Just to point out... I came up with the algorithm. Which is why I can
explain it so well. But implementing it into code is one well of a task.

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


Re: Python riddle

2005-12-05 Thread ech0
1 is not greater then 2 last time i checked :)

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


Re: Need help implementing an algorithm in python

2005-12-05 Thread ech0
wow. nevermind. i figured it out.

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


Re: Java Integer.ParseInt translation to python

2005-01-31 Thread ech0
buffer[0] = int(string,16) & 0xff

that should work

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


Re: type of simple object

2005-02-01 Thread ech0
use the type function!

>>> s = 'test'
>>> i = 25
>>> type(s)

>>> type(i)


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


Re: Second posting - Howto connect to MsSQL

2005-02-13 Thread ech0
You can also use pymssql. I've used it before on a little project. It
looks like it works on linux too.

http://pymssql.sourceforge.net/

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


Re: Py2Exe security

2005-05-03 Thread ech0
someone can sniff the client for the information it sends/receives so
its possible to extract the info that way.

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


Re: Py2Exe security

2005-05-04 Thread ech0
Keep in mind what i said, even you encrypt it the source (and decode at
run time), even if compiled via c++,c, etc., it can still be decrypted
if your using http as the protocol, all the person has to do is sniff
the packets. So if your going to encrypt your information make sure you
use a secure protocol (https).

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