Florence

August 5-7

Florence is the first city I have visited that is inland. It is set up in some green mountains that make the views very nice. Life seems to be a bit slower here than in Rome and there is much more natural beauty. There were many street performers in Florence. I saw musicians, painters and artists drawing caricatures. The best street performer I saw was a mime. He was advertising for his show and passed out fliers to the hundreds of people who were watching after his performance. Good way to advertise! He was working a busy corner of the main square, where many people were walking. One of his tricks was to walk up behind a random woman passing by, pick her up, and hand her to some random guy. ā€œHappy birthday!ā€ he would yell as he handed her off. Sometimes he would walk very close behind people, mocking them. He was good at hiding when they would turn around to see what the commotion was about. The person would then continue walking, the mime kept mocking! He had white face paint on that came off very easily. He would walk up to a random person, surprise them, then give them kisses on both cheeks, which would leave the kisseeā€™s face bright white from the face paint. Iā€™ve never seen anyone do something so outrageous in public in the U.S. I think it would be awesome but Iā€™m not sure it would be accepted as well as it was here in Europe, as he was pretty obtrusive to random, unwilling people.

 

Food

I had a very different food experience than in Rome. 2 types of food businesses here- pizzerias and gellaterias, and both are excellent! And they are everywhere. I tried some chianti wine- very good. The gelatti was amazing and the 2 pizzas I had were very good.

Boboli Gaardens

The Boboli garden is a nice park with a good view of the city. It was too expensive for what it provided but was  a good experience nonetheless. The gardens are divided up with paths and hedges so there are many private spaces. I went to the park on a sunny day, found a patch of grass for myself and took a nap. It was a nice way to start the day for sure.

Duomo

The Duomo is a HUGE church. It dwarfs the rest of the city. I decided to climb the bell tower, which is sever hundred steps and provides a nice view of the city. For me, the church did not look very big until I saw people at the top. It has an enormous dome that people can climb to the top of. I thought it was more expensive than it was- they try hard to upsell you- so I decided to climb the bell tower instead.

Michelangeloā€™s David

I went and saw this sculpture at a museum but visitors are not allowed to take photos. In addition to the David, there were many sculptures buy Michelangelo and other sculptors, and paintings that look like they belong in churches. Most of the paintings were pulled from monasteries and convents when Tuscany was invaded and the new government outlawed these religious venues.

Water machine

Florence had the coolest (eh?) public water fountain to fill up water bottles! It has regular and sparkling water in the main square, all for free. This saved me at least 10 bucks in buying bottled water and Sprite over the course of 36 hours. At first I did not know it had sparkling water. It has two spigots and I happened to fill up with the sparkling (frizzante) spigot the first time. The water tasted funny! And all the sudden my water bottle started leaking. It was the water escaping from the pressure of the sparkling water. Pretty cool.

 

Train mishap

Rome to Florence was the first train leg of my trip. I couldnā€™t figure out what train to get on at first because on the board at the station they show the final destination. My train was going on from Florence to Milan, so the board read Milan. Luckily they have people at the station in Rome to help people like me. I found my train and found my car. The train tickets have assigned seating so my next step was to find my seat. It looked like the overhead storage was filling up and there was space as I stepped in the car so I put my backpack up in the storage rack. Then I walked down the car and found my seat was at the opposite end and there was overhead storage above my seat. I thought it would be better to be close to my backpack so I wanted to move it closer. There were many people standing and getting settled in the isle between my bag and me so I thought I would go around the outside of the car to get back to the other side. Right as I stepped out, the train doors closed. I pushed the button on the outside of the car, nothing happened. At this point I realized the train was leaving, I was not on it, but my backpack was. Someone who had a Trenitalia (the train company) shirt on said something frantic and pointed to the other end of the train. I assumed it meant run so I started running in my flip flops with my wallet, phone, camera and computer in tow. About 8 or 10 cars down there was still a car with a door open so I hopped inside. The man who worked for the Trenitalia and was standing outside the open door said something to the tune of ā€œwhy would you do this?ā€ Now I know to check the time before I hop off the train. I didnā€™t bother moving my bag after all that; I was just happy I was on the train with my backpack.

