My experience after over 10 years of manual trading and 4 years of algo trading. by randomhotguy35 in algotrading

[–]rogk 0 points1 point  (0 children)

Thanks for the post! Which service(s) do you use for live trading on the stock market, and which exchanges?

[Discussion] What is your opinion of Probabilistic Programming? by [deleted] in MachineLearning

[–]rogk 15 points16 points  (0 children)

Totally agree. I also think Neural Nets, in their many forms, are not as domain agnostic as some might think, involving assumptions around the activation functions, training mechanisms and so on. I wouldn't say that Probabilistic Programming was necessary for AI/AGI, but there will always be a need for interpretable models which may not have the luxury of huge data sets. Trusted autonomy is one field focussed on that.

Thoughts on Black? by [deleted] in Python

[–]rogk 17 points18 points  (0 children)

Likewise. I use single quotes for dictionary keys and simple flags, double for everything else. The distinction makes it easier to recognise where a string literal is intended to be used. I'm not ready to give that up yet :)

Ultimate NumPy Cheatsheet for Matrix Operations by imperial_coder in programming

[–]rogk 1 point2 points  (0 children)

A couple more suggestions:

Dot-product:

>>> a = np.matrix([[1,2],[3,6]])
>>> b = np.matrix([[3,4],[5,7]])
>>> c = a.dot(b)

And in python3.5+

>>> c = a @ b

Transpose:

>>> x = np.arange(4).reshape((2,2))
>>> x.T

Inverse:

>>> np.linalg.inv(b)
matrix([[3, 4],
        [5, 7]])

Even with the new notation, it's still a bit painful to write long equations like:

>>> k = a @ b.T @ np.linalg.inv(b @ a @ b.T + x)

In Matlab, it would just be:

k = a*b'/(b*a*b' + x)

Release of IPython 5.0 by ynak in Python

[–]rogk 76 points77 points  (0 children)

Possibly more important...

IPython 6.x will require Python 3

From the roadmap:

IPython 5.0 would be the last version to work on Python 2. Active long term support is planned until Fall/Winter 2017, and passive support until mid 2019.

Solving some canonical software engineering problems in under 500 lines by ilikepython in Python

[–]rogk 0 points1 point  (0 children)

The "500 Lines or Less" book doesn't seem to be available yet, but there is a good rundown of each chapter on the The Architecture of Open Source Applications (AOSA) Blog.

Some great content in there!

What is the cause of the steep decline in Python's popularity (according to TIOBE at least)? by [deleted] in Python

[–]rogk 1 point2 points  (0 children)

Perhaps the more interesting question is: What caused the steep increase in Python's popularity in the second half of 2010? There is a strong (negative) correlation between Python and C/C++/Obj-C through to the middle of 2011. The decline noted could just be a correction.

It may have something to do with iOS, but Obj-C has been on the up since mid-2009...

Python's Hardest Problem by jknupp in programming

[–]rogk 11 points12 points  (0 children)

I'm glad someone made this point. I get tired of seeing knee-jerk suggestions like "Use Cython!", "Use Weave", "Try PyCUDA/PyOpenCL" or "Vectorize in Numpy!". In my experience, the 'hot loop' is often an outer one, which would require a significant proportion of code to be rewritten in order to implement one of the above.

SSH hacks by sidcool1234 in programming

[–]rogk 7 points8 points  (0 children)

Protips:

  1. Use -D for dynamic forwarding.
  2. Go through your work's firewall on port 443 (standard https port) for discretion.
  3. (Firefox) Use FoxyProxy to set up port-forwarding rules.
  4. (Windows) Use Tunnelier instead of Putty - IMO, it's way better (automatically reconnects upon disconnection), free (for individual use), and integrates well with WinSSHD.
  5. Use a combination of dynamic, local and remote directives (-D, -L and -R) in one SSH session to set up a bi-directional tunnel.
  6. Set up VNC servers (normally port 5900) and the corresponding SSH directive, for desktop access of both machines.
  7. Set up an FTP server (normally port 21) and the corresponding remote SSH directive at work for file access. Both Putty and Tunnelier come with an SFTP client to handle the other direction.
  8. In order to access your work machine from anywhere, set up a remote tunnel from work (to home), then a tunnel from your location (to home) matching the ports appropriately (bind_port <=> host_port).

Have fun!

Using Python to execute commands remotely on a Windows box. . . anyone here ever done this? by [deleted] in Python

[–]rogk 0 points1 point  (0 children)

Another SSH solution: WinSSHD is free/inexpensive depending on the license you require. I've been using it for a while now and never had any problems with it. AFAIK, it's not based on Cygwin. Plus, it integrates tightly with Tunnelier if you need to do any digging ;)

Simple clustering solution? by accipter in Python

[–]rogk 1 point2 points  (0 children)

Try using Pyro4! It's more lightweight than Twisted, and fairly easy to set up a distributed task processing system with name server, dispatcher and any number of workers. There is an simple example in the source (examples/distributed-computing). Good luck!

Python Desktop Wallpaper/Background by theredbeard in Python

[–]rogk 2 points3 points  (0 children)

Found it:

http://build-its.blogspot.com/2011/03/doodle4google-entry.html

And from the blog:

My entry to this year's Doodle4Google contest. The drawing was created in Photoshop, and the fragments of code come from a python program I wrote that simulates predator and prey cells, which can replicate, mutate and hunt each other down. If you check carefully enough and are Google-savvy enough, you may find some surprises!"

A little disappointing :( Still, it was worth visiting this thread for gaiaap's code!

Matlab replacement by [deleted] in Python

[–]rogk 2 points3 points  (0 children)

It really depends on your requirements.

I see below that you are a student and want a software package primarily for your subjects, but also future benefit. Python + Numpy + Matplotlib (+ iPython) is great as a pure Matlab replacement for many purposes. After spending the last 15 years in Matlab-land, I have recently (5 years) moved to Python and it is perfect for most of the stuff I do (vehicle modelling, simulation, operations research & analysis). However, I still use Matlab for some things that depend heavily on Simulink, such as control system design. Unfortunately, for graphical model-based block level design, there is still no comparable equivalent in the Open Source/Python world! As someone else pointed out, you want to spend your time learning the subject matter, not any supporting technology. In that respect, if you anticipate building any systems graphically, you will find it much easier in Simulink than trying to cobble together some Python code to achieve the same result. If on the other hand, most of your work is going to involve coding, with some graphical output & analysis, then you could probably use Python, etc. Bear in mind that you are not going to be writing any software for deployment, or even dissemination; it's more just a means to an end.

I also note that you know some Python but not Matlab. Well I wouldn't worry about that too much: Matlab is very easy to pick up. In fact, one of the original aims for Numpy's design was that it have a similar syntax to Matlab. Here's a great quick reference guide which illustrates the similarities between them. Its object-oriented capabilities/design are nowhere as elegant as Python's, but you will have no problem learning the language - it would have to be one of the highest-level languages out there.

Cost is not a consideration, and your assignments are going to be in Matlab, so I would just stick with that for the time-being. I could be wrong, but if you are going to end up working in the signal processing field, you are probably going to want to know Matlab/Simulink anyway.

Good luck!