Categories
advice and tips Fun

Found out why I missed 25000 miles Alaska Airlines from credit card

Reading Time: < 1 minute

I signed up the BoA credit card 50,000 miles promotion last Dec. But I forgot to spend $1000 in the first 3 months, I spent $995 in the first two months and then stopped. The reason was I thought I had reached this limit. But I forgot one thing: to check my spending at both BoA and at Alaska Airlines websites. I did not go to the latter because I thought I did not have the mileage plan number.

Today I found out on my credit card I do have the number. But the 3 months has long passed. They now offer 25,000 miles for bonus opening their credit card.

Categories
advice and tips kids

Chinese kids

Reading Time: < 1 minute

Saw this discussion at mittbbs.com (发信人: waluzz78 (哇鲁庄镇), 信区: Parenting). I think I agree.

======
最近跟国内来的访问学者或旅游的家庭往,感觉国内的孩子很活泼自信,跟大人打交道
也很自然。跟他们相比,我们周围在美国长大的10岁左右的小孩,包括我们自己的孩子
,显得更木讷,尤其不擅长跟大人打交道。我琢磨了一下,觉得原因是孩子在美国长大
,只想用英文说话,而在家里父母用中文跟他们交流,他们虽然能听懂,但不愿用中文
回答,久而久之,跟大人的交流也变少了,而中国父母跟美国家庭的来往有限,孩子们
也缺乏跟美国大人的来往,结果既没学会中国人待人接物的方法,也没学会美国人的方
式,基本上只会跟同龄人打交道,在成人面前就显得很木讷。想起夏天一个孩子班上搞
得跟老师告别的party上,美国孩子即兴侃侃而谈表达对老师的感激之情,几个中国孩
子唯唯诺诺的回避发言,当时以为是性格所至,现在看应该是生长环境造成的。国内长
大的孩子普遍就大方多了。现在很想亡羊补牢,改善一下孩子的社交能力,我能想到的
就是多带孩子参加活动,尤其是美国人为主的活动,因为让孩子学中国人待人处事已经
不切合实际了,只好人他们学习美国人的方式,自己也只好step out of the comfort
zone了.也许加入country club是个办法。以前觉得那里中国人太少了,加入是受罪.不
知大家有什么好建议。
======

Categories
Technology Web

Set up Apple TV with AT&T u-verse

Reading Time: 2 minutes

It seems the wifi router comes with AT&T u-verse does not work with Apple TV. Apple TV could not find the wifi network from the build in u-verse wifi router. I found one workaround, that is to turn off the build in Wifi, use an old wifi router (D-Link DI-524) for Wifi instead. But there is still problem with the mirroring from iPad to Apple TV. Since I still have my previous LinkSys wrt54g router, I set it up as second router behind the DI-524, and connecting both the Apple TV and iPad to wrt54g. That worked. Another side benefits is wrt54g is a newer/more powerful router, and could broadcast wider range. So in a summary the architecture from internet to apple TV is something like below.

u-verse modem (wifi off) => D-Link DI-524 router => LinkSys wrt54g router => Apple TV/iPad

You may wonder why I add this extra D-Link DI-524 old router. The problem was I could not easily connect LinkSys wrt54g (the newer router) to u-verse modem. So I used the old router as a bridge. If someone has idea to make it work without this extra router, please let me know. (Email: minjie DOT xu AT gmail DOT com; or twitter @stlplace)

There is another problem with setup AT&T u-verse which is not related to Apple TV. The problem is when creating new account at their web site, they prompt for secret question/answer, it appears they don’t take any space in the answer. It was a programming error (web page text field validation) in my opinion, since I have done some web programming lately. The workaround is not to type any space. Simple enough.

This is also after using cable internet for about 8 or 9 years, I am switching to AT&T. I was using their DSL before switching to cable. The main reason is their service is cheaper, another factor is the cable had some connection issues lately.

(Update 05-07-2015) Came across this post regarding how to make direct connection from linksys wrt54gl to uverse router. I tried it but was not successful. It does not like the new local ip address 10.0.0.1 for linksys. But the theory there (conflicting local ip address between uverse and wrt54gl) seems holds, as I saw people discuss similar problem on linksys support forum.

Categories
advice and tips Fun

Trying to beat the coffee habbit

Reading Time: < 1 minute

Lots of headache first few days. It’s getting better as time goes. The reason I am trying to do that is it (the coffee) appears to make me go to restroom much more often. I want to eliminate this one factor to see if things get better.

