Fredrik Håård avatar Fredrik Håård committed 34eb507

removed instance entries from repo

Comments (0)

Files changed (26)

blaag.cfg

-[content]
-title = Fredrik Håård's Blaag
-author = Fredrik Håård
-description = YAB
-entries_path = entries
-
-[html]
-css_name = haze.css
-css_url = /haze.css
-css_path = css
-templates_path = templates
-html_path = html
-base_url = http://blaag.haard.se/
-
-[disqus]
-name = devrantblaag
-
-[google_analytics]
-account = UA-27784490-1

css/blaag.css

-/*
-:Author: Fredrik Håård
-:Contact: The username fredrik on the domain haard dot se
-:Copyright: This stylesheet has been placed in the public domain.
-*/
-
-@import url(html4css1.css);
-
-body {
-    font-family: arial,sans-serif;
-    background-color: #DDDDDD;
-}
-
-a {
-    color: #AA3333;
-}
-
-a.menu_link {
-    text-decoration: none;
-}
-
-a:visited {
-    color: #CC4444;
-}
-
-a:hover {
-    color: #FF0000;
-}
-
-h1.page_title {
-    text-align: center;
-}
-
-div.wrap {
-    width: 960px;
-    float: left;
-}
-
-div.left {
-    float: left;
-    width: 150px;
-    margin: 15px 15px 15px 15px;
-}
-
-div.right {
-    float: left;
-    width: 150px;
-    background-color: #CCCCCC;
-    border: thin solid;
-    text-align: center;
-    margin: 15px 0 15px 0;
-    padding: 15px 15px 15px 15px;
-}
-div.main {
-    float: left;
-    width: 530px; 
-    
-    background-color: #AAAAAA;
-    border: thin solid;
-    margin: 15px 15px 15px 15px;
-    padding: 15px 15px 15px 15px;
-    
-}
-
-div.fullcomments {
-    width: 100%;
-    padding: 5px 5px 5px 5px;
-}
-
-div.shortcomments {
-    width: 100%;
-    padding: 5px 5px 5px 5px;
-    text-align: center;
-}
-
-div.footer {
-    text-align:center;
-    width: 100%;
-    padding: 5px 5px 5px 5px;
-    color: #333333;
-    font-family: courier, monospaced;
-}
-
-div.timestamp {
-    text-align: center;
-    font-size: 10px;
-}
-
-.strike {
-  text-decoration: line-through;
-}

css/haze.css

-
-html, body {
-  font-family: 'Helvetica Neue', Helvetica, Arial, default;
-  font-size: 15px;
-  line-height: 1.4;
-  background-color: rgb(46,56,66);
-  color: #efefef;
-  text-shadow: #000 0 0 0;
-}
-
-h1 {
-  font-size: 24px;
-  line-height: 36px;
-  margin-bottom: 9px;
-  color: #fff;
-}
-
-h2 {
-  font-size: 20px;
-  line-height: 24px;
-  margin-bottom: 9px;
-  color: #fff;
-}
-
-h3 {
-  font-size: 18px;
-  margin-bottom: 9px;
-  color: #fff;
-}
-
-h4 {
-  font-size: 16px;
-  color: #fff;
-}
-
-a,
-a:visited,
-a:active,
-a:hover {
-  color: #fff;
-  font-weight: bold;
-  text-decoration: underline;
-}
-
-p.fineprint {
-  font-size: 12px;
-  color: #ccc
-  text-align: center;
-}
-
-div.timestamp {
-  font-size: 10px;
-  color: #ccc
-  text-align: center;
-}
-
-section.page {
-  width: 960px;
-  margin: 0 auto;
-}
-
-header.page {
-  padding: 10px 20px;
-}
-
-footer.page {
-  padding: 5px 20px;
-  margin-top: 30px;
-  clear: both;
-}
-
-article.blog {
-  padding: 0px 20px 30px;
-  width: 680px;
-  float: left;
-  margin-bottom: 40px;
-}
-
-nav.blogs {
-  float: right;
-  width: 196px;
-  margin-left: 20px;
-  padding: 10px 10px;
-}
-
-.box {
-  background-color: rgb(56,66,76);
-  border-radius: 10px;
-  -moz-border-radius: 10px;
-  -webkit-border-radius: 10px;
-  -o-border-radius: 10px;
-  border: 1px solid rgb(73,83,93);
-}
-
-nav.blogs a.menu_link {
-  background-color: rgb(56,66,76);
-  border-radius: 5px;
-  -moz-border-radius: 5px;
-  -webkit-border-radius: 5px;
-  -o-border-radius: 5px;
-  
-  width: 196px;
-  padding: 3px;
-  text-align: center;
-  margin-bottom: 5px;
-  display: block;
-  border: 1px solid rgb(73,83,93);  
-  text-decoration: none;
-}
-
-nav.blogs a.menu_link:hover {
-  background-color: rgb(73,83,93);
-  color: #fff;
-}

