Vim Adventures

An interesting mini game to learn vim.

How 5 Tech Giants Make Their Billions



How to reset iphone/ipad without the icloud password?

The icloud prompt could keep coming up asking for the icloud password. It sucks when you forgot the icloud password, and at the same time forgot the password to your corresponding email.

Factory reset (Settings -> General -> Reset) won’t do it, coz after the reboot it will again keep asking you for the icloud password. And there is no way to log out or switch the existing icloud login username.

You will have to reset it with the DFU mode. You will need iTunes.

Entering DFU Mode on iPhone, iPad or iPod touch

  1. Plug your device into your computer with a USB cable.
  2. Turn off the device.
  3. Hold the Power button for 3 seconds.
  4. Hold the Home and Power buttons for 10 seconds.
  5. Release the Power button but keep holding the Home button.
  6. After about 15 seconds you will be alerted by iTunes saying that it has detected a device in Recovery Mode.

iTunes can then factory-reset everything on your device. The icloud prompt will now ask you for a new icloud login.

HTTP security headers

This post has really good info on HTTP security headers.

  • X-XSS-Protection
  • Content Security Policy
  • HTTP Strict Transport Security (HSTS)
  • HTTP Public Key Pinning (HPKP)
  • X-Frame-Options
  • X-Content-Type-Options
  • Referrer-Policy
  • Cookie Options

Why does Python 3 round half to even?

Python 2

round(3.5) => 4.0
round(4.5) => 5.0

Python 3

round(3.5) => 4
round(4.5) => 4

Mainly because:

  • to take away the round-up bias.
  • the result can be further divided by 2, and still an int

Key differences between Python 2.7.x and Python 3.x

Just a short list, not too bad.

  • The __future__ module
  • The print function
  • Integer division
  • Unicode
  • xrange
  • Raising exceptions
  • Handling exceptions
  • The next() function and .next() method
  • For-loop variables and the global namespace leak
  • Comparing unorderable types
  • Parsing user inputs via input()
  • Returning iterable objects instead of lists
  • Banker’s Rounding

Für Elise

It’s: foo e-LI-sa