A second reason, is I don’t want to dependent on one thing (coffee is addictive). I recall last summer when I was in China, and I could not find coffee in my hometown and my wife’s hometown, and I got headache. Eventually I was able to find the “American style” iced coffee and a bakery and certainly at McDonald. I think I need to reduce my coffee intake, and if I can stay alert without it, that will be the best.

Categories
advice and tips kids

Made same mistake again: stocked up too much new born and size 1 diapers

Reading Time: < 1 minute

When we were expecting the second baby, we vaguely recall the baby quickly grew out of the “new born” size diaper, so we did not stock up this time. When the baby came home with us, we already had a box of 88 pieces of Huggies natural, and being a person like to stock up things, I bought two 88 pieces Pampers new born. In about a month, our baby grew to 10 lbs, which is the upper limit of new born, and we still had about 40 pieces left.

Now baby is about 2 months old, and approaching 14 lbs (13 lbs 6 oz as of 2 month check-up), we still have a box of 92 pieces unopened. We bought a box (192 pieces) of Huggies little snugglers size 1 from Sams’ club before the baby was born. And a friend brought in 92 pieces Huggies, another friend gave us the “diaper cake” which probably had 50 pieces.

So here is our mistake again: stocked up too much new born and size 1 diapers. The good thing is we can always give it to friends who are expecting new baby 🙂

Categories
Fun kids

New problem with new baby

Reading Time: < 1 minute

We had a new baby girl about 2 months ago. One problem we anticipated did not show up as I feared: the feeling of being neglected for my older daughter, as new baby usually gets more attention. That’s good. When I think about it, I heard so many warnings from my friends and tried to spend some quality time with serenity.

But another unexpected problem arose. The financial one. Between the medical bills related to new baby, the home helper to help out my wife, and rising child care cost from Serenity’s school, and at the same time my stagnant take home pay, I suddenly found out I am not on a sound financial footing. I am doing some maneuvers, such as consolidating checking accts., refinance mortgage, etc.

I hope to get through this school year, because in next fall my elder daughter will start kindergarten at local public school. No more child are cost for her, if any 🙂

Categories
iPhone app

Why new Apple smart watch is not called iWatch?

Reading Time: < 1 minute

Here is my theory. Years ago I heard people in China mentioned “Apple Phone” (苹果手机), for iPhone. This is particularly true for older generation as their grasp of English is not as good as younger generation. So this time they decided just go with Apple Watch 苹果手表.

Note this is also their fourth main product category innovation since year 2000 : iPod, iPhone and iPad. If they stick with iWatch, the name will be too predicable. But this is secondary compared to the reason above, which is use their Apple logo, and name. Both are well known all over the world.

PS, saw this disturbing video about people lining up at Apple store for iPhone just for resell.

Categories
iPhone app

Calling restful POST PUT and DELETE methods in AFNetworking 2.0

Reading Time: 2 minutes

(Note 12-03-2015): for a more deep understanding of REST API and iOS usage of it, see this blog post by Mugunth Kumar. Very well written piece on REST. My tutorial below is meant to get hands dirty quickly on iOS web service calls 🙂

(Original 09-03-2014) Some example code here. For GET methods and AFNetworking 2.0 using a php web service, raywenderlich.com has an excellent tutorial. One problem I saw when I did this exercise is the service was expecting “application/json” for “Content-Type” (note the default is text/html, if we don’t specify in request serializer).


// POST method
-(IBAction)addBook:(id)sender
{
    // 1, note this is the base URL, typically it's the end point of REST web service
    NSURL *baseURL = [NSURL URLWithString:BaseURLString];
    NSDictionary *parameters = @{@"title": @"One Flew Over the Cuckoo's Nest",
                                 @"author": @"Ken Kesey",
                                 @"read": @false};
    
    // 2
    AFHTTPSessionManager *manager = [[AFHTTPSessionManager alloc] initWithBaseURL:baseURL];
    manager.requestSerializer = [AFJSONRequestSerializer serializer];
    manager.responseSerializer = [AFJSONResponseSerializer serializer];
    
    [manager POST:@"/book" parameters:parameters success:^(NSURLSessionDataTask *task, id responseObject) {
        self.title = @"Book added";
        _textView.text = [[NSString alloc] initWithFormat:@"Response JSON: %@", (NSDictionary *)responseObject];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        NSLog(@"\n============== ERROR ====\n%@",error.userInfo);
        
        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error adding book"
                                                                message:[error localizedDescription]
                                                               delegate:nil
                                                      cancelButtonTitle:@"Ok"
                                                      otherButtonTitles:nil];
        [alertView show];
    }];
}