Scams

Luckily I have not lost any money or significant amounts of time to scams but they have been occurring. Thought I should document for humor and future avoidance. Apparently I look like a dumb person who will fall for their trickery but they havenā€™t gotten me yet!

 

Athens

I received the same scam in Athens 3 times from 3 different people. I told the story to someone last night and he said it was so obvious it was a scam but the imposters were pretty convincing so my bad story telling can be to blame. In all of these scams, the bad people start out very friendly and try to relate to my life by saying they have been to the states, have a relative in the states, etc.

The first time I was scammed in Athens, I was walking down a main road by myself around midnight. The road had many nice shops and there were plenty of people there at night so I felt safe. A man came up to me and asked what time it was. I looked and gave him an answer. He went on to introduce himself and tell me he was travelling from a Greek island by himself. When I told him I was going back to my hotel he was offended, as Greeks stay out late and so should I! He asked me about 3 times if I wanted to get a beer at a pub with him and I said no thanks each time. Some more talking and I agreed to grab a drink; it couldnā€™t hurt. We walked down one of the main roads in downtown Athens. And further and further and further. I kept asking how far his pub was, skeptical that he was telling the truth. Finally we came to a boarded-up store front and he claimed his pub had closed. He then tried to convince me to go to a strip club. My best guess is that these scammers get some $crilla if they bring strangers into a strip club. So I went back home and went to sleep.

2 more times the following day 2 older men started talking to me and kindly offered to show me a local bar with ā€œmusic from around the worldā€.

Also in Athens, I think I observed a pick pocket at work. I was riding the subway to the airport on my way out and about 20 feet from me at one of the stops there was a lot of yelling and pushing between an older man and someone in his 20s. The transit security got them both off the train and I speculate that one was trying to get something out of the otherā€™s pocket.

 

Rome

I was walking up a nice pedestrian-only alley on the way to the Coliseum and I came to a road so I pulled out my map to see which way to go. It was a quiet street and a man who was coming up the road in his car pulled over to the side of the road and told me the Coliseum was to the left (correctly assuming where I was trying to go). Then he proceeded to ask me where I was from and we chatted about what we both did. He claimed he was a ā€œmanagerā€ for Armani and was going to be in Austin,Texas in a few months for a trade show. Then he told me he had some samples I could have if I promised not to sell them. He had a leather jacket with fringe that looked like something a cowboy might wear. He asked if I had a girlfriend, I told him yes, and he pulled out a large white purse. He went on to show me that he was running low on gas- he probably had a quarter of a tank left- and that he needed some cash because his credit card was broken. He took out a credit card that was absolutely trashed. It was bent in about 8 different places at different angles. Knowing how hard it is to break a credit card in half when they are expired, I knew this was not accident. I told him thanks, gave him a smile and walked off. He sped away.

 

Total scam count: 4

Athens- 3

Crete- 0

Rome- 1

Florence- 0

I will update this post as more scams occur šŸ™‚

Rome

August 3-5

Rome was fantastic. I loved the architecture, history and culture. It was much more refined than Athens. Athens reminds me of a Latin American or Caribbean city where many of the stucco condos are falling apart. In Rome, everything is very nice and well kept. I think the most amazing part of Rome for me is that even more so than Athens, the Romans live their everyday lives around all the historical sites and ruins in the city. Rome is much more expensive than Athens. Beverages from street kiosks were three to four times as expensive. 4 Euros (around 6 bucks) for a Sprite that is smaller than a Bottle of pop in the States- wowsers. I found the best places to get beverages on the go were grocery stores and mini marts.

Coliseum

