<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><description>Tim (duffyd) Knapp’s personal blog. Blogging about working as a python web developer &amp; life in general.</description><title>Fresh from the plantation</title><generator>Tumblr (3.0; @kokorice)</generator><link>https://kokorice.org/</link><item><title>Surprise features that you didn't ask for - Mike Haworth</title><description>&lt;p&gt;Server Side Request Forgery&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;Could access services on localhost&lt;/li&gt;
&lt;li&gt;Access other hosts in DMZ&lt;/li&gt;
&lt;li&gt;Bypass host-based authentication systems&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Vulnerable systems:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;memcached&lt;/li&gt;
&lt;li&gt;couchdb&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Urllib: accepts file://&lt;/p&gt;

&lt;p&gt;Pycurl accepts gopher://&lt;/p&gt;

&lt;p&gt;Memcached: gopher://127.0.0.1:11211/2get&lt;/p&gt;

&lt;p&gt;Preventing: blacklist is error prone.&lt;/p&gt;

&lt;p&gt;XML External Entity (XXE): &lt;/p&gt;

&lt;p&gt;Safer: &lt;a href="http://pypi.python.org/pypi/diffusedxml"&gt;http://pypi.python.org/pypi/diffusedxml&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Signed cookies - session data is visible to user.&lt;/p&gt;

&lt;p&gt;Also unless it&amp;rsquo;s got discount applied, just reapply discount. Can have a unique number that is issued each time we give discount.&lt;/p&gt;

&lt;p&gt;Don&amp;rsquo;t use pickle as could execute shellcode but instead use JSON.&lt;/p&gt;

&lt;p&gt;Pentesting challenges: &lt;a href="http://tinyurl.com/h4ckit"&gt;http://tinyurl.com/h4ckit&lt;/a&gt;&lt;/p&gt;</description><link>https://kokorice.org/post/97448531384</link><guid>https://kokorice.org/post/97448531384</guid><pubDate>Sun, 14 Sep 2014 17:18:40 +1200</pubDate><category>zopeplone</category><category>kiwipycon</category></item><item><title>Automated Deployment with Ansible - Juergen Brendel</title><description>&lt;p&gt;Configuration - system packages, settings, users, apps&lt;/p&gt;

&lt;p&gt;CM Tools - describe the desired state. E.g. ensure all system packages are updated.&lt;/p&gt;

&lt;p&gt;Puppet, chef - feel bit like working with Java.&lt;/p&gt;

&lt;p&gt;Salt, Ansible - simple.&lt;/p&gt;

&lt;p&gt;Ansible - orchestration engine. Written in Python. Uses YAML to write &amp;ldquo;playbooks&amp;rdquo;. Can use it to configure Windows.&lt;/p&gt;

&lt;p&gt;No central configuration server/client (on target).&lt;/p&gt;

&lt;p&gt;Just needs SSH access and Python on target machine.&lt;/p&gt;

&lt;p&gt;Modules - 100s of them. They know how to do stuff.&lt;/p&gt;

&lt;p&gt;Deletes module code from target after running it on target.&lt;/p&gt;

&lt;p&gt;Can define groups to operate against.&lt;/p&gt;

&lt;p&gt;group_vars directory/ all, groupname1&lt;/p&gt;

&lt;p&gt;Ansible &amp;lsquo;cloud&amp;rsquo; modules: AWS, Docker.&lt;/p&gt;

&lt;p&gt;Modules: all output to stdout + JSON.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/jbrendel/ansible_cluster_setup"&gt;https://github.com/jbrendel/ansible_cluster_setup&lt;/a&gt;&lt;/p&gt;</description><link>https://kokorice.org/post/97445283209</link><guid>https://kokorice.org/post/97445283209</guid><pubDate>Sun, 14 Sep 2014 16:29:26 +1200</pubDate><category>zopeplone</category><category>kiwipycon</category></item><item><title>Lightning Talks</title><description>&lt;h3&gt;LCAuckland&lt;/h3&gt;

&lt;p&gt;LCA: 12-16 January 2015&lt;/p&gt;

&lt;p&gt;Program online in next year or 2.&lt;/p&gt;

&lt;p&gt;Singapore also put in proposal for future LCA.&lt;/p&gt;

&lt;p&gt;6-700 attendees hoped.&lt;/p&gt;

