Science, Technology & Health: July 2005 Archives

I thought I liked Google Maps, but Google Earth is my new favorite toy. I could spend hours with this thing; I don't even know where to begin describing its features. It's like the global exploration of the past 600 years is at your fingertips.

A reader passed along another nifty Google Maps application: this one overlays a Google Map on a satellite photo. Post links to any other Google Map systems that you come across.

Ok, as I've said before, I love integrating of Google Maps with everything. Most recently I came across HotOrNot + Google Maps, a site that connects the hilarious HotOrNot picture database with maps that allow you look for hot or, mostly, not people in your area. I guess it's just more amusing to know that you could pass these people on the street and think to yourself, "Not!" I mean, it's ok to make fun of people who post their pictures online to be rated, right?

Anyway, on a larger scale, this sort of thing is the reason why Google Maps is so much cooler than any of the other mapping sites out there. Google provides a nifty API that allows users to easily integrate their own data with the maps and display them, which makes Google Maps far more entertaining and useful than its competitors.

(HT: GeekPress.)

... and maybe it is. The recent launch of Discovery was performed safely and smoothly, but now it appears that despite years of work and hundreds of millions of dollars of engineering Space Shuttle foam keeps falling off.

HOUSTON, July 27 - NASA suspended further flights of the space shuttle fleet on Wednesday after determining that a large piece of insulating foam had broken off the external fuel tank of the Discovery shortly after liftoff Tuesday morning, the same problem that doomed the Columbia and its seven astronauts in the last mission, two and a half years ago.

The foam does not appear to have struck the Discovery, so the decision will not curtail its 12½-day mission to the International Space Station, the officials said. But further flights will be postponed indefinitely, starting with that of the Atlantis, which was to have lifted off as early as September. ...

The effort to fix the foam problem had consumed more than two years and hundreds of millions of dollars. NASA identified the area on the tank that shed the latest piece of foam as a risk, but put off redesigning it.

"We decided it was safe to fly as is," Mr. Parsons said. "Obviously, we were wrong."

The incident occurred two minutes into the launching, at a point where the atmosphere is so thin that the piece drifted away. The Columbia accident occurred in part because the foam fell off the tank about 82 seconds after liftoff, when the air was much thicker and slowed the foam so the climbing orbiter struck it with great force.

N. Wayne Hale, the deputy manager of the shuttle program, said that if the Discovery foam had been shed earlier, "we think that it would have been really bad." ...

Others were more dismayed. A NASA engineer who has been involved in the return-to-flight effort said: "It's an ugly story. It's a mess." The engineer, who spoke on the condition of anonymity because of the delicacy of the issues involved, added, "Everyone's really, really disappointed," but continued: "It is what it is. Physics doesn't lie."

Alex Roland, a former NASA historian who now teaches at Duke and is a frequent critic of the space program, said that in some ways the problem was "worse than an unexpected anomaly arising."

"This was the major problem that they were looking to solve," Mr. Roland said. "It must be enormously demoralizing to them."

It doesn't take an engineer to tell you that when you spend all that time and money on a single problem, you expect it to be fixed. The lost foam -- a repeat of an earlier, shallow problem -- is much more distressing than a tempermental redundant sensor. Rand Simberg has an excellent post (from before the launch) in which he explains that a system as complex as the Shuttle will always have some failures, and that the system is designed to tolerate them. (The complexity of the system is the source of many problems with the Shuttle, and the primary reason to scrap the program.)

Any system as complex, with as many components as the Shuttle, must have adequate redundancy to allow safe operations with a failure of some components, because there are so many of them that some are bound to fail statistically, and if we mindlessly demand perfection on every flight, we'd never fly. This is the airline philosophy, and it used to be NASA's, but they've gotten gun shy, at least on this particular issue. But in making an a priori decision now to go with a failed sensor at launch, they're returning to a common-sense approach, for which the system was designed. ...

Now as to these demands that NASA not launch until the sensor is fixed, how much are those making the demand willing to spend (noting that the money belongs to all of the taxpayers, not them individually)? And to what end?

Someone once said that when failure is not an option, success gets very expensive.

