Friday, October 15, 2010

Blog Action - Clean Water in Haiti

I thought I would write my blog about the progress of restoring clean water and sanitation in Port-au-Prince, Haiti, after the destructive earthquake of January 2010. The more I looked into the Haiti water situation, the more desperate the situation appears, even before the quake occurred.

Haiti has no clear central authority for water supply, but a patchwork of  barely functioning public water committees, functioning under two different government agencies, one for Port-au-Prince and one for the remainder of the country.  The capital city public water utility, CAMEP, has few workers and fewer resources. Most of the control of water supply is given over to local water committees who purchase bulk water from CAMEP and the re-sell the water to residents and businesses. Any profits gained can be used for other things, not necessarily water distribution projects. Although CAMEP serves two million residents, they are not allowed to enforce payments for water use through the courts, and instead typically just turn off the water supply to non-paying customers. The water supply is then typically re-connected without payment, and with little staff, there is little enforcement. 

Typically in slum areas, the water is is resold by third and even fourth parties before reaching consumers, each vendor receiving a portion of profit.  There are also local wells drilled by private entrepreneurs, with no oversight, that also sell to vendors and residents.

Another problem with the current system is lack of water meters often means that water is billed at a flat rate, mostly based on ability to pay.  With such low income, there has been a considerable gap between water demand and ability to supply.

An attempt to formalize the water committees, ensure sustainable income for the utilities, and bring clean safe water to the shanty towns was organized by the Agence Française de Développement (AFD), and the Business Partners for Development after 1995.  This resulted in a more formal situation for 670,000 residents though a system of CAMEP supplied infrastructure and a regulated water system.  There is still at this point no indoor plumbing or sanitation for any of these areas, and people must go to the standpipe distribution point to collect water.

After the earthquake, the fragile water system, still only serving a fraction of the city, has totally collapsed.  As is the situation before the rebuilding effort of the last 15 years, most of the water used by residents in relocation camps is trucked in by NGO's. This unsustainable system needs once again to be replaced piece by piece.  The areas chosen for relocation of the slum populations have even fewer resources.  Charities such as the Catholic Relief Services are working on solutions that will be temporary fixes, such as bottled water and latrine construction.  Public water infrastructure and sanitary sewers seem to be move to the distant future in order to serve the immediate need.

There has been billions of dollars pledged to rebuild Haiti, and very little of this money has been spent, with the exception of what the NGO's can supply in emergency relief, much of which has gone to resettlement camps and to rural areas.  The NGO work is one of the bright lights in the relief efforts so far. Most of the long term commitment has to come from a stable Haitian government, assisted by organizations such as the World Bank, the UN, and the foreign governments that have pledged to help. It is estimated it will cost $11.5 Billion to reconstruct Haiti in the next 3 years. While a lot of money, this is only a half what it cost to build the Big Dig in Boston. Donor nations have committed about a third of what is required so far.

As of now, there is still so much rubble in Port-au-Prince that work on rebuilding the central government buildings has yet to begin. For years from now, women and children will be walking to get their water a few gallons at a time from a truck or cistern. The dream of getting potable water from a faucet in a home is a dream for the distant future.

Saturday, October 2, 2010

Clean Water for all - take action

Change.org|Start Petition
 

Sunday, September 26, 2010

linkFlow Wins Design Award

Yesterday I received notice that FamousWhy has just granted linkFlow an award for software design.  The award recognizes the usability, creativity, professional appearance and structure of the software. More info at their site. They also will be another linkFlow hosting site besides the SourceForge site.  In addition, they will be preparing a tutorial and a demo of the software, and hosting that on the site as well.


It is great for the software being recognized for the very things I was trying for in developing linkFlow. Namely, a great user experience and excellent portability.  I hope this award encourages more people to download and try out my software. In addition, I hope it encourages others to strive toward the same goals, especially for developers in the engineering and scientific software field. We have a long way to go in getting this field of software accessible to more people.

I will be linking to the tutorials and demos from my main bogturtletech.com site when they are posted at FamousWhy.

Monday, September 20, 2010

Installing Eclipse for Android on Ubuntu

In order to develop applications for Android, it is highly recommended by Google and the Android people to use the Eclipse IDE. When installing Eclipse, there are a few pitfalls I found.

First off, don't do as I did and just install Eclipse from the Ubuntu Software Center.  The Eclipse version in the installer is not the right one. You want to install version 3.5 of Eclipse, not 3.6.  If you have 3.6 installed, you need to uninstall it and go to 3.5, since there are reported problems with the Android Development Kit and version 3.6.  Eclipse 3.4 works as well.

