Sunday, December 18, 2016

Trying to make sense of Starkiller base's demise

Rogue One felt like an old friend I never knew I missed. As several reviews have mentioned, many have considered it the best Star Wars film since the original trilogy, a true hearkening back to the films we grew to know so well and lovr. But Force Awakens came out last year, and wasn't it already quite a resounding success, a return to original trilogy form?

I certainly thought so, and that was why I bought the digital film as soon as it became available. I had little difficulty explaining away most of the plot holes, at least to myself, but one hole kept nagging at me. How did the Resistance take down the Starkiller base with such apparent ease? Or conversely, why did the First Order make their prized weapon so vulnerable, and especially in such a way as to replicate the vulnerability of the two previous Imperial death planets?

Perhaps one key to reconciling this apparently fatal flaws lies in another potential plot hole. Another criticism raised against the Starkiller design is that its attachment to a planet greatly limits its mobility. Unless it could somehow up and move its entire existing planet, the weapon could really only target nearby planets within its fiery canon's range.

Either this design was an incredible overlooked weakness, or it underlies the fact that Starkiller was not an end unto itself. If it could only target planets within a local radius or its orbital trajectory, perhaps the weapon was but a prototype, or at least a first of its class, one of many such weapons to come. We might conjecture that Starkiller was merely a new type of weapon that would be installed on many additional planets, each targeting local New Republic planets within reach.

As one of many, Starkiller would not be the end all, the prized possession which the First Order would defend at any cost. The base would be important, no doubt, but also important would be the ability to construct multiple such bases efficiently and within cost. Even as formidable as a Star Destroyer might be, for example, each ship would have to "cut corners" in the name of reasonable construction costs and time to make the construction of any similar designs feasible.

Similarly, Starkiller would have to work within its design constraints, which meant relying on less than impregnable defenses. And as the first of many similar designs, a 1.0 effort shall we say, of a weapon that harnesses an inherently unstable energy source, the system remained only vulnerable to demise with a critical perturbation of its inner workings.

The Resistance took advantage of this vulnerability and killed the Starkiller base, but their celebration perhaps underlies their own naive vulnerability. The base had destroyed its intended targets -- multiple surrounding New Republic planets -- and many more Starkiller bases are perhaps to come, each situated near additional ripe Republic targets. And if the First Order can in fact learn from mistakes, then these new Starkiller 2.0 bases will be do away with the trench-run-critical-vulnerability once and for all. Or so we hope, at least for the sake of believability.

What made Rogue One feel so fresh was not having to go through such mental exercises to justify the plotline. But hey, there are so many much more skilled people doing the creative heavy lifting to put these movies together in the first place, so props to them for painting the universe we so thoroughly debate and enjoy.

Monday, September 05, 2016

Another try at Matplotlib

Awhile back, I finally managed to install Matplotlib (and Mayavi) through general package management tools on the Mac. Through a combination of Homebrew and Pip and a lot of finagling, my take-3-or-so try at getting the Python graphing libraries to work actually came to fruition.

Some recent feedback on the tXtFL AI prompted me to revisit the modeling software, but alas, Matplotlib was no longer working on my system. When I tried to run my scripts, I got a "Fatal Python error: PyThreadState_Get: no current thread. Abort trap: 6" error. As far as I can tell, the error tracks back to a bug in the latest version of vtk included with Homebrew.

What was odd to me was that the Virtualenv technique I had used was supposed to isolate the dependency chain so that the packages would continue to work even if some of them got updated and broke compatibility with other packages. I realized, however, that the Homebrew package installations take place outside of the virtual environment, so at least the way that I've been using Virtualenv probably does not fully isolate the environment.

Not being able to run a modeler just because of a broken dependency is of course a real bummer, so I set out to find alternative solutions. I've been reluctant to try commercial offerings in hopes of sticking with generalized package management solutions such as Homebrew, but I came across an at least partially open source solution called Anaconda. The trouble with installed Matplotlib from scratch is the sheer number of dependencies (no less than "pycairo, PyQt4, PyQt5, PySide, wxPython, PyGTK, Tornado, or GhostScript" listed on the official installation page), which makes having a dedicated package manager via  Anaconda for these and other Python scientific computing dependencies make perfect sense.

Anaconda offers the option of a complete install ("Anaconda") vs a minimalist install ("Miniconda"), and I went for the Miniconda install to see if I could get by with it. After installing the 64-bit Windows version, I created a separate virtual environment inside it with the Matplotlib and Mayavi libraries as follows:

conda create --name pystat matplotlib mayavi

Apparently including all required packages at environment creation time is preferable. Anaconda pulled in all the other required dependencies and set up the virtual environment. All of these packages apparently are available for new virtual environments as well, which streamlines future downloading.

I'm used to using Cygwin for all my Bash-within-Windows computing, but Anaconda and Cygwin do not appear to always play nicely with each other. I tried at activate the virtual environment within Cygwin, but the detected python appeared to be from Cygwin rather than from Anaconda.

Instead, I dropped into an old-fashioned Windows command prompt and fired up Anaconda from there. A simple "activate pystat" command brought me into the correct environment. I had to learn though that "cd d:\src" does not automatically bring one into that folder, but apparently typing "d:" as a separate command first is required. Clearly I'm a Windows command prompt newbie.

From there, both matplotlib and mayavi worked out of the box. I didn't even need to use the custom launch script that I had used previously. The beauty of Anaconda it is cross-platform, so I next plan to see if it will work as seamlessly back on my Mac as it has on Windows. Or maybe by then, vtk with brewed python will be friend again.

Sunday, June 26, 2016

Crowdsourced Prayer

I've always wondered why we should ask others to pray for us if God hears the prayers even of one--and especially if he knows our needs even before we ask of him. Having others pray for us might seem to be redundant, or if we were to take it to the extreme, even faithless.

One Scripture that comes to mind regarding the prayers of many is from Revelation, where the multitude if prayer is likened to incense being poured out to God. There is no indication that these prayers somehow grab his attention better or that they might get lost otherwise, but rather that just as incense is a way of worship, so also the prayers of many combine to form collective praise to our God.

Asking people to pray for us may then be less about maximizing the chances that God might answer our prayer and instead more about creating an opportunity where more people might worship God. And how does that happen through prayer? By asking others to enjoin in our requests, we give opportunity for more people to see how God answers our requests. By crowdsourcing our prayer, we collectively reap the rewards. Our concerns become others' concerns, and likewise our answered prayers become others' answered prayers.