people crave community...through conflict?

The USA is divided in many ways. There are strongly-held dichotomies in all arenas, from politics to sports. People identify with liberals, conservatives, city people, country people, whites, blacks, red sox fans, yankees fans, geeks, jocks, the rich, the poor, kids, adults, skinny people, fat people, fashionistas,  involved people, apathetic people, 420-friendly people, 420-unfriendly people, singles, couples, etc. And many of these identity distinctions are somewhat surprisingly dear to those who hold them, often associated with instantaneous judgment of any opposing groups. Liberal city people don't respectfully disagree with their opposition, they truly think that they are pure idiots! Particular religious people don't turn the other cheek, they declare war on contraception! And it's most obvious of all in sports. "Those a**holes on the other team are so evil and horrible that I just can't stand it!" I actually know people who pack extra cans of gas when they drive through Ohio so as to not "support their economy" for this reason. (Don't even mention the ref when he makes a call against my team! Complete imbecile!)

Within these groups, confirmation bias runs rampant. People surround themselves with like-minded peers, further pushing productive discourse into a neglected and forgotten corner. "You're either with us, or you're against us! And there's no in-between," we say.

I was having a typical conversation at work, discussing life after the next apocalyptic event. It occurred to me as we discussed our plans that the first few days after rule of law falls would be the scariest. People rioting through the streets, looking everything in sight, killing on a whim to get a pretzel or something; every man for himself. During this time, I plan to just hunker down with some PB&J and wait out the craziness. But after a few days, somewhat structured neighborhood alliances would form, enabling me to have a bit of trust in those around me. Instead of every man for himself, it's now us vs. them. And in that situation, I'm feeling much safer. I can cooperate with people again and defend against the neighboring block when they decide to invade again, and so on. Hooray.

Snapping out of this dark fantasy, and thinking instead about our less dire identity complexes, I came up with the following hypothesis.

Humans need safety to survive, by definition. Community groups have historically offered a bit of safety against the roving hoards. As old structures (such as neighborhoods, small towns, and churches) decrease in dominance in the modern US, there is an equal and opposite force diminishing community. Naturally, we have a subconscious urge to regain some community, so we do it the old way, but in lieu of "real" danger, we fabricate enemies through fairly trivial mechanisms (think sports) and in doing so, recreate the good old feeling of being part of "us" where they, those bastards, are part of "them."

If this is the case, then the natural antidote to cure our fabricated identity wars is to bring community back. Things like Facebook show how much we want it, but they are still pretty empty in terms of how well they satisfy our instinctual quest for safety. Everybody knows there's something ridiculous about how pigeon-holed we have made ourselves, but we're all in a kind of daze as to figuring out what to do with our ceaseless and unproductive arguing.

Others have argued similar points, but not quite for this reason. A book review I read in New Scientist of this book explained that this author claims that secular society needs religious institutions to be happy. There may be some truth to that, but trying to promote these ideas coming from an atheist group is just fanning the flames. It'd be nice to get some easy community going that is inclusive to both religious people and secular people. Maybe after cookies-and-punch hour we could all get together on Sunday afternoons and have community members give little talks about things they're good at, or a news story they've been following closely. There could be like 10 rooms, and you can go from one to the other depending on your interests. The mechanics could host a "learn to change your own tire day." If we could somehow institutionalize these kinds of gatherings, thereby giving people a little community, I think the ridiculous arguing would slow down, and we might feel better about ourselves.

Posted in random rant | 1 Comment

how to fix: ctrl-c closes ipython within console2

Just FYI, I was having a problem with ipython 0.12 running within Console, where pressing Ctrl-C to cancel an operation in a Python would actually just close the whole ipython window! It was horrible, since before I reinstalled everything it wouldn't do that. Anyway, there's an email chain talking about this here, but it's irrelevant to this particular problem, since I'm using mainline (non-dev repo) versions and don't know what an ETS is.

Thankfully, there's a very simple solution (assuming you made my same mistake). Rather than setting the console tab to C:\python27\scripts\ipython.exe, instead set it to C:\python27\python.exe C:\python27\scripts\ipython-script.py and Ctrl+C will give a KeyboardInterrupt and leave you in ipython, just like the good old days!

Posted in computers | 2 Comments

Building a python extension with Trilinos 10.10 on 64-bit Windows 7