Right now, NASA's hypersafety philosophy has made spaceflight hyper expensive (though not particularly safe). Rather than unrealistically making failure not an option, we need to embrace the fact that failures will occur occasionally. What we have to do is make sure that failures aren't as expensive as they were in the case of Challenger and Columbia (and numerous other lesser NASA program failures). What that means is making it cheap to fail, which in turn means making it cost much less to make attempts. That won't happen until we develop much more robust systems, with much more activity. But investing further millions into Shuttle (not only in terms of money spent fixing things, but the costs of continued delay, which are substantial) in a futile effort to make it any safer than it currently is, is a fool's errand. We should have flown a couple years ago.

Most public reaction that I've heard -- other than in the media -- is similar to that of Mike from Mike's Random Rantings who says that space flight is supposed to be dangerous.

Has the public gotten so used to the idea of flying into space that they have forgotten how hard and dangerous it is to put that much mass into orbit? Does the public think that flying to space should be as safe as driving to work?

These are ridiculous notions.

I beg to differ! Space flight should be much safer than driving to work, just as flying from Los Angeles to New York is much safer. The reason its still so dangerous is that we're launching a system designed in the 1970s that's run by government bureaucrats.

Casey from Right On! thinks NASA should start taking bids on future projects by private contractors, but I think a prize system modeled on the Ansari X Prize would be more efficient. Most of the engineers and managers at NASA are top-notch, and it's not their fault that the organization is so unwieldy, it's just the nature of giant bureaucracies. NASA should be converted from a production and engineering organization into a funding organization similar to the National Institutes of Health. The engineers who want to keep working on space exploration should be hired by private companies and get huge raises (as should all engineers everywhere, naturally).

Update:
Here's a private space venture I'd love to work for: The Spaceship Company.

Reader and server admin Cypren passes along these answers to the first few sections of the .NET Interview Questions I linked to a couple of days ago.


Everyone who writes code

Describe the difference between a Thread and a Process?
--- Both are individual execution paths, but process timeslicing (and memory space) is enforced by the OS, while thread differentiation is enforced by applications.

What is a Windows Service and how does its lifecycle differ from a "standard" EXE?
--- Services are loaded by the operating system and run in contained process spaces detatched from user interaction; users logging on and off the system have no impact on them.

What is the maximum amount of memory any single process on Windows can address? Is this different than the maximum virtual memory for the system? How would this affect a system design?
--- Windows processes are allowed 4GB of virtual address space, regardless of the actual amount of memory on the machine. Windows x64 allows 16TB of address space.

What is the difference between an EXE and a DLL?
--- EXEs can be launched as processes by the operating system. DLL executable code must be invoked by an existing process.

What is strong-typing versus weak-typing? Which is preferred? Why?
--- Strong-typing refers to defining the specific type of a reference at compile time rather than at run time. This results in more efficient execution and memory optimizations at compile time, as well as reduces the chance of a programmer accidentally providing a value of a type another component wasn't expecting.

Corillian's product is a "Component Container." Name at least 3 component containers that ship now with the Windows Server Family.
--- Component containers implement the IContainer interface to wrap components, providing a meta-architecture for organizing, interacting and communicating with the components.

What is a PID? How is it useful when troubleshooting a system?
--- (Ambiguous) This could refer to either a Microsoft Product ID -- the unique key that brands each activatable component installed on a system -- or to a Process ID, which is a means of referring to a specific process in calls to the Windows API.

How many processes can listen on a single TCP/IP port?
--- One.

What is the GAC? What problem does it solve?
--- The Global Assembly Cache. It stores strongly-named assemblies in a single location, allowing for verification of code library uniqueness when executing.

Mid-Level .NET Developer

Describe the difference between Interface-oriented, Object-oriented and Aspect-oriented programming.
--- Object-oriented programming consists of defining programming structures around logical units of data and the functionality required to operate on them. Interface-oriented programming extends upon the concept by mandating that cross-dependencies between objects be expressed in the form of abstracted, defined guidelines (without specific implementation) so that objects have set expectations for touchpoints. Aspect-oriented programming proceeds one step further, defining certain "first tier" processes which apply to almost all objects (such as logging), and providing high level means of attaching functionality to a wide swath of objects without specific implementation required in each one.