css/html4css1.css

-/*
-:Author: David Goodger (goodger@python.org)
-:Id: $Id: html4css1.css 7056 2011-06-17 10:50:48Z milde $
-:Copyright: This stylesheet has been placed in the public domain.
-
-Default cascading style sheet for the HTML output of Docutils.
-
-See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
-customize this style sheet.
-*/
-
-/* used to remove borders from tables and images */
-.borderless, table.borderless td, table.borderless th {
-  border: 0 }
-
-table.borderless td, table.borderless th {
-  /* Override padding for "table.docutils td" with "! important".
-     The right padding separates the table cells. */
-  padding: 0 0.5em 0 0 ! important }
-
-.first {
-  /* Override more specific margin styles with "! important". */
-  margin-top: 0 ! important }
-
-.last, .with-subtitle {
-  margin-bottom: 0 ! important }
-
-.hidden {
-  display: none }
-
-a.toc-backref {
-  text-decoration: none ;
-  color: black }
-
-blockquote.epigraph {
-  margin: 2em 5em ; }
-
-dl.docutils dd {
-  margin-bottom: 0.5em }
-
-object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
-  overflow: hidden;
-}
-
-/* Uncomment (and remove this text!) to get bold-faced definition list terms
-dl.docutils dt {
-  font-weight: bold }
-*/
-
-div.abstract {
-  margin: 2em 5em }
-
-div.abstract p.topic-title {
-  font-weight: bold ;
-  text-align: center }
-
-div.admonition, div.attention, div.caution, div.danger, div.error,
-div.hint, div.important, div.note, div.tip, div.warning {
-  margin: 2em ;
-  border: medium outset ;
-  padding: 1em }
-
-div.admonition p.admonition-title, div.hint p.admonition-title,
-div.important p.admonition-title, div.note p.admonition-title,
-div.tip p.admonition-title {
-  font-weight: bold ;
-  font-family: sans-serif }
-
-div.attention p.admonition-title, div.caution p.admonition-title,
-div.danger p.admonition-title, div.error p.admonition-title,
-div.warning p.admonition-title {
-  color: red ;
-  font-weight: bold ;
-  font-family: sans-serif }
-
-/* Uncomment (and remove this text!) to get reduced vertical space in
-   compound paragraphs.
-div.compound .compound-first, div.compound .compound-middle {
-  margin-bottom: 0.5em }
-
-div.compound .compound-last, div.compound .compound-middle {
-  margin-top: 0.5em }
-*/
-
-div.dedication {
-  margin: 2em 5em ;
-  text-align: center ;
-  font-style: italic }
-
-div.dedication p.topic-title {
-  font-weight: bold ;
-  font-style: normal }
-
-div.figure {
-  margin-left: 2em ;
-  margin-right: 2em }
-
-div.footer, div.header {
-  clear: both;
-  font-size: smaller }
-
-div.line-block {
-  display: block ;
-  margin-top: 1em ;
-  margin-bottom: 1em }
-
-div.line-block div.line-block {
-  margin-top: 0 ;
-  margin-bottom: 0 ;
-  margin-left: 1.5em }
-
-div.sidebar {
-  margin: 0 0 0.5em 1em ;
-  border: medium outset ;
-  padding: 1em ;
-  background-color: #ffffee ;
-  width: 40% ;
-  float: right ;
-  clear: right }
-
-div.sidebar p.rubric {
-  font-family: sans-serif ;
-  font-size: medium }
-
-div.system-messages {
-  margin: 5em }
-
-div.system-messages h1 {
-  color: red }
-
-div.system-message {
-  border: medium outset ;
-  padding: 1em }
-
-div.system-message p.system-message-title {
-  color: red ;
-  font-weight: bold }
-
-div.topic {
-  margin: 2em }
-
-h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
-h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
-  margin-top: 0.4em }
-
-h1.title {
-  text-align: center }
-
-h2.subtitle {
-  text-align: center }
-
-hr.docutils {
-  width: 75% }
-
-img.align-left, .figure.align-left, object.align-left {
-  clear: left ;
-  float: left ;
-  margin-right: 1em }
-
-img.align-right, .figure.align-right, object.align-right {
-  clear: right ;
-  float: right ;
-  margin-left: 1em }
-
-img.align-center, .figure.align-center, object.align-center {
-  display: block;
-  margin-left: auto;
-  margin-right: auto;
-}
-
-.align-left {
-  text-align: left }
-
-.align-center {
-  clear: both ;
-  text-align: center }
-
-.align-right {
-  text-align: right }
-
-/* reset inner alignment in figures */
-div.align-right {
-  text-align: inherit }
-
-/* div.align-center * { */
-/*   text-align: left } */
-
-ol.simple, ul.simple {
-  margin-bottom: 1em }
-
-ol.arabic {
-  list-style: decimal }
-
-ol.loweralpha {
-  list-style: lower-alpha }
-
-ol.upperalpha {
-  list-style: upper-alpha }
-
-ol.lowerroman {
-  list-style: lower-roman }
-
-ol.upperroman {
-  list-style: upper-roman }
-
-p.attribution {
-  text-align: right ;
-  margin-left: 50% }
-
-p.caption {
-  font-style: italic }
-
-p.credits {
-  font-style: italic ;
-  font-size: smaller }
-
-p.label {
-  white-space: nowrap }
-
-p.rubric {
-  font-weight: bold ;
-  font-size: larger ;
-  color: maroon ;
-  text-align: center }
-
-p.sidebar-title {
-  font-family: sans-serif ;
-  font-weight: bold ;
-  font-size: larger }
-
-p.sidebar-subtitle {
-  font-family: sans-serif ;
-  font-weight: bold }
-
-p.topic-title {
-  font-weight: bold }
-
-pre.address {
-  margin-bottom: 0 ;
-  margin-top: 0 ;
-  font: inherit }
-
-pre.literal-block, pre.doctest-block, pre.math {
-  margin-left: 2em ;
-  margin-right: 2em }
-
-span.classifier {
-  font-family: sans-serif ;
-  font-style: oblique }
-
-span.classifier-delimiter {
-  font-family: sans-serif ;
-  font-weight: bold }
-
-span.interpreted {
-  font-family: sans-serif }
-
-span.option {
-  white-space: nowrap }
-
-span.pre {
-  white-space: pre }
-
-span.problematic {
-  color: red }
-
-span.section-subtitle {
-  /* font-size relative to parent (h1..h6 element) */
-  font-size: 80% }
-
-table.citation {
-  border-left: solid 1px gray;
-  margin-left: 1px }
-
-table.docinfo {
-  margin: 2em 4em }
-
-table.docutils {
-  margin-top: 0.5em ;
-  margin-bottom: 0.5em }
-
-table.footnote {
-  border-left: solid 1px black;
-  margin-left: 1px }
-
-table.docutils td, table.docutils th,
-table.docinfo td, table.docinfo th {
-  padding-left: 0.5em ;
-  padding-right: 0.5em ;
-  vertical-align: top }
-
-table.docutils th.field-name, table.docinfo th.docinfo-name {
-  font-weight: bold ;
-  text-align: left ;
-  white-space: nowrap ;
-  padding-left: 0 }
-
-h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
-h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
-  font-size: 100% }
-
-ul.auto-toc {
-  list-style-type: none }