&lt;h3&gt;Heritage Preserve #WeWantJam&lt;/h3&gt;

&lt;p&gt;Grabbed 30TBs of .co.nz internet.&lt;/p&gt;

&lt;p&gt;2 days of catering, hacking.&lt;/p&gt;

&lt;p&gt;If you&amp;rsquo;d like to do it again tweet #WeWantJam&lt;/p&gt;

&lt;h3&gt;Less Boilerplate&lt;/h3&gt;

&lt;p&gt;import argparse&lt;/p&gt;

&lt;p&gt;Command line&lt;/p&gt;

&lt;p&gt;&lt;a href="http://github.com/aliles/begins"&gt;http://github.com/aliles/begins&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Command line programs for busy developers.&lt;/p&gt;

&lt;h3&gt;Show us the world&lt;/h3&gt;

&lt;p&gt;rbenv - isolate different&lt;/p&gt;

&lt;p&gt;pyenv shell 3.4.1&lt;/p&gt;

&lt;p&gt;pyenv virtualenv name&lt;/p&gt;

&lt;p&gt;pyenv local dirname&lt;/p&gt;

&lt;h3&gt;MySQL performance schema&lt;/h3&gt;

&lt;p&gt;Debugging schema for the database.&lt;/p&gt;

&lt;p&gt;Can configure at runtime.&lt;/p&gt;

&lt;p&gt;5.5 or 6 dbs.&lt;/p&gt;

&lt;h3&gt;Julia&lt;/h3&gt;

&lt;p&gt;Very pythonic. Stolen lots of good ideas from Python.&lt;/p&gt;

&lt;p&gt;Compiled just in time. Timing a file that does nothing it takes 2.25s.&lt;/p&gt;

&lt;h3&gt;The Python Promotion Pamphlet&lt;/h3&gt;

&lt;p&gt;International Python Promotion Pamphlet. Glossy &amp;amp; stylised.&lt;/p&gt;

&lt;p&gt;Creating NZ-version. Will have high-quality printable version and web-version.&lt;/p&gt;

&lt;p&gt;Make your company more visible to Python programmers rather than pay recruitment agents.&lt;/p&gt;

&lt;h3&gt;Blackbox&lt;/h3&gt;

&lt;p&gt;&lt;a href="http://sheltered-forest-9460.herokuapp.com"&gt;http://sheltered-forest-9460.herokuapp.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://github.com/tuxbert/blackbox"&gt;http://github.com/tuxbert/blackbox&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;NZPUG&lt;/h2&gt;

&lt;p&gt;When you subscribe to the mailing list (607 members on mailing list) you aren&amp;rsquo;t a member of the incorporated society.&lt;/p&gt;

&lt;p&gt;Jessica McKellar&amp;rsquo;s Kiwi PyCon73,000 views. Far more than Guido McV&amp;rsquo;s keynote at PyCon US.&lt;/p&gt;

&lt;p&gt;Thomi is commandeering LT and announcing my leaving committee and asking if someone can join NZPUG committee. See committee members if would like to join.&lt;/p&gt;

&lt;h3&gt;Docker for Python&lt;/h3&gt;

&lt;p&gt;Will do to IT industry what container box did to shipping industry.&lt;/p&gt;

&lt;p&gt;LXC (Linux Lightweight Containers) + UnionFS.&lt;/p&gt;

&lt;p&gt;Docker file is essentially like a bash script file of commands.&lt;/p&gt;

&lt;p&gt;You can inherit from other docker files.&lt;/p&gt;

&lt;p&gt;Fig - Vagrant for Docker.&lt;/p&gt;

&lt;p&gt;Ship deltas not images.&lt;/p&gt;

&lt;p&gt;Shipyard - 3rd party ecosystem.&lt;/p&gt;

&lt;p&gt;Gotchas&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;Use docker-osx, PyCharm&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;Object Factories&lt;/h3&gt;

&lt;p&gt;Sole object is to create objects for testing purposes.&lt;/p&gt;

&lt;p&gt;Don&amp;rsquo;t care about what object is. Just assign random attributes to objects.&lt;/p&gt;

&lt;h3&gt;Code Obfuscation&lt;/h3&gt;

&lt;p&gt;Weird bugs: object() &amp;gt; object()&lt;/p&gt;

