tungwaiyip.info

home

about me

links

Blog

< May 2012 >
SuMoTuWeThFrSa
   1 2 3 4 5
6 7 8 9101112
13141516171819
20212223242526
2728293031  

past articles »

Click for San Francisco, California Forecast

San Francisco, USA

 

Completed Coursera Course

game theory statement of accomplishment

Coursera is an organization that partners with some leading US Universities to offer free online courses. I have signed up for 2 courses, Model Thinking by Scott Page and Game Theory by Professor Matthew Jackson and Professor Yoav Shoham. Today I'm delighted to receive a letter of accomplishment for completing the Game Theory course.

It was a great experience to work on these courses. It has been a long time since I graduated to enrolled in a some kind of structured courses again. Prof Page's model thinking course is wide-ranging and provide a lot of useful tool to help us become an intelligent citizen of the world. All these delivered in a series of engaging and enthusiastic video lectures. The game theory course is more formal and its math is a bit difficult for me. Still I want to thank Prof Jackson and Shoham for doing this. An interesting topic like Model Thinking I think I can do well with independent study. But it is the power of a structured course that keeps me hanging in there to surmount the difficulty Game Theory.

I originally think once the professor take a video lecture and then they are done. Waves and waves of students then watch the same video and have the machine grade their quizzes while the professor are free to take a trip on a cruise ship. Actually there are fair amount of communication from the professor and they stay engaged and address issues throughout the course. While Coursera's description says you can do the study at your own pace, each course actually have a schedule that you need to adhere to. You better follow each week's work on time. Once you fall behind, more new materials are created each week making it more difficult to catch up. I do make good use of my gap time to watch the videos, like when I'm rocking my baby to sleep each night or when I'm working out in the morning. I guess in this sense it is to "study at my own pace".

After doing fair amount of work on this I vowed not to take 2 course simultaneously again. But Coursera has just published a long list of new courses. It look so interesting that I signed up for a bunch of new courses already.

2012.05.31 comments

 

Indians Dominate National Geographic Bee

I was reading about the National Geographic Bee award. The picture catch my eye because all the top three winners are of Indian descent‎. This is especially amazing when you consider Indian is of a tiny minority of the population of United States. I have not watched the National Geographic Bee competition. But I believe it is really hard and really board. The contestants must have demonstrated their encyclopedic knowledge to win.

National Geographic Bee Winners

Susan Walsh / AP

Congratulations to Vansh, Varun, Rahul and other competitors for playing a good game.

2012.05.26 comments

 

Morning High

I was out running in the morning. Mission Bay is always beautiful and the weather is always great. And I was listening to the TechNation interview of Rom Brafman and his book Succeeding When You're Supposed to Fail. He studies how people succeed despite facing adversity in life and he comes up with a list of enduring principles to achievement. To be accountable to yourself, find passion and meaning in life, stay focus to your goal, have a sense of humor and find your supporting star.

I feel so inspired and energetic from all this. To cap it off, I want to play the song Dreams of Cranberries for her exuberant spirit.

2012.05.26 comments

 

Forget About The Fog. Bring Sunglasses, Sunscreen When You Visit San Francisco

Dolores Park on Sunday is perfect. The beautiful sunshine, the gorgeous view to the downtown, the newly completed children playground swarming with running kids. Everyone is having a blast. What a lovely day it is!

Dolores Park

Dolores park (Jamison Wieser)

The only issue, ouch! Barely an hour under the sun is enough to get me sunburn. I know. I should have put on sunscreen. I have a tube with me but I just didn't expect such short exposure will do me any harm. This is a mistake I would have made many times.

But where is the San Francisco fog? The weather condition that the city is so well known for? A city shrouded in dense and cool fog. Foghorn blows the deep and the ghostly sight of cargo ship slowly emerge from the mist. The reputation of San Francisco fog spread so far that sometime visitors would ask for advice to plan around fog. How should they prepare themselves in the foggy weather. Bring umbrella? Trench coat? This is good for building up film noir atmosphere, but what you need in San Francisco is actually sunglasses and sunscreen.

As it turns out, San Francisco is one of the most sunny city in United States. It is not my wishful thinking. It is sunny according to meteorologists' statistics. 160 sunny days a year put it among the top most sunny cities. It even ranks favorably to the sunshine state of Florida, which is actually rather cloudy.

