Jan 31, 2012

Mac: adding a keyboard layout using AppleScript

Update: This no longer works in Mavericks because Apple changed the whole layout window. Last working OS version was Mountain Lion.

We have a special keyboard layout in the country, where I live (Latvia). It includes certain special letters: like ā, ē, ū and so on. Many people here set Latvian keyboard layout as a default. However I cannot do that because this layout has one major disadvantage for people like me.

Those special letters are typed by one of two ways: Alt+normal letter or '+normal letter. While the first way is goot, the second one is bad for programmers. I often use ' in the code, so having ' as a "dead key" (this is how it is called officially) is not suitable. But I still have to type those latvian chars sometimes. Until yesterday I kept English US layout as a default and added Latvian manually when I had to type latvian letters. This is a multiple move-and-click process. Yesterday I finally found a way to automate addition and removal of the layout.

Jan 17, 2012

Current life

I am not very much visible in TYPO3 these days. So I though I would give a short update on what I am doing or going to do.


Jan 10, 2012

Cleaning and optimising cache tables in TYPO3

There is an important issue with cache tables in TYPO3, which I am going to address in this article. The issue can become critical for projects with a limited disk space, projects with lots of user groups, which use indexed search or Solr, or projects with lots of pages.

Cache tables are designed to provide a high-performance access for simultaneous reads and writes. This means that several reads at a time should be possible as well as several writes and none should block each other. This is possible when cache tables use InnoDB MySQL database engine. InnoDB provides concurrency and data safety against sudden failures. TYPO3 uses InnoDB for several critical tables, including cache tables.

Sometimes cache tables can grow a lot. The more records exist in the cache table, the slower it is to find a necessary record there. TYPO3 provides a special scheduler task to clean up old cache records. If you have TYPO3 4.6 or newer, you should always use that task.

However, there is a certain fact that very few users know: running the task will remove entries from the table but it will not recover the disk space taken by removed records. InnoDB does not reuse the space when records are deleted. It always appends new data to the end of the allocated data file. Thus it is possible to have a fully empty InnoDB table, which takes 100GB on the disk.