Blog

MeoTempo

For about two years now, I’ve been working part-time on an iOS project with a small team of people. The app is structured as a calendar, but unlike other calendar apps this one tells you how much time you have left, how much time you’ve planned and spent on things, and it comes with a tool to track what you’re doing right now (giving you later a history of how you spent your time).

I’m not going to detail what the app can do here. It was released last week, so just go take a look.

For this app I built a synchronization engine. Each device running the app has an independent copy of the database, and each time it connects to our servers, databases are merged together and changes are propagated to other devices. The way it works is interesting, so I’ll elaborate a little.

Our synchronization system is built in a similar way to distributed version control systems (Git, Mercurial, etc.). It has a repository layer used to syncs binary data blocks with other repositories. On top of this the app maintains a SQLite database corresponding to the model. Changes in the local repository are kept in sync with the model database. Changes in the local repository are also pushed to the remote one, and vice versa. And there your iPhone syncs with your iPad.

This systems has two interesting properties in common with DVCS. First, if one repository is lost (whether on the server or on a device), it can be reconstructed from the others. Second, in theory we could do peer-to-peer sync too without a central server even though in practice managing peer-to-pear communications is more complicated and nothing has been done on this front.

It’s interesting to note that the model database is basically a cache of what is in the repository. Whenver the schema for the model database changes (when updating the app for instance), we don’t have to migrate any data: we get rid of the previous model database and rebuilt it from the local repository, just like when syncing.

All in all, I’m quite happy with this system. It took some time to build, there’s still some rough edges, but it was really worth the effort. Give MeoTempo a try if you want to see it in action.

PHP Markdown Lib

It’s time for PHP Markdown to become a mature well-packaged PHP library instead of a hybrid file that tries to be everything for everyone.

Today, I’m announcing the Lib branch of PHP Markdown. It contains the two exact same parsers found in PHP Markdown and PHP Markdown Extra, but without all the cruft. It is packaged to be used as a library, and only as a library. The two parsers classes are in the Michelf namespace:

\Michelf\Markdown
\Michelf\MarkdownExtra

Yep, a namespace, so it requires PHP 5.3 or later.

The Lib branch is PSR-0 compliant to allow autoloading of its parser classes. It’s also a Composer package made available on Packagist.

Three Branches

So, right now there are three branches of PHP Markdown. Here’s a summary of each:

PHP Markdown
The original PHP Markdown is the one implementing the Markdown syntax specification. It includes a global Markdown function, a parser class, as well as various plugin interfaces for Wordpress, Smarty, for replacing the Textile parser.
PHP Markdown Extra
The Extra branch has been added quite a while ago to extend the core Markdown syntax with other useful things. It’s implemented as a second parser class derived from the PHP Markdown parser’s, and packaged exactly the same way in a single file with the various plugin interfaces.
PHP Markdown Lib
The Lib branch is a new one aimed at being a modern PHP library people can use to integrate in various things. Contrary to the other two, it does not contain any plugin code. It requires PHP 5.3 or later because it makes use of namespaces.

PHP Markdown Lib starts at version 1.3. I wanted to start over at 1.0, but that’d have made bug reports about a specific version of PHP Markdown harder to understand (people often don’t say or know which branch they’re using), hence why there’s a separate version number.

Moving forward

Next year, in 2014, only the Lib branch will continue to be updated.

The original PHP Markdown and PHP Markdown Extra distributions will continue to be available on the classic version page, but starting next year updates containing bug fixes and new Extra features will go exclusively to the Lib branch.

If like many of you you’ve been using PHP Markdown as a Wordpress plugin, you can still continue to rely on it, it is unlikely to stop working anytime soon. The reality however is that I do not have the time to keep improving things for Wordpress as it evolves. Time passed, and now many other plugins based on PHP Markdown but with better integration have appeared. I do not have a recommendation to make at this time, but feel free to let me know if you have one as I might write a follow-up on that topic.

Ditching support for older versions of PHP will simplify the maintenance work and will enable usage of newer PHP constructs in the code. Getting rid of the Wordpress plugin part will let me worry about things which are more related to the parser side of things.