Continuing the journey, the folks at work upgraded me to 64-bit Windows 7 and the Trilinos folks updated to 10.10. Needless to say, I had to rebuild. I can't definitively say which of these steps is necessary but I can tell you that if you follow them, you can compile a C++ python extension that uses many aspects of Trilinos on this system. And not just a few packages from Trilinos either. In fact, I'm currently using all of the following:

  • Epetra
  • AztecOO
  • Anasazi
  • Teuchos
  • epetraext
  • Amesos

To do this, first run the trilinos cmake system without shared libraries. Then build. This builds things like epetra.lib. Now, go back and turn on shared libraries and build again, this time with shared libraries turned on. This builds the dlls, which I believe are required to build a python extension. If one of the ones you needs fails, just go in to Visual Studio 2008 and open up the Trilinos solution. Right click the project. Change from a static library to a dynamic librray. Change Use of MFC to "Use MFC if a Shared DLL." Change Use of ATL to "Dynamic Link to ATL." The rebuild the package. The DLL should be created.

Build trilinos shared library

VS 2008 options to build shared libraries

Once all the static and shared libraries are built, I didn't even mess with environmental variables (being a grad student and all) so I just copied them all into the build directory of my Python extension. On import, it worked just fine. Amazing!

I have yet to try linking to MSMPI and running large reactor problems on Microsoft HPC but that will be coming someday.

Posted in computers, nuclear | Leave a comment

US nuclear scientist considers assassination of Iranian utterly despicable

It's unclear who assassinated Iranian  nuclear scientist Mostafa Roshan by driving by his car on a motorcycle, placing a magnetized explosive designed to damage the inside of the car but not the outside, and then speeding off through the packed traffic by lane-splitting. Some Iranians have their opinions:

Thousands of mourners chanted “Death to Israel” and “Death to America” on Friday during the funeral of a slain nuclear expert whom Iranian officials accuse the two nations of killing in a bomb blast this week as part of a secret operation to stop Iran’s nuclear program.

- The Washington Post

Even some western experts have claimed that it must be Israel:

"If you look at the choice of target, it really could only be Israel,'' says Robert Baer, a former CIA agent in the Middle East.

On the other hand, some suspect that certain factions of the Iranian state could have done it due to their suspicious of disloyalty and involvement with western institutions. And in that case, the following message is basically irrelevant.

Perspective: I'm a run-of-the-mill US nuclear scientist working on advanced nuclear reactors to help mankind get energy to improve quality of life.

If Israel and/or other western-like states did this, shame on them. Covertly killing scientists is nothing but counter-productive towards any imaginable goal. The enraged Iranians will likely place a more pressing national priority on developing nuclear weapons, and make it even more secret. In this case, you're not scaring people from going into the industry, but instead you're inspiring them to become national heroes. You're not causing meaningful set-backs in terms of Iranian expertise, the industrial knowledge to manufacture weapons is somewhat well-known. All you're doing is justifying their quest for nuclear weapons (who would risk losing a major city for one botched assassination attempt?) and making them more angry with the oppressively powerful west.

Countries with nuclear weapons are acting like overgrown bullies on the playground who got held back a few grades. When some less powerful country tries to pick up a stick, the bully smashes it out of his hands and says: only bullies can have sticks. The non-proliferation treaty was meant to prevent the spread of nuclear weapons AND to reduce the nuclear capabilities of the nuclear states to minimal levels. The latter has not happened (as is thoroughly detailed in this wonderful book). I fully understand and support non-proliferation, and accordingly I would like to see more reasonable attempts at stopping the spread. Until we live in a world where all nations can be comfortable in their sovereignty, the non-nuclear states will try to get nuclear weapons. The posturing we're seeing now, and this and other similar assassinations will only lead to more people trying to get nuclear weapons, in any possible aftermath. These are the most horribly destructive weapons known to man, and indirectly promoting their spread by bickering about minutia and/or invading countries for minor reasons is an extreme disservice to mankind. You're nourishing seeds that will last for generations telling people that they aren't safe until they have nuclear weapons.

Posted in nuclear, random rant | Leave a comment

old schwinn exercise bike fun

At Smashputt 2012 last night, there was a random old Schwinn exercise bike like my mom use to have. I made Kylie and Caroline ride it like my sister and I used to: one person on each pedal!

Awesome bike. It even had the dinger!

Here's a really dark video that kind of shows how much fun it was