Despite what it says on the Android SDK install page, you need to install the Java Development environment into Eclipse before installing the development tools. There is a little bug with Ubuntu 10.04 that prevents you from installing the development tools unless Java has been installed.  You will need the Java environment anyways, so install that first. Be sure you have the latest version of JDK 1.6 correctly installed before installing Eclipse for Java.  You can install Java with the Ubuntu Software Center, which makes this task rather painless. Just search for "Java" in the Software Center and install "OpenJDK Java 6 Runtime" from the list.

To get the best version of Eclipse, go to this site and download using one of the links on the right hand side of the page (Linux 32, do not try this in 64 bit). The downloaded file will be named eclipse-java-galileo-linux-gtk.tar.gz in your download folder. The file doesn't need to be installed, just unzipped into the right place. If you are lazy like I am, the easiest way to do this is graphically.  Go to your Ubuntu menu and open a Terminal from the Accessories menu. Open up Nautilus as a root user in the Terminal by typing sudo nautilus at the prompt in the Terminal window. After you supply your password, Nautilus will pop up, and you can then browse over to your /usr/share folder. Open another instance of Nautilus by clicking on places > home  in the Ubuntu menu.  Browse to the Download folder. Now find the eclipse tar file and drag it over to the /usr/share folder window. Once the file has been moved to the folder, right click on it.  Open the archive, then install all files to the original folders.  You should end up with an Eclipse folder in the /usr/share folder.

Now you need to install the Android SDK. Go to the SDK download page and click on the link for Linux (i386). Note there is no link for 64 bit environments. After the file has downloaded, do the same as before, and unzip the archive in the /usr/share folder.  Now you need to tell Eclipse where to find the SDK.

Again with your Nautilus, go to your /home/username folder and look for the file named .bashrc and right click on it.  Choose to open it with gedit. You need to add a path statement. If you have a regular install of Ubuntu, there won't be a PATH statement in the file.