It’s time for PHP Markdown to become a mature well-packaged PHP library instead of the strange hybrid it has been for many years. Therfore, starting today, the Lib version now takes the front row on the updated PHP Markdown webpage. Let me know if you have any question.

Aaron Swartz, slices of an inbox

Aaron Swartz, 2004, Markdown-Discuss mailing list:

Jelks Cabaniss:

Will there by a way do allow the “implicit link name” syntax to do without the following [] brackets? In other words, like [this] instead of like [this][]?

That was my original idea, but Gruber was concerned it would be too easily tripped, e.g. in:

Condi said, "[The President] loves his job."

Turns out that your idea, like many others, is now implemented everywhere. Thank you for your ideas.


Aaron Swartz, 2006, seeking advice about porting PHP Markdown to Python:

Eek. Everything I try to run this regular expression through goes into some sort of infinite loop:

'/^(?:[^`]+|(`+)(?:[^`]+|(?!\1[^`])`)*?\1(?!`))*$/s'

(it’s the balanced ` matching thing…)

The regular expressions used to implement Markdown would madden anyone. I’m glad I could help.


Aaron Swartz, 2008, finding something wrong with my website:

I think you mean “markdown” not “makrdown”

Oops!


Rest in peace Aaron. We weren’t talking that much, but I’ll miss you.


P.S.: Someone ought to find a way to fix that farce of a justice system.

Perhaps Microsoft Freaked Out

Since about two years now, Microsoft has been touring its new full screen user interface that’ll soon be available in Windows 8. It’s called Metro… well, no longer. Long story short, only some weeks before final release they’ve now announced it’s not called Metro anymore, it’s called Windows-8-style. And they’re hard at work at updating their documents all over the place to reflect the change and erase any trace of the Metro word.

Microsoft is citing a trademark conflict with German retailer Metro AG as the reason behind the change. For one thing, it’s strange that the Metro AG trademark would extend to computing. For another, metro is a common noun used in hundreds of trademarks all around the world. It’s hard to imagine Microsoft’s legal teem would be intimidated at all by a retailer over a generic word known and used to identify many things all over the world. Even so, they surely could have bought a license from Metro AG. Remember, this is the company is using a common noun as the name of its operating system.

So how could all this make any sense? I think I just saw a clue today. Jon Brodkin writes for Ars Technica:

In an update to the “Naming your app” instructions, Microsoft now tells developers “Make sure your app name doesn’t include the word metro. Apps with a name that includes the word metro will fail certification and won’t be listed in the Windows Store.” (Hat tip to the Marked Up blog for discovering the change). Since the company Metro AG has apparently accused Microsoft of infringing its trademarks, the change in language is not unexpected in one of those puzzling, legalistic sorts of ways.

Now, this is clear and limpid: Microsoft is doing everything it can to make people stop referring to Metro-style apps as being Metro-style apps. Could they be doing that because of that strange trademark issue alone?

Here’s a crazy idea: What if that trademark issue is just a diversion? What if the terrible name (Windows-8-style) was chosen on purpose so that no one will use it1? What if Microsoft was simply afraid that the term Windows would get burried by Metro in our collective minds in a year or two2? Because when all the developers start talking about their new Metro apps being available in the Store, they won’t call those apps Windows apps, they’ll call them Metro apps, and so all the new cool things will be associated with the word Metro while Windows will become associated with applications of the past. I think someone or something at Microsoft is profoundly afraid of that, and their response has been to burry their new cool emerging brand under the Windows omniword.

Microsoft is taking a bold step with Metro, which is great. But it also looks like they fear their own shadow, which is sad.


  1. They expect everyone to say Windows-8-style, but seriously, who’s going to say that unless they’re somehow obligated to? That’s a horrible new name for Metro. 

  2. I’d guess they had that fear all along. That would explain why Microsoft talked about Metro-style apps, never forgetting to put the -style suffix as if to diminish the importance of it all. Metro-style apps were always meant to be Windows apps first and foremost. Now that Metro is gone, they certainly will. 


Archive