Archive for the ‘Technology’ Category

Unscientific America, a nonreview Part 1

July 19, 2009
Stepping out

Stepping out

Lately there’s been a lot of talk about Chris Mooney’s and Sheril Kirshenbaum’s latest book, Unscientific America. I have not yet read this book. I would like to, but burdened already underneath a huge reading list and too many projects, it is not likely I will have a chance to do so. So this, unlike other reviews of the book out there, will be a non-review. I think it is good that they have sparked some discussion, although much of the discussion seems to have been focused on the wrong things. From the review I linked to above, much of their discussion seems to not have been backed up with sufficient evidence and they don’t seem to have really addressed the root causes of the problem, if in fact, there is a problem.

They seem to lay part of the scientific illiteracy problem at the feet of the so-called new atheists. Apparently spending a couple of chapters to do so. The thinking seems to be that outspoken atheists alienate people and drive them away from science. They single out P.Z. Myers and Richard Dawkins as the poster children for this so-called bad behavior. There is a strong anti-science component in the U.S. There are people determined to undermine science education and public policy choices informed by good science. In strong part, this component is fueled by religious fervor and thinking. People like P.Z. Myers are addressing this, and rightly so. The muddle headed anti-critical thinking that is often inspired by religious thinking needs to be pointed out, and when necessary, mocked. One of the factors, according to their blog, Moony and Kirshenbaum, decided to leave science blogs was the “Crackergate” affair (Google it, if you haven’t heard about it. I’m too lazy to go digging around for that at the moment.). This just borders on the bizarre. It was not directed at them. In fact, the whole thing should have been merely a barely noticed minor blip on the “blog-dar”. The fact that it got so much attention speaks far more about the disproportionate reactions religious thinking inspires than anything Myers did. This fact seems to have been lost on Mooney and Kirshenbaum.

Nevertheless, Mooney and Kirshenbaum do a service on at least helping to spark some discussion on addressing scientific illiteracy. I don’t think a case is clearly made that it is a growing problem, but I think we are probably safe in assuming that we, as a nation, are not as literate in science as we could be. I think there is some discussion to be had on just how literate is enough. Not everyone is going to be needing to figure out how to do lattice gauge calculations, or what have you. Certainly, as a representative democracy, we need to be able to carry on a public discussion about climate change, recognize the need for vaccines, alternative energies, and so forth. There are several contributing factors to anti-science thinking in the U.S. Religion is one of them. The other is that same democratic spirit that made helps to define our national character. “I don’t need no ivory tower scientist to tell me how things work!”. Yankee ingenuity, all of us are equally capable, no elites necessary. I personally know several people where these traits combine to make the perfect storm. “Creationism is just another viewpoint! It should be taught in the schools on at least equal footing!”. These are factors about which very long discussions can be had and perhaps we’ll explore these further in future posts (I’ve already hit on these a few times myself), though feel free to tackle them in comments.

The suggestion that Mooney and Kirshenbaum make is to pave the way for an increased number of literate science communicators, modeled after Carl Sagan. Get scientific ideas out to the public and help them understand what we’re doing, and how things work. Chad Orzel, over at Uncertain Principles is running with this ball. I certainly agree that it is important to get ideas out there. To enable people to see a little better how the world works, and how it effects daily lives and public policy. It is an important mission. Of course, in fact, there are plenty of good science communicators out there already. There is Chad Orzel, of course. We also have Phil Plait, Sean Carroll, et al, P.Z. Myers (linked to earlier), Jennifer Oulette, Neil deGrasse Tyson, Ken Miller, and many more. My first thought is not that there is a lack of good science communicators, but many are lost in the white noise of everything available on all the different available media. With a few exceptions (Phil Plait on Coast to Coast radio, for example), one has to seek these guys out. There is a preaching to the choir effect where those who are interested and motivated by science will find these good communicators. We have to nurture the interest, and I think this starts with a good education, along with something that will engage imagination and curiosity.