entries/2011-12-16.rst

-It's alive!
-=============
-.. role:: strike
-    :class: strike
-    
-After :strike:`almost` more than four hours of *grueling* work, my blogging platform codenamed "blaag_" works. 
-
-I created blaag since I've been thinking about blogging, but didn't like the blogging platforms I found, because they were made of bloat with a little functionality hidden deep within. I did, however, like the idea behind hgblog_ - especially that it's based around generating the blog from rst_ using Mercurial_ hooks, allowing blogging from the comfort of Emacs. In the end, I decided to roll my own.
-
-The code for blaag and the entries for this instance of blaag coexists at Bitbucket, so you can view the source code and the source for the entries themselves there. 
-
-The goals of blaag are, in order of priority:
-  #. Nicer color scheme
-  #. Time/Datestamp posts
-  #. RSS support
-  #. Add example of Mercurial hooks to repo
-
-I guess documentation should be somewhere up top as well. Suggestions on what color scheme I should use are welcome! (assuming the Disqus integration works)
-
-.. _blaag: https://bitbucket.org/haard/blaag
-.. _hgblog: https://github.com/codekoala/hgblog
-.. _rst: http://docutils.sourceforge.net
-.. _Mercurial: http://mercurial.selenic.com/

entries/2011-12-17-2.rst