Pretty neat. I didn’t go inside because the line was very long and I didnā€™t have much time. My favorite part was there were Indians selling hats and Chinese junk (just as I have found in Athens and Crete). Apparently they are not supposed to be there because there was a police car chasing them around. The police would spot one, drive pretty fast toward him (and the area was pretty crowded with ppl) and the Indian would pick up his good and run! I watched this for at least 10 minutes. It was a hoot!

Vatican City

Very impressive. If you have not been, you should go. The history and scale of the buildings blew my mind. I went in the afternoon around 2 or 3. No line for the Basilica. I walked around the outside of Vatican City to check it out, not knowing what was back there. Found the Vatican museum, again no line. There is amazing art in there from many periods including sculptures, paintings and tapestries. Apparently you arenā€™t supposed to take pictures in the Sistine Chapel because after I took one, a guard grabbed me by the shirt and told me to leave. But I still got my picture!

The Yellow hostel

I stayed in an awesome hostel! Itā€™s called The Yellow. Definitely recommend for any young people traveling to Rome. Itā€™s in a good location a few blocks from the train station. I arrived in the evening, maybe around 9:00. I found a sign for the hostel on the side of the building but there was a restaurant or bar under the sign and there were 50 people outside and inside. Walked past all the commotion and couldnā€™t find the entrance to the hostel. Someone who was outside in the crowd asked me if I was looking for the checking desk, I told him I was, and he showed me inside. Turns out the hostel has its own bar in the ground floor! When you check in, they even give you a token for a free drink. Pretty good way to meet people from around the world! Lots of Aussies in Rome (and Florence).

 

Food

The food I ate in Rome was rather underwhelming. When you get pizza from a pizzeria (not a restaurant), it is cold, then they warm it up in a toaster oven if you want it to go. And it wasnā€™t all that great. But to be fair, I didnā€™t eat at a restaurant. I found the gelatti I tried (and I tried a few places that looked decent) to be not so great as well.

Crete

July 30 to August 3rd

 

I had planned to go to the Greek island of Ios but by the time I tried to get a ferry ticket, it was too late. If I were to do my trip again, I would book as much of my lodging and transportation in advance as possible. My idea was to be more flexible with my plans by not booking everything in advance. But as it turns out, the good hostels fill up so I am now booking my lodging 1-2 weeks in advance. So the flexibility is lost. Oh well.

The travel agent recommended I go to Crete when we found out I couldnā€™t go to Ios. I think it was a good recommendation! Crete is the largest of the Greek islands and its main city is the 4th largest (by population I guess?) in all of Greece.

Inside the ferry- looks like a Las Vegas hotel!

The ferries from Athens are incredible! 9 decks, multiple restaurants, a swimming pool (Iā€™m writing this next to the swimming pool on my return trip), etc. Itā€™s a cruise ship with capacity for cars on the bottom decks. There are even 3 floors of staterooms, all for a 6 Ā½ hour trip. The company has 2 of these boats that are identical and each makes 2 trips every day.

The main street in Irakleio runs perpendicular to the sea and cars are not allowed. In Greece, anywhere you can ride a motorcycle it is OK so there was some motorcycle traffic but mainly foot. I stayed at the El Greco hotel, which is around 4 blocks up the main foot street. It was fancier than I needed but it was only around 10 bucks more than the alternative hostel, in a better location and the travel agent recommended it so I went for it. At both hotels Iā€™ve stayed so far, each room is opened with a metal key. When you leave the hotel, you leave the key at the front desk. When you return, just tell the receptionist your room number and sheā€™ll give you your key back. I was always a little worried about the security of the system but no theft so far.

I wanted to go to Ios to lounge on the beach, so I decided to take the same approach in Crete. The first day I went to a beach 3 miles west of the main town, the second a beach 6 miles east. Both beaches were nice and had a fair number of people doing the same thing I was. The water is very warm! Like Hawaii or maybe even a tad warmer. I was able to float on my back, which has never been possible as far as I can remember. Maybe there is a high salt content in the water?