So to start with examining such matters, and to throw in a few thoughts, I’ll look to myself as an example. What motivated me to go into science? What were the initial seeds? One of course, was museums. Visiting air and space museums and natural history. Another was the movie 2001, A Space Odessy”. I had no idea what this movie was about as a kid, but the awesomeness of space exploration was firmly transfixed in my mind and inspired me to learn all I could. Another factor that contributed to my motivation was the lunar landing of Apollo 11 on July 20, 1969. Getting humans to the moon, and then back, was a stunning achievement, not only for America (after all, it was a competition with the Soviets), but for all humanity. This motivated many young minds at the time into studying science and engineering.

It is now 40 years after this stunning achievement. Friday night, I saw nothing on T.V. celebrating this. Aside from a few obligatory film footage shots on CNN this morning and a good article in the LA Times, the media have been relatively quiet. Is this part of the problem? What can be done now to make the type of inspiration stemming from Apollo 11 part of our national fabric?

Advertisements

The Iran problem and theocracies

June 28, 2009

One of the larger pieces of news over the last few weeks was the Iranian election. Or what passes for an election anyway. As I’m sure everybody has heard by now, Mahmoud Ahmadinejad, was allegedly re-elected and Mir Hossein Mousavi, was apparently not. As Mousavi seemed to have a lot of popular support this shocked many Iranians who took to the streets to voice their disapproval. The regime, led by Supreme Leader issued stern warnings and eventually cracked down on dissent with violence. This was accompanied by an attempt to control information. Not allowing journalists to properly cover events, and attempting to control and censor the internet connections to and out of Iran. Typical of a theocratic mindset. We see the same thing on a very small scale on some religious blogs. Post a sound rebuttal to some argument and it is deleted, at least at some sites. Can’t let people see that. Fortunately, the educated populace of Iran managed to skirt around some of these issues and get videos posted to youtube and so forth.

But what about the internet censorship? Apparently two companies are involved in developing the technology to help the religious leaders of Iran monitor and possibly block internet access, Nokia, and Siemens. From the article:

in confronting the political turmoil that has consumed the country this past week, the Iranian government appears to be engaging in a practice often called deep packet inspection, which enables authorities to not only block communication but to monitor it to gather information about individuals, as well as alter it for disinformation purposes, according to these experts.

The monitoring capability was provided, at least in part, by a joint venture of Siemens AG, the German conglomerate, and Nokia Corp., the Finnish cellphone company, in the second half of 2008, Ben Roome, a spokesman for the joint venture, confirmed.

How does it work?

Deep packet inspection involves inserting equipment into a flow of online data, from emails and Internet phone calls to images and messages on social-networking sites such as Facebook and Twitter. Every digitized packet of online data is deconstructed, examined for keywords and reconstructed within milliseconds. In Iran’s case, this is done for the entire country at a single choke point, according to networking engineers familiar with the country’s system. It couldn’t be determined whether the equipment from Nokia Siemens Networks is used specifically for deep packet inspection.

.

Big Brother is alive and well in Iran. From a technology standpoint, it is kind of cool how it works, but ultimately is fundamentally at odds to a healthy democracy. Interestingly, the President of Iran has little real power. The ultimate power rests with the undemocratically selected Supreme Leader. From the Wiki:

However, certain executive powers, such as command of the armed forces and declaration of war and peace, remain in the hands of the Supreme Leader.[5] Furthermore the Supreme Leader may even dismiss the president and prevent the legitimation of any law (appointed by assembly) by the institutions under his control, the Guardian Council and the Expediency Council.

So, that’s the real problem. A shining example of how religion mixed with politics leads to a mindset critical of openness, and insidiously controlling of all. Iran needs a velvet revolution. I doubt that will happen though as this is not a threat to national identity and does not interfere with local religious practices. But it should inspire all of us to vigorously support the American United for Separation of Church and State organization.

Python fun

June 8, 2009

Earlier I had mentioned how much fun coding in python is. So I recently needed to do a few standard deviation calculations by inputting numbers the first time, and reading other numbers, one line at a time from a file. I could do this by plugging in numbers in some calculating device, use excel, or … But instead I figured I’d write a few lines of code and have an excuse to try out Eric, a Python IDE. It seems to support ruby as well, and the save as option suggests support for editing Java, javascript, tex, sql, etc. etc. Overall, I found using Eric to be a pleasure. It’s got all the usual stuff, setting breakpoints, stepping through code, project management, and even built-in support for source control (Subversion and cvs). Of course, the very name Eric, is in keeping with the Python theme, being named after Eric Idle of Monty Python fame. Further keeping with the fame, there exists a code refactoring menu item labeled Bicycle Repairman.