-RSS support is go!
-==================
-
-There's no reason to roll my own when the guys over at `Dalke Scientific Software`_ 
-have created the awesome PyRSS2Gen_. It's everything I want from a
-utility library - it's simple, documented by example, it does one
-thing, and it does it well. Thanks to them, this Blaag now sports a
-RSS_ feed!
-
-Also some bug fixes and minor tweaks done.
-
-.. _`Dalke Scientific Software`: http://www.dalkescientific.com
-.. _PyRSS2Gen: http://www.dalkescientific.com/Python/PyRSS2Gen.html
-.. _RSS: http://blaag.haard.se/rss.xml

entries/2011-12-17.rst

-Progress is made
-================
-
-Timestamps from Mercurial is now used to insert creation and
-modification times for posts in Blaag. I've also done some code
-cleanup and documentation, although there is still work to be done.
-
-Next up is RSS or Atom feed generation, just have to decide if I
-should use an existing library or just generate the XML. Knowing
-myself, I'll probably roll my own, yet again.

entries/2011-12-18-2.rst

-On useless testing
-==================
-
-All testing is not valuable. There. I said it. 
-
-If you take a look at the source_ of Blaag, you might notice a certain
-lack of tests. No unit test, no tests at all in fact. Does this mean I
-do not believe in unit tests, TDD and testing in general? No! If you
-take a look at hgapi_, for example, I wrote almost all code using TDD
-since that was the only way to know I got it right. 
-
-When starting on Blaag (which did at the time not have a name), I
-began by creating testblaag.py, writing ``import unittest`` - and then
-I froze. I had no idea what a test for Blaag would look
-like. Everything Blaag does, is glue code. It fetches data, feeds it
-to docutils_, collects some additional data from Mercurial_,
-creates documents using `string.Template`_ and a RSS feed using
-PyRSS2Gen_.
-
-There are some utility functions (implemented as functions or not)
-that I could have created unit tests for, but what information would I
-draw from writing a test for ``sum([int(i) for i in
-hgdate_string.split()])``? I write this code for me, and for me this
-code is obvious. So how do I *know* it works? I test it. Manually,
-since generating the entire html source is the *only* way for me to
-know that Blaag works as I intend it to work. 
-
-Whereas when writing hgapi_, I wrote a tool for others to use and
-adapt, and a tool that I could not easily look at and see if the
-result was correct, Blaag is *easy* to verify: I look at the rendered
-site, in my browser. If it does not look OK, I have a bug. If it
-works, I have NO bugs. I might have potential bugs, like the fact that
-the ``-f`` option is currently required when updating, but if the code
-generates the result I want, consistently, and in reasonable time,
-Blaag performs perfectly. 
-
-Any test would simply be more code that did not add information or
-value - and there is a name for that kind of code: bloat. And while in
-the case of Blaag this is easy to see, I believe that more care should
-be taken generally when writing tests, just as when writing
-functionality - the question you should always ask yourself when
-producing code is simply: *what value does this code add?* If you
-cannot answer that question, you probably should not write the code,
-whether it's a test or not.
-
-Because code unwritten never breaks.
-
-.. _source: https://bitbucket.org/haard/blaag/src
-.. _hgapi: https://bitbucket.org/haard/hgapi
-.. _PyRSS2Gen: http://www.dalkescientific.com/Python/PyRSS2Gen.html
-.. _Mercurial: http://mercurial.selenic.com
-.. _docutils: http://docutils.sourceforge.net
-.. _string.Template: http://docs.python.org/library/string.html#template-strings