I ate at two local restaurants in Crete. Both gave me fresh fruit for dessert ā€œon the houseā€ including watermelon, cherries and cantaloupe. Donā€™t know if this is a Crete thing or what but it was nice!

One of the restaurants I visited was called the Fish Tavern. They had calamari as an entrĆ©e. Forrest introduced me to calamari 2 summers ago and ever since I have really liked it, but Iā€™ve never seen it as an entrĆ©e- only as an appetizer. I got 2 grilled calamari and they were whole. The rings and tentacles make so much more sense now! I never really understood what part of the animal I was eating. I was going to get a Greek salad but I saw for the same price they had a crab salad. I was expecting a green salad with crab on top but instead got a bowl of the kind of crab salad you would normally put on a sandwich. Oh well. The calamari was really good! It tasted fresh; Iā€™m guessing they pull it out of the Mediterranean. Definitely the best calamari Iā€™ve ever had.

Ouza ingredients

The second restaurant was in a city park on the road the parallels the sea on the water side. There is a large shelter (roof only, no walls) and 4 restaurants share the space. The actual restaurants are across the street but no one was eating in there. The waiters have to run the food across the busy street and dodge the car and motorcycles- pretty crazy! I saw a couple of close calls. For dinner I got a Greek salad (decided not to be adventurous with my salad choice after the previous night) and the mixed seafood plate so I could try some different things. Unfortunately the seafood plate was fried but oh well. It had calamari, muscles, shrimp, 2 filets (I forgot what types those were) and anchovies. It was fun- I donā€™t think Iā€™ve ever had anchovies before. I had to peel the meat off the skeleton. Everything was good! I decided to order Ouza because I had read that is a traditional Greek drink. It comes as 40% alcohol that you mix at the table with water and ice. A couple cubes of ice, fill the glass 25-30% with ouza and fill er up with water. It didnā€™t have much flavor, I donā€™t know what I can relate it to. Then for my complimentary dessert along with my fruit, the waiter brought some hard alcohol that he said is made with the byproducts of making wine. He warned me that it would make me dizzy after confirm that I wasnā€™t driving home, but I canā€™t say I felt any dizziness. After dinner I walked down the street to check out the night life but at midnight, it was still pretty dead. I donā€™t know if the party was just starting or if it was an off night. Based on the bars preparing they venues, looked like they expected customers later. People stay out late in Greece! When I left the restaurant around 11:45, it was still full and there were families with little kids eating at that time of night. I wonder what time people in Greece typically start work and if all the people out late at night are vacationers. My guess is no.

I didnā€™t mention it in my post about Athens, but on every corner in both Athens and Crete, there is a kiosk and an Indian selling junk from China. The Indians either sell sun umbrellas, little r/c cars, light up sticks the size of a straw that they shoot up into the air at night, sunglasses, fake designer purses or rubber balls that make a design when you throw them at something (they have small 1x8s to show you). Most sell the rubber balls. I never saw anyone buy one but they are always out throwing their balls at the boards. It cracks me up every time! The kiosks are like miniature versions of a 7Eleven. They always have cokes, candy, etc. Theyā€™re everywhere and the locals buy from these little stands. When I had to call my bank in the U.S., I had to go to a kiosk and but a calling card to stick in the pay phone- the phones themselves donā€™t take your money like in the states. Next stop, Rome!

Athens

July 27 to 30

 

First impression: Athens is a huge city in a desert! When I flew in, it looked like I was flying into the Middle East. As far as I could see, there were brown hills with no sign of life. I was surprised not to see any tall buildings. Everything I saw in Athens was a max of around 8 stories.

City Center

My hotel was a block from Monastiraki, which is the downtown/ city center area, at least in a historical sense. The streets there are pretty much walking only, although there is an occasional car or motorcycle. There is a street that has all the fashion stores, a street with restaurants and a street with kick knacks. I heard that these streets are the old Roman and Greek markets. Theyā€™re right next to the Acropolis and nearby ruins so itā€™s believable. A sign at one of the excavation sites said the newer streets cover up parts of the ruins. The street with the clothes stores is the busiest at times itā€™s pretty hard to walk.

