This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Default variable if not set | |
[ -z "${var:-}" ] && var="Default..." | |
echo "$var" | |
# array declaration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.collection._ | |
import com.twitter.util._ | |
scala> val buffer = mutable.ArrayBuffer.empty[Int] | |
scala> println(Time.measure { (0 to 50000000).foreach { buffer += _ } }.inMillis) | |
17610 | |
scala> var vector = immutable.Vector.empty[Int] | |
scala> println(Time.measure { (0 to 50000000).foreach { vector :+= _ } }.inMillis) | |
7865 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.