entries/2011-12-18.rst

-Styling
-=======
-New style thanks to `@markuseliasson`_ - anything ugly is because of my
-adaptions, anything looking great is his work. Since the main parts,
-are done (still to be done: Mercurial hook, optional
-disqus/analytics), the next post may actually have
-other content than the Blaag itself!
-
-.. _`@markuseliasson`: http://twitter.com/#!/markuseliasson

entries/2011-12-20.rst

-Tools for better Python
-=======================
-**TL;DR**
-    pip install virtualenv pylint ipython autohook
-
-
-Tools I use every day to write better Python, to make it more fun, or just easier:
-
-  * A good editor: I prefer Emacs_, you might like something else, but trust me on this - it’ll be a humongous project that forces you to use a full IDE. If you stay clear of large web frameworks, you might never need it. I started out using PyDev since I was used to Eclipse, but now I just don’t think its worth the complexity and overhead.
-  * virtualenv_: I use my virtualenvs for more than just Python these days, and setting a new environment up is the first thing I do when starting a new project.
-  * pylint_: Not only does it tell you what you might want to fix in your code, it tells you if your code gets better or worse. The more unsure you are, the more you should use pylint.
-  * ipython_: While REPL is nice, iPython is truly awesome for testing and prototyping. For me, its gradually replacing bash as well.
-  * unittest/unittest2: Python comes with built-in unit test support - use it (where appropriate)!
-
-These are the tools I use in almost any project, and recently I’ve added one of my own:
-
-  * autohook_, to run pylint/unit tests on commit to Mercurial
-
-Finally, I’d like to point anyone starting out with Python to the excellent introduction set up by Mir Nazim at `his site`_. 
-
-.. _pylint: http://www.logilab.org/project/pylint
-.. _`his site`: http://mirnazim.org/writings/python-ecosystem-introduction/
-.. _virtualenv: http://pypi.python.org/pypi/virtualenv
-.. _Emacs: http://www.gnu.org/s/emacs/
-.. _ipython: http://ipython.org/
-.. _autohook: https://bitbucket.org/haard/autohook

entries/2011-12-21.rst

-Autohook updated
-================
-
-When I linked to autohook the other day, I was not prepared that
-somebody would actually try it, and tell me that it did not work. 
-
-So, eating my own dogfood I set up the released version of autohook_,
-to run Blaag generation, and realized that it did, indeed, not
-work. This is fixed now in version 1.1.0, which also does away with
-using "*if __name__ ...*" and instead uses setuptools magic to create
-runnable scripts. 
-
-In addition, I realized that setting up hooks for a single repo was
-kind of a pain, so I simplified the configuration for that use case.
-
-.. _autohook: https://bitbucket.org/haard/autohook