Posted in seattle | Leave a comment

favorite programming language jokes

These started coming up at work and people kept chiming in new ones. Here's a list. Sorry in advance for the offensive one.

  • What's a pirate's favorite programming language?
  • What's a miner's favorite programming language?
  • What's a hispanic's favorite programming language?
  • What's a diver's favorite programming language?
  • What's a mongoose's favorite programming language?
  • What's a Seattleite's favorite programming language?
  • What's the army's favorite scripting language?
  • What's the little mermaid's favorite scripting language?
  • What's Beethoven's favorite programming language?
  • What's a Frenchman's favorite programming language?

Hilarious. Answers below.

Continue reading

Posted in computers | Leave a comment

building a python extension with trilinos on linux and windows

Continuing my python extension project, I've now successfully built a toy python 2.7 extension in C++ that uses the Epetra package from Trilinos 10.8. I've built it on Ubuntu 11.10 (with gcc) and on Windows XP (with Visual Studio 2008) using distutils. It's a bit of a hack, but it works and is a path forward for me.

I started with Linux, because I figured it would be easier. I learned a few things along the way. First, you have to have built Trilinos with shared libraries enabled. This is required for how Python handles things, I guess, and is made clear under the heading "Shared Libraries" in this file. The PyTrilinos package (which is effectively a professional set of python-trilinos extensions, btw. I needed a custom one!) needs them as well. So run your cmake-gui and check the shared libraries button. Besides the libepetra.a in the build folder, you'll now also find a libepetra.so. In Windows, you'll get >500 errors if you compile all of trilinos with shared libraries, but Epetra at least worked.
Continue reading

Posted in computers, nuclear | Tagged , , | Leave a comment

my experience compiling against Trilinos on Ubuntu

I'm just embarking on a historic journey to learn a bit about the Trilinos math library.  To get started, I've gone through the hands-on tutorial a bit and after a few tries, I've gotten something compiled.

Trilinos 10.4 is available in the repositories for Ubuntu (11.10 confirmed). But Trilinos 10.8 is out now, so I had to build my own. Their instructions with CMAKE were quite good and the build process didn't have too many hiccups. I found that the cmake gui is the way to go. Make sure you enable Didasko (the tutorial) in the cmake gui. When you do this, a few more Didasko options show up so you have to go enable those too.
Continue reading

Posted in computers | Leave a comment

Speed of python dict access methods (direct vs. get)

In Python, a data from a dictionary can be retrieved using either direct key access (e.g. daysIn['January']=31) or through the get method (e.g. daysIn.get('January',31). In the first method, if a key does not exist, there will be a KeyError exception raised. In the get method, if no key exists, the optional default value (31) will be returned with no error. This is well-documented here.

I've been interested in accessing very large dictionaries very quickly for a nuclear reactor simulation code I'm writing for my thesis. For a large core (3000+ regions, 6 mesh points/region, 33 groups), the scatter matrices easily make dictionaries with 16 million entries or so. Since scatter matrices are fairly sparse, I've saved memory by only entering non-zero values. Then, looping back through, I just used get. It was slow though. I wondered whether saving the non-zero keys and accessing the dictionary directly would be much faster. So I ran a test with various amounts of data density. Low density means there are more zero entries.

Dictionary Timing Results get vs. direct

Dictionary access timing results for various amounts of data sparsity

In conclusion, directly accessing remembered keys converges to not quite twice as fast for full dictionaries. Good to know.
Continue reading

Posted in computers | Tagged | Leave a comment

How about a nice game of chess?

Here's a random one. I've had this talking electronic chess board since 1994. It's called the Sharper Image Design Talking Chess Companion. Model SM 470. It's awesome and wonderful and I can't find any commentary on it on the internet. Therefore, this. I've taken the attached video showing Chester in all his glory, and with all of his loving phrases. Such as:

Hi! I'm Chester. How about a nice game of chess?

Sure you're playing better but your taking more time than me.

Now I've got you!

How about a draw?

Many good times hanging out with old Chester. They did a great job putting in tonality into his commentary. It's really like playing with another person. I only wish the random number generator had him do other openings more often. I've never really used the tournament openings mode, but I'm kind of curious. I wish I still had the manual. Anyway, the best part is that I know that my 4th-grade self is better at chess than my current self because I used to be able to easily beat Chester on a higher level than I can now.

Posted in Uncategorized | 1 Comment