Zitat Schülerpraktikant

Wenn einen der Schülerpraktikant fragt: “Gibt es in Swift auch so etwas wie statische Klassen wie in Java?”, dann weiss man, …
– Hier hat jemand etwas schon ziemlich gut verstanden
– Es könnte sein, dass dieser Schüler mal ein Programmierer wird
– Solche Sätze sind der Grund, warum wir uns mit Schülerpraktikanten belasten. Und warum wir stolz darauf sind, das zu machen. Und warum es auch manchmal Spaß macht.

Übrigens: Wer nicht versteht, was gemeint ist – egal. Ich glaube man kann auch als Nicht-Programmierer ahnen, dass das ein ziemlicher Fach-Satz von einem Jugendlichen ist.

Und zuletzt die Auflösung der Frage: Ja, die gibt es, sie heissen in Swift “Type Methods”, werden func class mymethod() geschrieben und myclass.mymethod() aufgerufen.

Xcode Project breaks after png added

From time to time we have pupil interns. Our last intern, let’s call him John started some Xcode Swift programming and all was fun and great. After more than a week of successful programming small pieces of this and that he created a png picture file using the gimp editor. He then pulled the file into the project and from that minute on, Xcode did not want to compile any more.

It turned out, that the problem was the copypng perl script used by Xcode (found here: Programme ▸ Xcode.app ▸ Contents ▸ Developer ▸ Platforms ▸ iPhoneOS.platform ▸ Developer ▸ usr ▸ bin). Since the intern had created a subdirectory called John`s programs, he had a directory name with not only a space, but also a capital letter and a quote in it (I can not guarantee the particular type of quote any more, but I think it was the one I used above).

When I think back of the times where just on of the three was forbidden or problematic, I still shiver and I have to admit, that I am still a little bit superstitious regarding the use of blanks in directory names, even nowadays.

It turned out, that while compiling the swift files with that quote char in the file name did work, it did not work for the copypng perl script.

We changed the directory name and all went well a second later.

Filed a radr (bug report), Number 19653543

Swift and Core Data hiccups

When we decided to add core data to a swift project, we thought, a simple drag and drop of the core data model file would do the job. After some time wondering why it did not work, we finally found out, that xcode did not compile the file correctly, creating only a mom-file and not the momd-file package. The fix was easy, of course. We only had to create a new core data model file using New->File->… and then to copy the content from the old to the new model, which then worked as expected.

The other surprise of that day came while trying to access the class that we had created using Editor->Create NSManagedObject Subclass. We could not correctly use the subclass as we had done it using Objective-C. Again, after some minutes I remembered, what I had read in the iBook “Using Swift with Cocoa and Objective-C”, that since Swift has no flat class model, we needed to include the class name into the Class-Field of our Entity.

We did that by selecting the entity, opened the model entity inspector and prefixed our entity class with the project name separated by a dot. I just wonder if that class name ( e.g. project.entity ) would still be accessible using Objective-C as well. May be I’ll try that next time.

Stupid Spammer sends me his Spamtext-Generator Input

Hello, today I received multiple Spam comments in my WordPress blog. One of them is interesting, because due to an error on his side, the stupid spammer sent me a long, long text of what seems to be the input to his Spam-Text-Generator. So just in case you want to write a Spam-Detector, here is the input you need – at least for this particular sort of spam (long, sorry). If you are not a programmer, in order to read and understand this “text”, consider all parts between braces “{” and “}” as different choices that the text generator will have, all separated by “|”. This is a typical formal syntax description technique in computer science, nothing special, more or less. Have a SPAM free day! Best regards, Thomas

{
{I have|I’ve} been {surfing|browsing} online more
than {three|3|2|4} hours today, yet I never found any interesting article like yours.
(...deleted...)

Self-Referencing SPAM

Today I got a spam post, that was referencing spam. It read

Hi, i read your blog from time to time and i own a similar one and i was just wondering if you get a lot of spam remarks?

So let me answer on this: Yes my dear, from people and spam-bots (programs that create spam and thus behave like spamming robots, thus called spam-bots) like you!

If so how do you protect against it, any plugin or anything you can suggest?

As you know by having commented on my blog, I have a plugin that should protect me, but  it does not (good enough), as we can see by your spam entering nonetheless.

I get so much lately it’s driving me crazy so any assistance is very much appreciated.

No. Instead I wish you tons, tons, tons of spam! All the best, Thomas

P.s.: If you are a spammer, feel free to comment below… <sigh>

Why do we type passwords twice?

Sometimes we stumble upon websites that ask us to enter our information twice. Some even try to disable the ability to copy and paste the information from one field to the other.

Any idea, why this input method was invented?

It was invented, because it helps to find typing errors, especially in fields like password entering fields, that do not show which characters you typed, but instead show dots or just plain nothing.

It was not invented to torture the customer, but to help her. Now look at this field:

Bildschirmfoto 2014-07-25 um 15.23.54It asks you to retype the
email, not the password.

Why?

Because the password is probably sent to us by email anyhow. And if the email is wrong, then the password can not be sent to the customer.

Now I wonder: Is that a

  • clever idea
  • fail
  • nerdy solution

to the problem, that either the email or the password could have been mistyped? What do you think?

1000+ Downloads on our Android Apps

Teltow, 30.5.2014

Today we can celebrate the 1000th download of one of our Android Apps since we started publishing Android Apps.

According to the Google reports we get from Google Play Store, we started two years ago, on the 20.6.2012 with our first download, we reached the 500th download on 11.11.2013 and the 1000th today, the 30.5.2014. We have sold 23 paid apps, 1001 apps are reported as “downloaded” and about a fifth of them, 212 are still installed.

I have no idea how Google knows, if an app is still installed on the phone of our customers, they probably get a notification when an app is installed or deleted.

Btw.: The “installed” number is not available by Apple for their apps, so Apple knows less about their customers than Google does.

Beware of iPhone “Restrictions” mode

When sitting in a cafe with two other smartphone users, we spoke about “kids-safe” restricted mode in the different smartphone systems and how they differ from the restrictions mode in the iPhone. In order to demo (and try it out), I did set my iPhone in the restrictions mode “on” and we analyzed and nodded about nearly all the features.

What surprised my, was, that my self-programmed apps where still there – obviously you have to load them from the app store or my apps where missing some information that app store apps have e.g. like age restrictions.

Then it was time to set the settings back to normal and there came the shocking moment: All Icons were in disorder, they had left their groups, the sorting in the home-screen pages on the iphone were a mess.
I wondered, what would have happened, if I would have had so much icons that the sheer number would not fit on the screen, because I had them all grouped? If you know, feel free to comment.

Of course, I could have made a backup, or re-loaded a previous backup, but unfortunately, I did not know about this hazard and I already had made changes after my last backup a day ago.

So my learning from this experiment: Kids restrictions settings are not for temporary use. If you want to hand over an iPhone to a kid, put it in restricted mode only, if you can live with the disorder afterwards or if you had over the iPhone for a longer time. Or make a backup before handing over.