entries/2011-12-28-2.rst

-Jenkins
-=======
-
-Recently, I wanted to migrate some lightweight services from a virtual
-host to an account at Webfaction_, since running a wiki/issue tracker
-(Trac_) and CI server (Jenkins_) for a couple of low-volume projects
-really shouldn’t take a whole machine of it’s own. Or should it?
-
-This is when I realized that Jenkins is heavyweight in a world of
-cloud and shared hosts. I already kinda knew, since I've been
-administrating a Jenkins installation that claims several gigs of RAM,
-but that's with over thirty Maven projects and a pretty high load.
-
-Firing Jenkins up and configuring two (Ant) projects, it claims ~150Mb
-RAM - for doing nothing. On a shared host, that’s unacceptable. Under
-the old RAM limits on Webfaction, it’d be impossible to run, now its
-just claiming 3/5 of my total memory allotment.
-
-So yesterday I set up continuous integration using a Python script
-that runs the build, determines fail or success, and publishes the log
-and/or artifacts; it took a bit less than an hour to get working from
-scratch (admittedly using my own Mercurial lib for integration).
-
-Now I'm thinking of maybe creating something useful out of this. Right
-now, I publish logs as static web pages, but I could just post them as
-wiki pages to Trac via RPC_. That would allow logs to tie into the
-ticket system and source browser, and I could show build status right
-there on the Kanban-ish-board next to the tickets. 
-
-I've got no firm design done yet, but I'm thinking about what the
-requirements for a minimalistic CI tool should be:
-
- * Take no resources apart from disk space when idle
- * Be able to publish fail and success logs in a useful format
-
-   * It should be trivial (for real) to implement support for new targets for result publishing 
-
- * Ability to limit resource usage (number of concurrent builds)
- * Jobs can trigger each other
- * more?
-
-
-.. _Webfaction: http://www.webfaction.com/
-.. _Jenkins: http://jenkins-ci.org/
-.. _Trac: http://trac.edgewall.org/
-.. _RPC: http://trac-hacks.org/wiki/XmlRpcPlugin
- 

entries/2011-12-28.rst

-Problem exist between chair and keyboard
-========================================
-It was pointed out to me that a entry was missing. My initial
-reaction was "No, its not!", but then had to confess that yes, an entry
-that had been posted was missing. This was because I've developed (and
-written) for blaag on several computers, and I'd accidently made a
-closed head tip and lost an update. Maybe I need to add some
-functionality to make sure that existing posts do not disappear.

entries/2011-12-29.rst

-hgapi 1.1.0
-===========
-
-As a belated christmas gift, I just released hgapi_ version 1.1.0. New
-since 1.0.1 is support for hg status, merge and revert. This means
-that I right now have no firm plans for the future, as the tool does
-what I need it to do. If you have other requirements, add them to the
-issue tracker.
-
-.. _hgapi: https://bitbucket.org/haard/hgapi

entries/2012-01-15.rst