Acropolis, nearby ruins and Filopapou hill

All these ruins are impressive to see to give perspective as to how new everything I see in my daily life really is. I wonder what Seattle will look like in 2000+ years. There were lots of sacred places built to worship their gods. A few of the sites are on the hill tops in Athens which afford a nice view of the expanse of buildings and out to the Med.

Glyfada

When I asked the hotel receptionist where would be a good place to go at night, he recommended I go to Glyfada. Glyfada is about an hour tram (light rail) ride from Monastiraki. First night: fail. Got off the stop that was called ā€œGlyfadaā€ and there was only a hotel by the sea, surrounded by giant houses. The last train went back 30 minutes after I arrived so I walked along a boardwalk next to a marina for a bit and got back on the tram. I decided to give it another try the next night. I found out that there are several tram stops in Glyfada and this time learned the correct stop for the center fo Glyfada. Glyfada is a nice town on the shore of the Mediterranean. Reminds me a bit of Southern California. It is supposed to be famous for its night life but as far as I could tell, night life in Greece consists of going to a restaurant with your friends. I wasnā€™t going to go to a restaurant by myself so I walked around the town then jumped back on the train.

Quick Facts

Communication barrier: none. Everyone spoke pretty good English and communication was never a problem.
Food: similar to Greek food at home. Even the fast food restaurants served gyros. One difference: gyros here have French fries in them. Funky.
Friendliness: good. Everyone I asked for help seemed happy to lend a hand.

Made it to Europe

After almost 24 hours of travel, today I arrived in Athens! It’s warm here! After taking a bus from the airport to the city center and walking around for an hour, I found a hotel (Hotel Fivos) that has “hostel” rooms. Just a tiny single hotel room with a bathroom down the hall for only 35 Euros/ night. Seems reasonable so I’ll stay here for 3 nights. Some notes of interest from my first day of travel (Seattle to Chicago to London to Athens):

  • British Airways serves food on the plane! Even a 3 or 4 hour flight from London to Athens had a hot breakfast for free including eggs, sausage, ham, a roll, fresh fruit and orange juice. I haven’t had food on an airplane in a while. On the flight from Chicago to London, even the alcohol was free. When I asked the flight attendant what was available, he responded with “whatever you like”. It took a few more questions to find out that I could have a free beer so I had a Heineken. Wine was served with dinner.
  • There are tons of motorcycles and scooters in Athens. Many don’t wear a helmet.
  • Space is tight! In our water closet, the toilet is so close to the wall that I have to sit sideways.
  • Credit cards are not widely accepted as they are in the U.S. Only after I told the hotel front desk that I did not have enough cash to pay for my 3 nights did he admit that his credit card machine does indeed work. At dinner, paying with a credit card was not an option.

UW Registration Method

It’s that time of the quarter to register again. I am personally not a fan of the UW’s registration system but what can you do but play the game and figure out how to win. I have had several quarters where I don’t get the classes I want, which is followed by the most stressful morning scrambling to fill in a decent schedule. I have found a way to register that has gotten me into the classes I want every time (4?) and I thought I’d share.

Step 1: ’twas the night before registration

Get all your classes into the Schedule Finder. Even if you found all your classes by hand without using the schedule finder, do it anyways.

Step 2: get your clock ready

Pull up the Official US Time in another browser window.

Step 3: pull the trigger

When the official time passes 5:55am (I usually wait for 5:55:05 to be safe), press the “Register for this schedule” button in the Schedule Finder next to the schedule you want.Dunzo. It is important to use the official time because I have trusted my computer’s clock to be accurate in the past and that assumption screwed me over.

Why it works

The UW Registration page opens up at 5:55. But if you preload your schedule into the Schedule Finder, you can simply push the register button instead of having to enter your SLNs into the registration page. 10 seconds saved could mean the difference of getting into a class or not. In addition, I have had the server time-out on me while trying to load the registration page and did not respond for over a minute. This is the best system I have found for registering for classes at UW. Have you found a better way?