&lt;p&gt;If doing tests against time it will fail at midnight depending on your timezone.&lt;/p&gt;

&lt;p&gt;False = True&lt;/p&gt;

&lt;h3&gt;Arduino + Thermal Printer + Python&lt;/h3&gt;

&lt;p&gt;Arduino sketch, Python script, Git&lt;/p&gt;

&lt;p&gt;&lt;a href="http://github.com/nick-NZ/Arduino-pull-request-printer"&gt;http://github.com/nick-NZ/Arduino-pull-request-printer&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Dynamically creating Python tutorials and presentations&lt;/h3&gt;

&lt;p&gt;Massey Computer Science moved to Python in 2011.&lt;/p&gt;

&lt;p&gt;Emacs: an operating system disguised as an editor.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.orgmode.org"&gt;http://www.orgmode.org&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Org-babel - generate code.&lt;/p&gt;

&lt;p&gt;Org-slidy&lt;/p&gt;

&lt;h3&gt;Bad-ass Postgres Tricks&lt;/h3&gt;

&lt;p&gt;&lt;a href="http://bit.ly/pgtrix1"&gt;http://bit.ly/pgtrix1&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;Template Databases - clone dbs&lt;/li&gt;
&lt;li&gt;Estimated Counts&lt;/li&gt;
&lt;li&gt;Hstore - values have to be strings&lt;/li&gt;
&lt;li&gt;Smart Indexes&lt;/li&gt;
&lt;li&gt;Schema Change Locks&lt;/li&gt;
&lt;li&gt;PL/Python&lt;/li&gt;
&lt;/ol&gt;&lt;h3&gt;&amp;ldquo;One button&amp;rdquo; test and deploy on AWS&lt;/h3&gt;

&lt;p&gt;Use Vagrant+Ansible&lt;/p&gt;

&lt;p&gt;Scripted creation of AMI and deployment.&lt;/p&gt;

&lt;h3&gt;Python Antipatterns&lt;/h3&gt;

&lt;p&gt;Better: list comprehension&lt;/p&gt;

&lt;p&gt;Better: raise AssertionError&lt;/p&gt;

&lt;p&gt;Better: if pattern in input_str&lt;/p&gt;

&lt;p&gt;Don&amp;rsquo;t pass empty list as default are.&lt;/p&gt;

&lt;p&gt;if 5 &amp;lt;= i &amp;lt; 10: print &amp;ldquo;something&amp;rdquo;&lt;/p&gt;

&lt;p&gt;Better: return NotImplementedError&lt;/p&gt;

&lt;h3&gt;Map reduction using Python scripts&lt;/h3&gt;

&lt;p&gt;Script to create ArcMap maps.&lt;/p&gt;

&lt;h3&gt;Making weird maps with Python&lt;/h3&gt;

&lt;p&gt;Pulled data from census + meshblock boundaries (Koordinates.com) + map box (tile mill) + GDAL.&lt;/p&gt;

&lt;p&gt;Should have used Fiona + Shapely.&lt;/p&gt;</description><link>https://kokorice.org/post/97443227564</link><guid>https://kokorice.org/post/97443227564</guid><pubDate>Sun, 14 Sep 2014 16:00:47 +1200</pubDate><category>zopeplone</category><category>kiwipycon</category></item><item><title>Multimedia programming using Gstreamer (and, of course, Python) - Douglas Bagnall</title><description>&lt;p&gt;Pipelines consist of linked elements.&lt;/p&gt;

&lt;p&gt;Elements:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;Link&lt;/li&gt;
&lt;li&gt;Source&lt;/li&gt;
&lt;li&gt;Sink (file, net, screen, etc)&lt;/li&gt;
&lt;li&gt;Demux, tee&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;code&gt;$ gst-launch-1.0 filesrc location=video.ogv ! oggdemux ! theoradec ! autovideosink
  &lt;/code&gt;&lt;/p&gt;


&lt;p&gt;playbin - just play file = mplayer&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Probably about 100 media players in world that are based on gstreamer&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Muxer: combining 2 streams into 1 file.&lt;/p&gt;

&lt;p&gt;Really good example - video wall.&lt;/p&gt;

