Friday, June 15, 2012

The remains of the time

They finally fixed the best LED sign in Taipei, and I have this movie of it.


I guess the lesson is that persistence pays off.

When you come back from a trip to XXX, people always ask you the question:
Well, how was XXX? Where to start the answer and how? Most memorable?, most interesting?, funniest?, best food?, shittiest experience? ... I was always at a lost to know how to answer.

I thought a blog would be a good solution, then I could just answer: Did you read my blog? After awhile I realized that a lot of people who asked this question were just being polite. Kind of like talking about the weather. You'd think after 3 blogs and 451 blog entries I would have figured this out earlier, but I'm a slow learner.

So I think the blog gradually became more for me than for others. (I guess not everyone is into old motorcycles.) So it goes. For me it has been fun.

For old time sake, here's an interesting bike/motorcycle antique:


Most of the early motorcycle makers in Japan and Taiwan started out as bicycle makers who used a small 2 stroke engine bolted to the rear wheel to give the rider an "assist". I had only read about these machines, but last month I saw one on the street. Still running after more than 60 years.

Over and out.

Thursday, June 14, 2012

The knot project

I pretty much completed my math/programming project while in Taipei. At the end of my last stay in Tainan, I thought I was close to computing the Kauffman polynomial for all knots. This is an algorithm for associating a polynomial to each knot which is the same polynomial no matter how the knot is manipulated but stays untied.

After awhile I realized that I was far from correctly computing the polynomial, so I decided to rewrite from scratch and this time use C++ instead of C. Previously, I had used C++ at work, but after this project I feel I know the language well. I set up C++ classes for loops, knots and links, implemented overloaded operators for Laurent polynomials, used dynamic allocation and recursive calls. All of these could have been done in just C but are so much easier in C++.

I used gnuplot to create pictures of the progress of computation. Here is a simple composite of the steps for computing the Kauffman polynomial for the figure 8 knot.



In my two previous stints in Tainan, I used an Asus netbook running Linux for a development machine. This time, I used a Toshiba notebook running Windows 7. To simulate the Linux environment, I used CYGWIN and the vim editor for vi. I'm too cheap to buy the Microsoft development suite and don't have the time to learn all of MS's details.

For the most part, it worked OK but I did have some problems:

1. Because of my recursive use, I ran out of stack space and CYGWIN has noway of increasing stack space. So I'm stopped at computing only the knots with up to seven crossings. When I get back home on a real linux box, I'll do more.

2.MS has no automatic(and free) way to view thumbprints of .eps files. I like to survey the correctness of the algorithm by viewing the directory of thumbprints. It's a pain to open dozens of output .eps with ghostscript/gsview.

3.I feel that little Asus netbook running linux was faster than the big Toshiba notebook running windows7.

Out in Neihu I saw this sculpture in an apartment garden. I doubt that 1% of passerbys know what figure they are looking at. Hexagons and pentagons in the shape of a ball. What could that be?


Ok, none of that has been too practical. But here is something that is. One of my relatives in Taiwan gave me a blank Microsoft paper notebook that had the current calendar as 1994(they never throw out anything). The days of the year matched up perfectly with the current year(at that time) 2011. How often does that happen?

Using unix tools the command "cal xxxx" produces a text copy of the calendar year xxxx. Then looking for duplicates(easy in the unix world). We get this table for the years 1900 to 2100:

 Duplicates
1900 1906 1917 1923 1934 1945 1951 1962 1973 1979
1990 2001 2007 2018 2029 2035 2046 2057 2063 2074
2085 2091
Duplicates
1928 1956 1984 2012 2040 2068 2096
Duplicates
1920 1948 1976 2004 2032 2060 2088
Duplicates
1916 1944 1972 2000 2028 2056 2084
Duplicates
1904 1932 1960 1988 2016 2044 2072
Duplicates
1901 1907 1918 1929 1935 1946 1957 1963 1974 1985
1991 2002 2013 2019 2030 2041 2047 2058 2069 2075
2086 2097
Duplicates
1912 1940 1968 1996 2024 2052 2080
Duplicates
1902 1913 1919 1930 1941 1947 1958 1969 1975 1986 
1997 2003 2014 2025 2031 2042 2053 2059 2070 2081
2087 2098
Duplicates
1924 1952 1980 2008 2036 2064 2092
Duplicates
1903 1914 1925 1931 1942 1953 1959 1970 1981 1987
1998 2009 2015 2026 2037 2043 2054 2065 2071 2082
2093 2099
Duplicates
1908 1936 1964 1992 2020 2048 2076
Duplicates
1909 1915 1926 1937 1943 1954 1965 1971 1982 1993
1999 2010 2021 2027 2038 2049 2055 2066 2077 2083
2094 2100
Duplicates
1910 1921 1927 1938 1949 1955 1966 1977 1983 1994
2005 2011 2022 2033 2039 2050 2061 2067 2078 2089
2095
Duplicates
1905 1911 1922 1933 1939 1950 1961 1967 1978 1989
1995 2006 2017 2023 2034 2045 2051 2062 2073 2079
2090

