Tuesday, September 30, 2008

AquaInkscape

With Aqua, Apple provides its customers with an intuitive graphical user interface (gui) and an appealing desktop display. Apple's OS X, also known as Darwin, is a UNIX-based operating system. This permits frugal users to run free open-source software on their Apple computers. The main obstacle that needed to be overcome was that much open source software is developed for operating systems that use the X11 window system, whereas Apple uses its own Quartz Compositor. Apple solved this problem with developing X11.app. This application consists of a command line terminal that is run from an X11 window server. Open-source applications that were compiled for Apple computers and use X11 can be run from this terminal. A number of such applications can be found under the Unix & Open Source tab on Apple's Mac OS X Software downloads site.

The X11 windows system does not take fullest advantage of Aqua's capabilities. The X11 project develops very rapidly, progressing faster than the three-year release cycle of Apple's OS X. Incompatibilities may result. Hence, I decided to adapt available open source software that scientists commonly use, e.g. desktop publishing and graphics applications, to run with the Quartz Compositor as back end. The applications take advantage of Aqua and do not need X11.app. They are compiled for Tiger (OS X 10.4) and, more recently, Leopard (OS X 10.5) on the intel (i386) architecture. The applications can be downloaded from my project site on sourceforge.net called "Software for Small Budget Science".

Last week, I completed my first Aqua-build of Inkscape for Tiger. I named it AquaInkscape. A version for Leopard is in preparation. Inkscape is a versatile vector graphics application with a great number of tools and options similar to Adobe's Photoshop®
and Illustrator® CS4
or the open source application GIMP. These applications feature freely-floating tool bar, control and navigation windows that are detached from the main window with the canvas. This is great when you have two monitors attached to your computer and are able to reserve one for the tools, control and navigation, leaving the view of your work unobstructed on the other. However, if work needs to be done on a small display like a PDA, clutter ensues and free-floating windows quickly finish unretrievable in the stack of open windows.

By contrast, in Inkscape the tool bar is integrated into the main window. This may seem old-fashioned. But I found it truly helpful when working in a confined space. Detached popup windows provide further options. But these windows are task-specific and do not need to be left open. This design profoundly enhances the user's experience of an uncluttered workspace.

To software engineers, Inkscape offers the advantage of an application that can be accessed by and integrated into programs written in Python, a programming language widely used in science and for internet applications (e.g. the Google App Engine).

Below,  I briefly summarize my experience with a number of issues pertinent to building AquaInkscape.
  • I compiled 35 packages to build this application. The needed packages were identified using configure --help, beginning with Inkscape and proceeding through the packages required subsequently. I used the latest stable releases for most packages and developmental versions for gtk+-2.0 and cairo. 
  • For compilation, I followed GNU standard procedures, that is the commands aclocal, autoconfig, autoheader, and automake, if the package was unconfigured. Sometimes, packages provide an autogen script that can be used instead. Then, I execute configure, make, make test and, if all goes well, make install. I install into the default location, that is /usr/local. 
  • In order to be able to run the packages with Aqua, the compiles have to be configured without X11 and with quartz, if configure --help indicates these options. The packages gtk+-2.0 and cairo are instrumental for rendering Inkscape's gui. They can be built for quartz. 
  • The demos in gtk+-2.0 and tests in cairo instruct about the potential performance of these packages with Aqua. In the demos for gtk-2.0, not all options worked because the default collection of theme icons known as hicolor icon theme was incomplete. I found a full set that fulfilled the necessary requirements in the Mac4Lin Leopard gtk icon theme package. 
  • With my cairo build (version 1.7.4) a third of the tests failed. Most failures involved tests with very large font and some svg options. Only few failures were associated with quartz. I decided that the chances were good for a functional version of Inkscape for Aqua.
  • It is important to configure the font usage accurately, because faulty instructions may result in ugly font output and Inkscape crashes. I use fontconfig and freetype2 for font management. On my system, the path to the default fonts needed in the configuration of fontconfig is /usr/local/etc/fonts.  You may furnish additional font with ghostscript or gutenprint. Both packages will install fonts in /usr/local/share by default.
After all required packages had eventually been installed, I was prepared to compile the inkscape binary with the MacOSX build script provided in Inkscape's packaging folder. I specified the options openoffice files, internal perl, LittleCms, Inkboard, Poppler-Cairo, ImageMagick/Magick++, Libwpg, as well as with and without internal python. For Python, I compiled and installed version 2.5 on my system. Precompiled MacOS X binaries of Python 2.5 cannot be used because they are incompatible with the Numpy package that Inkscape requires. Therefore, the python version of AquaInkscape contains Python 2.5 modules.