&lt;p&gt;Decode bin -&amp;gt; split into 4 streams (tee) -&amp;gt; queues (often freezes as all running in 1 thread and bump into eachother) -&amp;gt; crop (I.e. Remove 3/4s of video). And also play audio.&lt;/p&gt;

&lt;p&gt;Can just use gstreamer cli syntax when calling &lt;i&gt;gi&lt;/i&gt; calls in Python.&lt;/p&gt;

&lt;p&gt;github: douglasbagnall&lt;/p&gt;

&lt;p&gt;&lt;a href="http://gstreamer.freedesktop.org"&gt;http://gstreamer.freedesktop.org&lt;/a&gt;&lt;/p&gt;</description><link>https://kokorice.org/post/97434332849</link><guid>https://kokorice.org/post/97434332849</guid><pubDate>Sun, 14 Sep 2014 13:58:31 +1200</pubDate><category>zopeplone</category><category>kiwipycon</category></item><item><title>Understanding human language with Python - Alyona Medelyan</title><description>&lt;p&gt;Android Auto: hands-free operation via voice commands.&lt;/p&gt;

&lt;p&gt;WordLense: “augmented reality translation”&lt;/p&gt;

&lt;p&gt;“Her” movie in reality: “Siri will you marry me? Siri doesn’t seem to be available.”&lt;/p&gt;

&lt;p&gt;Segmentation complexities.&lt;/p&gt;

&lt;p&gt;Disambiguation complexities. E.g. Flying planes can be dangerous.&lt;/p&gt;

&lt;p&gt;Categories - taxonomy terms, entities - biological/chemical, sentiment.&lt;/p&gt;

&lt;p&gt;NKTK - Python toolkit for NLP.&lt;/p&gt;

&lt;p&gt;How to get to the core words? Remove stopwords.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;from nltk.corpus import stopwords
from nltk.tokenizie import word_tokenize
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Keyword scoring: TFxIDF&lt;/p&gt;

&lt;p&gt;Gensim:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;from gensim import corpora, models
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;When ranking words can use score to discard them.&lt;/p&gt;

&lt;p&gt;Text Categorisation with NLTK&lt;/p&gt;

&lt;p&gt;Sentiment Analysis:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;from textblob import TextBlob
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://deeplearning.net/software/theano"&gt;http://deeplearning.net/software/theano&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://textblob.readthedocs.org"&gt;http://textblob.readthedocs.org&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://scikit-learn.org/stable"&gt;http://scikit-learn.org/stable&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://nltk.org"&gt;http://nltk.org&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://radimrehurek.com/gensim"&gt;http://radimrehurek.com/gensim&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://github.com/zelandiya/KiwiPyCon-NLP-tutorial"&gt;http://github.com/zelandiya/KiwiPyCon-NLP-tutorial&lt;/a&gt;&lt;/p&gt;</description><link>https://kokorice.org/post/97432360684</link><guid>https://kokorice.org/post/97432360684</guid><pubDate>Sun, 14 Sep 2014 13:30:23 +1200</pubDate><category>zopeplone</category><category>kiwipycon</category></item><item><title>PyPy.js: What? How? Why? - Ryan Kelly</title><description>&lt;p&gt;@rfkelly&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mozilla&lt;/strong&gt; - protecting &amp;amp; promoting the web.&lt;/p&gt;

&lt;p&gt;The Web? Technology + Culture (open - don&amp;rsquo;t need to submit to &amp;lsquo;web pool&amp;rsquo;, ubiquitous, secure, trustworthy)&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&amp;ldquo;For Mozilla, anything that the Web can’t do, or anything that the Web is not faster and better at than native technologies, is a bug. We should file it in our Bugzilla system, so we can start writing a patch to fix it&amp;rdquo; - Andreas Gal (Mozilla CEO)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;var vm = new PyPyJS()
import js
js.eval()&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;An experiment in building a fast, compliant, in-browser Python environment.&lt;/p&gt;

&lt;p&gt;PyPy.js is &amp;hellip; Not so Fast. Incompatibilities between the JIT compilers.&lt;/p&gt;

&lt;p&gt;Is &amp;hellip; Humongous.&lt;/p&gt;

&lt;p&gt;How? PyPy + Emscripten.&lt;/p&gt;

