Author Archives: xangis

Preserving Newlines in XML Serialization

With .NET’s XML serialization, it kills newlines when you serialize XML to disk. More specifically, it converts a CR+LF into just an LF (\r\n becomes just \n).

This was causing annoyances with the spell editor, since you can edit source code for spells with it, but the code would appear all on one line after saving and reloading.

The fix was to declare XmlWriterSettings with a newline preference.

The code was this:

         public void Save()
         {
             XmlSerializer serializer = new XmlSerializer(GetType());
             Stream stream = new FileStream(FileLocation.SpellDirectory + FileName,
                 FileMode.Create, FileAccess.Write, FileShare.None);
             serializer.Serialize(stream, this);
             stream.Close();
         } 

And now it’s this:

        public void Save()
        {
            XmlWriterSettings ws = new XmlWriterSettings();
            ws.NewLineHandling = NewLineHandling.Entitize;
            XmlSerializer serializer = new XmlSerializer(GetType());
            Stream stream = new FileStream(FileLocation.SpellDirectory + FileName,
                FileMode.Create, FileAccess.Write, FileShare.None);
            XmlWriter writer = XmlWriter.Create(stream, ws);
            serializer.Serialize(writer, this);
            stream.Close();
        }

I can have my newlines and eat them too. Oh joy!

I Am Addicted To Github

Until recently, the only code I’ve released as open source has been the Magma MUD codebase.

In the process of posting the Magma source on Github, I kind of got hooked on posting code online. Since then I’ve posted the source for a handful of applications, a mix of Linux and Windows desktop apps. A 12-day commit streak so far, yay!

I’m also considering open-sourcing the Basternae 3 codebase. The main things that make it easier to work with than old-timey C-based MUDs are the use of C#, which has amazing exception handling and debugging capabilities (no more attaching gdb to a core dump), and speaks XML natively, so data files are Human-readable, portable, fairly robust, and extensible. The editor is also getting to be pretty good.

To open source Bast3, I’d need to write a lot more documentation, and I’d need to “genericize” a lot of things that are specific to Basternae. It’d be a lot of work, but I think it’d be a fun project. The source is already in a private repository on Github, but that’s the easy part.

Magma MUD Codebase Now on Github

The Magma MUD codebase, last updated in 2008, is now on Github: https://github.com/Xangis/magma

I’ve cleaned up the build a little bit, but it’s still the same old Magma that was used to start Basternae 2, warts and all.

If you feel like cleaning up any bugs (there are plenty) or adding any improvements, go ahead.  If you want to send a pull request I’m Xangis on Github (as you can probably tell from the URL).

Using MonoDevelop

I’ve almost always used both Windows and Linux, but I stopped using Windows a few months ago.  One of the things that only runs on a Windows machine is Visual Studio.  The Basternae code was compiled on a Windows machine and then uploaded to the Linux host.

Without access to that, it was time to try using MonoDevelop.

MonoDevelop
It was able to load the Visual Studio solution, with some exceptions:  The client WPF project didn’t load, nor did the abandoned Silverlight project.  I could probably install more packages to make WPF work, I’m not sure yet.

I noticed that the compiler works differently for some things, like terminal characters.  The ECHO_ON and ECHO_OFF sequences broke logging in, but some weird prompt formatting that’s been around for a while just fixed itself.  It will be interesting to see what other diffferences turn up.  Even though C# is supposed to work the same on all platforms, I suspect that it might work better when both the build and run machines have the same operating system.

What of the MUD?

That is a good question.  I haven’t touched it in a long time, around a year.

Basternae is still important, but it’s been pretty severely deprioritized in favor of the startup work I’ve been doing here in the Portland area.  As soon as I get a win big enough to retire on it’ll be my first priority, I promise.

Can you think of a way I can make a living writing a MUD?  I’ve been trying for 10 years, but haven’t come up with anything.  That’s a shame because it’s far more fun than doing almost any kind of real work.

Mint Mark Guide

From my website stampscoinsnotes.com. The meanings of mint marks on coins from different countries.

Germany

A – Berlin
D – Munich
E – Muldenhutten
F – Stuttgart
G – Karlsruhe
J – Hamburg

Mexico

A – Alamos
AS – Alamos
C – Culiacan
CA – Chihuahua
CE – Real de Catorce
CH – Chihuahua
Cn – Culiacan
D – Durango
Do – Durango
G – Guanajuato
Ga – Guadalajara
GC – Guadeloupe y Calvo
Go – Guanajuato
H – Hermosillo
Ho – Hermosillo
M – Mexico City
Mo – Mexico City
O – Oaxaca
OA – Oaxaca
P – San Luis Potosi
PI – San Luis Potosi
SLP – San Luis Potosi
Z – Zacatecas
Zs – Zacatecas