So, here’s a little taste of some code I scribbled out in about 5-10 minutes in Python.


def standardDeviation(mean, numberArray):
""" Calculate the standard deviation
Expects the mean to have already been calculated
"""
sumOfSquares = 0.0
for num in numberArray:
sumOfSquares = sumOfSquares + num *num

rootMeanSquare = sumOfSquares/len(numberArray)
return math.sqrt(rootMeanSquare – mean*mean )

def readInput():
print “Enter a white space seperated series of numbers”
numbers = raw_input(“==>”)
return [int(n) for n in numbers.split()]

def readData(theFile):
try:
myfile = open(theFile, ‘r’)
except:
print “Could not open file”
numlist = []
for line in myfile:
try:
numlist.append(int(line))
except:
print “Invalid input in file”

myfile.close()
return numlist

(Having just done the preview, I’ve noticed that the WordPress formatters did not keep my indentations. Those of you who already know Python know what I’m talking about. For the rest, just keep in mind that every block of code, for example, everything after a def and contained within in it, should be indented with respect to the def label. Simply trying to tab or add spaces doesn’t seem to work right on this editor. I’ve got about 2 seconds before needing to drive to work so later on, if I get time, I’ll see if I can make it look right.)

The def label indicates the start of a function. The readData function opens up a file and we’re prepared to print a warning if the file doesn’t exist. We append each number to an array called numlist. Reading the file was trivial. The line “for line in file” does the trick. Each line is stored in the variable line each step through the loop. Not shown here is the fact that later on I use this numbers to calculate a mean and pass the results to the standardDeviation function.

Later on, if I get time and am motivated, I can prettify this up quite a bit. I could encapsulate a lot of this in a full blown python class and provide more statistical calculation functionality, throw in TK to get some graphics and charting capability, and generally create a nice little statistics package. Of course, a lot of that functionality already exists elsewhere, but its always fun to roll your own to see if you can find a different take on things.

Python for fun

May 1, 2009
Pining for the fjords

Pining for the fjords

A while back I had posted something about Paul Graham’s essay on good hacking environments. As an aside, one of the observations he made (with which I don’t necessarily agree) is that there will be a tendency to find better hackers coding Python than coding Java. I do more Java myself these days, but find I really like Python as well. So let’s talk about Python for a bit. This has become relevant for me because I want to get started on one of the coding projects that has been sitting on my queue at home. After pondering things for a while, I’ve decided to go Python (I already have several Java projects lined up). Python code is pretty, web friendly, object oriented (though you can write it like it isn’t if you really want), and has a lot of useful libraries.

The coolest thing about the language, of course, is that the creator, Guido van Rossum, named it after Monty Python, a little British comedy group that was responsible for finding things like the holy graile, the meaning of life, and starting a religion after a boy called Brian who grew up to be a man called Brian. One of the funky things about the language of Python is that all blocks must be indented. It is part of the syntax as it were. That took me some getting used to, but since pretty code should be nicely indented anyway, that’s not really that intrusive. There are editors that will assist with that, such as emacs (also xemacs), which will run under Windows as well. Python also has its own ide as well, called Eric, which coincidentally is also the name of one of the Monty Python members. Although Python is almost trivially on every Linux system (though you may need to select the software; I did for SuSE) you can have it Windows too.

One of the fun things about Python is its support for imaginary (complex) numbers (square root of -1, for well defined rules of multiplication). Stick a j on a number to make it imaginary. For example, in Python you can write a complex number such as a = 3.0 + j5.0 . Then establish that a.real is 3.0 and a.imag is 5.0. With that comes a lot of manipulations, etc. You can do the same thing in Java, but you would need to find a library for it, or write it yourself.

