performance

iPhone/iOS: How to quit using cellular data when using WiFi

I live in Colorado, where cellular reception can be very hit or miss. As just one example there are only two spots in my apartment where I can make a phone call. So when I’m at home trying to view a website using Safari on my iPhone and the page is loading really slow, I find it really annoying that my iPhone is trying to use my cellular data rather than my home wireless network (WiFi).

Note: Apple implies that the cellular data is “assisting” the WiFi, but with the poor cell reception here, I can confirm that this feature just slows down my iPhone internet speed.

A Scala method to run any block of code slowly alvin August 5, 2017 - 5:36pm

The book, Advanced Scala with Cats, has a nice little function you can use to run a block of code “slowly”:

def slowly[A](body: => A) = try body finally Thread.sleep(100)

I’d never seen a try/finally block written like that, so it was something new for the brain.

In the book they run a factorial method slowly, like this:

slowly(factorial(n - 1).map(_ * n))

FWIW, you can modify slowly to pass in the length of time to sleep, like this:

def slowly[A](body: => A, sleepTime: Long) = try body finally Thread.sleep(sleepTime)

What an employer looks for in an employee

“There is no ‘try’”

Yoda

As a small business owner, I classify employees in three categories:

  1. If employees have basic good qualities, I’d try to keep them through good times and bad.
  2. If they were “problem” employees I got rid of them very quickly.
  3. If employees had exceptional performance, they got the big raises, and I considered them as potential business partners.

Here’s a quick look at those three categories.