The World's Loudest Sound ⟶
The sound made by the Krakatoa volcanic eruption in 1883 was so loud it ruptured eardrums of people 40 miles away, travelled around the world four times, and was clearly heard 3,000 miles away.
The sound made by the Krakatoa volcanic eruption in 1883 was so loud it ruptured eardrums of people 40 miles away, travelled around the world four times, and was clearly heard 3,000 miles away.
I just hit the cartography jackpot. This collection has well over 37,000 maps in high-resolution glory. I’ll see you in a few hours…
If you ever see me doodling, odds are that I’m drawing letters and numbers of some kind. I’ve always found alphabets, notations, and writing systems in general to be facinating. Typography is beautiful. Typography in foreign languages, even more so.
Anne Neuberger is Special Assistant to NSA Director Michael Rogers and also the Director of the NSA’s Commercial Solutions Center.
The NSA, Neuberger said, has suffered a particularly “long and challenging year” dealing with the public loss of trust following the Snowden revelations. The agency is reviewing all of its activities to determine how to regain that trust. One change is more open engagement with the public. “This presentation is a starting point.”
Astronomers have discovered that much of the water on Earth—and the solar system—predates the Sun.
This isn’t really surprising, right? I mean, it lines right up with the Genesis creation. Still, thinking about things like this blows my mind.
1 In the beginning God created the heaven and the earth. 2 And the earth was without form, and void; and darkness was upon the face of the deep. And the Spirit of God moved upon the face of the waters. 3 And God said, Let there be light: and there was light. 1
A parenthetical statement that is a complete sentence should begin with a capital.
I used to debate this everytime I’d use i.e. or e.g. in my writing. Not anymore!
Welcome to my new blog! 1 All of my blogging in the past has been in the form of longer articles, mostly technology related, and mostly trying to teach a tip or trick.
I’m taking a different approach this time. I’ll be posting more random thoughts. Sharing articles I find interesting. Overall I expect this to feel more like reading my Facebook wall and that’s what I’m going for. 2
Here goes nothing!
One of the first things you’ll notice in Go is that two different types are commonly used for representing text. string and []byte. A quick example is the regexp package which has functions for both string and []byte.
string is immutable and []byte is mutable. Both can contain arbitrary bytes.
The name “string” implies unicode text but this is not enforced. Operating on string is like operating on []byte. You are working with bytes not characters.
Methods can be declared on both pointers and values. The difference is subtle but important.
type Person struct {
age int
}
// Method's receiver is the value, `Person`.
func (p Person) Age() int {
return p.age
}
// Method's receiver is a pointer, `*Person`.
func (p *Person) SetAge(age int) {
p.age = age
}
In reality, you’d only define getter and setter functions like this if you needed to implement additional logic. In an example like this you’d just make the
Agefield public.
Go doesn’t have constructors in the traditional sense. The convention is to make the zero value useful whenever possible.
type Person struct {
Age int
}
// These are equivalent.
// `p1` and `p2` are initialized to the zero value of Person.
// Neither of these are nil.
var p1 Person // type Person
p2 := Person{} // type Person
// You could also use `new` to allocate which returns a pointer
p3 := new(Person) // type *Person
It is most common to use the struct initializer. e.g.
p := Person{}orp := &Person{}if you need the pointer.