-What's the point of properties in Python?
-=========================================
-
-A few days ago I was asked by a collegaue what the point of properties
-in Python is. After all, writing properties is as much text as
-writing getters and setters, and they don't really add any
-functionality except from not having to write '()' on access.
-
-On the surface, this argument holds as we can see by comparing a
-simple class implemented with getters and setters, and with properties.
-
-Implemented with getters and setters:
--------------------------------------
-
->>> class GetSet(object):
-...   x = 0
-...   def set_x(self, x):
-...     self.x = x
-...   def get_x(self):
-...     return self.x
-...
-
->>> getset = GetSet()
->>> getset.set_x(3)
->>> getset.get_x()
-3
-
-And implemented with properties:
---------------------------------
-
->>> class Props(object):
-...   _x = 0
-...   @property
-...   def x(self):
-...     return self._x
-...   @x.setter
-...   def x(self, x):
-...     self._x = x
-...
->>> props = Props()
->>> props.x = 5
->>> props.x
-5
-
-The point
----------
-In fact, we've gone from 196 to 208 chars in this simple use case - so
-why would we use properties at all?
-  
-The answer is, that in this use case we would not. In fact, we would
-write thus:
-
->>> class MyClass(object):
-...   x = 0
-...
->>> my = MyClass()
->>> my.x = 4
->>> my.x
-4
-
-
-'But!', I can hear you scream, 'there's no encapsulation!'. What will
-we do if we need to control access to x, make it read-only or do
-something else to it? Won't we have to refactor everything to the
-getters and setters that we avoided?
-
-No - we just switch to the property version, add whatever we want, and
-have not changed the interface one iota! The great thing about
-properties is not that they replace getters and setters, its that you
-don't have to write them to future-proof your code. You can start out
-by writing the simplest implementation imaginable, and if you later
-need to change the implementation you can still do so without changing
-the interface. Neat, huh? 

entries/2012-01-19.rst

-Mercurial in Python 3: promoting hgapi
-======================================
-
-When I took a look at the python.org_ `Py3k poll`_, I saw that Mercurial was on the top list of things people wanted ported (though far behind the likes of Django). Now, I don't know why others want to tie into Mercurial from code, but if a little performance overhead from using the CLI isn't critical - such as when writing hooks_, or just integrating version control in some tool_ or another, you might want to consider hgapi_.
-
-hgapi uses only the command line interface, and was created to be able to release autohook_ under a more permissive license than the GPL - and it's tested against both Python 2.7 and Python 3.2. It now supports most (for a given computation of 'most') operations in Mercurial, and as a bonus there are no open feature requests - so if there is something you miss, this is the time to request it!
-
-Also, don't forget to register for PyCon_, early bird rates until 25/1!
-
- .. _PyCon: https://us.pycon.org/2012/registration/
- .. _tool: https://bitbucket.org/haard/blaag
- .. _autohook: https://bitbucket.org/haard/autohook
- .. _hooks: https://bitbucket.org/haard/autohook
- .. _python.org: http://www.python.org
- .. _`Py3k poll`: http://python.org/3kpoll
- .. _hgapi: https://bitbucket.org/haard/hgapi

entries/2012-02-07.rst

-Using Python to get rid of .doc
-===============================
-
-I'll be appearing att `Software Passion`_  to speak about using Python
-for protocol specifications, instead of using an external document to
-write the specification, and then try to implement it from there (or,
-perhaps more common, implementing it and then trying to keep the
-document up-to-date).
-
-A while ago at `Visual Units`_, the situation was this: There was a
-protocol to transfer data over TCP from fleet management black boxes running J2ME to a
-server running Python, which then stored that data so interesting
-things could be done with it. Accompanying the protocol was a
-ever-slightly-out-of-date protocol specification, and a client
-implementation in Python used for testing the server.
-
-This means that we had four different implementations of the protocol:
-one in Java, two in Python, and one in English. If one of those was
-not updated when the others were, the system was no longer consistent,
-and might break in interesting ways.
-
-Since this created a lot of work for me, I set out to change
-things. First, I searched for viable existing solutions, but the need
-to keep the protocol compact (telematics data transfer is expensive),
-and J2ME support meant I did not find anything to use off the shelf.
-
-Instead I started to implement my own solution, with a vision that I
-would implement the protocol once, and use it everywhere - Java,
-Python, and English. In the end, using a couple of hundred of rows of
-Python, we can now specify a protocol thus::
-
-  message = string
-  timestamp = i64
-  timediff = i32
-  
-  ping = ("A ping, with a time and message",
-           timestamp, message)
-
-  pong = ("A pong, with message, timestamp and perceived lag",
-          timestamp, timediff, message)
-  
-...and from this, we create Java source code for the terminals, the
-Python clients and servers use it directly when packing and parsing
-messages, and the documentation for the poor souls who might want to
-read English instead of Python is generated.
-
-Want to know how this was made possible, see some code, and point and
-laugh at my miserable attempts that failed? Want to know why
-meta-classes were absolutely vital - or not? Register_ for `Software
-Passion`_ where I'll be talking about this - if you use the promontion
-code 'BLAAG' when registering, you'll even get a 10% discount!
-
-
-
- .. _`Software Passion`: http://softwarepassion.se/
- .. _Register: http://softwarepassion.se/register.do
- .. _`Visual Units`: http://www.visualunits.se

