Category: python

  • Unicode block names in regular expressions

    Frequently, I find myself wanting to do some simple language detection. For Chinese, Japanese, and Korean, this can easily be done by looking at the types of characters in some text. The simplest and most robust way to do this is to use Unicode block names. It is very simple to write a regular expression…


  • Monkey patching in python

    I was just reading an article about Martijn Pieters, who is a python expert, and he mentioned monkey patching I did not know what monkey patching is, so I googled it, and found a great answer on stack overflow Basically, it takes advantage of python’s class access philosophy. Unlike java, which has a strict access…


  • Pretty printing json

    Here is a really simple way to pretty print some unformatted json $ echo ‘{“foo”: “lorem”, “bar”: “ipsum”}’ | python -mjson.tool { “bar”: “ipsum”, “foo”: “lorem” }


  • Small fix for article class in plasTeX

    I recently found a small error in plasTeX, the program I like to use to convert latex to html. Unfortunately, it looks like it is not being actively developed anymore, but since it is open-source, and it is written in python, which I know, I was able to figure out the issue in not too…


Join 164 other subscribers

Archives

  • 2024 (5)
  • 2023 (8)
  • 2022 (15)
  • 2021 (19)
  • 2020 (1)
  • 2019 (1)
  • 2018 (2)
  • 2017 (1)
  • 2016 (2)
  • 2015 (5)
  • 2014 (5)
  • 2013 (2)
  • 2011 (7)
  • 2010 (10)
  • 2009 (50)
  • 2008 (28)
  • 2007 (31)
  • 2006 (8)

Category