So what else does Python give you? One of the powerful web application servers out there is Zope, written in Python. I have not played with this yet, but am reasonably confident that if you are writing Python apps, you could easily leverage what Zope offers. You can do graphics using the TK (toolkit) interface arising out of TCL/TK by using TKInter, and I’ve recently found out about vpython, another library that allows you to do 3d graphics and animation. Apparently a lot of colleges are using this to have inexperienced (from a coding point of view) students write their own physics demos. I expect I’ll play with this a bit going forward.

What does code in Python look like? Here’s an example of some really simple throwaway code I did several years ago. This sends email to a specified address (maintained in a separate configuration file called mailconfig.py).

import smtplib, string, sys, time, mailconfig, os
mailserver = mailconfig.smtpservername

interestingStuff = sys.argv[1]

fd = os.popen('hostname')
myhostret = fd.readlines()[0].split('\n')

From = mailconfig.sender
To = mailconfig.recipient
Subj = 'Some Alert!'

date = time.ctime(time.time())
text = ('From: %s\nTo: %s\nDate: %s\nSubject: %s\n\n'
% (From, To, date, Subj))

text = text + "Something interesting happened on " + myhostret[0] + " for " + interestingStuff

text = text + "\n\n" + mailconfig.signature

print 'Connecting...'
server = smtplib.SMTP(mailserver)
failed = server.sendmail(From, To, text)
server.quit()

Of course, one can add to this and make it as complicated as one wants. The import at the beginning just specifies some libraries like the stmplib that the Python interpreter needs to do its work. Python can look even more simple. All you need to do is run the interpreter and type in equations to use it as a calculator (that’s what I often do for quick calculations…either that or Lisp).

So, go ahead, if you are not a software developer, try your hand at some simple Python code. I am of the opinion that everyone should know a little coding, just like everyone knows how to hammer a nail in a piece of wood. Not everybody is going to build fancy furniture and houses, but should be able to do a few simple things here and there. Python is a great language to get started playing around and pick up a few things. I promise it won’t kill your parrot.

Office space

April 23, 2009
Typical work environment

Typical work environment

I’ve barely had time to really put the time into really quality blogging lately, but here’s a topic I think I can whip out pretty quickly. A bit of a rant on work space environments. If nothing else, I hope it will be somewhat entertaining.

A friend sent me a link to an essay by Paul Graham (author of ANSI Common Lisp, sitting either on my bookshelf or buried in a stack papers on my desk. I’m not going to go looking for it at the moment.). The essay was dated 2004 but is still relevant today.

First, I don’t agree when he implies that are probably no good Java hackers. I’ve known quite a few as I’ve been coding in Java (though I do not claim to be a great hacker myself). I’ve also written perl, python, and lisp and have seen really good code written in those languages as well. I’ve also seen really crappy code written in all those languages. We can get into whole lengthy discussion on what languages or means of expression are good in which type of circumstances, but that’s a completely different post with no clear cut answers. So, that aside, let’s move on to work space environments.

If you are a company whose main product is software, the software you create is only as good as your developers. Their thoughts and creativity are your product. One way to maximize the likelihood of crappy product is pollute those thoughts by putting them in a totally distracting environment where they are constantly interrupted and distracted by people walking around, random conversations taking place here and there surrounding them, etc. In a word, cubicles. Whoever designed the cubicle work environment was not a hacker. In Graham’s words,

The cartoon strip Dilbert has a lot to say about cubicles, and with good reason. All the hackers I know despise them. The mere prospect of being interrupted is enough to prevent hackers from working on hard problems. If you want to get real work done in an office with cubicles, you have two options: work at home, or come in early or late or on a weekend, when no one else is there. Don’t companies realize this is a sign that something is broken? An office environment is supposed to be something that helps you work, not something you work despite.

He is absolutely right. In spite of cubicles being exactly the wrong environment to put hackers in, practically every company I know of does it. Every since I started working in software, every company I’ve been in, with one exception, has been a cubicle farm. When was I the most productive? At home, or after hours, or in the one company I was at where I had an office. Good hackers like getting quality work done, and getting it done well and quickly. An environment that runs contrary to this goal is, I find, generally despised. If you are a hacker reading this who actually likes working in a fabric covered box, please let me know in the comments. Allow me to be the first to congratulate you as you’ll be the first I’ve ever met.