Microsoft Interview Day

Microsoft | Be what's next
On Friday I had my all-day final round interview at Microsoft for their Program Manager Intern position. It was a long day and I had a lot of fun answering the problems and meeting the Program Managers I met with so I thought I would document my experiences. Adding to the excitement of the day, I received an offer following my interviews! Surely a great end to a long week.

The Start

My day started in the recruiting building (111) at 9:00 but I didn’t see my recruiter until around 9:45. This gave me enough time to fill a water bottle, check out their modern furniture and play some Kinect. The recruit candidates all wait in this lobby until a recruiter calls each recruit’s name. We went into a small conference room for around 10 minutes where we talked about the general interview process. It was then that I learned I was interviewing for the Office group, which means I would be on an “Office Loop”. At Microsoft, recruits interview with employees who have worked at Microsoft for a while (my four interviewers had been at Microsoft a minimum of seven years). The interviewers always work together on the same interview team, such that the same set of employees interview candidates together. This gives them a general sense of what the other interviewers have asked or will ask so there is not much overalp in the questions they ask. Each interviewer had one or two interview questions for me, after which I was asked if I had any questions. The biggest question I had in terms of my curiosity was since Microsoft Office has a seeming monopoly on productivity software, how do they continue to push themselves to be better, and what are the overarching goals and aims of the Office suite for the long term? I learned they are pushing Office to be more collaborative and to increase the communication capabilities (logical), and their strongest competitor is previous versions of Office because many organnizations do not immediately upgrade to the newest versions as they are released (I had not thought about this before- interesting).

Getting Around

Shuttle Connect Prius

The most impressive system at Microsoft that I saw was the transportation on campus. Microsoft has a fleet of Prius hybrids with drivers who have memorized the location of every building- and that’s a lot. When I needed to move between buildings, I would tell the receptionist where I needed to go and within three minutes a driver would come get me. It is my understanding that I had priority access to the cars because I was a recruit, but I believe all employees can use the service.

Interview Questions

I had a lot of fun answering the interview questions that were presented to me. They were certainly unique to the Program Manager position. I was expecting (as per Microsoft’s website) to be asked to code solutions to some questions but this was not the case for me. I had one data structure/algorithm question where my interviewer asked me to simply talk about my solution. Generally, I would pre presented with a skeleton of a problem and I was required to ask more questions to flesh out the details and gain more understanding of the problem I was asked to solve. The following are the questions I was asked in the order they were asked:

Convict’s Ransom Note

A convict needs to write ransom notes using letters out of newspaper clippings. He wants to know if a given magazine contains the letters he needs to write a certain note. Given the inputs of the note and magazine in text form, what is the best way to return whether or not the magazine contains the necessary letters and what is the algorithm’s runtime?

Variation A: The convict wants to use words out of the magazine instead of letters to write the note.

Variation B: The convict is okay using homophones in the note. You are allowed to design the API of the object that knows the homophones of words in the dictionary.

Solution

Design a Movie Theater Kiosk

Then I was asked to design the UI one of those electronic kiosks at movie theaters that allow you to purchase movie tickets without interacting with the human at the ticket window.

Remote Control for Children

After lunch in one of the Microsoft cafeterias, my next design question was to design a remote control that would allow a 3-8 year olds to watch their favorite TV channels with no help from a parent.

Talk About a Technology System

My next question was the most open ended of them all. My interviewer asked me to begin talking about any technology I wanted, and then we have a conversation about the technology behind it. She told me I could talk about a well known system such as how a search engine works, or I could tell her about the details of a project I have worked on in the past.

Learning Game for Kids

To end my third interview, I was asked to design a game that would be a smashing hit to 5 year olds with the goal of teaching them how to order a set of four double digit numbers. Thus far, this was the most difficult question for me because I do not play computer or video games. This forced me to really be creative, as I could not borrow many elements from other games as I imagine other candidates would be able to do. I started with some simple counting lessons to improve game players’s “number sense” and allow them to be able to compare two numbers and determine with is larger. Then I moved into a sorting algorithm in which I designed the game to teach kids bubble sort.