- (void)setupForRemoveAndUpdateBook:(AFHTTPSessionManager **)manager_p bookIdString_p:(NSString **)bookIdString_p
{
    NSURL *baseURL = [NSURL URLWithString:BaseURLString];
    
    [_textField resignFirstResponder];
    
    int bookId = [_textField.text intValue];
    
    *bookIdString_p = [NSString stringWithFormat:@"/book/%i", bookId];
    
    *manager_p = [[AFHTTPSessionManager alloc] initWithBaseURL:baseURL];
    (*manager_p).requestSerializer = [AFJSONRequestSerializer serializer];
    (*manager_p).responseSerializer = [AFJSONResponseSerializer serializer];
}

// DELETE method
- (void)remove_book
{
    NSString *bookIdString;
    AFHTTPSessionManager *manager;
    [self setupForRemoveAndUpdateBook:&manager bookIdString_p:&bookIdString];
    
    [manager DELETE:bookIdString parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
        self.title = @"Book deleted";
        _textView.text = [[NSString alloc] initWithFormat:@"Response JSON: %@", (NSDictionary *)responseObject];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        NSLog(@"\n============== ERROR ====\n%@",error.userInfo);
        
        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error deleting book"
                                                            message:[error localizedDescription]
                                                           delegate:nil
                                                  cancelButtonTitle:@"Ok"
                                                  otherButtonTitles:nil];
        [alertView show];
    }];
}

-(IBAction)removeBook:(id)sender
{
    [self clear:nil];

    if (_textField.text == NULL || _textField.text.length==0) {
        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Book ID required"
                                                            message:@"Please input the book ID"
                                                           delegate:nil
                                                  cancelButtonTitle:@"Ok"
                                                  otherButtonTitles:nil];
        [alertView show];
    }
    else {
        [self remove_book];
    }
}

// PUT method
- (void)update_book
{
    NSString *bookIdString;
    AFHTTPSessionManager *manager;
    [self setupForRemoveAndUpdateBook:&manager bookIdString_p:&bookIdString];
    
    NSDictionary *parameters = @{@"read": @true};
    
    [manager PUT:bookIdString parameters:parameters success:^(NSURLSessionDataTask *task, id responseObject) {
        self.title = @"Book updated";
        _textView.text = [[NSString alloc] initWithFormat:@"Response JSON: %@", (NSDictionary *)responseObject];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        NSLog(@"\n============== ERROR ====\n%@",error.userInfo);
        
        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error updating book"
                                                            message:[error localizedDescription]
                                                           delegate:nil
                                                  cancelButtonTitle:@"Ok"
                                                  otherButtonTitles:nil];
        [alertView show];
    }];
}

-(IBAction)updateBook:(id)sender
{
    [self clear:nil];

    if (_textField.text == NULL || _textField.text.length==0) {
        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Book ID required"
                                                            message:@"Please input the book ID"
                                                           delegate:nil
                                                  cancelButtonTitle:@"Ok"
                                                  otherButtonTitles:nil];
        [alertView show];
    }
    else {
        [self update_book];
    }
}

Categories
kids

Baby car seat and travel system, more about indoor playground

Reading Time: 2 minutes

We got this Graco travel system from Wal-Mart long before our second baby was born. Btw, there is a promotion ($25 rebate) going on for this product. I recall we bought the same car seat for our elder daughter when she was new born, we still have the base which we are using again, but I forgot how we install the car seat at that time (note I also wrote a blog post on this topic 4 years ago).

We also went to the St. Louis Outlet Mall (formerly the Mills), and Serenity got to play in the big indoor playground. Sometimes she just runs around.

photo 1

photo 2

photo 3

photo 4

This is the best indoor playground in St. Louis, in my opinion.

Categories
iPhone app

iOS Objective-C interview questions

Reading Time: < 1 minute

I just throw some technical questions out here. Note Ray Wenderlich has a series on this. BlackPixel has an article too.

life cycle of UIViewController;

NSString property copy or retain?

frame vs bounds

category vs subclass

What is protocol (Apple doc; Ry’s Objective-C tutorial)? Create a protocol for List, and how to implement the “add” method for linked list (stackoverflow)?

block (how to avoid memory issue);

To be continued…