The rest of the essay continues on to make really valid points. I highly recommend a read.

As an addition to that, I would have to add one thing. If you are a manager who is determined to damage productivity while possibly decreasing morale in the process, here’s a sure fire method. Introduce heavy handed processes that run completely orthogonal to how software developers actually work. But I’ll cover that in another post sometime.

New OS

March 29, 2009

Sort of off topic from anything I’ve written here, but, hey, I think it was kind of fun. I spent yesterday afternoon installing the openSuSE 11.1 Linux distribution on a new system I bought recently. So, I can now give a brief review so far.

Seems like a pretty stable distro so far. The installation went very smoothly. I had to spend a little time mucking about with the partitioning, since the interface is significantly different than what I’m used to with SuSE (10.2 and going back earlier). But I managed to create the / mount, swap, and stick everything else into logical volumes (/home, /usr, /opt, /{and so on}) for ease of expansion later. Once that was done, everything went as smooth as liquid helium. The sound card (82801G ICH7 family high definition audio controller) worked perfectly. My last sound card worked as well, but I do remember the days when sound cards on Linux was kind of hit and miss.

One of my pet peeves in software design is poor user interface design. There were a few glitches in this area. I opted to use a static IP address (for some future DNS set up, and didn’t want to fool around with callbacks, being kind of lazy) instead of a DHCP (obtaining a dynamic IP). In spite of a perfectly valid IP I entered, it kept complaining that it was invalid. Turns out I had an extra space before the address. How difficult could it be to trim out extra spaces? This is what we do in our code all the time. The most tedious part was getting online updates near the end of the installation. We have a cable network connection to “the cloud” and this just took forever. Which is o.k., I’ve got things to read while this is going on. But, when one connection fails it would throw up a dialog asking to retry, ignore, or skip. I’d usually hit retry and everything would be fine. It would also give a little beep when pressing the “Retry” button. In fact, it would have been more useful to have the beep when throwing up the dialog. I don’t need audio confirmation that I pressed a button; I have visual confirmation of that. The updates take so long that I need an audio cue that the dialog came up. There were many instances where I’d look up from my reading and chance to see the dialog.

It is still painful to grab all software to install (all the optional packages and such). In the old days, after selecting all, you wouldn’t actually get everything but would still need to go and select individual packages. I didn’t actually see a select all option this time, but had to go in from the beginning and select everything individually. I do tend to want to get everything out there, all kernel source, all development tools, etc., etc., so I’m not sure how much of an issue this would be for the average user. But I will say that compared to previous releases, there was much less in the way of having to slog through dependency hell this time. They seem to have fixed this up pretty nicely.

With KDE 4.1, the task bar disappeared when moving to multiple desktops. After researching this for a while and finding no clear answer applicable to what I was doing, I found rebooting fixed the problem. Probably restarting the windows manager would have been sufficient, but oh well. KDE 4.1 does seem pretty sexy (yes, I opted for KDE instead of gnome, although I went ahead and installed all the gnome software). Infinitely configurable as well, there’s a whole lot to play with here.

But all in all, those complaints are pretty minor compared to the big changes that seems to have gone into this distro. The NIC (network card) drivers worked great. On the old SuSE 10.2, my NIC card would not work unless I have a noapic parameter to the kernel on boot. Took a lot of headaches to figure that out. With 11.1, the network connection came right up with no headaches at all. It came with a lot of cool apps and server additions. I’ll have to spend more time playing around with it to see everything they got, but so far, responsive and solid. If you want to try a Linux distribution, you wouldn’t make a bad choice to go with this one.

After backing things up and moving things around, I’ll replace the old SuSE 10.2 with Ubuntu to play with and see how that goes. I keep hearing good things about Ubuntu and guess I should see what the fuss is about.

Lighten down

February 25, 2009

Obama gave his State of the Union speech tonight (as I type this). I thought it was somewhat enlightening. As I’m sure much more can be found across the intertubes to shed more light on his speech, I thought I’d talk instead about too much light.

