mctext 0.2 – A Markov Chain Text Generator

This is the second release of my Markov Chain text generator – mctext. This text generator takes existing sample text and generates new text using Markov Chains.

The main new thing in this version is that it allows users to specify via the command line how many words should be considered when generating the next one. The bigger the step number, the closer the generated text is to the original one. The value used in mctext-0.1 was 2, and this is also the default in this one. The number of steps can be set using the --steps command line switch.
Continue reading mctext 0.2 – A Markov Chain Text Generator

Pull vs. Push MVC Architecture

I intended to write this post a couple of months ago, when I worked on a pull-based MVC framework for some site. Most web developers are acquainted with the MVC architecture, and almost all the major web frameworks use this concept, including Ruby on Rails, CakePHP, Django, Symfony, and others. So what is MVC, and what’s the difference between pull and push?
Continue reading Pull vs. Push MVC Architecture

Equality-at and Relation-at LaTeX Macros

These are two useful LaTeX macros for creating equality-at and, more generally, relation-at signs. These macros depend on the mathtools package. As with all other macros, you should add them to your preamble in order to use them.

The general macro is relat. It takes two arguments: the relation and an expression where the relation takes place (the “at”). The equality-at macro, eqat, is a specific case of relat. I’ve created it because it is commonly used and only requires passing the “at” argument.
Continue reading Equality-at and Relation-at LaTeX Macros

A Greasemonkey Fix to the Top Menu in Sheilta (Open University)

Following comments in Fixing the Home Link in the Telem System (Open U), I’ve decided to fix the top bar links in the Sheilta system too.

The links in the top bar are JavaScript links that open in a new window when clicked. My Greasemonkey script turns them into regular links that you can open in a new tab.

Continue reading A Greasemonkey Fix to the Top Menu in Sheilta (Open University)

Notes About Using amsmath split Environment in Hebrew Documents

Recently I’ve worked on a Hebrew document in LaTeX and wanted to use the split environment to typeset a multiline formula. The document, which compiled just fine until that point, failed to compile with the following error:

Package amsmath Error: begin{split} won't work here.

Continue reading Notes About Using amsmath split Environment in Hebrew Documents

Hidden Spam Links in WordPress

About a week ago, I decided to look at the HTML source of my blog. I was in total shock to find a spam link hidden there. This is how it looked:

<!-- ocadia theme credits, downloaded from wpthemesfree.com -->
<u id="ocadia" style="display: none">Buy some <a href="http://detoxbuddy.com/categories/191.html">marijuana drug testing</a> products</u>

Ocadia is the name of the theme I’m using, so I guessed the hidden link came from there. I was partially right. The code indeed resided in the index.php file of the theme, but as I later found out, the theme had nothing to do with that. I removed the link and the comment immediately, and went to see if it was distributed this way from Beccary (the author of the theme).
Continue reading Hidden Spam Links in WordPress