entries/readme

-This is were the entries go. Will be sorted by filename, and only those ending in .rst will be used.

templates/blaag_template.html

-<article id="${identifier}" class="blog box">
-    ${html_body}
-    ${timestamp}
-    ${comments}
-</article>
-      

templates/comments_full.html

-
-<div class='fullcomments'>
-    <div id="disqus_thread"></div>
-    <script type="text/javascript">
-        /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
-        var disqus_shortname = '${disqus_name}';
-        var disqus_identifier = '${threadid}';
-        /* * * DON'T EDIT BELOW THIS LINE * * */
-        (function(d) {
-            var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
-            dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
-            (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
-        })();
-    </script>
-    <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
-    <a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
-</div>

templates/comments_short.html

-
-<div class='shortcomments'>
-    <a href="${link}#disqus_thread" data-disqus-identifier="${threadid}">Comments</a>
-</div>

templates/created.html

-Blaag created ${timestamp}.

templates/menu_link.html

-<a href='${link}' class='menu_link'>${title}</a>

templates/modified.html

- Last modified ${timestamp}.

templates/pagetemplate.html

-<!DOCTYPE html >
-<html lang="en">
-<head>
-  <title>${page_title}</title>
-  <meta charset="UTF-8">
-  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-  <link rel="stylesheet" type="text/css" href="${css}" />
-  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
-  <meta name="description" content="${page_title}"/>
-  <meta name="author" content="${author}" />
-</head>
-<body>
-
-    <section class="page">
-      <header class="page">
-        <h1>${page_title}</h1>  
-      </header>  
-      
-      ${main}
-      
-      <nav class="blogs">
-        <a href='/' class='menu_link'>- index -</a>
-        <a href='/rss.xml' class='menu_link'>RSS Feed</a>
-        <h4>My recent posts</h4>
-        ${links}
-      </nav>
-    
-      <footer class="page">
-        <p class="fineprint">Page created using <a href='https://bitbucket.org/haard/blaag'>blaag</a> and abusing <a href='http://docutils.sourceforge.fnet/' target='_blank'>docutils</a>. <a href="/rss.xml">RSS Feed</a> generated using <a href='http://www.dalkescientific.com/Python/PyRSS2Gen.html'>PyRSS2Gen</a><br/> Copyright Fredrik Håård &lt;fredrik at the server named haard dot se&gt;.
-      </footer>
-    </section>
-    
-    <!-- Add JavaScript after this point, it makes the page load faster when client does not need to interpret JS at start -->
-    <script type="text/javascript">
-      var _gaq = _gaq || [];
-      _gaq.push(['_setAccount', '${google_analytics_account}']);
-      _gaq.push(['_trackPageview']);
-      (function() {
-        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
-        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
-        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
-      })();
-    </script>
-     
-    <script type="text/javascript">
-      var disqus_shortname = '${disqus_name}'; 
-      (function () {
-        var s = document.createElement('script'); s.async = true;
-        s.type = 'text/javascript';
-        s.src = 'http://' + disqus_shortname + '.disqus.com/count.js';
-        (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
-      }());
-    </script>
-
-</body>
-</html>

templates/timestamp.html

-<div class='timestamp'>
-${timestamps}
-</div>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.