&lt;p&gt;Emscripten: an LLVM backend that generates JavaScript.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&amp;ldquo;It&amp;rsquo;s awful all the way down&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Alts: &lt;a href="http://GitHub.com/PythonJS"&gt;http://GitHub.com/PythonJS&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&amp;ldquo;Please, file bugs against the Web&amp;rdquo;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://pypyjs.org"&gt;http://pypyjs.org&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://github.com/rfk/talk-pypyjs-what-how-why"&gt;http://github.com/rfk/talk-pypyjs-what-how-why&lt;/a&gt;&lt;/p&gt;</description><link>https://kokorice.org/post/97425542594</link><guid>https://kokorice.org/post/97425542594</guid><pubDate>Sun, 14 Sep 2014 11:51:47 +1200</pubDate><category>zopeplone</category><category>kiwipycon</category></item><item><title>Deploying a Django application using Juju - Tim Penhey</title><description>&lt;p&gt;Or &lt;strong&gt;“How I used Juju to deploy my Django app up to AWS”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Used &lt;strong&gt;&lt;a href="http://backbonejs.org"&gt;backbone.js&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Juju is written in Go. Service orchestration in the cloud.&lt;/p&gt;

&lt;h3&gt;Charms:&lt;/h3&gt;

&lt;ul&gt;&lt;li&gt;Encapsulate application configurations&lt;/li&gt;
&lt;li&gt;Define how services get deployed&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;Existing Charms&lt;/h3&gt;

&lt;ul&gt;&lt;li&gt;PostgreSQL&lt;/li&gt;
&lt;li&gt;Python-Django&lt;/li&gt;
&lt;li&gt;Gunicorn&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Juju can help with scaling later.&lt;/p&gt;

&lt;p&gt;Simple repeatable deployments.&lt;/p&gt;

&lt;p&gt;Writing a subordinate charm.&lt;/p&gt;

&lt;p&gt;Hooks are just scripts. Used &lt;strong&gt;Install&lt;/strong&gt; hooks and &lt;strong&gt;Everything else&lt;/strong&gt; hooks.&lt;/p&gt;

&lt;p&gt;Promoted charms are only ones that are officially available.&lt;/p&gt;

&lt;p&gt;“As a Juju core developer it was interesting that if I didn’t know the value that Juju would give me later, I would’ve thrown it out ages ago.”&lt;/p&gt;

&lt;p&gt;Insufficient documentation around using the Python-Django charm, had to read the code.&lt;/p&gt;

&lt;p&gt;Insufficient documentation around how to write a payload charm for Python-Django, very much work it out as you go.&lt;/p&gt;

&lt;p&gt;Python-Django and gunicorn still needs nginx to be really useful.&lt;/p&gt;

&lt;p&gt;Should have a full stack Django charm.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;juju bootstrap|deploy|add-relation|deploy|expose
&lt;/code&gt;&lt;/p&gt;</description><link>https://kokorice.org/post/97422690954</link><guid>https://kokorice.org/post/97422690954</guid><pubDate>Sun, 14 Sep 2014 11:11:29 +1200</pubDate><category>zopeplone</category><category>kiwipycon</category></item><item><title>2nd Keynote: A Snake in Space - The rise of scientific Python in Astrodynamics and Astronomy - Francesco Biscani</title><description>&lt;p&gt;Max Planck Institute for Astronomy, European Space Agency.&lt;/p&gt;

&lt;p&gt;PaGMO and Astropy - will mainly talk about PaGMO as wrote this and more familiar with this.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PaGMO&lt;/strong&gt; - Parallel Global Multiobjective Optimiser. Optimisation tool. Initially a trajectory optimisation tool, evolved as a general-purpose optimiser.&lt;/p&gt;

&lt;p&gt;Focused on parallel and distributed computing. Can use via C++ or Python.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="http://www.astropy.org"&gt;Astropy&lt;/a&gt;&lt;/strong&gt; - community effort to develop a single core package for Astronomy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Optimisation&lt;/strong&gt; - a large area of applied mathematics. &amp;ldquo;The selection of a best element (with regard to some criteria) from some set of available alternatives.&amp;rdquo; E.g. Travelling salesman (TSP).&lt;/p&gt;

