Jan 27, 2015

When it fails...

Failures happen all the time in every aspect of our life. While I am going to discuss failures of software developers, methods to handle those failures can be also applicable to other situations, even for families and friends.

When something fails, we all are unhappy about it. When developers screw up an important launch, when hotfixes break the system even more, when the site does not go online in sync with related sites, it is a failure. Failures has to be handled.

How do people handle failures? There are different ways. One of the most dangerous and bad ways to handle failures is to start looking for the responsible person and blaming him for errors.

Why is it bad?

Jan 24, 2015

Opening images directly in Photoshop on Mac

I work with Adobe Photoshop CC 2014 quite a lot. Often I have to open JPEG images there from Finder. By default, JPEG images are opened in Preview. To open them in Photoshop I have to right-click on the image, scroll down to Open With..., wait until the pop up menu appears (or click it to open faster), find Adobe Photoshop CC 2014 there and click it. Too long.

Can this be simplified? Oh, yes!

Jan 16, 2015

Strange localisation code in the Extbase persistence layer

Quite often I see that people do mistakes when they work with localisation in TYPO3. This topic is quite complex and often misunderstood.

TYPO3 localisation is defined by the Frontend Localisation Guide document, which was written by Kasper. I was one of the early reviewers of the document before it was published. While screenshots there are old, the document is still accurate. Let's have a quick look how localisation of records is handled in TYPO3.

Record localisation in TYPO3

Note that we are talking about records here, not pages. Pages are localised slightly differently.

All localisable records can be logically divided into the records in the main language and in other languages. This is an important distinction. Main language in TYPO3 always had id equals to zero. Other languages are defined on the tree top level and have id values starting from one.

The record in the main language is very important because it contains all fields. Records in other languages may either contain all fields or only some fields that depend on the localisation. For example, a record like Event can have the following fields:

Dec 5, 2014

TYPO3 7.0 and RealURL

RealURL is not compatible with TYPO3 7.0 because old compatibility classes were removed in TYPO3 7.0 but RealURL must be compatible with TYPO3 4.5.

I plan to release a new version of RealURL somewhere in March 2015. It will compatible with TYPO3 6.2 and newer TYPO3 versions (not with TYPO3 4.5). That new version will use different principles for building URLs: faster and more reliable. This will be completely new code. Configuration will be compatible with existing version with the exception of redirects: they will not be included into new RealURL because I strongly believe it is not a RealURL functionality and redirects should be done in a different way.

That's all news for now.

Nov 24, 2014

Zend Certification Study Guide

I understand why they give 50% discount to it. Not worth the money at all.

It costs $15 at Zend web site and it is absolutely useless. If you can read headings of PHP manual at php.net and 2-3 sentences of each section, this is what this $15 guide gives you: heading at a couple of [worthless] sentences.

Lost money, total crap. Don't buy.

Nov 23, 2014

Why I wouldn't upgrade to Yosemite, iOS 8.1, etc.

Usually when Apple makes updates I upgrade fast. For regular users (non-developers) such updates are easy and bring new cool features. For developers it is a certain amount of pain because developers have to reinstall all kind of tools they use (java, macports, Xcode, and so on). It takes some time but still it is usually worth upgrading.

This time when Apple released Yosemite and iOS 8.x I decided not to upgrade. Why? Because it causes more problems than it is worth. See yourself:

  • Apple broke TRIM for 3rd party SSDs. It is pretty bad not to provide TRIM by default for all drives but to complicate TRIM enabling is even worse. Yes, this can be overruled but the cost is lowering security of the OS. Bad.
  • Continuity. Sorry, no. I do not wish to pick up phone calls on my Mac or iPad. I do not want all my devices to ring at the same time, especially when I am on a call with my boss over Skype. Yes, it can be switched off. But I do not want to go and switch it off everywhere somewhere deep inside settings. I want either a question at installation or this feature to be off by default to preserve compatibility.
  • Stability issues. OS X should not come with wi-fi connectivity issues.
  • Performance issues. Nether iOS, not OS X should be that much terribly slower because some head at Apple decided that transparency is cool and windows now should be transparent. Yes, can be turned off but why the system comes with non-optimal settings?
  • Why does it enforces iCloud on me? I do not want to use your iCloud, Apple!
Apple devices and OS are still the best combination to work with. Nobody made even anything remotely close to the convenience of Apple production for the same price. So I stick with Apple for now but I am looking for something else. Not Windows. May be some Linux, which is optimized for humans (no, not Ubuntu). And good hardware that works smoothly, with multitouch touchpad and proper keyboard work. 404, not found so far.

Nov 21, 2014

Your code tells about you more than you think

Suppose you have the following in your code:

$this->pid_list = $this->pid_list ? $this->pid_list : 0;
if (! $this->pid_list) {
$this->errors[] = 'No pid_list defined';
}

This translates to: “If the value is not true, than set it to false. If the value is false, set the error message”. As you see, there is some room for improvement here: there is no need to set the value to false if it is not true because it is already false.

When you code, think what you write. The code above tells that the author either does not know PHP well enough or he is not thinking clearly.

Speaking too much

Recently when I communicate with people in various languages, I started to notice that people talk too much. They repeat themselves may times using different words, often speak about unrelated things or completely off topic. Sometimes it takes 5-10 minutes to discuss something, which could be discussed 2x faster.

When you need to communicate to others, make sure that you know your subject and what you want to say. Don't let others sit and think: “What does he really want to say?”

Nov 20, 2014

How to change number of recent places in save dialogs on OS X

I have to save files to various locations from time to time. There are many such locations and my side bar is quite long. Adding more and more items there is not a convenient option because such locations often have short living time. It also clatters the side bar.

Fortunately save dialog has recent locations but unfortunately it is limited to five items. I spent time searching for ways to increase this limit and found it:

defaults write .GlobalPreferences NSNavRecentPlacesLimit -int 10