But what about the fog that engulf the city so often? It is of course no illusion. We residents experience it regularly. People who knows about San Francisco may point out to the effect of microclimate. Areas close to each other may experience dramatically different climate due to different geographic features like hills and valley. In general it means the coastal side is far more foggy than the bay side. To a visitor, it means Golden Gate Bridge and Golden Gate Park can be quite foggy, while Union Square, Embarcadero and the gorgeous Dolores Park are a lot less susceptible.

The microclimate explains some of the paradox. But what if I say the west side is also rather sunny? You may laugh at me really hard for saying this. That's pretty much people's response when the city of San Francisco announce plan to build a major solar power system on top of the Sunset Reservoir a few years ago. Everyone knows it is foggy in the Sunset district. To build a solar system there sounds so absurd that it is widely ridiculed. But wouldn't a professional solar developer have better idea then people who make judgment base on gut feeling? Indeed fog does not come all day to Sunset and it does get quite a bit of sun. According to the developer Recurrent Energy, the solar resource in Sunset is on average only 15% lower than the sunniest areas of the City and is consider quite good. With this solar power installation, it more than triple the energy San Francisco generate from the sun.

Sunset Reservoir Solar System

Sunset Reservoir Solar System (Recurrent Energy)

To make sense of the fog city so sunny paradox, it helps to understand a common bias known as base rate fallacy. Scientists find that people have a tendency, when making judgments of the probability with which an event will occur, to ignore the base rate and to concentrate on other specific information. Overall fog is a rather infrequent phenomenon. But the specific attribute of San Francisco's fogginess affect people's judgment more than the general base rate. To give another example, if city A hails 30 times a year, you will be right to consider it far more prone to hail than other cities. So how likely is it going to hail next Monday? Some people maybe tricked to think it is quite likely. They ignored the fact that hail is a rare phenomenon and even hail prone city A has 326 hail free days.

Let's not get distracted. Meteorologists say San Francisco is a sunny city. Bring sunglasses and sunscreen to enjoy your the visit. Don't get sunburnt like me.

2012.05.07 [] - comments

 

&D\anger'"+<b>@?!mb Against Code Injection

I have to build my web app against code injection. I find that the problem requires us to see input string used in several different context.

  • In HTML/XML as text.
  • In HTML/XML as an attribute inside the quote.
  • In URL as query parameter.
  • In JavaScript to dynamically create or edit DOM elements.

In each context, there are different rule in escaping them. Since the data can move from one context to another, they have to be properly escaped in all cases.

To help test for proper escaping, I have come up with a string that has lots of special characters below. Put it in your test database and paste it in your input fields. Observe if this causes problem anywhere. In properly escaped system, the string should be transfered and reconstructed verbatim.

  &D\anger'"+<b>@?!mb

A related issue is whether your code support unicode correctly. I find it helpful to insert a string below into the test data to test it out right from the beginning.

  \u4e09\u570b\u5fd7 or
  三國志

2012.05.01 [] - comments

 

past articles »

 

BBC News

 

Israel election: Netanyahu and rival headed for deadlock (18 Sep 2019)

 

Brexit: Talks 'should not be a pretence' warns Barnier (18 Sep 2019)

 

Inside Afghanistan's 'no-man's land' (17 Sep 2019)

 

Menstrual blood ad complaints rejected (18 Sep 2019)

 

Greta Thunberg to US politicians: 'Sorry, you're not trying hard enough' (18 Sep 2019)

 

Australian hiker rescued after 'carrying' broken leg for two days (18 Sep 2019)

 

Saudi Arabia oil drone attack 'a blow for the world' (18 Sep 2019)

 

Three killed in Monte Carlo-Venice boat speed record attempt (18 Sep 2019)

 

Lord of the Rings returns to New Zealand with Amazon TV show (18 Sep 2019)

 

Ukraine's former national bank chief fears for life after arson attack (17 Sep 2019)

more »

 

SF Gate

 

Ship traffic, September 18 (17 Sep 2019)

 

Cnet Review: These 65-inch TVs are the best (15 Sep 2019)

 

Apple TV Plus is just , but will people pay for it? (15 Sep 2019)

 

Deliveroo ad implying delivery anywhere (even space) is banned in UK (15 Sep 2019)

 

The world wastes tons of food. A grocery ‘happy hour’ is one answer (15 Sep 2019)

 

Executive has plan to turn Spotify into ultimate podcast hub (15 Sep 2019)

more »


Site feed Updated: 2019-Sep-18 03:00