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…

Categories
kids

Stock up some diapers from Target.com

Reading Time: 2 minutes

Target is offering $20 gift cards for 2 giant packs of Pamper or Huggies diapers. With the expiring $10 off $40 store pick up offer from target.com, that makes 2 giant packs from about $70 to $40. With Target red cards, there is 5% discount as well. Personally I picked up Huggies little snuggler size 2 (12 to $18 lbs).

This is better deal than a similar deal I got from target recently, in which they offer $10 GC for 2 super packs Pampers new born diaper, which costs $50 before tax.

Sam’s Club: I bought a “super giant” Huggies’ size 1 snug and dry pack from them, which has 192 pieces, and they offered $6 off about $40 original price. From this article at babycenter it appears “little snugglers” is better than “snug and dry”.

Of course, the risk of stocking up diapers is overstock 🙂 From personal experience, size 2 is a safe bet, because infant usually slows weight growth after couple months. That’s why I don’t want to stock a lot new born and size 1.

Last but not least, when placing order at Target.com, make sure entering a valid email address to receive the free Gift Card, it appears their web page does not check that. I had to call their customer service to get the $10 GC as I forgot to put it my own email there.

PS, I picked up the huggies size 2 order this morning at 8 am. Because this is the last day of tax free holiday this year, there is quite a crowd and the Guest Service lady complained about this “flexible fulfillment” promotion (pick up in store), and the tax holiday thing. I waited for about 10 minutes before they got the items from their warehouse. Anyway, it appears Target is getting some disgruntled workers. And a related question, if a store is full of deal seekers, and not many people willing to spend, that also signals trouble, right?

Categories
advice and tips

Got suspicious call from Chase Fraud Service

Reading Time: < 1 minute

Twice

The first time, call originated from this number 1 844 540 4033, the guy not even verified my name, and told my Southwest Air Credit Card is stolen, then started reading about those “fraudulent” charges. At the end, I asked the last 4 digits of my card number, that does not match; and I asked the first name, does not match, and so on. So I told him I would hang up and call Chase directly.

The second time, they are coming back with a similar message, with this call back number 1 800 955 9060.

This itself (the phone calls) appears more like fraud, I am thinking they are trying to get more information from me. To have a peace of mind, I did verified my credit report via annualcreditreport.com (free for everyone, 3 reports for one year), and I could not find the card number mentioned by the suspicious caller.

Just trying to add some burden as we are having a baby girl lately. Those cheaters.