&lt;p&gt;E.g. algorithms: gradient-based methods, evolutionary algorithms, stochastic algorithms.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Interplanetary trajectories&lt;/strong&gt; - space mission trajectories are defined by sets of parameters: launch date, initial velocity vector, sequence of flybys, sequence of deep-space manoeuvres (DSM).&lt;/p&gt;

&lt;p&gt;Usually we want to minimise fuel consumption.&lt;/p&gt;

&lt;p&gt;The resulting optimisation problem is hard: multimodal objective function, highly nonlinear, highly dimensional.&lt;/p&gt;

&lt;p&gt;Traditionally tackled by teams of &lt;strong&gt;human experts&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;Bio-inspired algorithms:&lt;/h3&gt;

&lt;ul&gt;&lt;li&gt;genetic algorithms&lt;/li&gt;
&lt;li&gt;differential evolution&lt;/li&gt;
&lt;li&gt;ant-colony optimisation&lt;/li&gt;
&lt;li&gt;artificial bee-colony optimisation&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Island model&lt;/strong&gt; - name inspired by Darwin&amp;rsquo;s trip to the Galápagos Islands.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;History of PaGMO&lt;/strong&gt; - pattern of scientific programming code: created as part of some research and then abandoned for many years; not useable by anyone else and then picked up later and made more &lt;em&gt;consumable&lt;/em&gt; by others.&lt;/p&gt;

&lt;p&gt;Initially created Python bindings to initially created C/C++ &amp;lsquo;research&amp;rsquo; code (2008-2009) and followed 'eat own dog food&amp;rsquo; approach by using it a lot for internal research. Been through 2 GSoCs and now 'fully-fledged&amp;rsquo; open source project.&lt;/p&gt;

&lt;h3&gt;Pros of Scientific Computing&lt;/h3&gt;

&lt;ul&gt;&lt;li&gt;Emphasis on correctness &amp;amp; reproducibility&lt;/li&gt;
&lt;li&gt;Powerful driver for innovations in HPC&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;Cons of Scientific Computing&lt;/h3&gt;

&lt;ul&gt;&lt;li&gt;Wheel re-invention&lt;/li&gt;
&lt;li&gt;Code is often written with a one-paper-horizon mindset&lt;/li&gt;
&lt;li&gt;Most scientists are not trained in software engineering&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;PaGMO framework:&lt;/h3&gt;

&lt;ul&gt;&lt;li&gt;The abstract island class includes a problem, an algorithm and a population of candidate solutions, and a virtual &lt;em&gt;evolve()&lt;/em&gt; method that dispatches the optimisation (to a thread or a process on another machine)&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Implemented via Boost.Python.&lt;/p&gt;

&lt;h3&gt;Challenging, non-trivial issues:&lt;/h3&gt;

&lt;ul&gt;&lt;li&gt;&lt;p&gt;serialisation across language boundaries involving virtual classes, base pointers, etc&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;extension from Python of C++ base classes&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;working around some of Python&amp;rsquo;s limitation wrt parallel programming (GIL)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;Leveraging Python&amp;rsquo;s strengths:&lt;/h3&gt;

&lt;ul&gt;&lt;li&gt;Scientific Python stack: NumPy (crunching results), SciPy (optimisation algorithms), matplotlib, IPython, etc&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;PaGMO uses: evolution of neural networks for autonomous Martian rovers, selection of Near Earth Asteroids for future human missions.&lt;/p&gt;

&lt;h3&gt;Astropy - &amp;ldquo;a community package for Astronomers&amp;rdquo;:&lt;/h3&gt;

&lt;ul&gt;&lt;li&gt;&lt;p&gt;Handle practical needs of astronomers: units, coordinates, FITS files, cosmological calculations&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&amp;ldquo;One of best community packages ever seen&amp;rdquo;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Not research package like PaGMO&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Heavy reliance on NumPy&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;</description><link>https://kokorice.org/post/97420194904</link><guid>https://kokorice.org/post/97420194904</guid><pubDate>Sun, 14 Sep 2014 10:37:00 +1200</pubDate><category>zopeplone</category><category>kiwipycon</category></item><item><title>Java for Python Developers - Chris Neugebauer</title><description>&lt;p&gt;One company who likes Python but in reality likes Java a lot more = …. Google!&lt;/p&gt;

&lt;p&gt;.java -&amp;gt; [compiler] -&amp;gt; JVM ByteCode -&amp;gt; JVM&lt;/p&gt;

