[Chicago] In case anyone is interested.....

Lewit, Douglas d-lewit at neiu.edu
Sun Jul 19 23:16:14 CEST 2015


Hi fellow Python enthusiasts,

Last time I asked for some help with Cartesian products in Python.  I also
did the same thing in Java.  But with my Java program I went one step
further.  I included a hasRepeats( ) boolean function to help extract the
permutations from my list of Cartesian products.

"Speaking" more than one computer language has actually helped me
tremendously.  I really learn stuff when I translate Java code to Python
code, or translate Python code to Java code.  I know that some strict
theoretical people in this field believe that algorithms should be language
independent, but I'm not really convinced of that.  I personally believe
based upon my own experiences in programming that the language you use the
most often is going to influence how you think about all these various
algorithms.  I have dabbled in Fortran, C++, Ocaml, Matlab, have used Maple
and Mathematica very extensively, and have also done a lot of programming
work in Java and Python.  I definitely do not believe that all languages
are the same.  (It's like universalists who believe that all religions are
the same.  Uh.... NOT TRUE!!!)

Best,

Douglas.

P.S.  Extracting the permutations from the products was easy, but now I
want to extract the combinations from the permutations.  I think in Python
that would be pretty easy because of the keyword *in *to test for
membership in a list.  In Java that could be more of a challenge.  I'll
worry about it after my summer final exams are over!   :-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/chicago/attachments/20150719/c777d912/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CartesianProductN.java
Type: application/octet-stream
Size: 1291 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/chicago/attachments/20150719/c777d912/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CartesianProductNTester.java
Type: application/octet-stream
Size: 1992 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/chicago/attachments/20150719/c777d912/attachment-0001.obj>


More information about the Chicago mailing list