United Kingdom

H – Heaton
KN – King’s Norton

United States

C – Charlotte
CC – Carson City
D – Denver
O – New Orleans
P – Philadelphia
S – San Francisco
W – West Point

Country Identifier

From my website stampscoinsnotes.com. This may help in identifying stamps or currency.

Afghanes – Afghanistan
Al-Maghrib – Morocco
Batavia – Netherlands Indies
Bon Towarowy – Poland
Cabo Verde – Cape Verde
CCCP – Russia (Soviet era)
Ceskoslovensko – Czech Republic
CPBNJA – Serbia
CRVENI KRST – Yugoslavia
Deutsche Bundepost – Germany
D.P.R. Korea – North Korea
Eire – Ireland
Foroyar – Faroe Islands
Haute Volta – Upper Volta
Helvetia – Switzerland
HP BbArAPNR – Bulgaria
Hrvatska – Croatia
Island – Iceland
JYROCNABHJA – Yugoslavia
Kampuchea – Cambodia
Kibris – Cyprus
Letzeburg – Luxembourg
Lietuva – Lithuania
Magyar – Hungary
MAKEDOHNJA – Macedonia
Malgache – Madagascar
MOHROA WYYAAH – Mongolia
Muntbiljet – Suriname
Nippon – Japan
Noreg – Norway
Noyta – Russia
Osterreich – Austria
Persane – Iran
Poccir – Russia
Republica Dominicana – Dominican Republic
Santral Sesel – Seychelles
Shqiperia – Albania
Srpske Krajine – Serbian Krajina
Suomen – Finland
Sverige – Sweden
Togolaise – Togo
TOYNKNCTOH – Tajikistan
UAPCTBO – Bulgaria
UPHETOPE – Montenegro
Zhongguo – China
Aitutaki – New Zealand
AZERBAYCAN – Azerbaijan
Belgique – Belgium
Bundeskassenschein – Germany
Cambodge – Cambodia
Ceska – Czech Republic
Comores – Comoros
CPNCKA – Serbia
DDR – German Democratic Republic
Deutsche Demokratische Republik – German Democratic Republic
Eesti – Estonia
Espana – Spain
Gronland – Greenland
Heireann – Ireland
Helvetica – Switzerland
HP GbNraPNR – Bulgaria
Inrikes – Sweden
Jugoslavija – Yugoslavia
KA3AKCTAK – Kazakhstan
KbIPTbI3CTAH – Kyrgyzstan
Kyrgyz – Kyrgyzstan
Liban – Lebanon
Lietuvos Respublika – Lithuania
MAKEAOHCKN – Macedonia
Malagasy – Madagascar
Maroc – Morocco
Moldovei – Moldova
Nederland – Netherlands
Nistriana – Transnistria
Norge – Norway
Noytobar Mapka – Russia
PCCP – Russia
Pilipinas – Philippines
Polski – Poland
RSA – South Africa
Sedlabanki Islands – Iceland
Shqiptar – Albania
Suid-Afrika – South Africa
Suomi – Finland
Tchad – Chad
TOrPOr – Mongolia
Turkiye – Turkey
UPHA rOPA – Montenegro
YKPAIHN – Ukraine

Number Identifier

From my old website stampscoinsnotes.com, numbers in different languages.

Language 0 1 2 3 4 5 6 7 8 9
Arabic ٠ ١ ٢ ٣ ٤ ٥ ٦ ٧ ٨ ٩
Bengali
Burmese (Myanmar)
Devanagari (Hindi/Nepali)
Ethiopic
Gujarati
Hebrew א ב ג ד ה ו ז ח ט
Japanese (Chinese/Vietnamese)
Kannada
Khmer
Lao
Malayalam
Oriya
Punjabi (Gurmukhi)
Tamil
Telugu
Thai
Tibetan
Urdu (Persian/Farsi) ۰ ۱ ۲ ۳ ۴ ۵ ۶ ۷ ۸ ۹

Cleaning Old Coins

Old coins often have dirt, corrosion, oil, or other “gunk” on them. It can be tempting to clean them with powerful industrial cleaners, silver polish, Shine Brite, or other chemical cleaners.

However, this is a bad idea.

Over time, coins develop oxidation, discoloration, and a layer of grime. This is called a patina, or more commonly in numismatics, toning.

Natural Toning on a Mercury Dime.

Chemical cleaning agents will remove toning. A coin in its natural toned state is more valuable, so removing toning will reduce a coin’s value and collectibility. An ugly old coin may not look as appealing to most people, but a shiny, artificially new-looking coin from the 1920s with a noticeably worn face is unappealing to an experienced collector.

