Amazon stock keeps falling

After Amazon announced that nobody is buying their Fire phone, their stock took another tumble. I don’t know why people invest in Amazon. There’s no way you can understand when to buy or sell it because Jeff Bezos runs it like the world’s largest nonprofit company. Their revenue is huge, but their income is non-existent, and he’s run the company like that forever. IMHO, a responsible investor can’t invest in a company like that because there is income (or EBITDA) to base a value on.

Scala tip: Easily create lists of test data with Ranges in Scala

If you ever need a list/sequence when testing some Scala code, don’t forget this simple technique:

scala> val l = (1 to 10).toList
l: List[Int] = List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)

Of course you can do many other things to your list if you want, such as multiplying each element by 2, like this:

scala> val l = (1 to 10).map(_ * 2).toList
l: List[Int] = List(2, 4, 6, 8, 10, 12, 14, 16, 18, 20)

You can do this with characters as well:

scala> val l = ('a' to 'k').toList
l: List[Char] = List(a, b, c, d, e, f, g, h, i, j, k)
Syndicate content