Thursday, December 31, 2015

Outside Pants

A few nights ago I stepped through a "hole in the fence" into a gated community.  It was dark outside and I was behind Dave, Irene, and Becky, all of us walking silently in the cold.

It wasn't really a "hole in the fence" like you might normally picture, more of a doorway intentionally built into in a gate with a very high threshold to step over, 18 inches or so.  For some reason whoever built the wall around the community built it with big iron gates that had little doorways for people that remind me of those doors in submarines and navy ships that you have to step over the threshold to get through.  I think they make them like that, on boats, so that they can be closed and sealed against water in case the ship starts sinking or taking on water.  In this case I think they built doorways in the fence with high thresholds for structural reasons, so the gate didn't wobble.  By the way: the gate was built for cars with a little "man door" off to the side, the door that I'm talking about, in case you're trying to visualize it.  The gate is connected to a big thick wall that goes around this particular community of tallish apartment buildings.  One of these buildings had an apartment in it that had a delicious Korean dinner being prepared for us as we marched carefully over the ice.

Of course dinner was delicious and the company was charming.  After dinner I found myself building a little pile of sunflower nuts and a bigger pile of shells on the dinner table.  Our gracious hosts had brought out pomelos and a big bag of unshelled and unsalted sunflower seeds.  Dave, Irene, Becky, and I go through a bag of sunflower seeds almost every day. They roast them and sell them on the sidewalk near our front door.  So there we were chatting it up with our friendly hosts and eating our favorite snacks when Irene started to talk about her pants.

For a low price you can buy special pants, here in the coldest corner of China.  Pants that will keep you warm.  We've been calling them "Cellulite Pants" because of the way Dave's legs look when he wears them under his jeans.  They are made of a thick, maybe an inch, layer of cotton stuffing sandwiched between two thinner layers of fabric.  There are little dimples every inch or so to hold it all together.  A little like the comforter on your bed, but in the form of pants.  I don't own a pair yet but everyone who wears them says that they are incredibly warm.  And, yes, they make your legs look fat.  But it's worth it.

Irene owns a black pair of these cellulite pants, she's had them for a couple weeks now.  And, as I shelled sunflower seeds, she started telling our charming hosts about a conversation she had with her local friend about her pants.  To summarize: Her local friend, a girl in her twenties, politely told Irene that the pants were "Stupid" and that if Irene wore them she would walk far enough behind her so that no one would know that they knew each other.  Irene was asking our host's opinion of what he thought about the pants, and why her friend would say these things.

At first our host didn't understand why our mutual friend, the local girl, would say something like that.  The local girl is a very sensible and friendly person, she must have had a good reason to so harshly shun these warm and wonderful pants.  Keep in mind that when you are speaking foreign languages you generally have no choice but to be blunt, otherwise people won't understand your meaning, and even then, like in this case, meanings are frequently confused.