It is possible to add false toning to a chemically cleaned coin with something like Midas Black Max Oxidizer, which uses hydrochloric acid and tellurium to create an artificial patina. This is technically a form of counterfeiting and is not recommended, as it renders a coin numismatically worthless. It may be a fine choice when recovering corroded old coins to turn into jewelry, but that is the only sane use for such a thing.

Cleaned and False-Toned Mercury Dimes for Use in Jewelry Manufacture. Image Courtesy of Dean Moore Designs.

The only safe way to clean a coin is with a gentle wash in mild dish soap and water. If that can’t remove the excess grime from your coin, then it wasn’t meant to be removed.

Coins should be washed by hand in a plastic container, because rubbing them against a metal sink can scratch them, as can some cleaning pads and brushes. Using steel wool to clean coins would be an especially bad idea. Rub the coin with your fingers from the center outward to push dirt, oil, and grime toward the edge of the coin.

After washing, rinse the coins with clean water to remove all remaining soap residue. Distilled water is preferred.

You should pat coins dry with a soft towel after rinsing and make sure they are completely dry before storing them. After rinsing, you should only handle coins by the edges to avoid adding more oil from your hands.

Be careful of residual moisture when cleaning coins. Some 20th-century coins from Romania and the Soviet Union are prone to rust if kept wet for any length of time. Their plating is not sufficient protection for the ferrous core of those coins. Soaking them is not a good idea. Other coins can be safely soaked for a bit to loosen grime. For example, an old piece of candy cane clinging to a coin isn’t just going to wash off. It’ll need to soak for a few minutes.

The Advent of The Zip Code

In the early 20th century it was common for mail to be sent without an address. A letter addressed to “Reginald Doe” with an address of “City” would have no trouble arriving to an addressee in the same town provided there was only one person with that name. In small-to-medium-sized towns in 1910, that was enough to ensure delivery.

In the 1920’s some post offices encouraged senders to write street addresses on mail. An example can be found here on this postcard from 1922 with a postmark reading “Address your mail to street and number”:

In 1943, due to a shortage of experienced postal carriers caused by World War II, postal zones were created. They were intended to make sorting and delivery easier within the 178 most populous areas of the United States. A typical address would then read:

Reginald Doe
1123 Main St.
Long Beach 3, California

In 1963, the “Zone Improvement Plan” was created based on a 1944 proposal by the postal inspector Robert Moon. It is a system of five-digit codes used for routing mail to a more specific location. This plan made use of the existing postal zone codes, using three prefix digits in conjunction with the existing postal zone. The previous “Long Beach 3” postal zone became ZIP code 90803.

The first digit of a ZIP code generally indicates how far west a location is. States on the east coast have zip codes beginning in 0, while Pacific states have zip codes beginning with 9. The 0 prefix was also used for U.S. Territories such as Puerto Rico and the Virgin Islands.

At the same time, the post office started encouraging the use of two-letter state codes. The theory was that compressing the name of the state would make it easier to make room for the five-digit ZIP.

In 1967 the ZIP code was made mandatory for bulk mailers of 2nd and 3rd class material.

In 1983 the nine-digit ZIP+4 was created. This includes more specific location data with the first two digits being “sector”, such as a group of streets or high-rise building, and the second two being “segment”, such as a specific city block or floor of a skyscraper.

For post office boxes, each box has its own unique +4 code. In the case of box numbers with four or fewer digits, this is simply the box number.

The ZIP+4 scheme has not been widely adopted for non-commercial mail and is not required, but it is used extensively by postal processing and sorting equipment. Bulk mailers receive a discount on postage if they pre-print the postnet barcode for the extended ZIP code on their mail.

Though intended primarily for mail routing, the 42,000+ zip codes are used for statistical aggregation by the Census Bureau and are used extensively by business for marketing and customer data aggregation purposes. It is also very common to see real estate data aggregated by zip code.

State Quarters

From 1999 to 2008 the United States Mint issued state-themed quarters. Five states were issued per year in the order in which they achieved statehood. After the state series was completed, quarters for the U.S. territories were issued in 2009. Each of the state quarters was issued from both the Denver and Philadelphia mints, making a total of 100 quarters in the full set.

Here is a list of the state quarters, with date of statehood in parentheses:

1999

Delaware (1787-12-07)
Pennsylvania (1787-12-12)
New Jersey (1787-12-18)
Georgia (1788-01-02)
Connecticut (1788-01-09)

2000

Massachusetts (1788-02-06)
Maryland (1788-04-28)
South Carolina (1788-05-23)
New Hampshire (1788-06-21)
Virginia (1788-06-25)

