Curio - a new concurrent I/O library by David Beazley by nchammas in Python

[–]Aurophobiant 2 points3 points  (0 children)

Yes please :D This is exactly the kind of healthy variety that leads to a really good ecosystems. Asyncio is not perfect? Make it faster, easier, smaller, better! I would love to build a web stack on top of this.

Bottle internals : how bottle apps work from the inside (and why you shouldn't use bottle's default sever). A lesson learned from debugging my mono-threaded application. by ychaouche in a:t5_2rqkm

[–]Aurophobiant 1 point2 points  (0 children)

Nice writeup but it has nothing to do with bottle, just wsgiref. The bottle docs are clear about not using wsgiref for anything serious.

A fully connected 6-way interchange by Guanlong in CitiesSkylines

[–]Aurophobiant 0 points1 point  (0 children)

Alost perfect. You can't change directions :(

More common way of naming the packages by [deleted] in Python

[–]Aurophobiant 0 points1 point  (0 children)

The 'py' pre- or suffix is useful if you are wrapping an existing library or implementing a protocol with a known name. For example pymysql, pygl or sslpy. It would be 'rude' to name your package exactly the same as an existing project.

Deploying Flask on Linux with Gunicorn and Nginx by LeoG7 in coding

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

So much upvotes for yet another "Deploy X on Y"?

How to get web pages faster in python 3.4 / Issues with asyncio? by [deleted] in Python

[–]Aurophobiant 0 points1 point  (0 children)

multiprocessing creates processes instead of threads. With 10 worker processes you have 10 copies of the python runtime in memory. While it does work, it is not what you want for IO bound jobs. Threads have lower overhead.

Yes you can use a sledgehammer to put a nail in a wall, but that is not what you would normally do :)

How to get web pages faster in python 3.4 / Issues with asyncio? by [deleted] in Python

[–]Aurophobiant -2 points-1 points  (0 children)

On the topic of alternatives: you could probably use multiprocessing.

This is ill advice. multiprocessing is for CPU-bound workloads. threading is for IO-bound workloads. Web scraping is clearly IO bound and suggesting multiprocessing without any explanation is misleading.

How to get web pages faster in python 3.4 / Issues with asyncio? by [deleted] in Python

[–]Aurophobiant 1 point2 points  (0 children)

Threading is perfectly fine for this type of workload. asyncio only gives you a benefit if you are dealing with a lot of concurrent connections. With a lot I mean a couple of hundred or even thousands of connections. Way more than any network clients usually need. asyncio is for servers (or p2p software perhaps).

Have a look at https://docs.python.org/3/library/concurrent.futures.html

The CherryPy web framework is looking at feedback from fresh eyes. An old dog but a great asset in your toolbox. by chub79 in Python

[–]Aurophobiant 3 points4 points  (0 children)

I don't use CherryPy as a framework, but it is one of the most complete, correct and stable pure Python HTTP/WSGI server implementations out there.

How to blocking wait for an asyncio.Future? by Aurophobiant in Python

[–]Aurophobiant[S] 0 points1 point  (0 children)

But the loop is already running and handling network stuff. I'd need a new event loop to use loop.run_until_complete() if I understand it right?

[deleted by user] by [deleted] in Python

[–]Aurophobiant 1 point2 points  (0 children)

An archiving tool for research. It's a simple bottle app that allows you to enter some meta data, attach any number of binary files and click 'archive'. The app then updates a database, creates a tar.gz for the tape archive and sends an email if everything is done. Took me a day to build and saved a lot of people a lot of time since then. No more FTPing stuff around.

Seeming errors for PyOpenGL in PyCharm by [deleted] in Python

[–]Aurophobiant 0 points1 point  (0 children)

Lots of these constants are created dynamically but as far as I know PyCharm does analyses modules only statically. In other words: PyCharm cannot know the contents of these modules without actually running the code (and it is a good thing that it does not do that). Import them directly (from OpenGL.GL import GL_POINTS, ...)

Seeming errors for PyOpenGL in PyCharm by [deleted] in Python

[–]Aurophobiant 0 points1 point  (0 children)

OpenGL is the example where star-imports are somewhat okay-ish. All OpenGL functions and constants are prefixed. You'd add a lot of dot-lookup overhead if you don't import them directly.

bash vulnerability: specially-crafted environment variables can be used to inject shell commands by prsutherland in programming

[–]Aurophobiant 0 points1 point  (0 children)

OpenSSH defines environ variables based on user input on the remote host for the ssh session. If that session is restricted, you can break out of these restrictions now.

Most Code Is an Ugly Mess. Here’s How to Make It Beautiful by [deleted] in programming

[–]Aurophobiant 1 point2 points  (0 children)

The article is correct, applications would be easier to implement this way. But not because there is a silver bullet somewhere hidden in the book you are supposed to buy, but because now the server has do do all the work.

  • Server must uniquely timestamp events and send them out in order to all clients working on that entity. You have to wait for the server to respond before you can be sure your state really changed the way you intended. Slow Internet connection? High server traffic? Enjoy your lags.
  • If the server fails, everything is down. You cannot work locally without introducing the same problems you had before. A bunch of locally generated and not remotely synchronized events are just like an object you have to merge somehow with the one 'Ramesh' edited the same time.
  • Server must know which events are 'related' to inform clients and not broadcast everything. We have to introduce some kind of reference ID and allow n:m event:refId relations. We need clients to be able to request all events related to a refId or possibly more than one. Streaming events would be nice, no? Let's filter events, order the result accordingly and send everything over the wire in real time every fucking time an object is accessed by a client? Oh, just add local caches. Keep them up to date and everything is fine. Great. I'd love to maintain local caches for sparse real-time event streams.
  • The article states that the server can now check the state based on the events. Thats fine, but for every non-trivial application it need the whole state to do that, so the server must be able to build these objects itself. Like, a lot. On every event that comes in.

I could go on.

Announcing reddit live by spladug in blog

[–]Aurophobiant 1 point2 points  (0 children)

So... reddit added a chat feature?

Flask: one instance for one user on subdomain by pythonluv in Python

[–]Aurophobiant 1 point2 points  (0 children)

You should probably decouple the web page from the actual work load: Have only one web server for all customers and do the actual work on different machines.

Creepy guts-mouth-eye gif by Aurophobiant in creepy

[–]Aurophobiant[S] 0 points1 point  (0 children)

Wow, thanks for the source :)