Describe what an Interface is and how it’s different from a Class.
--- Interfaces are "guidelines without implementation" for functionality in an object. They define methods and properties which must be exposed, but leave it to the individual object to determine implementation.

What is Reflection?
--- Reflection is the ability to dynamically execute code without pre-linking at compile time. This may take the form of dynamic module loading and late binding, or it may take the form of real-time code construction and compilation.

What is the difference between XML Web Services using ASMX and .NET Remoting using SOAP?
--- Web services are generally stateless, using a standard HTTP interface, while remoting is highly customizable and extensible, varying by the specific application that uses it.

Are the type system represented by XmlSchema and the CLS isomorphic?
--- No.

Conceptually, what is the difference between early-binding and late-binding?
--- Early binding determines execution path at compilation, late binding allows for dynamic execution at runtime.

Is using Assembly.Load a static reference or dynamic reference?
--- Dynamic

When would using Assembly.LoadFrom or Assembly.LoadFile be appropriate?
--- When your assembly is not in the GAC.

What is an Asssembly Qualified Name? Is it a filename? How is it different?
--- A type reference qualified by the name of the assembly it is referenced from.

Is this valid? Assembly.Load("foo.dll");
--- No. Assembly.Load(string) takes the full name of the assembly (as contained in the GAC), not the name of the file.

How is a strongly-named assembly different from one that isn’t strongly-named?
--- Strongly-named assemblies can be loaded into the GAC and use key pairs to insure non-collision and authorship verification.

Can DateTimes be null?
--- No. They are structs, not objects.

What is the JIT? What is NGEN? What are limitations and benefits of each?
--- JIT is Just-in-Time compiling, which natively compiles .NET code as it needs to be executed, allowing more flexibility in platform optimization. NGEN is the Native Image Generator, a tool which precompiles native code for assemblies and caches it for execution, pre-empting JIT. NGEN saves time at execution in exchange for potentially slowing execution on platforms other than the one it was originally executed for.

How does the generational garbage collector in the .NET CLR manage object lifetime? What is non-deterministic finalization?
--- The garbage collector defines objects into multiple generations based upon their expected lifecycle, and collects each generation with different frequency. Non-deterministic finalization means that the Finalize() method of objects is not guaranteed to be called as soon as the object falls out of scope; it is executed when the garbage collector has time to prioritize it.

What is the difference between Finalize() and Dispose()?
--- Finalize() is called by the garbage collector before destroying an object, allowing it to clean up resources it may have allocated. Dispose() is a method the programmer can call on an object to force resource deallocation (and pre-empt costly finalization).

How is the using() pattern useful? What is IDisposable? How does it support deterministic finalization?
--- The using() construct allows you to mark a resource which is guaranteed to be disposed when the block exits. IDisposable provides an interface for the Dispose() method, which allows a programmer to forcibly finalize an object while still placing a Finalize() method in it as a means of security in case another programmer neglects to use Dispose().

What does this useful command line do? tasklist /m "mscor*"
--- Allows you to see which processes currently running have loaded a specific library -- in this case, anything beginning with "MSCOR".

What is the difference between in-proc and out-of-proc?
--- In-process communication is that between threads in a particular application space, as defined by the operating system. Out-of-process communication is that between non-shared memory and process spaces.

What technology enables out-of-proc communication in .NET?
--- Serialization

When you’re running a component within ASP.NET, what process is it running within on Windows XP? Windows 2000? Windows 2003?
--- XP & 2003: aspnet_wp.exe, 2000: inetinfo.exe

Senior Developers/Architects

What’s wrong with a line like this? DateTime.Parse(myString);
--- Doesn't specify a locale or format.

What are PDBs? Where must they be located for debugging to work?
--- Program Database files. They contain references that connect the uncompiled code to the compiled code for debugging. They must be located either in the same place as the EXE/DLL, or in your VS.NET specified symbols path.
---
What is cyclomatic complexity and why is it important?
--- It's a measure of the number of independent linearly executed paths through a program. It's important for judging the complexity of software and assisting in determinations of which modules should be refactored into smaller components.

Write a standard lock() plus “double check” to create a critical section around a variable access.