So for 2013,  a calendar from 2002 or 1991 will do just fine and it there are so many similar calendars because it is not a leap year.

Wednesday, June 13, 2012

The Night Sky in Taipei

I have been in Taipei for almost 6.5 months and I have never seen any stars. Of course, on cloudy nights nobody can see the stars, but even on clear nights I see no stars. I haven't been vigilant in observing every night, I just casually have never seen the stars.

I think the problem is "light pollution", basically the light from the city drowns out the light from the sky.  Not all objects in the sky are of the same apparent brightness, here is a table abstracted from the Wikipedia article on magnitude:

–26.74 Sun (398,359 times brighter than mean full moon)
–12.92 Maximum brightness of full Moon
–4.89 Maximum brightness of Venus
–2.94 Maximum brightness of Jupiter
–2.91 Maximum brightness of Mars
–2.45 Maximum brightness of Mercury
–1.47 Brightest star (except for the Sun)Sirius
–0.72 Second-brightest star: Canopus

This is in a logarithmic scale so the difference between brightest Venus and the brightest star is more than 2000X (4.89-1.47=3.42, 10^3.42 = ~2630). So in the Taipei sky, it's possible to see the sun.
And in this next shot we see both the moon and Venus.
You can see Venus as a small spec of light below the moon and to the left.
I wonder if any one in NYC has seen the stars? I doubt it.

But there is an upside to this situation, while in a noncity environment you can't see anything on a cloudy night. But in Taipei on a cloudy night, you can see the clouds, they are illuminated from the city lights from below.



Tuesday, June 12, 2012

Food

Tourists taking pictures of their food is just part of traveling nowadays. It use to be that photos went to die is some old family album, now they live forever on blogs and facebook.

Coffee is making inroads into Taiwan and China but Tea is still king. As much as the taste both have their own rituals. Like clever presentation.
And who wouldn't want to drink coffee that was once the shit of a cute little weasel.
For some reason I don't know of, now is the season for winter melons, they look like watermelons but are white inside and go into soups. 
They are popular.
 But my favorite is the traditional Chinese breakfast of shoubing yutiao snf doujiang, especially at FuHang's.

Monday, June 11, 2012

Zong zi

In a previous blog entry we had a picture of zong zi. These are the tetrahedrons of glutinous rice wrapped in bamboo leaves with a filling inside. In the West they are sometimes called rice dumplings.
Inside can be all kinds of ingredients like meat, cooked peanuts, water chestnut, black mushrooms, hard boiled egg sections, ... When they are steamed,, the rice cooks and the favor from the inside ingredients migrates to the rice but stays within the bamboo leave wrapping. They use to be only available on DuanWuJie(Dragon Boat Festival), but nowadays,  anytime of the year you want them, you can find them.

They are easy to reheat in a rice maker, the bamboo wrapping is kind of like the original Tupperware container.

 They are a little messy to unravel, usual there is a string holding the bamboo leaves together.
 Once unwrapped you can cut the tetrahedron of rice to see what's inside. In these that I got from the Carrefour supermarket has pork, peanuts, water chestnuts, and black mushrooms.


Rice was cultivated in China about 10,000 BC and the Bronze Age only began about 3,000 BC. So without pots and pans, how did they cook rice? So at 10,000 BC they had pottery, but no metal.  Certainly the zongzi is one way but another way is to use the bamboo tubes. Raw rice and water are added to the tube and the tube is cooked over the fire. Sometimes it is still done this way, but mostly for tourists by aboriginal people.

Sunday, June 10, 2012

Bridges

Like all major cities, Taipei is located near a waterway. In Taipei's case it is near the confluence of the Danshui and Keelung rivers and the Danshui river empties into the Pacific ocean. (The only case, I can think of, of a city not located on a waterway is Las Vegas.)

 Maps from 200 years ago, show Taipei as just a ferryman's house. Compared to the rest of Taiwan, Taipei has cold winters and hot summers, located in the bottom of a basin it doesn't get the breeze from the ocean like other Taiwanese cities. But more than 100 years ago, electricity made Taipei more inhabitable. Heating in the winter first and after WWII air conditioning in the summer. Without these, Taiwan's capital would still be the older capital, Tainan.

Located on the rivers, Taipei has its share of bridges and ships.

And it has shallow bottom boats like this, maybe Mark Twain is the pilot.
In in Taiwan they use these gigantic "Jumping Jacks"  made of cement to prevent erosion of the river banks.
But like all big cities, when the space is crowded, they build into the sky. Crisscrossing Taipei is a system of elevated highways, although some are not "elevated" that high. I think some SUVs wouldn't get under this bridge.
But the most famous bridge in Taipei is probably the moon bridge in the Dahu park.


