Division in Python 2 vs 3

One major change in Python 3 is the implementation of the division operator /.

In Python 2 the division yielded a floor rounded integer when dividing two integers but a float when using a float as divider or divisor. Due to Python’s weakly typed nature this behavior could lead to some issues. So PEP-238 changed the behavior of the operator in Python 3 and introduced a new operator // in Python 2.2. Let’s have a look at the different behavior

 Python 2Python 3
1 / 200.5
1.0 / 20.50.5
3 / 211.5
3 // 211
3.0 // 21.01.0

If You want to use the new behavior of operator / from Python 3 in Python 2 you can do:

from __future__ import division

So have fun when You divide and conquer 🙂

Debunking 3 iOS Development Myths

Let’s debunk some myths about iOS development:

Myth #1 – You need to code Objective-C

False – since 2014 you have an alternative: Swift. This language is open source under the Apache License 2.0 (since Swift 2.2) and even runs on Linux

Myth #2 – You need to be enrolled in the Apple Developer Program

False – To develop your app and test it on your own device you just need to have an Apple ID which You likely already have if you’ve ever purchased something in the iTunes or app store.

Side note: If you are looking forward to integrate Siri or Wallet or iCloud into your own app you’ll have to pay. Bummer 🙁

Myth #3 – You need to own a Mac (iMac, Mac Book, Mac Pro)

In theory yes, because you have to run XCode which is only available on Mac OS X. But wait: What if I run Mac OS X elsewhere? You can use a VMWare or Virtual Box as well or even build your own hackintosh.

 

 

My first iPhone App

After carrying around my iPhone 6 for two and a half years I finally wanted to know how to build an iOS app.

Getting started

I used this tutorial from apple and rolled with the punches:

Installing XCode

takes ages!  Download 4,6 GB 🙁

First issue: when accidentally making the wrong connection between a UI-Element and the ViewController (@IBOutlet instead of @IBAction) You have to remove the connection in the code _and_ in the storyboard via context menu.

First own app

After I was done with the tutorial I wrote an app I always wanted to write:

A music player app to make learning songs easy. Use case: You want to learn a solo from e.g. Metallica’s “Nothing else matters” and You want to play along the music.

Requirements so far:

Continue reading “My first iPhone App”

New Year’s Resolutions & Technology Learning Roadmap 2017 – Update

In New Year’s Resolutions & Technology Learning Roadmap 2017 I listed all my tech and non-tech objectives for 2017. Here is a quick update:

After I bought my new Mac Book I asked myself: “Why haven’t I tried to develop an iOS app before?”
Well, I think it had something to do with Objective-C which I considered awful back in the days. But since 2014 You have another option: Swift.

The language looks a lot better to me, somewhere between Java and Python.

So I gave it a try and started the first tutorial. And -tada- there are two new objectives on my list. “Write an iPhone app” and “Publish app in app store”.

To get on with the objective “Learn Angular 2” I bought the course: “Angular2 verstehen und anwenden” on Udemy for 10€

 

SE-Radio Episode 281: James Whittaker 

SE-Radio Episode 281: James Whittaker on Career Strategy

In Episode 281 of SE Radio James Whittaker shares his knowledge on career strategy.

James Whittaker was Engineering Director at Google before he left for a position at Microsoft. He also wrote the book “How Google tests Software”

In his blog article he tells us why he left google

Takeways:

  • Don’t seek a mentor in your boss
  • Don’t strive for salary or position but for impact

Future Mobility Days 2017

After I visited my first barcamp (#SWEC16) in 2016 I wanted to participate in my first hackathon in 2017. I stumpled upon the Future Mobility Days #FMDNUE in Nuremberg, which offerd a bar camp, a design thinking jam and a hackathon all at once at on place within 36 hours. All in all for 99€ quite a bargain. And a additional motivation to get a new laptop for the hackathon.

Don’t count your chickens before they are hatched.

Of course I missed the early bird priced tickets so I had to pay the full 199€. And then there is this little topic called health. Becoming older is no walk in the park. The days before the event I realised that the conecpt of hacking for 24 hours with little to no sleep was not going to apply to me. Dang!

Nevertheless I was excited to go to this event! Continue reading “Future Mobility Days 2017”

Short Rewiew t3n magazine Q2-2017

Being sick at home can become quite boring after a couple of days so I was happy today as I opened the mail box: (Yes, the physical one😜) the new t3n magazine! Yeah!

Nice cover!

First of all I remove all advertising garbage by shaking the magazine, but lo and behold, there are some nice stickers in it. Perhaps I share them with my daughter.

These are the topics I will definitely read:

Developer Toolbelt

Inspired by the Blog Post https://gingter.org/2016/12/15/my-developers-toolbelt-2016 I want to share what my tool set looks like in 2017:

  • PyCharm as main IDE for Python, JavaScript, CSS, HTML and Rust
  • Notepad++ for big files
  • Spotify for getting into “the Zone”
  • WinSCP and Putty for Secure FTP and SSH / Telnet access to our servers
  • Total Commander for browsing the harddrive
  • Beyond Compare 3 for diffing
  • Firefox with SQLite Manager
  • yED for diagrams
  • Luxafor for distraction management
  • Perforce P4 Visual Client
  • Outlook / Skype for Business
  • Wire
  • Github OSS
  • Bitbucket for private Repos
  • Atom for educational purposes
  • iMacros / Greasemonkey for browser automation / optimization

I really love PyCharm and it gets better with every update. To get the same user experience for full stack web development You would need to configure Eclipse-based PyDev with a whole bunch of Eclipse plugins

Are You ready? / jQuery struggle

$(function() {
    console.log( "ready!" );
});

is the short form for:

$( document ).ready(function() {
    console.log( "ready!" );
});

Very intuitive, this does not work:

$("input#myInput").bind("change", function(){
});

Instead of “change” You have to use “input”

$("input#myInput").bind("input", function(){
});