Earthquakes in Nepal

On April 25, I sort of rushed this post out with no real content except links. This caused the blag plugin to complain. So for what it’s worth, I’ll add some content, specifically about earthquakes.

I’ve only been in one real quake. Real by Eastern US standards anyway. Virginia had a five point something that did damage to some buildings in the District of Columbia and shook my house near Philadelphia. I tweeted about it at the time under another account. The shaking lasted for a good long while and got me thinking about exiting the house. Fortunately, no actual damage was done. It was a bit unnerving though.

The USGS site I link to below is an interesting resource for earthquake information. Quakes more powerful than 2.5 on the MMS scale happen daily. That’s just powerful enough that you know it isn’t a truck driving by. The scale is logarithmic. A 3 has ten times the energy of a 2. Unfortunately, there is no real way to convert the strength of an earthquake into megajoules or megawatts, depending if you want to know the total energy released or the peak power.

This leaves us with a rather fuzzy comparison for the strength of two quakes of the same energy. Time is also a factor. The more shaking that goes on, the more damage that can be done. But what is more? Are we talking peak amplitude or simply duration at a specific amplitude? I don’t really know how that works on the MMS scale. This prevents doing a comparison of an earthquake to something like an atomic bomb or a tornado.

So what happened in Nepal? There were actually several quakes along the same fault line over the course of the day. Two were moderate and the one that made the news was major. I doubt the extent of the damage and casualties has been completed as I type this. It’s only the day after. It takes some time for all the assessment to be done.

The USGS tends to modify its numbers as more data comes in. It takes seismic waves some time to travel. Detectors around the world pick up the waves and transmit the data to the USGS and others. The data is collated as it comes in. This is one reason why you see different numbers reported. It is also possible that some numbers are based on the older Richter Scale. They don’t quite translate.

We live on a geologically active planet. Volcanic activity is pretty much a daily occurrence somewhere. And so are weak to moderate earthquakes. Fortunately the major earthquakes are rather less frequent. You can still expect to see them around the world every few years though. It also doesn’t much matter where you live to feel a moderate earthquake sometime in your life. There are fault lines all over this planet. Some are simply more active than others as the tectonic plates slide around on the mantel of the Earth.

Video embedded from LiveLeak.

If that doesn’t work for you, try here.

http://www.liveleak.com/view?i=e78_1429996092

USGS Earthquake site.

http://earthquake.usgs.gov/earthquakes/

USGS Earthquake page for the big one in Nepal today.

http://earthquake.usgs.gov/earthquakes/eventpage/us20002926#general_summary

Yes, Back To Basics

The problem I’ve been having with the UICollectionView has been solved by vacawama on Stack Overflow. The question I posted, along with the responses I got are here:

http://stackoverflow.com/questions/29715269/uicollectionview-not-sized-or-rotating-properly/29719673

It has been pointed out, correctly, that my manner of asking the question was not ideal (paraphrasing here). I won’t excuse myself. Still, I couldn’t think of any other way to do it. I had no idea where the problem lay. I didn’t think pulling from GitHub would be a huge burden. I was probably wrong on that point even though vacawama took it up.

Now I can go back to the app that really matters and fix the collection view there. I’ve also committed the fix, with credit, to GitHub. So anyone with any interest in a modern way to implement Apple’s CollectionView-Simple example in Swift 1.2 can pull down that project and play with it.

It’s something of a stress relief that the problem was solvable. I just wish I knew how the view options got screwed up.

Back To Basics?

I’ve been working on a simple (relatively speaking) app that I thought would be useful at conventions and such. The key UI element in this app is a UICollectionView. Apple has a demo app for using it called CollectionView-Simple. It works just fine as given. However, I’m using Swift 1.2. So I translated the example with a project starting from scratch.

It doesn’t work.

OK, it sort of works. But the collection view does not draw properly. It also draws differently on different devices. But the thing that is really bugging me (apart from not being able to solve this little issue) is the device rotation. The view is supposed to redraw itself to fit the rotation. It’s not doing that.

To be honest, this is driving me mad. I’m sure I’ve looked at every option in the storyboard editor (Interface Builder) to make sure that all the settings are the same as in the demo app. I can’t find a discrepancy. Except for rotating the device to a different orientation, the app works properly (so far as I can tell).

The WWDC is coming up in June. It would be nice to have my app on the iTunes store by then. But I must confess that little issues like this really do drag me down mentally. If there is anyone out there who can figure out the issue, I sure would appreciate it.

Here is the project on GitHub.

https://github.com/DavidSteuber/CollViewSwift