&lt;p&gt;Jython - setuptools - make .jars&lt;/p&gt;

&lt;code&gt;from java.Lang.system&lt;/code&gt;

&lt;p&gt;What can do in Python 2.7 can also do in Jython.&lt;/p&gt;

&lt;p&gt;Android devices outsold full-size computers 2x.&lt;/p&gt;

&lt;p&gt;Dalvik Virtual Machine = Android Runtime (ART)&lt;/p&gt;

&lt;p&gt;.java -&amp;gt; [compiler] -&amp;gt; .dex (Dalvik exe) -&amp;gt; DVM&lt;/p&gt;

&lt;p&gt;No dynamic 3rd-party libraries. All statically compiled into Dalvik exe.&lt;/p&gt;

&lt;p&gt;Java Native Interface (JNI).&lt;/p&gt;

&lt;p&gt;&lt;a href="http://kivy.org"&gt;Kivy&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Python-For-Android: Cpython API for Java.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;from jnius import autoclass
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;PyJnius runs on Android!&lt;/p&gt;

&lt;p&gt;JNI method signatures are a nightmare.&lt;/p&gt;

&lt;p&gt;If Java’s more important, use Jython! Support for C extensions is not complete.&lt;/p&gt;

&lt;p&gt;If Python’s more important, use PyJnius!&lt;/p&gt;

&lt;p&gt;Jython is corporate sponsored by Sun.&lt;/p&gt;

&lt;p&gt;2.7 support on Jython is only recent.&lt;/p&gt;

&lt;p&gt;Kivy doesn’t have a very native look-and-feel. They say they’re working on this but “they don’t know what they’re talking about”.&lt;/p&gt;

&lt;p&gt;&lt;i&gt;Toga&lt;/i&gt; aims to use the native APIs for theming but currently has no Android support.&lt;/p&gt;</description><link>https://kokorice.org/post/97359567459</link><guid>https://kokorice.org/post/97359567459</guid><pubDate>Sat, 13 Sep 2014 17:01:53 +1200</pubDate><category>zopeplone</category><category>kiwipycon</category></item><item><title>Intro to flask-security - Beau Butler</title><description>&lt;p&gt;Why Flask? Steep Django learning curve. Like to start simple and then become more complex.&lt;/p&gt;

&lt;p&gt;App example code: &lt;a href="http://github.com/oddy/bangingminimal"&gt;http://github.com/oddy/bangingminimal&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Don&amp;rsquo;t get &lt;strong&gt;Async&lt;/strong&gt; mail sending, &lt;strong&gt;Pretty&lt;/strong&gt; forms.&lt;/p&gt;

&lt;p&gt;You get: sess auth + RBAC, base users db, all std workflows, passwd crypto, token/JSON auth.&lt;/p&gt;

&lt;p&gt;pip install flask flask-security flask-SQLAlchemy pyBcrypt paste&lt;/p&gt;

&lt;p&gt;Google: Prove Domain ownership - use button option.&lt;/p&gt;

&lt;p&gt;Black box testing: Know lots of hackers.&lt;/p&gt;

&lt;p&gt;Need motivate hackers - apply drink.&lt;/p&gt;

&lt;p&gt;How hacked? ARP Redir (had PC on same subnet), SSLSplit, click forgot password, intercept reset URL, reset URL.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Actual hack - other PC pretending to be Google SMTP server (on same subnet) intercepted program call and passed call on to Google SMTP server and hacker&amp;rsquo;s app.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Py smtplib doesn&amp;rsquo;t check Google&amp;rsquo;s cert! 2.x smtplib can&amp;rsquo;t do it at all.&lt;/p&gt;

&lt;p&gt;Admin Ronacher FTW.&lt;/p&gt;

&lt;p&gt;Flask-Sec RBAC itself &lt;strong&gt;still not broken&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Have a go: &lt;a href="http://pwnoddy.com"&gt;pwnoddy.com&lt;/a&gt;.&lt;/p&gt;</description><link>https://kokorice.org/post/97357306749</link><guid>https://kokorice.org/post/97357306749</guid><pubDate>Sat, 13 Sep 2014 16:25:15 +1200</pubDate><category>zopeplone</category><category>kiwipycon</category></item></channel></rss>
