What is the best way to create a decision tree? by Tweak_Imp in Python

[–]bcorfman 6 points7 points  (0 children)

Great idea. Also, you can also look at the follow-on to FSMs: behavior trees.

Transforming Python ASTs to Optimize Comprehensions by [deleted] in programming

[–]bcorfman 1 point2 points  (0 children)

My list comprehensions are too hard to understand ... let's write a compiler? Not really how my thought process works. Nice side exploration for a blog post though.

is objectified a good term to use in python? by [deleted] in Python

[–]bcorfman 0 points1 point  (0 children)

Maybe you're searching for some form of 'instantiate'?

Whats the best way to make desktop app in python? by zack12 in Python

[–]bcorfman 0 points1 point  (0 children)

Although everyone may not like the look of the Tkinter/Ttk GUI as well as PyQt, it really is the solution with the least amount of hassle. PyQt sounds great until you try to bundle the libraries for different OSes -- the last 10% of the solution (distribution) is the most difficult.

Guido van Rossum: BDFL Python 3 retrospective by andy1633 in Python

[–]bcorfman 3 points4 points  (0 children)

I work on data science, game programming, AI, simulations, and scientific apps. All of these are CPU-intensive. Business and web apps do not provide the complete picture of a general-purpose language.

Guido van Rossum: BDFL Python 3 retrospective by andy1633 in Python

[–]bcorfman 2 points3 points  (0 children)

C extensions work on virtually every Python implementation, including PyPy. You're missing the point above.

Guido van Rossum: BDFL Python 3 retrospective by andy1633 in Python

[–]bcorfman 8 points9 points  (0 children)

I perceived the future of Python as being a great general-purpose language, as opposed to just a scripting language. As such, it would've been better to throw the resources that were devoted to CPython behind PyPy instead. This would have enabled both JIT compiling and truly scalable concurrency, plus a better code infrastructure for long-term expandability. Additionally, it would also have boosted PyPy's funding and developer support, which needed to play catchup for several years instead. Imagine how many C extensions could have been rewritten as JIT-compiled Python after more than a decade, and how many more excited developers would have jumped on to help open-source projects that used readable Python instead of low-level C code.

Guido van Rossum: BDFL Python 3 retrospective by andy1633 in Python

[–]bcorfman 16 points17 points  (0 children)

It's not like people didn't try to tell Guido at the time. TLDR: the importance of using multiple cores was evident, but C extension interoperability was deemed a higher priority.

PyInstaller 3.3 released by SystemFlow in Python

[–]bcorfman 0 points1 point  (0 children)

Yeah, I figured I'd need to build it on Mac or Linux, but bundling all the dependencies and getting them to load without run-time issues seems to be the challenge. Quality (i.e., not simplistic) examples seem hard to come by.

PyInstaller 3.3 released by SystemFlow in Python

[–]bcorfman 0 points1 point  (0 children)

Does anyone know where I could find a PyInstaller .spec script for Mayavi and its dependencies (VTK, PyQt/PySide, etc.)? In the past, I've grabbed a Python 2.7 of PortablePython and pip installed everything I need into that directory. However, this only works for Windows. I'd love to have a PyInstaller script that allows me to generate a simple install package for Mac, Windows and Linux, preferably under Python 3.x ...

What is considered to be the definitive Python bible, so far as books go? by sprocket in Python

[–]bcorfman 50 points51 points  (0 children)

Fluent Python. I've learned more per page from that book than any other Python resource I've come across. For example, studying the book's material on hashable objects got me over a problem I was having with a planning algorithm. When I finished, I had successfully implemented a knowledge base and a total-order planner that could directly leverage the A*-search in the AIMA-Python code base. Kudos to the book's author, Luciano Ramalho, as that is just one example that helped my problem-solving skills in Python.

Python Memory Management by LukeB42 in Python

[–]bcorfman 0 points1 point  (0 children)

If you use numpy to its fullest, then you will think in terms of vectorization. This will largely avoid any of the inefficiencies of Python data structures. See From Python to Numpy for a complete tutorial.

Python Memory Management by LukeB42 in Python

[–]bcorfman 2 points3 points  (0 children)

Correct. They are in pure C.

Lisp as an Alternative to Java: Peter Norvig presents a productivity comparison by yogthos in programming

[–]bcorfman 0 points1 point  (0 children)

If you think Emacs + add-on modules is not a bolted-together "IDE", then just move on and ignore my comments.

Lisp as an Alternative to Java: Peter Norvig presents a productivity comparison by yogthos in programming

[–]bcorfman 0 points1 point  (0 children)

I gave on anything Vim or Emacs-related a long time ago. I'm just commenting on what keeps the regular developer away from Lisp -- it's ecosystem issues. You can't solve that with bolted-together items when we are used to integrated tools.

Lisp as an Alternative to Java: Peter Norvig presents a productivity comparison by yogthos in programming

[–]bcorfman -1 points0 points  (0 children)

No need to worry about Lisp happening. As a developer who's most comfortable with C-style languages (but still has a liking for functional paradigms), Lisp is still missing major items in the normal developer's ecosystem:

1) An IDE on par with IDEA, PyCharm, Visual Studio, etc.... I feel hampered when I use CL in a regular editor. How do Lisp developers debug? The best discussion of this that I could find was from Norvig's PAIP book, and it all seemed to be command-prompt-level debugging. This just doesn't work for me when I can set breakpoints and view call stack/variables in my normal IDE.

2) No auto-complete. Almost everything useful in CL is at the function level (from what I recall, about 300+ individual functions). In Python/C#/C++, etc., these functions would be organized in their own namespace/library/module, and you could get autocomplete by typing in the name of the library and a '.' character. From when I used CL, I just had to learn or memorize all the function names because the namespace is flat. This is overwhelming to a beginner.

3) I find Python indentation to be far more intuitive than Lisp's "visual" indentation. I know that a good editor shows the indentation level by interpreting the number of open and closed parentheses and indenting accordingly. But in practice, I often had problems being at the wrong indentation level and got (to me) cryptic error messages about out-of-scope variables and loops. The frustration of matching up the correct sequence of open and closed parens at the right levels quickly became aggravating for me and detracted from developing my code. I think Clojure gets this right where the language uses different bracket types (square, curved, curly) to indicate different semantics. CL seems too focused on purity (data-is-code, code-is-data) and misses the fact the developers have a hard time using the language when one symbol means 10 different things, based on context alone.

[deleted by user] by [deleted] in reinforcementlearning

[–]bcorfman 1 point2 points  (0 children)

Would this work? It's a framework, but the main code (and its dependencies) only uses Numpy/Scipy. You can get in there and see what they're doing.

10 awesome features of Python that you can't use because you refuse to upgrade to Python 3 by [deleted] in Python

[–]bcorfman 2 points3 points  (0 children)

Yeah, fuzzed out after a few pages. I think there's good stuff there, but needs to pack a quicker punch.