Our host told Irene that he also had some cellulite pants and that most of the locals wore them as well.  (Although he didn't call them "cellulite pants")  Naturally, around here, no one would be concerned about how fat their legs looked, everyone is bundled up in so many layers, so that wasn't the reason.  But Irene was determined to get to the bottom of this.

I'm sorry I don't remember all the details of the conversation but at some point our host came to understand one important detail about Irene's pants that he, and the local girl, had taken for granted.  Irene was not only wearing the pants outside, out-of-doors, but she was wearing them outside her clothes.  She was wearing only one layer, just the cellulite pants.  His eyes got big and he clearly used the word "underwear" to clarify what part of the wardrobe these cellulite pants were supposed to fill.  Our local friend's shunning of these pants was becoming more understandable.  (Our local friend wasn't there by the way)

Of course Irene was in a state of disbelief at this point, still trying to get to the bottom of this, so she was asking, to clarify, if our experienced host thought that she should wear her cellulite pants outside.  And apparently he did not want to tell her what to do, or boss her around, but he kept saying "underwear".

Irene has been walking around, shopping, riding buses and taxis, possibly teaching an English class, in her underwear pants.  Of course us foreigners already stick out around here because of our faces, but Irene asked our host if she had been further distinguishing herself as the "foreign lady who walks around in her underwear pants".  She even reached down and flipped the upper edge of pants down to reveal that the inside was lined with a leopard print.  Yep, our host communicated, that confirms it even more.  Underwear.

Of course, needless to say, everyone in the room was laughing so hard that we were crying.  I had even stopped paying attention to my little pile of sunflower seeds.

Thursday, December 24, 2015

A Spot With A View

A few days ago I found myself standing in an interesting spot, at least I thought it was interesting. 

I was led there, to this interesting spot, by a friend to wait for another friend to go somewhere else.  So I probably couldn't find my way back to this spot on my own.  It was a short bus ride to get there and it was in front of what I'll call a "market street".  This market street looks more like what I'd imagine a Chinese street to look like if I'd never been here.  What I'm saying is that most streets here don't look like this. It even has one of those big Chinese gates arching over the road like you see in China-town in Seattle, and probably in other "China-towns".  I always thought that was just something quaint we did in America to identify where a "China-town" starts, but I was surprised to find these ornate, but door-less, "gates" all over the place in Taiwan, and now one here, in China.  But that's where we ended up, standing near a Chinese gate listening to catchy techno music and the traffic.  I did a few dance moves, but not enough to attract attention.

I noticed something I hadn't seen yet here: tuk-tuks.  I know that's not what they call them here, "tuk-tuk" is a Thailand term, three wheeled, two seated, taxis.  That was the only place I'd seen them until now.  Only here they are completely enclosed, which makes sense because it's really cold here!  You can see a couple of them in the picture.

I thought this spot was kind of picturesque, in an odd way, looking from behind that gate looking out over the wide busy street towards a couple rows of tall slender, brand-new and probably unoccupied high-rise apartment buildings in the distance.  A little pile of garbage piled at next to the gate.  My favorite part of this view was on one of the red wooden round pillars on either side of the gate.  The pillar on the left has a two character message, basically graffiti, penciled across it: 中国.

95% of Chinese characters, graffiti or otherwise, confuse me as they confuse you, unless you happen to be learning Chinese.  Yes I've learned some of the verbal, but not much of the visual: I need to learn how to read those things, I know, I know.  But in this case I was happy and not frustrated because these two characters were very familiar, I knew what they said, they said: "China".

I'm not sure what the message really meant.  I'm not sure why someone would write "China" on a red post in the middle of China.  Most people wouldn't see unless they were standing right there listening to techno music.  I guess that's what you see when you look through that gate: you see "China" beyond that gate, but then again it's also behind you.  But that's what I was looking at anyway, and that's what I was thinking about: China.

I'm trying to imagine someone writing "United States" on some sort of unremarkable landmark, in pencil, somewhere on some unremarkable intersection in Seattle.  On the other hand, I just remarked about it, so now it's remarkable.  I might even find myself awake tonight thinking about it, wondering why anyone would write it, and why they would write it in pencil.

Saturday, December 19, 2015

Ice Patches

Today I saw people sprawled out over the tables, sleeping, at McDonalds.  I walked all the way there!

I think we walked a mile or two, that's like 1.6-3.2 kilometers.  Our path was covered with little foot sized patches of ice.  Of course the sidewalks, and roads, are regularly scraped and swept of ice and snow.  For some reason when you try to remove snow like that, or maybe I should say when you do, it leaves patches of black compacted snow and ice. So everyone here becomes experts at walking on ice.  Maybe that's normal, but it's kinda new for me, you use extra muscles when you walk like that, I'm still breaking mine in.  I didn't slip and fall all day, that was my accomplishment.

I've been thinking about this ice.  Some parts of it aren't scraped and swept, like less traveled roads, they have at least six inches of that black compacted ice on them.  It's black for many reasons, there's probably a little garbage in there, and a lot of sludge and dirt.  The sludge here is mixed with many things, stuff you'd normally find a storm drain, and then lot's of stuff you'd find in a sewer, and then that stuff they scrape out of restaurant kitchen stoves.  We take off our shoes here when we come inside.  There is no running back inside to grab your keys or your wallet with your shoes on because you don't feel like putting them back on.  Nobody in their right mind would do that here.

But rest assured, you don't have to take off your shoes at McDonalds!  Actually McDonalds is a nice comfortable respite here.  Come to McDonalds, order some fries, go upstairs with your buddy, do some homework, and then take in a nap.  I haven't done it yet, but I might.  And I might actually buy something there too, instead of just going in with soy milk and a Chinese chicken pie.

Tuesday, December 08, 2015

Snow In China

We've decided that snow is beautiful in the country but ugly in the City. It snowed for about three days here, and now it's below freezing.  I've really only been out in it once, on Thursday.  We did pass through a University campus where the snow was quite beautiful, but that's not really "city".  Also snow seems to make more noise here for some reason, lot's of squeaking when you walk on it, kinda like the sound you make when you sit in a leather chair.  I'm not sure why it's so noisy, maybe the snow is extra dense here, it doesn't form into snow flakes, more like crystals, and so many people have walked on it, so it's packed down.  Or maybe it squeaks because it's so dry, it doesn't stick at all.

There are hundreds, probably thousands, of people wearing safety orange with brooms and shovels sweeping the snow and trying to scrape it off of the sidewalks.  There must be hundreds of big tractors scraping away at the streets with slightly modified back-hoes, all night.  It's kinda of an eerie sound, that scraping sound, that you hear all night.  I saw waves of huge yellow snow plows plowing, followed by tractors with front shovels (whatever those are called) pushing the plowed snow to the side in big piles, followed by big trucks with scores of guys who'd hop out and shovel snow into the backs of the trucks.

Wow, China is serious about snow.

Also I've got a cold, and I've had it for three days now. It's also taken me more than that long to get back to my blog site. In case you haven't heard, there is a great fire wall protecting China, making it very difficult to type into my blog, which was hosted by blogger.com, a Google service. I've moved my blog to a Microsoft Azure hosted WordPress blog.  Like you care.

Monday, November 30, 2015

Day 1 - Freeze Dried

It's 5:48 am.  Our friendly host told us last night that we'd wake up at 4:00 am due to jet lag. Obviously he doesn't know what he is taking about, 4:00 am was almost two hours ago. I'll correct him in the morning.
Oops, that's sarcasm. Sarcasm is one of those things that usually doesn't translate.  I need to learn how communicate here so I better choose my words carefully. Either that or I can use this blog as an outlet for any of my sarcasm.
Obviously Becky and I have arrived safe and sound.  Right now, as I slowly swipe this blog entry into my cell phone with my thumb, Becky is tucked into bed probably not sleeping either. I'm in the living room sitting on the leather couch wearing only jeans.  ...Just now I was curious if my back would stick to the couch, it's so dry here that I thought it might not, but it did.  Also, don't worry Mom, I'm drinking plenty of liquids.
It's hard to articulate my first impressions of China. It's cold, dry, flat, brown, smells like smoke, and is covered in a thin layer of useless dry powdery snow.  (Snow that cannot be built into igloos or snow men is useless. Also it's flat here, so no snow boarding) There are about ten million people in this area so there are plenty of tallish buildings.  The road near where we are staying is 14 lanes wide, 7 lanes going one way, and seven going the other way, these lanes are completely ignored but traffic flows. Drivers in China like honking their horns outside our bedroom window while ignoring these lanes.
The locals here are very friendly and I haven't seen any other foreigners yet.
Oh, and a fun detail, from Becky, is that fruit here is sold frozen on the streets using the great outdoors as the freezer. Ice cream bars are also sold as street food from cardboard boxes out on the open.
Well the city is starting to wake up and honk at each other, maybe I'll try to sleep some more.

Day Zero Leg 2

Ok, now we're on the plane again, somewhere over China, about two hours left. Becky is playing her favorite word search game on her tablet. "Ricky and the Flash" is playing silently with Chinese subtitles on the little screen hanging down from the ceiling 3 rows up, it looks like Meryl Streep's character has just gotten to know her grown daughter, which she apparently abandonned and left with the father, but is hitting the road again. We lucked out on this flight, we have an entire row to ourselves, and the row in front of us, half the row in front of that, half a row behind us, you get the idea. It's leg room heaven! In a few hours we'll be talking to immigration officials, handing them the little yellow forms we just filled out on the plane. I'm wondering how it will go. I've had a few language-barrier frustrated conversations with immigration officials before about this box or that box on their forms... or at least that's what I thought the conversations were about. I saw something I've never seen before today. I saw a flight attendant attach an aluminum baby cot to the wall in front of the first row. The baby cot had straps and a little pillow and it was attached to the wall a little below eye level of the parents sitting in front of it. It's probably not a Chinese thing, or Tawainese, since this is an Airbus A321-200 and the wall has sockets for it built in, but I've never seen it before. There's not that much else that's interesting that I saw today. Although I was reminded of the Taiwanese custom of having women clean the men's bathrooms while the men are using it. It happened to me pretty often when I lived in Tawain in 2008. At first it was confusing, then akward, then kind of insulting for some reason, then I hardly noticed. And now, seven years later, it's just like old times. I wonder what new customs I will adapt to next. Well this blog entry is getting longish and I can't remember much else that I've noticed so far. I will say one thing, the Chinese food on EVA, a Taiwan based airline, is pretty good, whereas the American style food is about the same as it is on an American airline: not as good as the Chinese food on EVA. Also, note to future self: bring an extra shirt in the carry-on for your next long flight. My green extra largeXbox T-Shirt has EVA Chinese food stains and Taiwanese Niu rou mian (Beef noodle soup) stains all over it. Meryl Streep's character is singing with her band at her daughter's friend's wedding, and her daughter is laughing, it seems that her attempts to form a relationship with her daughter were a success. Oh now her daughter is singing with her. Now I can end this blog entry.

Sunday, November 29, 2015

Day Zero

I'm sitting in an airport terminal listening to soft Chinese chatter.  This is my first exposure to what is probably, I'm assuming, the accent of the people of the city where I am going to live for the next year or more.  Of course I have not strained my ears enough yet to understand any of it...
Speaking of understanding: My wife laughed at me about an hour ago when I came back to the table, in an airport restaurant, with a full tray of food.  My second tray.  I only wanted the fried tofu, but apparently I ordered "the meal", which come with little side dishes.  I think it was #8.  
"Here we go again" I said to myself.  I almost forgot about the confusion of ordering from a Chinese menu, pointing and nodding.
But I solved this problem by eating almost the whole tray.  No problem.  My "Xbox Music" T-Shirt, which I found in a give-away pile at work is sized XL.  
We have overcome a few obstacles on the way here.  Overweight carry-ons, a missing sock.  Well that's all that I can remember.
Ok they're boarding! Better go!  I can't wait to fill out immigration forms, or tourist forms or whatever they're called

Wednesday, August 12, 2015

ILSpy for Decompiling Assemblies

I found an even better way to decompile C# assemblies, better than ILDASM.  It even creates a .csproj file for you.

Although ILDASM helped me find source code from a hexadecimal location in an error message from production, I'm not sure if you can do that with ILSpy, I haven't tried.

It's an open source project called ILSpy, this is their website: www.ilspy.net
I had a little bit of trouble getting it to decompile a XAML file, but not a lot of trouble.

Just press Ctrl-O to open a C#/.NET .exe, then Ctrl-S to save the code and .csproj file.  Then you can open the .csproj file in Visual Studio, I used Visual Studio 2013 and it worked without any issues.

I used ILSpy at work to locate a hard coded file path in a tool that we had no source code for.


Thursday, June 04, 2015

Too many parameters in my constructors.

If I have too many parameters in my constructor, that means my class is doing too many things.

Quotes from this article: http://blog.ploeh.dk/2010/02/02/RefactoringtoAggregateServices/

"Surely, five constructor parameters are too many."

"Constructor Injection makes SRP violations glaringly obvious."

If you think that I should use a dependency injection framework, I disagree.

I agree with this article: http://blog.schauderhaft.de/2012/01/01/the-one-correct-way-to-do-dependency-injection/

You can use it in your outer layers to get things built up and started, but don't call a dependency injection framework from your business logic, your inner layers.  All of your injected dependencies should be injected into the constructors so they will be obvious, not scattered throughout your code.



Thursday, May 07, 2015

Variable Swap Problem

Someone suggested this problem to me a while back: Swap x and y integers, 6 and 248, without using an extra variable.  I was already working on my XOR solution, similar to how RAID 5 and one pad key encryption works, when she told me I could use XOR.  I almost had it! But anyway this is the solution I came up with:

        [TestMethod]
        public void NoExtraVariables_Swap_XY()
        {
            int x = 6;
            int y = 248;

            x ^= y;
            y ^= x;
            x ^= y;

            Assert.AreEqual(248, x);
            Assert.AreEqual(6, y);
        }