Japanese Characters

This question started my fourth and final interview. In Japan, there are two character sets- Kanji and Hiragana. Hiragana characters represent sounds and there are 46 characters in the alphabet, so they are represented by one byte. Kanji characters, on the other hand, represent an entire word and are intermingled with the Hiragana characters in documents. There are many Kanjis, such that they require 2 bytes to represent each character. To distinguish between these characters electronically, the most significant bit of a Hiragana character is a 0 and the most significant bit of the first byte of a Kanji character is a 1 (the second byte can start with either a 1 or 0). The challenge with this scheme is that it is not trivial to distinguish the bytes when not starting at the beginning of the document. The question presented to me was how do you optimally delete the last character of a document. I needed some help with this problem, as my brain was tired by this time and I did not immediately recognize the pattern.

Solution

Describe an Interesting Project

To wrap up my final interview, my interviewer asked me to describe an interesting project I have worked on. After I described the project, he asked me if I utilized any frameworks and I explained that no framework I was aware of was appropriate to what I was doing.

Wrapping Up

After my fourth interview was complete, I caught a Prius back to the recruiting building where I played some more Kinect and then met my recruiter. He told me that a hiring manager wanted to have a quick phone call with me. After finding a conference room with a phone, we got the manager on the line and he informed me that he was from the Office.com group and that I was being offered the position! By this time I was exhausted and certainly relieved and ecstatic that the day had been a success. Finally, my recruiter gave me a sweet t-shirt and I headed home. The end.

Microsoft Interview Solutions

These are solutions to the two algorithmic questions I was asked in my Microsoft Program Manger Intern interview

Convict’s Ransom Note

The solution I came up with was to create an array of length 26 that will represent counts of letters in the ransom note. For example, if the note contains 4 letter ‘a’s, index 0 will be set to 4. My solution was certainly influenced by UW CSE143’s Letter Inventory assignment. In addition to the array, I used a counter to represent the sum of the values of the array. After setting up this array and counter, I traversed through the magazine. To compare our note’s needs with the magazine’s letters. Here’s some pseudo code:

counter = 0
loop through letters of note{
increment corresponding index of the current letter by 1 and increment counter by 1
}end loop

loop through letters of magazine{

if value of corresponding index is greater than 0{

decrement value of corresponding index and counter, each by 1

if counter is 0, return true

}

}end loop

return false //did not find enough needed letters in magazine

Variation A- words instead of letters:

replace array with a Map with strings for keys and Integers for values

Variation B- allow homophones:

Create an interface that returns possible homophones when given a word.

in the algorithm, repalce

“if value of corresponding index is greater than 0{”

with

“get homophones for current word

loop through possible set of homophones and if the map contains one of them as a key, perform operation using that word”

Japanese Characters

The key to this problem is, starting from the end of the document and working backwards, to find the first position where you know a character ends. The correct way to do this is to find the first byte that starts with a 0 (ignoring the last byte), because a byte that begins with a 0 is either a one byte character or the last byte of a 2 byte character. From there, you can work backwards and discover if the last character is represented by 1 or 2 bytes.

The optimization comes from knowing that ignoring the last byte, all bytes before the key byte starting with a 0 start with a 1. Therefore, the number of bytes you looked over to get to the first byte that begins with a 0 determines whether the final character occupies 1 or 2 bytes.

japanese character problem solution

Google Apps Mailing List With Auto-Response

The mailing lists in Google Apps do not support automatic responses. I have come up with a solution using a mailing list and eMail account, outlined below. In this example, the address that users would send mail to is [email protected]. This is a standard eMail address set up with a Vacation Responder (or Canned Response from Labs) and forwarding onto the Group (mailing list).Mailing List with Auto-Reply