Wednesday, May 10, 2017

Mini PyCon Malaysia 2014

Mini PyCon Malaysia 2014



Website at http://www.pycon.my/mini-pycon-my-2014


Python on Google App Engine

Speaker: Desmond Lua

<to be done> see https://plus.google.com/115982009673713015482/posts/GSvHDNUaEY4 for now


Boosting Productivity with IPython
Speaker: Boey Pak Cheong

Get iPython from http://ipython.org/ or at Github repository.

When first start off with Python and used the Python shell, you may feel it is severely limited compared to other environments. Then came the interactive shell that is QT-based, and finally the arrival of the Web Notebook.




Whats interesting is decoupled evaluation from the REPL environment, into its own kernel process. This allows several clients to connect simultaneously to the kernel.

You get features such as

  • ? gives you overview
  • tab completion
  • object introspection

Any sufficiently advanced technology is indistinguishable from magic - Arthur C Clarke

And so we have magic functions in iPython.

Similar to vi, the !<cmd> gives you a shell escape. You can capture the output by using var = !<cmd>. For debugging purposes, run %debug to activate post-mortem debugging. 

Heres another nifty feature: loading code from URL %load http://matplotlib.org/mpl_examples/showcase/integral_demo.py

You dont even have to install IPython, run it online at  http://nbviewer.ipython.org/. See some examples at http://nbviewer.ipython.org/github/ipython/ipython/blob/master/examples/notebooks/Part%201%20-%20Running%20Code.ipynb#

Learn More

All you need to know about IPython is available at http://ipython.org/ Want more? Go through IPython in depth via this self-paced course https://github.com/ipython/ipython-in-depth


Python Powered Cloud 

Speaker: Joe Ziegler
Time: 1400

Joe is giving an interesting introduction to Amazon Web Services Elastic Beanstalk with Python.


You can use Elastic Beanstalk for free. You only pay for the underlying resources - see the Elastic Beanstalk pricing page.

Joe is giving a live demonstration of writing Python code, deploying it to AWS and using Elastic Beanstalk. Since I cannot share it here, try watching these videos instead.


Detailed introduction to Elastic Beanstalk


Deploy and scale Python apps with Elastic Beanstalk


Python in Robotics Development 

Speaker: Yap Wen Jiun
Time: 1450

Next up, someone who is constantly pushing the edge of programmable robotics with plenty of experience in Arduino, is going to show us Python in robotics environment.

Did you miss out the Micro Python at Kickstarter? Well according to the speaker this may have limited use - think about the low level sensors and LEDs that you are controlling using Python, a high level language.



Introducing you to the Robot Operating System, a meta OS for robotics applications. You get:

  • hardware abstraction
  • low-level device control
  • etc
If you are a commercial user, good news, ROS is BSD-licensed: i.e. you can do anything with the code, including modify and sell it, without sharing your modification. Simply acknowledge the author in the copyright section. 

Try to cut up your robotics systems to as many Nodes as possible. So that it is modular and easy to use. The Node is the core entity in ROS
  • Small program written in Python or C++
  • Executes relatively simple task
  • Every node can be started and stopped independently of each other
You have to imagine your ROS application as a graph of nodes. Nodes get to know each another via rosmaster, and they can communicate via Topics and Services. These small programs can be written in C++ or Python. 

Some examples:
Asus Xtion Pro / OpenNI camera
iRobot Create


Heres a code snippet of a publisher in Python

Loading https://gist.github.com/9563032....


For the explanation and the Subscriber part of the code, head over to http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber%28python%29


Creating Powerful RESTful API Services with Django Tastypie

Speaker: Leong Seh Hui
Time: 1520

First of all, lets take a look at what Tastypie is. Seems even the worlds most powerful person loves Tastypie.



N-O-P-E. We are talking about this Tastypie. In programmers slang: Tastypie is a fuckin awesome API framework for Django for creating REST interfaces (and sod off if you need to say lily-livered stuff like REST-ful or REST-style).

Being an Asian, I am naturally gifted at regurgitating content, so these are the features plucked right from the website:


  • Full GET/POST/PUT/DELETE/PATCH support
  • Reasonable defaults
  • Designed to be extended at every turn
  • Includes a variety of serialization formats (JSON/XML/YAML/bplist)
  • HATEOAS by default
  • Well-tested & well-documented

I can do no justice to Seh Huis comprehensive demonstration, so take a look at the code at https://github.com/felixleong/pyconmy2014-tastypie


Concurrency in Python

Speaker: Farzad Ghanei
Time: 1600

Does the word "concurrency" scares you? It scares me. So heres the gist of concurrency in Python by Farzad. The whole idea is to break up a big chunk of processing into smaller chunks. The important question is - in what order are the chunks processed? One of the biggest problem has always been unpredictable execution path.

GIL (Global Interpreter Lock)  is not going to help you if your application is CPU Bound only. At the moment there is no solution yet.

Threads are:
  • Good for user interactivity
  • Not good for CPU bound tasks
Coroutines brings co-operating concurrency, with predictable execution. Think yield. See also PEP 380 and greenlet. Imagine three persons holding hands and walking together - explaining greenlets.

Whilst explaining Twisted, Farzad said

I can see how your faces look like. That is exactly why this library is named Twisted.

His own experience of using 200 processes performed much better than threads, process and gevent.

Take note that each frameworks website will claim their solution performs better than other alternatives. Performance varies according to the nature of the task (CPU-bound or IO-bound), and you have to test it out yourself before concluding which framework is the most suitable.


Lightning Talk Breakout

Pycons in East Asia

Speaker: Victor Neo

Pycon Singapore - 18th - 20th June 2014
Pycon India (Bangalore) - 26th - 28th September 2014
Pycon Japan (Tokyo) - 13th - 15th September 2014


MorePath

Speaker: kagesenshi

Morepath is a micro web framework that is flexible yet expressive. Read more at http://morepath.readthedocs.org/en/latest/

Pycon Malaysia 2015

Speaker: Ng Swee Meng


Manage, test and monitor infrastructure with Salt and Python 

Speaker: Bruno Clermont 


For alerts and errors, sentry is a great option with excellent integration with Django, etc.
Logging - GrayPy. Does anyone know a good centralized logging fully implemented in Python?

Statistics on server side - Carbon for the web UI and Graphite.

For statistics producers, Diamond is a daemon that run collectors (network interface I/O to RabbitMQ) at specific frequency, and send them to Carbon.

Here is what it looks like with StatsD/Graphite.


On the monitoring side, use Shinken - because it scales better than Nagios.

You can write Nagios plugins easily via https://pypi.python.org/pypi/nagiosplugin/

For backup, tarfile and subprocess to create archives, boto to upload to AWS S3.

The 2 most popular Puppet replacements are Ansible and Salt. This talk will focus on Salt. Some important concepts:


  • formulas are what you want to be on the server, not execution scripts
  • grains are static client information
  • pillars are configuration applied to formula (stored on server)


Enhanced by Zemanta

Go to link Download