--- bool notLocked = true;

--- if (notLocked)
--- {
--- --- lock (typeof(lockingObject))
--- --- {
--- --- --- if (notLocked)
--- --- --- {
--- --- --- --- notLocked = false;
--- --- --- --- foo = lockingObject;
--- --- --- --- notLocked = true;
--- --- --- }
--- --- }
--- }

What is FullTrust? Do GAC’ed assemblies have FullTrust?
--- FullTrust means all .NET security permissions are granted to the assembly. GAC assemblies have FullTrust by default, but that can be changed by the user's security policy.

What benefit does your code receive if you decorate it with attributes demanding specific Security permissions?
--- Allows administrators to see exactly which permissions your application needs to run; prevents your code from being exploited beyond what permissions it absolutely needs; allows your application to forcibly fail instead of having to manually handle situations where it might be denied permissions it requires.

What does this do? gacutil /l | find /i "Corillian"
--- Lists all assemblies in the GAC, searching for those whose names contain "Corillian".

What does this do? sn -t foo.dll
--- Shows the token for foo.dll.

What ports must be open for DCOM over a firewall? What is the purpose of Port 135?
--- 135 for the service control manager, 1024-65535 (or whatever range the administrator has restricted DCOM to) for applications.

Contrast OOP and SOA. What are tenets of each?
--- OOP tries to encapsulate functionality required to operate on data with the data structure itself, making objects "self-reliant". SOA aims to decouple functionality from data entirely, using interfaces to allow functional components to operate blindly with as little understanding of the precise nature of the data they're fed as possible, allowing many types of data sets to be fed into them for the same operation.

How does the XmlSerializer work? What ACL permissions does a process using it require?
--- Reflects the object and reads its interfaces to serialize them. Requires the .NET ReflectionPermission, obviously.

Why is catch(Exception) almost always a bad idea?
--- Because it swallows an exception without doing anything with it. The only time this should really be used is when trying risky casts that you expect to have a reasonable likelihood of failure, but always of a very specific type.

What is the difference between Debug.Write and Trace.Write? When should each be used?
--- Debug.Write isn't compiled in if the project isn't built with the DEBUG symbol. Trace.Write calls are compiled regardless.

What is the difference between a Debug and Release build? Is there a significant speed difference? Why or why not?
--- Release builds don't contain debug symbols and are more compact and optimized.

Does JITting occur per-assembly or per-method? How does this affect the working set?
--- Per-method. This affects the working set because methods that aren't lined up for calls aren't loaded, reducing its footprint.

Contrast the use of an abstract base class against an interface?
--- Abstract classes can provide implementations for methods and properties. Interfaces only provide required declarations.

What is the difference between a.Equals(b) and a == b?
--- The first uses the object's equivalency constructor to see if it considers itself value-equal to the the second object. The second construct compares their memory references to determine if they are the SAME object.

In the context of a comparison, what is object identity versus object equivalence?
--- Identity means that two references point to the same memory address. Equivalence means that two objects share the same value.

How would one do a deep copy in .NET?
--- Implement the IClonable interface, and define your implementation to execute deep copies on your subobjects (possibly through IClonable interfaces). Alternatively, serialize the object and then deserialize it into another object, but this is very slow compared to a dedicated cloning interface.

Explain current thinking around IClonable.
--- IClonable is preferable to using copy constructors because it is standardized and utilized by other portions of the .NET framework to generate object copies.

What is boxing?
--- Taking a value type and converting it to an object reference. Unboxing is the reverse process.

Is string a value type or a reference type?
--- It's an "illusionary value type" that masks an interface to the System.String reference type.

What is the significance of the "PropertySpecified" pattern used by the XmlSerializer? What problem does it attempt to solve?
--- Defines the specific parameters that .NET class members serialize into. Solves the issue of an XML spec needing to have slightly different names for class members than the class itself does.

Why are out parameters a bad idea in .NET? Are they?
--- Out parameters create uncertainty about the data which may be returned from the function, and permit the caller to potentially pass bad references which your function must validate before using. From a design standpoint, it's more elegant to define a custom class with multiple properties in the event that you need to return multiple values from a single function.