Finally, I had to edit the scripts for packaging so that AquaInkscape would launch without asking for X11. The resulting application seems in good working order. I have not tested all possibilities. The only shortcoming I found so far and have been unable to resolve is that the program does not respond to the quit button in the application menu once inkscape-bin is running. The application can be quit, however, with the button in the pulldown menu under File and with the button in the icon menu on the dock. Clicks with the mouse expand the compressed tool icons in the side bar. Have a try and be patient at start up! The application takes some time to launch.
Apple iTunes


Friday, September 26, 2008

Subprime Lending: Truthiness & Delusion of Mind



After Citigroup collapsed late last year, I wondered whether the underestimation of risk in securitized investments was the result of a failure in using scientific methods of risk assessment. Read my post dated Dec. 5, 2007. Soon, I learned that such methods were widely employed in investment banking and insurance. Apparently, misconception prevailed about the reliability of the predictions that these methods provide.

A year on, we find out that the statistical software did not fail. Any scientific method will provide a realistic prognosis only, if the entered data are correct. We presume that a loan is approved with the assurance that the applicant is going to be able to service the payments through the loan period, provided that the applicant's financial situation does not change dramatically. This good practice seemed to have been widely ignored in the subprime and prime ARM (adjustable rate mortgage) loan market of the past eight years. Too often, applicant naivety and lender carelessness took sway over prudence.

In hindsight, the considerate risk analyst would have welcomed an additional column in the input spreadsheet with a truthiness factor weighting each loan. That is, the loan agent is asked to assign a score estimating the applicant's ability to service the loan once the interest rate resets. The agent could be rewarded for good judgment and the improvement in the quality of loans issued. Perhaps such estimates from the field would have helped to predict the risks with the ensuing securities more accurately.

In the absence of such information, the analyst is left to look at the foreclosures on the loans to examine risk retrospectively in the hope that forward projections gain accuracy. Paul Jackson reports on housingwire.com in a post dated Sep. 5, 2008, that the Mortgage Bankers Association (MBA) announced in early September that more than 9 percent of U.S. mortgages were delinquent or in foreclosure at the end of the second quarter of this year. “Subprime ARM loans accounted for 36 percent of all foreclosures started and prime ARMs, which include option ARMs, represented 23 percent,” Jackson quotes MBA's chief economist Brinkmann.

Addendum
  • As The New York Times reports today, I am not far off with my assessment. Listen to this incredible story (11/5/08).

Thursday, August 21, 2008

Cell Phones & Brain Cancer

Remember Jon Krakauer's account of tragedy on Mt Everest? We have an irrational perception of acceptable risk. For sheer enjoyment, we frequently are willing to expose ourselves knowingly to the possibility of severe injury. Just three weeks ago about a dozen climbers succombed to an ice fall on K2. In any good summer, roughly 100 people perish in mountaineering accidents in the Swiss Alps alone. V. Lischke and others report 462 fatalities for 1997 Europe-wide. According to the U.S. Dept. of Transportation, 4,810 Americans perished on motor bikes in 2005, translating into 73 riders per 100,000 bike registrations. The fatalities continue to rise. Last year 5,154 Americans died on their bike.

By contrast, according to wrongdiagnosis.com every year fewer than 50 in 100,000 Americans battle glioblastoma multiforme, that is the most aggressive and fatal type of brain cancer. Recent research studies link brain cancer with electromagnetic radiation from cell phones. A discussion of some studies can be found here. The debate has become ever more intense since Senator Edward Kennedy was diagnosed with malignant glioma, probably a glioblastoma multiforme. I discussed this type of brain cancer in my post dated Jun. 3, 2008.

Prudence is advised in the debate on a possible association between cell phone-related electromagnetic radiation and brain cancer. The energy of electromagnetic waves is directly proportional to their frequency. The spectrum of the frequencies ranges from meter-long radio waves via the nanometer-long waves of visible light to atom-sized gamma rays. The shorter the wave length, the higher the frequency and the greater the energy that potentially can harm our genes. DNA may be altered directly through the absorption of radiation energy or indirectly through radiation-produced free radicals that may react chemically with the DNA. Even low amounts of energy can damage DNA and may theoretically result in uncontrolled cancerous cell proliferation. However, our cells are provided with DNA repair mechanisms. Commonly many hits are needed to overcome the defenses and cause noticeable damage. Alas, the defenses appear to wear out with advancing age and we may become more susceptible to cancer.

