Announcing EatMoore.com

My wife is a great cook and has been cultivating a recipe collection since before we were married. Last year (2013) she made a very limited run(4 books) of hand-made recipe books for as Christmas present for a couple of friends.

For her birthday this year I made her a recipe website. You can check it out at EatMoore.com.

It uses the Bootstrap framework for the layout, Typeahead.js for the searching, and PHP with Postgres for the back end.

You can download the code over on GitHub

EatMoore.com screenshot
EatMoore.com screenshot

Features

  • LibreOffice Base front-end for easily loading in data
  • Support for sub-recipes (eg. for sauces or whatever)
  • Uses the popular Bootstrap 3 framework
  • Instructions and About sections support Markdown
  • Fractions look like fractions
  • Search / Autocomplete box
  • Random meal generator
  • Works well on mobile devices and on the desktop
  • Support for marking recipes as favorite or quick (or both)
  • Browse recipes by ingredient or by category
  • Nice print specific CSS makes for easy hard-copy recipes
Posted in Something Interesting | Leave a comment

How to Flip All of XOrg Upsidedown

I recently hung an old iMac upsidedown from the ceiling to be used as a media center. It’s out of reach of the kids, but I needed to flip the video upside down. Since I am using Linux, I needed X11 to be inverted.

Upside Down Mac
Upside Down Mac

 

It ended up being really easy.

1) Generate an xorg.conf file:

sudo X -configure

(This is saved in ~/xorg.conf.new)

2) Copy the xorg.conf file to /etc/X11
sudo cp ~/xorg.conf.new /etc/X11

3) Restart X to make sure the conf file is good
sudo service kdm restart

(or sudo service lightdm restart, or whatever you’re using)

4) Edit /etc/X11/xorg.conf
Find the “Monitor” section and add this line:

Option "Rotate" "inverted"

5) Restart X11 again to apply the change. It should now appear upside-down

 

One shortcoming — If you have an built-in video camera, this does not flip the video camera upside down too. Since this is a media center, they won’t be needing the video camera at the moment.

Posted in Computers, Projects, Something Interesting | Leave a comment

GeoServer GetLegendGraphic Fails With “Width (0) and height (0) cannot be <= 0″

I had a weird issue with WMS GetLegendGraphic requests failing with the following message:

<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE ServiceExceptionReport SYSTEM "http://michael.mapfeeder.net:80/geoserver/schemas/wms/1.1.1/WMS_exception_1_1_1.dtd"&gt ;<ServiceExceptionReport version="1.1.1" &gt ;<ServiceException>
java.lang.IllegalArgumentException: Width (0) and height (0) cannot be <= 0
Width (0) and height (0) cannot be &amp;= 0
</ServiceException></ServiceExceptionReport>

This was weird because my request definitely included non-zero height and widths, like so:

/geoserver/wms?LAYER=parcel_area&REQUEST=GetLegendGraphic&FORMAT=image%2Fpng&STYLE=michael_test&WIDTH=20&HEIGHT=20

Eventually I tracked it down to an issue with the SLD xml. The XML was valid, but GeoServer didn’t like the use of CDATA tags inside of <Name>,<Title> and <ogc:Literal> tags.

So anywhere with formatting like this

<NamedLayer>
<Name>
<![CDATA[Parcel Area]]>
</Name>
<UserStyle>
<FeatureTypeStyle>
<Rule>
<Name>
<![CDATA[ Low Density Residential ]]>
</Name>
...

had to be changed to

<NamedLayer>
<Name>Parcel Area</Name>
<UserStyle>
<FeatureTypeStyle>
<Rule>
<Name>Low Density Residential</Name>
...

Once I got rid of the CDATA tags everything worked beautifully.

This issue was on GeoServer 2.5. YMMV, etc.

Posted in Computers, GIS Portfolio, Programming | Tagged , , , , | Leave a comment