Can attributes be placed on specific parameters to a method? Why is this useful?
--- Yes. This might be needed to specify remoting implementations or types for method parameters, or to provide metadata for method parameters when exporting a code library.

C# Component Developers

Juxtapose the use of override with new. What is shadowing?
--- Override redefines an inherited method which was marked as virtual or abstract, and its access level must be the same as the method it overrides. New allows you to completely hide an inherited member and create a different implementation of it with whatever attributes you choose. Shadowing is another name for disabling an inherited method and redefining it.

Explain the use of virtual, sealed, override, and abstract.
--- Virtual marks a method as overridable. Sealed marks a class as uninheritable. Override redefines a method declared as virtual. Abstract defines a class which cannot be instantiated, or a method which must be overriden in any derived classes.

Explain the importance and use of each component of this string: Foo.Bar, Version=2.0.205.0, Culture=neutral, PublicKeyToken=593777ae2d274679d
--- Assembly name -- used for loading. Assembly version -- also used for loading. Culture -- defines culture settings used for string translation and other locale-specific settings. PublicKeyToken -- used to uniquely identify this assembly and prevent collisions.

Explain the differences between public, protected, private and internal.
--- Public: accessible from any class. Private: accessible only from within the same class. Protected: like private, but derived classes may also access. Internal: like public, but accessible only by code within the same assembly.

What benefit do you get from using a Primary Interop Assembly (PIA)?
--- A PIA is a strongly-named assembly which defines COM interfaces for a component. Because it is strongly-named, it can be loaded into the GAC and verified against the COM component's own signature to give the component collision-protection and authorship-verification benefits when interacing with .NET code.

By what mechanism does NUnit know what methods to test?
--- Reading attributes defined for classes and methods via reflection.

What is the difference between: catch(Exception e){throw e;} and catch(Exception e){throw;}
--- Both statements will catch and throw exception, but the latter will preserve the original exception stack.
---
What is the difference between typeof(foo) and myFoo.GetType()?
--- The first returns the object's type at compile time; the second returns it at runtime.
---
Explain what’s happening in the first constructor: public class c{ public c(string a) : this() {;}; public c() {;} } How is this construct useful?
--- The first constructor invokes the base constructor in addition to its own functionality; this would be useful if your base initialized basic field values or had other code that all other constructors would utilize.

What is this? Can this be used within a static method?
--- The "this" reference refers to the current object context. Static methods have no context, so it is not valid.

I've only been developing with .NET for a few months, but I know the answers to most of these .NET interview questions -- or at least I think I do. I'm sure many of my readers will be eager to test their own knowledge, and if anyone wants to write up a list of short answers to the questions I'd love to post it.

This article about redundant fuel gauges on the Space Shuttle highlights many of the reasons why the aging behemoth should be cancelled and its budget reallocated towards newer technologies and contracts for private space developers.

Deputy shuttle program manager Wayne Hale said the fuel gauge problem has been a vexing one - engineers still don't know exactly what caused it - and he's asked himself, "Are we taking care enough to do it right."

"Based on the last 10 days' worth of effort, the huge number of people and the tremendous number of hours that have been spent in testing and analysis, I think that we're coming to the right place," he said. ...

"These are rather arcane matters, I would admit. They're rather difficult and sometimes they don't always present well," Griffin said. "But in the long run, I think if it's the right thing, we can explain it to you and you want us doing what's right, not what necessarily is obvious or popular." ...

"My observation is that when the weather is good, you have vehicle problems. If the vehicle works, you have weather problems," he said, smiling. "Since we have some weather concerns, I'm confident the vehicle is going to be OK."

The Shuttle is 1970s technology and it had always been precariously balanced between nail-biting success and horrendous disaster. For $5 billon per year our country could fund 500 prizes similar to the Ansari X Prize -- or hundreds of larger prizes for more difficult accomplishments -- and allow the private market to select the best, most promising technologies. Everything the government runs is wasteful and inefficient, and the Shuttle Program is no exception. By redirecting our tax dollars towards private research, the public would be assured of funding only the best and most successful technology, and humanity would be assured of actually returning to space.

This article about geological Martian temperature is a great example of how chaotic knowledge can be -- chaotic in the sense that very slight changes of interpretation and awareness can have drastic effects on the final conclusion.