From Der Spiegel, we have a well written article on a subject near and dear to my heart. Light pollution. I knew light pollution was bad in the States (I saw maybe 10 stars during my run tonight. Granted, I live in street lit suburban area.), but I did not know it had gotten so bad in Germany. A scroll down the Wiki (looking for somebody to clean that up, by the way) illustrates how bad it really is there.

Of course, it is also pretty bad here in the States, at least anywhere where there is a significant population density. One of the treasures lost is the view of the stars. No big deal one might say. Consider that the universe holds at least hundreds of billions of galaxies. Galaxies vary in size, but totaling everything up, it seems that there may be 70 thousand million million million stars. How many can we see with the naked eye varies, but one resource puts it at 1500 or so, with low light pollution (with a couple of galaxies thrown in for good measure. I’m thinking Andromeda, but they referred to M101), This tiny infinitesimal fraction of the whole cosmos visible to the us with our eyes alone makes this view very precious. Even then, given distances to the stars, what they are, and our implied relationship to the cosmos inspires a a life of wonder and a driving curiosity to learn more. One might be given to think that our seeming determination to wipe out even this view is a measure of arrogance.

It is not just the resource of starry nights that is at risk. From Der Spiegel:

For eons, all life on earth has been shaped by the constant cycle of day and night. But in many places, night has been lost. This loss, says IGB director Klement Tockner, “entails a dramatic reduction in biodiversity.” According to Tockner, the adverse effects are especially noticeable in bodies of water, where “the light shining in promotes algae growth and changes the food web throughout an entire lake.”

and

Billions of insects die on streetlights each year or in the webs of the spiders that live on these lights in unnaturally large quantities. Many birds flying at night become confused by the light smog and collide with brightly lit high-rise buildings. Light-sensitive frogs stop their mating activity, thereby producing fewer or no offspring. Freshly hatched sea turtles crawl toward the light on streets instead of into the ocean. Salamanders remain hidden longer than usual, because of insufficient darkness, which deprives them of the time they need to search for food.

There are also adverse effects to us humans as well.

Now that I’m sure I’ve convinced you there is a problem, be sure to check out The International Dark-Sky Association. The web site has excellent discussions on reducing light pollution including using lighting fixtures that minimize glare and so on.

1234567890

February 13, 2009

Yup, at 3:31 PST (my time), I will have to raise a glass (of coffee, still at work) and drink a toast to when Unix computer clocks will reach 1234567890–1.2 billion seconds elapsed from January 1, 1970, the official beginning of the Unix epoch. So, perhaps you too are counting down to the countdown.

I’m still not sure what to call this artificially significant time. Numerical sequence day/time? Number time? The poster of the original link was correct though. It is amusing that this is all significant because we have 10 fingers and 10 toes. An octopus would probably go octal, of course. Would we have already celebrated 11145401322?

Speaking of 21st century opportunities

February 13, 2009

As I’ve mentioned previously, science and technology funding can play a vital role in helping to stimulate the economy (it also looks as though NSF and DOE science funding was mostly restored in the stimulus package, which is a very good thing). Along those lines JPL will be hosting a high tech conference March 3-4. From the link:

Attendees can participate in “how-to” workshops, meet with industry representatives from companies and agencies such as NASA and Lockheed Martin, and make use of individual counseling to discuss potential business opportunities with exhibitors.

More information on the conference can be found here. At previous conferences, about 900 small business owners were in attendance. So, if you think you or your business can make some high tech contribution (transportation, computer technology, aerospace, etc.) for the future and make some money doing it, definitely think about checking this out. At $140 per person, it is not entirely cheap, but a lot less expensive then other conferences I’ve been attended.

Creationist harm

December 14, 2008

I was recently asked in an email (not related to this blog) about the harm of creationism. This person tried to make the point that it is only fair to have both sides of the evolution story presented in science class. That this is in keeping with true American democracy and we should let children know that the matter is not settled. The person went further and asked that since most Americans accept creationism and our nation is in a position of scientific leadership, surely that demonstrates that it is o.k. to present creationism (or its insidious cousin, “intelligent design”) as a viable alternative theory. So, I figured I would work out some thoughts on the subject here on this blog. Feel free to add your own comments here.

Read on!
(more…)