Hide/show table rows using JavaScript

I wanted have a HTML table where toggle the visibility of its rows (TR elements) using display:block. This is wrong. You need to use display:table-row.

Without using the table-row property, the TR will not have the proper column widths. This is a problem when using Firefox or other Gecko-based browser.

Improper vs. Improper way to hide or show a TR element using javascript.

Sample Table

<table>
<tr id="showme" style="display:none">
    <td>I am in a row</td>
</tr>
</table>

test = document.getElementById("showme");
test.style.display = 'block'; //wrong
test.style.display = 'table-row'; //correct

Wine from MacPorts build fail

Wine install fails if you try to install it using MacPorts. To get around this you can install the development version of Wine.

sudo port install wine-devel

People know about the problem and it has been fixed in Wine version 1.1.2. I don’t know when it will get fixed for regular wine. Brief research suggests that it has something to do with iPhone SDK. http://trac.macports.org/ticket/13000

My Mac is 10.5.4 Leopard. I have iPhone SDK.


./crtdll.spec:44: external symbol 'CRTDLL__basemajor_dll' is not a function
./crtdll.spec:45: external symbol 'CRTDLL__baseminor_dll' is not a function
./crtdll.spec:46: external symbol 'CRTDLL__baseversion_dll' is not a function
./crtdll.spec:66: external symbol 'CRTDLL__cpumode_dll' is not a function
./crtdll.spec:243: external symbol 'CRTDLL__osmajor_dll' is not a function
./crtdll.spec:244: external symbol 'CRTDLL__osminor_dll' is not a function
./crtdll.spec:245: external symbol 'CRTDLL__osmode_dll' is not a function
./crtdll.spec:247: external symbol 'CRTDLL__osversion_dll' is not a function

Zillow neighborhoods on Google maps

I’m working on a neighborhood-related map feature for something at work. Zillow blog released its neighborhood shape file data to the public to be able to map the boundaries on various things, most notably Google Maps.

While doing some research into the situation, this undertaking is going to be pretty complicated. A brief Google search gave me several key blogs and tools that I think will help me in this project.

notes

Trying to use shp2text. Downloaded ZIP file. Damn thing won’t compile on Mac.

make: *** No rule to make target `shapefil.h', needed by `shpopen.o'.  Stop.

Downloaded shapefile C lib. Compiled shapefile and copied chapefil.h to my shp2text dir. Damn shp2text still won’t compile. Damn Mac.

cc -g -c dbfopen.c
dbfopen.c:210:24: error: safe-ctype.h: No such file or directory
make: *** [dbfopen.o] Error 1

Got shp2text to compile. Found a thread that had exact same problem as me. Comment out include safe-ctype.h from the dbfopen.c file. That file is in the shp2text dir.

Now I can use shp2text to convert my .shp file into 3 formats: tab-separated value spreadsheet, GPX (XML), or geo.location (XML). I’m not sure what these are but we’ll find out soon enough.

shp2text --gpx ZillowNeighborhoods-CA.shp

To convert into GPX it asks me to choose some fields. I presume the field selection availability is pulled from the .shp file somehow.

shp2text --gpx shape_file.shp name_field# attribute_field#
;utility to dump esri shapefiles into various text formats
;you must supply two field numbers
Field 0: Type=String, Title=`STATE', Width=2, Decimals=0
Field 1: Type=String, Title=`COUNTY', Width=43, Decimals=0
Field 2: Type=String, Title=`CITY', Width=64, Decimals=0
Field 3: Type=String, Title=`NAME', Width=64, Decimals=0
Field 4: Type=Double, Title=`REGIONID', Width=32, Decimals=10


	

Since I want neighborhood name and city, I picked 2 and 3.

shp2text --gpx ZillowNeighborhoods-CA.shp 2 3

But it pushes everything to standard output. So I need to send it to a file…

shp2text --gpx ZillowNeighborhoods-CA.shp 2 3 > cali.xml

Now I have a GPX file cali.xml of all the neighborhoods in California. I think I can use this static file in Google maps but I’m not sure if it will give me a filled polygon or not.

The geo.location option looks promising because it specifies a geo.polyline but it does not give me metadata for the city or neighborhood name. The format is useless to me. Damn!