To determine thresholds for harm from electromagnetic radiation, epidemiological studies are conducted that compare the health records of people with known exposure to those of people who match this group in all aspects, except the exposure. Professionals with job-related extraordinarily high exposure are frequently enrolled in the group of the potentially affected to improve the chances of discovery. Hardell and others (2005) observed that Swedish long-term users of analogue mobile (NMT) phones like the now obsolete car phones developed a significantly higher risk for auditory nerve tumors (acoustic neuromas) on the side of phone use. Digital mobile (GSM) phones like our modern cell and cordless phones did not increase this risk consistent with findings in Denmark (Christensen and others, 2004). The prevalence of acoustic neuroma in the U.S. is low. Less than 1 in 1000 Americans is affected. According to ctia.org, roughly 264 million wireless subscriptions are active at present.

Though the results of such studies provide important leads on the type of the potential harm to our health and may be instrumental for safety considerations at the work place, they cannot be easily extrapolated to regular phone users. The amount of radiation energy deposited in the auditory nerve can only be estimated. Moreover, the effects cannot be ascertained with the data collected at higher doses because of the non-linearity of the relationship between dose and effect and the increasing scatter of the observations at progressively lower doses. The concerned may opt to use plug-in extensions for ear and mouth pieces or voice-activation as precaution.

Addenda
  • NPR's All Things Considered ran an interesting update on this issue today. You may wish to read the report and listen to Allison Aubrey's podcast entitled "Doctors Urge Research On Cell Phone-Cancer Issue" (09/25/08).
  • On Aug. 24, an ice fall swept away a party of twelve on the Mont Blanc du Tacul, a smaller brother of the White Lady. Eight are missing. I once stood on this mountain at a different time in the year. I was fortunate to have a friend as guide who understood risk well (10/21/2008).
  • Maggie Fox reports in her post with the title "U.S. senator promises look into cellphone-cancer link" published online on Reuters today that the chairman of the Senate Committee for Health, Education, Labor and Pensions Senator Tom Harkin plans to encourage more research to examine whether the use of cellphones may cause cancer. The fear persists (09/14/09).
  • The environmental working group lists the head-absorbed power [W/kg] of the radio waves emitted from a number of cell phones in this table (06/16/2010).
  • Volkow and others (2011) report in this week's issue of the Journal of the American Medical Association that cell phone radiation is statistically significantly associated with an acute increase of glucose metabolism in the temporal and frontal lobes of the cerebral cortex by, on average, 7.2 percent on the side the active, but muted, phone was held for 50 minutes. The researchers used the [18F]fluorodeoxyglucose method and positron emission tomography (PET) to determine regional cerebral glucose utilization rates in 47 healthy volunteers. They conclude in the abstract of their communication that “this finding is of unknown clinical significance.” Indeed, the finding does not provide any insight into the cellular mechanisms underlying the observed increase. Under healthy physiological conditions, brain glucose metabolism does not rise to levels posing a health hazard. I have written on this topic in my post with the title "Good News for Brain Energy Use" published Sep. 12, 2009. If the sole aim of this study had been to investigate the potential influence of modern-day cell phone radiation on brain energy metabolism, the study could have been conducted with mice at lower cost, sparing the participants unnecessary exposure to ionizing radiation from PET (02/24/11).
  • Epidemiologists have recently come to discrepant conclusions on the risk of cancer associated with cell phone use. According to Scott Hensley's report with the title "Cellphone Use May Be A Cancer Risk After All" on National Public Radio's All Things Considered today, a recent World Health Organization review conducted by 31 experts from 14 countries found sufficient evidence that may support a correlation between cellphone use and gliomas and acoustic neuromas. The study will be published in the July issue of the journal The Lancet Oncology. By contrast, a comprehensive case–control study with 2708 glioma and 2409 meningioma cases and matched controls from 13 countries published last year by The INTERPHONE Study Group (2010) could not establish any elevated risks with mobile phone use with certainty (05/31/10).
References

As the eminent film director Werner Herzog so aptly documents in his public service announcement video below with the title "‪From One Second To The Next‬", cell phone use may pose other, more prevalent effects proven to be absolutely devastating to our health (08/20/2013):