Just after the first comments (comment lines have a # as the first character) in the bashrc file, add the line:

export PATH=${PATH}:/usr/share/android-sdk-linux_x86/tools

Now save and close the file.

You are almost done, you just need to set up Eclipse and the Android Development Tools (ADT). The installation of the ADT goes smoothly if all the setup work has been done correctly. Go to the installation page and follow the instructions for Eclipse 3.5 (Galileo). After you restart Eclipse, the ADT should be installed.  You can now install the Android platforms, so that Eclipse has a development target, and you can run Android emulations.

You need to browse with Nautilus over to the Android SDK folder we installed earlier. By the way, you need to be connected to the internet in order to install these files. Go to the tools subfolder, and then look for the file called android. Right click on it, and run it.  You should get the tools program with a listing of all available platforms for Android. Just select all of them and install them. You are done!

Have fun programming!

Sunday, September 19, 2010

NetBeans IDE 6.8 review

I wrote the Linkflow software on the standard Sun/Oracle IDE NetBeans 6.8.  Although NetBeans is certainly powerful and can be very flexible, the process was at times frustrating.  By using NetBeans, I was automatically wed to the swing framework for developing the front end of the software. This was not really a bad thing, although making swing work is a detailed and time consuming process.

The IDE is set up to enable the developer to layout the controls on the page and not worry about coding all the placement.  I found this to work OK, but there was no way to layout complex page views without doing some of my own coding anyways.  The code generated by the IDE got gigantic, and there is no way to edit the code on your own without losing the WYSIWYG editing. I also experienced a few crashes along the way, enough so that I made sure to save before I hit the preview button.

Once setting up your page in the IDE, you were really locked into the Sun methodology of separating all strings, descriptors and tooltips from the actual GUI element.  In a few cases, label strings I defined went missing and just refused to be recovered. Other times, the code would keep forcing my controls to have a height of 0 pixels. This forced me to set a few label values and even menu titles in the GUI setup code, which I could see as a problem down the road.

I searched for solutions to the problems I had and hit a large snag. There really is no decent documentation on using NetBeans. Not anywhere. The Sun tutorials are sparse, and jump from Freshman to Master level in a single bound. The features change so often, there was even an upgrade to NetBeans 6.9 made available while I was working on linkFlow, and they were talking about how great the version 7.0 was going to be. I decided to pass on that until my 1.0 project was completed.

By the final re-write of the program, I ended up writing all the formatting by hand. I set up a method or two in the constructor of each GUI element that handled the construction of all the fields and buttons, etc, and all the event calls.  Another method initialized all the values in the fields and set default for buttons and spinners. This way, all strings are set up for internationalization in one method.  All the formatting is set up in static method calls to one class so it can be reversed to read right to left instead of left to right if this is needed as well.

Writing the program this way also got rid of all the resource files used by NetBeans to hold the descriptor data. So now, the class files and image resources can be ported over to Eclipse, where I plan on writing future versions of the software. After that, will use NetBeans only for simple applet projects.

Tuesday, September 14, 2010

linkFlow is now in Beta at SourceForge

I have spent the the last few months learning Java and a whole lot of other technologies. Why? There are some projects I have in my head that I have never been able to take the time and get out into the Universe.  Linkflow is one of those projects.

There are many hydraulic design programs out there. I designed linkFlow for a particular purpose, with one aim.  It is designed to make things a complex design situation very simple, in a piece of software that is so lightweight it can run on anything, preferably even while you have a lot of other pieces of software running on your desktop.  The simplicity and portability of the program also means it can be used anywhere.  It is written in Java so it runs on anything.  So an engineer in the field in a developing country has the same design tool as an engineer in an air conditioned office in Chicago.

So linkFlow is also flexible, allowing the designer to work in US Customary Units and in SI units.   Any pipe series can be used for the design. Any erosion control fabric can be used for the lining, and any kind of crushed stone can be used for stability.  Even the local vegetation can be input into the program to better model local conditions.  All these things are stored in the back-end data of the program.  The front, the direct user interface, is designed to be intuitive to operate. These are features not found in other hydraulic calculators.

The user only has to decide on the section he is designing, input a few design parameters, and with a few clicks, let linkFlow do the iterations to solve the problem. Simple computations of pipe diameters, to complex riprap channel design - both take seconds to fully design. All designs conform to the latest FHA standards for roadside drainage.

What else? This program has the ability to design complex and irregular sections with flexible materials, with varying n values. This is another feature not found in other hydraulic calculators. This opens the door to a lot of possibilities, including ditches with compound sections, and the design of watercourses with adjacent wetland areas in the same model.

So linkFlow is the first of many designs. I hope that it serves to help make the world a more livable place, by protecting water quality and reducing erosion. I am already working on the next project, but I will still be maintaining and updating this one. Download linkFlow free at SourceForge.

Thursday, September 9, 2010

Creating documents in LaTeX

I am in the middle of a technical document writing project that involves formatting math formulas, keeping track of cross-references, and multiple section levels.  The usual format for writing a project such as this is LaTeX, which enables the writer to concentrate on writing and not all the typesetting and references involved in the document creation.  Another advantage to the format is that a very nice PDF file can then be created directly from the LaTeX document.

I certainly knew I did not want to  try writing this document in OpenOffice or Word.  OpenOffice because it becomes very challenged with complex documents. Both programs suffer when doing cross referencing, bibliographies, and the math add-ons are clumsy and in-elegant.

I came upon a document processor call LYX that allows you to type in the text and enter the LaTeX formatting commands as you go along.  The commands are entered transparently as you designate each document environment.  The program has a nice math toolbar which make formatting complex equations very simple. Although the program does not a have a spell check built in, one can be added from a third party source.  Many templates are available to allow the document to conform to submission standards to scientific and professional journals.

After the document is complete, it can be exported as a pure LaTeX document, saved as a PostScript document, or saved to PDF.  There is a add-on available under Linux to format the document in the DocBook (XML) format.  Although much of the typography will no doubt be lost, there is another small program to change LaTeX language formulas to small PNG files to insert into the xml file.

For some of the figures in the project, I am going to try the LaTeXDraw program, which enables you to draw svg format files that can be embedded directly as vector art in LYX.

Friday, August 13, 2010

New Urbanism for Greener Cities

New Urbanism has promised better neighborhoods, reduced pollution, less traffic, and less sprawl.  source  Is this working?  So far, there have been a very slow movement to adopt new urbanism principles.  A lot has to happen to make it work in one place.  There have been a few developments in Florida that adhere to the ideas of a livable and walkable neighborhood, and at least one seems to be functioning as envisioned.

Abacoa in Jupiter Florida was built without a major employment source (as is typical of Florida), but a functioning Main Street area and a desirable location has kept it growing.  The construction of the Scripps Florida campus on site has ensured a major employer is within walking distance of much of the downtown area. This may be enough to ensure the concept of a central community will be achieved in Abacoa.

Other developments, such as Tradition in St. Lucie County, Florida, have been marketed more as retirement communities and marketed more to snowbirds that year round residents.  It also suffers from the inclusion of large Big Box strip malls adjacent to the town center.  These type of developments discourage pedestrian movements. The addition of Torrey Pines to the development may change the resident mix of that community, and give it the financial boost it needs at present.

New Urbanism can be adopted in existing urban areas with some success.  West Palm Beach is attempting to incorporate many of these ideas with some success. City Place, Clematis Street, a reconstructed Dixie Highway, and the new City Government complex successfully use New Urbanism ideas.  The location of the conference center south of Okeechobee with little linkage to the center is less than ideal, however.

Rainbarrels Are a Great Way to Go Green

Rainbarrels conserve water, reduce runoff pollution, and help even out the irrigation of your yard.  You can even use the barrel as a great source of soft water for washing. The Miami-Dade County Cooperative Extension Service is offering a series of Rain Barrel Workshops. These workshops give the residents of Miami-Dade County an opportunity to learn about important water conservation issues and the workshop fee includes a rainbarrel of your own! - source

If you live in a home that is served by untreated Florida Aquifer water, you know how bad hard water can be on washing your car.  Even your hair can be impacted by washing in hard water.  Rainwater is about as soft as you can get.  The rainbarrels that Miami-Dade is using are the bright blue plastic ones, which are mostly sealed tight, and corrosion free, so should last many years.

Water Quality Impacts of Global Warming

The US EPA estimates that changes due to global warming will cause higher water temperatures in our lakes and streams, along with increases in storms AND droughts in the Southeast?  These changes will mean increased pollution and decreased oxygen levels in our waterways. Some of these issues can be addressed with improved management practices. - source

Water quality impacts will occur due to increased runoff after longer dry periods - increasing pollutant loading of the runoff.  Sites should be designed with significant areas of pervious landscape, and allowing rainwater to percolate naturally into the ground.  In addition, there are structural approaches to remove sediment loading and consequently remove trace contaminants from runoff.  These measures can take very little land area, which is important on urban sites.  The downside is that there is a regular maintenance schedule that must be followed to ensure that the management practice put into place actually functions year to year.

no JMF support

I decided after installing the JMF library that it is really not worth the bother.  The framework has not been supported by Sun for years, the .jar files are dated from 2003.  The installation method is broken, it all has to be done by hand using the Linux Terminal, and the library needs to then be installed into Netbeans, and still the diagnostic tool on the Oracle site does not recognize the installation.

Sun and Oracle came out with JavaFX in 2008, which is  supported on the Linux platform. It is more a scripting language, although it does support full Java.  IT also runs on mobile platforms.  JavaFX sounds like the way to go at present.

Thursday, August 12, 2010

Java Media

I found today that Java has a Media Extension with all kinds of sound and video goodies built in.  I went to the Oracle site to install the extension, and they had two packages to install on my Linux machine.  One was a .bin file, so it has to be installed with a shell script.  The other was a zip file.  Also, there are environment variables to set so that the Java compiler can know the files are present.  Well, pretty straightforward, until you run then shell script.

Then bash reports errors in the shell script! Missing end parenthesis and some unknown other symbols that apparently are a result of something exploding in the file downloaded from the Oracle site. So it's a no-go on the install.  There is no way to read the .bin file to see what is wrong.  Back to square one.  See if the files can be manually installed tomorrow.

Wednesday, August 11, 2010

Google Earth on Linux

You would think that Google of all people would make an application that would be dead easy to install and run on Linux.  Well, it runs, but there have been issues for me with Ubuntu 10.04.  Seems to me it was much better under Linux Mint x64 when I was using that last year.

Kind of crazy that it installs and runs with a shell script.  And does not turn up in the Ubuntu Gnome menu, I had to track down the starting script in the Opt folder.  Ran from the Mint menu before now.  Also, has crashed on me twice clicking Panorama pics. 

I had to switch to Ubuntu 32 bit to write programs with Netbeans, which gave me all kinds of problems in the 64 bit OS.   At least the flash viewer is supported in 32 bit, as the 64 bit one seems to dropped off the Adobe site.

Why Java?

I chose Java for one main reason - it is compatible with all major platforms, without having to write separate code for Windows, Mac, Linux, etc.  At home, we use multiple platforms, and I imagine a lot of other people do the same thing.  In addition, the basic Java core is even used on the Android operating system.

To me, the Android looks like a lot of fun to program on.  It reminds me of the fun I used to have with my HP-41C way back when.  I was able to write things like integrals, and time step solutions for detention systems on this little calculator.  We pretty much ran our engineering office with a few of those machines running survey calcs on one and drainage calcs on another.  Now an Android phone is much more powerful, and can be used for many other things as well, and my head spins with the applications that would be so cool to run on those things.

Monday, August 9, 2010

Learning how to program in Java

I have spent the last few months teaching myself Java programming.  I found that a lot has changed in the programming world in the last 15 years.  The structure of Java and other object oriented languages has really improved the art of programming.  Although there is still the huge amount of effort going into developing a user interface that is pleasing to the eye and functional for the user, the use of Java Swing components at least takes a lot of the burden off the programmer to develop a cohesive user interface.  The function of the interface can also be easily separated from the actual computational work and the data that is used, making for a lot cleaner programming style.