A chemical study of Martian meteorites implies that the planet has always been cold and was rarely above freezing.

Writing in Science, researchers have been able to determine the maximum temperature the rock experienced.

There is no evidence that it was ever warm, they say, as it records near surface conditions for four billion years. ...

This new line of research is a puzzle given the contrary evidence of running water on Mars. ...

The study is bound to be controversial showing a disparity between those scientists who look at pictures of Mars to discern its history and those who study the only pieces of the planet we can examine in detail in the laboratory.

The truth is that we may never know, and we may never even know if we're anywhere near correct. Just as this "argon dating" procedure led one group of scientists in a new direction, there are certainly a limitless number of other approaches that may never be thought of but that would yield different hypotheses. As much or more than God, history itself can be seen as the elephant explored by blind men, each of whom perceives a different aspect of the beast and none of whom can reach agreement as to its actual nature.

By popular demand, here's a follow-up on my post from four months ago about home security gadgets. In that post I mentioned two devices that I subsequently purchased and used.

First was the Keep-I volumetric air pressure alarm.

Keep-I monitors air pressure. If any change occurs, such as a criminal opening a door or window, the alarm sounds. When the device is set to fine recognition mode, a simple touch on your door handle will trigger the 95 decibal alarm. Within the space protected by the Keep-I, you can move about freely, your kids can play and your pets can run around. This alarm allows you to live your life while still protecting yourself and those you love, giving this high tech system great practical advantages over infra-red and motion detecting alternatives.

It sounds like a neat idea, and the science actually works very well. The problem is that opening and closing interior doors can set the alarm off by changing the air pressure gradients in the house, so you either have to leave them all open or disable the alarm before opening one. This limitation, though completely understandable and unfixable, makes the Keep-I awkward to use at night, particularly if you ever have to go to the bathroom. I expect it would work very conveniently in a hotel room or other smaller enclosed area with fewer swinging interior doors.

The second system I bought was a big box of magnetic door and window alarms. Each unit has two parts, one that attaches to the door or window and the other that attaches to the frame. When activated, the unit makes a loud noise if the door or window is opened. They're very simple and cheap -- about $2 each if you shop around.

One disadvantage is that the door frames in my house are poorly angled and not well-suited for these devices. The two parts of each unit need to be mounted within a centimeter of each other, and the way my frames are shaped makes this difficult to do without having the device obstruct the path of the door. Still, I managed to rig up all the doors on my house and I set the alarms every night. The devices mount perfectly on my window frames.

A second disadvantage is that the double-sided tape that comes with the devices can come undone in high temperatures. Units placed in sunlight may ocassionally fall off and start screeching until their batteries die if no one is home to shut them off.

All in all, both devices have their uses and can increase home safety for a very modest price.

What should be done about mobile phones in cars? Almost every stud I've seen, including this one, says that using a phone -- hands-free or not -- while driving increases the risk of an accident by 400% to 500%. That makes talking on the phone while driving as dangerous as driving drunk. As the article indicates, small fines don't do much to reduce the problem.

So what's the solution, or is there one? I have libertarian sympathies, but I'm all in favor of laws that prohibit drunk driving. People should be able to do whatever they want on their own property, but in public space the majority has the right to set the rules. Is the problem that the fines are simply too small, or is the risk of a crash still so small that people can't properly judge it and act appropriately?

For myself, I try very hard to use the phone only rarely while driving. The temptation is great, but I don't want to be one of the people who looks back and regrets making a dumb decision. Plus, I see all the people talking while they drive and it's obvious how divided their attention is.

I categorized this post as science because there must be a technological solution to the problem of making phones safer or reducing their use.

I may not get online much today because I'll be playing with my Yamaha RMAX helicopter. After the bombings in London I have a renewed vigor for my work.

About this Archive

This page is a archive of entries in the Science, Technology & Health category from July 2005.

Science, Technology & Health: June 2005 is the previous archive.

Science, Technology & Health: August 2005 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Supporters

Email blogmasterofnoneATgmailDOTcom for text link and key word rates.

Science, Technology & Health: July 2005: Monthly Archives

Site Info

Support