2001

New York (1788-07-26)
North Carolina (1789-11-21)
Rhode Island (1790-05-29)
Vermont (1791-03-04)
Kentucky (1792-06-01)

2002

Tennessee (1796-06-01)
Ohio (1803-02-19)
Louisiana (1812-04-30)
Indiana (1816-12-11)
Mississippi (1817-12-10)

2003

Illinois (1818-12-03)
Alabama (1819-12-14)
Maine (1820-03-15)
Missouri (1821-08-10)
Arkansas (1836-06-15)

2004

Michigan (1837-01-26)
Florida (1845-03-03)
Texas (1845-12-19)
Iowa (1846-12-28)
Wisconsin (1848-05-29)

2005

California (1850-09-09)
Minnesota (1858-05-11)
Oregon (1859-02-14)
Kansas (1961-01-29)
West Virginia (1863-06-20)

2006

Nevada (1864-10-31)
Nebraska (1867-03-01)
Colorado (1876-08-01)
North Dakota (1889-11-02)
South Dakota (1889-11-02)

2007

Montana (1889-11-08)
Washington (1889-11-11)
Idaho (1890-07-03)
Wyoming (1890-07-10)
Utah (1896-01-04)

2008

Oklahoma (1907-11-16)
New Mexico (1912-01-06)
Arizona (1912-02-14)
Alaska (1959-01-03)
Hawaii (1959-08-21)

2009

District of Columbia
Puerto Rico
Guam
America Samoa
Virgin Islands
Northern Mariana Islands

Mint Marks on Washington Quarters

The George Washington quarter first came into circulation in 1932. It was designed by John Flanagan, whose initials appear at the base of Washington’s neck. They can be hard to spot, since they are one of the first things to wear off of the coin.

For silver coins before 1964, the mint mark appears just below the wreath on the reverse side. Coins with “D” are from Denver, with “S” are fron San Francisco, and those with no mark are from Philadelphia. The San Francisco mint only produced quarters through 1954, but reopened in 1965.

Starting with the switch to copper-nickel clad coins in 1965 and through 1967, the quarter shows no mint mark, even though coins were produced in Philadelphia, Denver, and San Francisco.

The standard method of using D for Denver and no mark for Philadelphia resumed in 1968, but with the mint mark appearing on the obverse side to the right of the nape of Washington’s neck. That year the San Francisco mint ceased producing quarters for general circulation and switched to striking limited-run proof coins for collectors.

In 1980 the letter P was added for Philadelphia. This continued through the state and national parks series of quarters.

1953D Washington Quarter

1994D Washington Quarter

 

The Jefferson Nickel

The Jefferson Nickel first came into circulation in 1938. It was the first coin design ever chosen in an open competition and was created by the winner, Felix Schlag. His initials were not originally on the coin, but they were added in 1966.

The reverse shows Thomas Jefferson’s home in Monticello.

During World War II, nickel was diverted to the war effort and the coins were made of an alloy that was 56% copper, 35% silver, and 9% manganese. These nickels had a large mint mark above Monticello in order to be easy to identify. This was the first time that the mark P for Philadelphia was used. These were made from 1942 until 1945. After the war the nickel’s composition returned to 75% copper and 25% nickel, which it had been since 1866.

In all other Jefferson nickels prior to 1965, the mint mark appeared to the right of the building, with no mint mark meaning the coin was struck in Philadelphia.

From 1965 to 1967, the nickels were struck with no mint mark, even though they were produced in Denver, Philadelphia, and San Francisco.

After 1968, normal mint mark usage returned, with D for Denver, S for San Francisco, and no mint mark for Philadelphia. Starting in 1980, coins were struck with a P for Philadelphia.

1938D Jefferson Nickel

1943P Jefferson Nickel

1982P Jefferson Nickel

Heading North

I live in Mountain View, CA in the heart of Silicon Valley right now.  I’m moving 700 miles north to Beaverton, OR in the heart of the Silicon Forest over the next few days.  I’m looking forward to not being around California drivers anymore.

Server Updated

Over the course of a lunch hour yesterday I updated the operating system on the Basternae box.  It was running Ubuntu 10.04.  It’s now on Ubuntu 12.04.  It took about 45 minutes to finish the whole process including testing and fixes.  Only one thing broke in the process.  The Django web framework, which runs about half of my websites, was uninstalled by the upgrade process.  I had to manually reinstall it, which took about 10 minutes.

I remember upgrading a Red Hat 5 box to Red Hat 9 many years back.  The process took about 10 hours to finish and get everything working again.  Easy upgrades are a good thing.