Saturday, June 9, 2012

Giving up the searching for true neon

I use to think that if I concentrated hard enough and compared known neon sources I would be able to identify neon lights just by their shade of reddish orange color. And I've written about this before.


http://tainanchineseclass.blogspot.tw/2010/02/neon-signs.html
http://tainanchineseclass.blogspot.tw/2009/11/neon-everywhere.html
http://mikeess-trip.blogspot.tw/2011/06/searching-for-true-neon.html

Living in one of the older sections of Taipei means that there is still true neon(uses neon gas) versus uses of fluorescent technology and a phosphor coatings. This NOT true neon:
Investigating further, my problem is that the emission spectrum of neon is not a single pure color but a mixture of wavelengths.

So the light we see from a light using neon is a mixture of colors(mostly in the reddish/orange range). By varying the current, voltage and glass absorbency,  all true neon light don't have the same color. And for the fluorescent technology, varying the composition of the phosphor coating let them mimic any color spectrum.

There are only two ways, I know of to be sure the sign is true neon.

1. When the light is turned off, the glass tubes are transparent, i.e. there is no coating of phosphors that implement the fluorescent technology. Here the tubing is transparent(better seen in daylight).  True neon.



2. The sign has to be pretty old to be true neon. The florescent technology is just more efficient. The mercury vapor and phosphor coatings are cheaper than using neon(also more colors are available) and the power requirements are less. So
any modern sign is NOT true neon. These old style Christian crosses are neon, close inspection shows the tubes are transparent.
But there are lots of nonfunctioning neon signs in our area of Taipei, that are just too dangerous to remove, kind of like fossils of a bygone age.
Well it's nice to put this one to bed, even if the result is not what I hoped for.

Friday, June 8, 2012

The Ardunio Project

One of the projects I completed here in Taiwan was project using an ardunio processor to control a linear actuator. Basically I use the mouse on my computer to drive a motor, but more than that, I use a coupled LED and photocell  to map the position of a frame changed by the motor onto the coordinates of the mouse. Here's a diagram:

Using the ardunio to turn on the motor and reverse it's direction would be just a switch but the pair of an LED and a photocell provides a feedback mechanism to measure how close the LED is to the photocells. These measurements tell the program where the motor has moved the frame.

Here's the board:
The major components are:

The ardunio board with it's microprocessor
The H-bridge chip connected to the ardunio board that controls the direction of the motor.
The brush motor controlled by a PVM signal from the ardunio board
The feedback mechanism of two tubes with an LED movable at one end and an immovable photocell at the other end. The photocell signal is an input to an analog port on the ardunio board.
I can control the motor from the serial monitor on the ardunio board, but instead I wrote a GUI in the processing language to run on the PC that takes the inputs from the mouse to determine how the motor moves the frame position. It's a simple GUI,
Here's the set up for the movie, with the board next to the GUI, my hand on the mouse is off camera.
And here's the project in motion, I'm moving the mouse and clicking on a position for the motor to move the frame to.

This one worked out so well I thought I might investigate patenting it, but I thought: "Why ruin a fun project?"  Like Robert Cray said(and Seymour Cray would agree) "If you want to make my day, tell me a boat full of lawyers just sunk."

I reached the limit with what I could do here in Taiwan because the frame is now made from tongue depressors and Popsicle sticks. The holes are drilled with hand tools. In Seattle I will switch to plexiglass and a drill press. The web material on photocells say that the photocell is too inaccurate for applications. It works OK for me and I have a few tricks left to investigate.

Usually ardunio projects use an expensive stepper motor to effect position placement. I think my method could also work. The pieces I got off the web, putting them all together in this way was my idea. I give permission(if anyone cares) to anyone who wants to use it. Need help? Give me an email.

Eventually I would like to use two motors to move to any xy position. I'm thinking of using it for a microscope stage.

Thursday, June 7, 2012

Ideas #3

Here are some ideas from Taiwan.

In Taiwan, you can buy a plate with a lock that clamps on to the top of the shifter
plate. It locks the stick shift into the park position. Better that the "club" on the stearing wheel.

The curbs in Taiwan rarely have ramps built in the cement for cars to enter and exit. So each business makes their own ramp for vaulting the curb.


Not many use trundle sew machines anymore but at one restaurant they used these sewing machine tables for tables. Good for ADD children.

We tried out these tandem bikes, the experience tells us to eschew those bikes that have no ability to adjust for different size riders. 
The derailers on bikes are just there to adjust the ratios between the main sprocket and the rear wheel. There really is no reason why the front and rear wheel has to be of the same radius.
The ramp in the middle of the stairway is for bicycles. 
Those are not Christmas presents in the brightly colored packages. Those are bricks used as door stops or decorations.