Sunday, July 21, 2013

My SO Reached to 6K

Yesterday, my StackOverflow reputation reached to 6003 on July 20, 2013. I have not been very active on SO actually during the period time from 5K Dec, 2012 to today. That's all my past activities contributed to the growth. On the other hand, it is the evidence my Q and A are valuable for some people.

However, since I was active on SO, my previous contributions and efforts have been recognized by other users on SO. As a result, my reputation has been kept grow. The following is the snapshot of my 5k moment:



The main reason I have been rarely on SO is that my current work is apart from development. I have been working as application supporter within a group under HP.

Even though my work is not development related, there are couple people in our team developing small tools for our support work. When I see their codes, I see there are so many areas the codes could be much better, in terms of architecture, code resizability, and modularization. I have been volunteered to train a young developer to tune-up his codes. This is great chance for me to review I did several years ago. I did realized some enhancement in my codes as well, which are used as library for my colleague.

Read More...

Sunday, June 30, 2013

WWDC 2013

Apple Worldwide Developers Conference, WWDC, 2013 was held from June 10-14 at San Francisco. It has been over already for 2 weeks. This time, the session videos of technical talks was available right on the second day of the conference. The first time, all the talks are available directly from web browser. I started learning and watching all the shows. This saves my time to download shows and disk spaces as well.

The convenience of on-line shows is that it will automatically adjust video quality depending on demands. I don't need to get HD in order to watch the clear videos. There is additional option to get HD, SD and PDF. Since what I need to get the content, I have not bothered to do any downloading.

References


Read More...

Friday, May 31, 2013

Weight Loss Program Result

I started weigh loss program on February 1, 2013. After four months, what is the result? The program actually was planned in two month. However, something happened after one month. In March, I learned about the event of Scotiabank Calgary Marathon 2013. Soon I registered the event. That's why it takes me so long time to see the result.

During the first month, I tried to keep one hour physical exercise every day. Eat small meals and add one or two Attain drinks as snack food. It went well, however, the progress is slow. That's why when I knew about marathon event, I decided to take it: running is a very exercise to burn fat.

My preparation for marathon has been very intensive, about 10+km for 3 days a week, and one 30-44km at weekend. I use Access bar as a way to supply energy from fat. I could immediately see the result of losing my weight.

I finished my first official marathon on May 26, 2013. This is also the end of my weight loss program. Here are the result:

  • Weight: 67kg, losing 7kg from 74kg
  • Belt waist: 86 cm, reducing 8 from 94 cm
From this experience, I feel that even though the losing weight by burning fat is really hard, the program is really effective. With Attain drinks and Access bars, it makes it much easy to accomplish my marathon dream. I can say that with those tools, I could not finish my run. I have learned so much about how to do exercise comfortably and safely.

References


Read More...

Tuesday, May 28, 2013

I did It: Finished Marathon!

I did it on May 26, 2013: finished my first Marathon run at the event of Scotialbank Calgary Marathon. On that date, Sunday, it was a very nice day, sunshine with no wind. I got up very early at 5:10am, since the run starting at 7:00am sharp. My wife dropped me at LRT station. Almost all early riders are runners towards to Stampede Park.

Even though I had several Marathon tries during my preparation in the past two months, this is my first official Marathon in public event. I had a strong start at 5'06"/km for the second one km (the first one I was in the middle of the start, and I took some pictures and videos). The five minutes pace was kept up to 15k. Then my wife waited me there to fill my drinks, 8'23" at 16k. Then I kept my less then six minutes to 22k.

After that, my run was still in constant pace up to 6 minutes. I kept running all the route. I achieved my best result in 4:26:33, at average 6'11"/km pace!

NameCHU, Daqing
EventMarathon
DivisionM5559
Gun time04:26:33
Chip time04:24:58
10KM split00:55:03
21.1KM split02:02:46
30KM split03:02:48
Event Placement585 of 986
Sex Placement430 of 633
Division Placement26 of 41

When I finished my run, I was still filled with energy. Still I felt my foot sore at that time. In the afternoon, I had about one hour walk along the river, the route I had my preparation running before. This realization helps me a lots. Yesterday I went work. Today I feel full recovered back to normal.

Here are some photos I am going to order, sent by Marathonfoto:





For my participation as a fundraiser, I raised $1,415 as to date for Alberta Cancer Foundation.

References




Read More...

Wednesday, April 24, 2013

Three Must Watch Speeches

Today I read a message in Weibo about three speeches one must watch in life-time. The first one is the speech by Steve Jobs at Stanford University. I knew this one long time ago. Actually this one is the one changed my view about Apple. In 2007 I switched my focus more on Apple, Mac OS, iOS and its related technologies.

The other two I do't know. I took time to watch them. They are also very inspirational ones. I like them very much. One is the speech by J.K. Rowling at Harvard University and the third one is the last lecture by Randy Pausch. Their in-deepth sight and passion hit my heart. I think that they will have the same influence and impact on my life as Steve Job did.

Here are speeches:

Steve Jobs at Stanford University


J.K. Rowling speech at Harvard University:

Randy Pausch's last lecture:

and Randy Pausch 10 minute speech:

At the tudou video sharing site, Randy's speech with Chinese subtitles:

Read More...

Wednesday, April 17, 2013

Tips on using Microsoft Office

Here are two tips on using Microsoft Office. I use Microsoft Office at work on various works, including support and development documentations. Office documentations are common way to communicate at work.

The first tip is a simple one. In many cases, we need to copy content of an Excel cell as text. If you use normal copy by control+C key, actually you will get some extra information. This results in formats or extra carriage return be pasted. To copy text only, you can select text in the top input area next to toolbar items. Copy the text there will only get plain text only.

The second tip is about Word file. I like to use style to format text in word documentation. The style is something like css classes. You change one style, and all the text assigned with the style will be changed automatically. The second advantage is to layout the documentation by styles, such as title, heading 1, heading 2 and so on.

In the toolbar area, there one dropdown box for existing or current used styles. This list does not list all the predefined styles there. It is tedious to enable all the styles. One thing I noticed is that the dropdown box is editable. You can type in a style name. If it exists, it will be loaded. For example, Title is not normally in the list, but you can type it to bring it out. This is very handy way to use styles you remember.

Those are two very simple ones, but I use them very often.

Read More...

Saturday, March 30, 2013

Challenge: My Participation in Calgary Marathon 2013

Today I have registered the run of Calgary Marathon 2013, one day before the special register fee.

In the past month, I have practiced several times over the weekends to run along Bow River path trail. In about two month time, I'll challenge myself to run the full Marathon, the first try in my life time. I am very exited to take this challenge and going to prepare myself for the full run. My goal is to finish the run in about five hours.

Within my fundraising web site, I add a video of my previous practice running in March. One time I run from Edworthy Park to Prince's Island, Downtown Calgary, return back, and another time extended to Calgary Zoo, a return run. The third try was from Bowness Park to Calgary, but return only to the 7-11 store at Crowchild Trail on the Bow river side. I was exhausted.

I understand that this is a very huge challenge for me. I have never run the full length of Marathon before, even during my preparation in the past month. One thing I keep in mind is that I am not going to run very fast, but a none-stop run. I'll not run crazily to hurt myself, just within my conformable level. I know my limit, but I have several secretes to help to finish the run. I'll make my best effort to take the challenge. I hope I'll be able to make it.

As my effort to support Charities, I choose to raise funds for Alberta Cancer Foundation with my participation in the event. Please help me to donate your contribution as an incentive for my run.

References


Read More...

Nike+ Running App

Yesterday I had an another great run. This time I used Nike+ Running app for iOS to help me to record my running. I was going to get a Nike+ sensor, but I found that that sensor is only of iPod. Nike+ sensor is old technology. Now with iPhone GPS, there are many other better apps available for tracking running. Nike+ Running is one of them and it was free when I got it yesterday.

I gave it a try with close to two hour run, about 16+K. One of great features is that it, by default, keeps announcing my running status, such as distance, time and speed every one kilometer. I had clear picture of overall running. I kept running at even pace, so that I was able to control my energy during my run. After running, I can see my running statistics. All those data are also available at Nikeplus web site with my personal login. That's great. With this app, it will be great tool to know my strength, energy level and progress.

Here is my stat about my average speed:



The app saves my running route as a map:



And this are my overall numbers:



This is a great app!

References


Read More...

Tuesday, March 26, 2013

My Plan to Run Marathon

In the past 4 weeks, I have been in preparation for Scotiabank Calgary Marathon 2013. I got this news from a local news group. I was immediately attached by this event. The reason I am interested in this program is that I have been on a weight loss program. At the time I knew about the marathon, I was already in one week in the program.

Basically, the program is based on a package of products from Melaleuca. It recommends to change three meals in to three smaller ones. To overcome craving, it suggests to add two snack foods between meals. The snacks are Attain or GC Attain, which is based on a technology with natural ingredients to block craving desire. All those are for reducing calories input.

Another key element in the package is to use Melaleuca's exclusive and patented Access bar. The bar itself does not have feature for burning fat. However, it can block adenosine effect, which locks fat release when energy is required during exercise. In other words, by taking the bar 15 minutes before exercise with empty stomach, it will allow fat to be released when energy is required.

I like running exercise. It is a outdoor activity. By running long distance, it will push hard on my body for energy, as a result the energy from fat. I have never tried marathon run before. That's why I would like to take this opportunity try out Melaleuca's weight loss program.

This was my first long distance run on Mar 1, 2013. It was about 15k.




The second weekend I added another 5k, extended from Prince's island to Calgary Zoo. The last weekend I added another 10K starting from Bowness Park to Zoo, and then back to Crowchild Trail at river side. During those long distance runs, I used Access Bat to help me to get more energy power.

In addition to all those weekend runs, I intentionally do more physical activities during week days. In the past week, I started to walk from 4th floor (this is the only lowest one to access to stairs, 1-3 doors are locked) to 23th floor twice a day, and run from 15th to 23th once. Those are great exercises to help me to build strong muscles.

Another great product I use is the Pain-A-Trate. This one has great effect to reduce muscle sore or pain. Without it, I would not be able to recover so quickly from my muscle sores.

References


Read More...

Thursday, March 21, 2013

Use HTML Button Tag in Blog

This morning I read an article on web. The article is a long serials one, but it does not show the whole article on one page. Instead, it breaks down into small ones and placed serval buttons at the end of each one: First, 1, 2, ..., Last. I like this style. I immediately related this to my blog. Sometimes, I do the same thing, but I use UL LI list tags to show them as a list.

I did some investigation. What I found are three basic ones. First is to use DIV or UL LI with CSS. Although it does provides flexible and nice layout, it is a little bit complicated. The most concern I have is that I have to define CSS styles in my blog headers. This is not an issue in Blogger, but my other blog web providers do not allow me to add CSS styles.

The second method is INPUT tag. It is very simple. It provide a button like UI. However, it is a single tag with limited layout enhancement.

The third one is BUTTON tag. With this tag, any HTML tags can be placed within open and close tags. I like this one very much. Both INPUT and BUTTON utilize OnClick event to trigger click or hit event. For my blog purpose, what I need is to direct to another URL, either in current document or a new window. This can be done by client side JavaScript. I'll show this later on.

Here I give it a try in this blog.

The following codes define two BUTTON tags. By using inline Javascript, one will open a URL (Apple web page) in another new window and another open Microsoft web page in the current window. Within each button, there is an image content with text on the next line.

<button type="button"
 onclick="JavaScript:window.open('http://www.apple.com')">
 <img src="http://images.apple.com/home/images/billboard_ipad_hero.jpg" />
 <br/>Go to Apple... make my day!
</button>
<button type="button"
 onclick="JavaScript:document.location='http://www.microsoft.com';">
 <img src="http://compass.surface.com/assets/e4/38/e43802e2-8e9c-4fb9-80d6-f27fa6cf50df.jpg#1280_carousel_1_meet_surface.jpg" />
 <br/>Go to Microsoft... make my yesterday!
</button>

Here is another example with two buttons. I added a SPAN tag with TITLE attribute so that each button has a tooltip when you move mouse over the button.

<button onclick="JavaScript:window.open('http://davidchuprogramming.blogspot.com/2004/05/my-first-blog-entry.html')" type="button">
<span title="First blog">||&lt;&lt;</span></button>

<button onclick="JavaScript:document.location='http://davidchuprogramming.blogspot.com/2013/02/communication-between-mvc-controllers.html';" type="button">
<span title="Previous blog">&lt;</span>
</button>

Read More...

Thursday, February 28, 2013

Communication Between MVC Controllers

When there are more than two MVC controllers, controllers need to pass data or send notifications between two controllers. For example, a table list controller, parent, may push to an item edit controller, child, when an item is selected. The easiest way to is to set a property in child controller and pass the reference to parent controller to child's property. However, this strategy has one drawback: strong binding between parent and child controllers. In case the parent controller is changed to another kind of controller, the property of child has to be updated.

The alternative way is to implement delegate in Objective-C. Define a delegate in .h, then keep communication by defined methods in the delegate. Here is the steps of this strategy.

Define a Delegate

The delegate provides APIs to pass data or to send notifications. For example, the following codes define a update method:

@protocol MyEntityEditDelegate <NSObject>

- (void) updateEntity:(NSIndexPath *)index;

@end

Add a Delegate Property in Parent Controller

The next step is to implement the delegate property in the parent controller. This breaks the strong binding between the parent and child. The child will call parent by the delegate APIs.


@interface ParentListViewController :
    UITableViewController <..., MyEntityEditDelegate>

....
@end

Define a Delegate Property in Child Controller

The last step is to add delegate property in the child controller. This will let the child hold a reference to its parent by delegate.

@interface ChildEntityEditViewController : ...

@property (nonatomic, weak) id<MyEntityEditDelegate> delegate;

@end

Notice that the property type is id<...> type. This prevents the coupling between the parent and child.

Read More...

Monday, February 18, 2013

What is the Next Big Thing for Apple

This is a question most people ask today. There are many rumors about iWatch, a wearable device can be attached to human body. Personally, I think this is a tip of iceberg, and it must be a part of Apple eco-system.

In the past, from Apple's WWDC seminars, I noticed that Apple has been very interested in BLE (Bluetooth Low Energy) technology. There was a demo about using iPod touch as a BLE device to communicate with iPhone. This is a open standard protocol and has great application potential in many areas.

I remembered one Video of Steve Jobs' talking about what Apple learned from its past. Apple invested a lot in personal computer, OO technology and graphics OS. Steve was so fascinated with this. This came out of the result of Mac computer. One thing Steve mentioned that he missed out network and internet, the potential products in this area. Actually, from Apple's past, the company has invested a lots in this area with innovative technology, such as zero configuration networking or Bonjour.

With iPhone's success, I think this has been raised to top priority of Apple's next technology innovation. iWatch is just one device for motion monitor device (MMD). It seems that Apple is also working on motion event device (MED) as well.

The next big thing is built from the past technology or concept in Apple for long time. When it is out, I think it will be a big surprise WOW for consumers. This will be not just one single device. This is a whole system with iPhone and mobile devices. The innovation will be built on a solid system and it will an open system for developers.

Read More...

Sunday, February 10, 2013

Update my Codes to iOS 6

After I updated my Xcode to 4.6, I got several compiling errors when I tried to compile my app. It seems that they are iOS 6 related.  Most of them are easy to fix. However, I had a little bit hard time to nail down two.

The first one is block related. I used self within block. In Xcode 4.6, this is a potential memory issue: Capturing 'self' strongly in this block is likely to lead to a retain cycle. With the help of SO, I quickly found the solution: using __weak prefix to capture self as none-retaining variable. Then use the var in the block.

if (entity.imagePath) {
   __weak UITableViewController *weakSelf = self;
   // Load image from entity to doc helper with handler
   [self.docHelper addImageDocs:myDoc
            withCompleteHandler:^{
                [weakSelf.tableView reloadRowsAtIndexPaths:
                   aPath
                   withRowAnimation:UITableViewRowAnimationBottom];
            }];
}

The second one was tough for me, because it is Storyboard related. The warning only indicates a potential issue but I could not locate it: table view background color is deprecated in ios 6.0. In a similar way, I got an answer from SO. But in my case, I have too many views and components. It is hard to locate the issue. Eventually, I found a way to view the storyboard as XML text and soon I located the deprecated color. I submitted my answer to SO.

References

Read More...

Friday, February 01, 2013

Start Weight Lost Program

I t has been two weeks after my vacation from China. I read a news from Melaleuca about weight lost program. Basically, the program works in a simple way: reduce daily large meals into small ones, meal size like my fist. Take GC Attain or Attain between meals to replace snack food. Exercise 45 minutes daily, and take a Access bar before walk out. Optional: take PfoFlex20 within one hour after exercise.

Today I sent my application to Melaleuca. Here are my numbers:


  • Weight: 74Kg
  • Belt waist: 94 cm
  • Height: 1.72m

I also took a photo before I start the plan today. I'll see if I'll loss 10% after the ten week plan.

Reference


Read More...

Sunday, January 27, 2013

New Year Resolution

Just come back from my visit trip to China. I spent about 3 weeks there in Wuhan and Beijing to visit my parents and family relatives. During my stay in China, I had some time to think about the new year 2013. In the past year, my work switched to application support. Therefore, I had less time on software development. In 2013, I think this will be the same.

The only thing I will do is my Mac or iOS development. I think I have layout very solid foundation already. I have started several projects, but not finished yet. The only way to make progress is to make personal commitment. I have set up my year 2013 resolution: first, loss weight 10%, to about 150p. The second one is to commit two days after work time on my iOS development. With this effort, I'll be able to finish my long-over-due project.

Start from this week!

Read More...

Saturday, January 19, 2013

Cardiovascular System and ProvexCV

This is a known fact:: Coronary heart disease is the singl leading cause of death in the world today. In our lifetime, it is highly likely this deadly disease will affect us or some one we love. People have been waiting for science research break through in this area, either cure solution or even impotently a way to prevent heart disease.

As a IT technician, I want to maintain my cardiovascular system in good shape. Through my after work investigation and research, I am so fortunately to find out there is solution from Melaleuca. ProvexCV is one most popular product from the company. In past about 17 years experience as a Melaleuca preferred customer,  I have witnessed its introduction and updates.

This product was introduced one year after I become a preferred customer. The introduction of this product was the most special event I have ever seen. The company noticed us, all the preferred customers, a very important telephone conference call one day. During the call, Frank VanderSloot, the CEO, was very existed to claim that Melaleuca was in the leading position with the ProvexCV product,  in terms of preventing heart disease. He mentioned one of key researchers, Dr. John Folts, who is the person discovered Aspirin health benefit for heart.

Even it was a very existing news, I did not pay attention to this product. I was in very good health and I did not think that I needed this product. However, I knew that I could share this news with some one who would benefit from this. My parents and in-law parents had heart issues. I purchased the product and sent to them. During the past years, they told me that ProvexCV really made difference in their lives. They feel much better with almost daily on ProvexCV.

In my after work hours, I spend some time to study Melaleuca products. I read all the information I could get from Melaleuca. I collected some key facts and I tried to find support from other channels. This investigation does open my eyes. With my extended knowledge in this area, I got exited about this product.

One of break-through findings in 2012 was that I found video shows about Dr. John Folts on cardiovascular system research and red wine. This was the first time I head directly from Dr. Folts about the relationship of his research and Melaleuca. His in depth research taught me the importance of food supplements. They are nutritional substances to maintain our cell, organ and body in good health. They are not magic bullet to cure disease like medicine drugs. In terms of ProvexCV, this is for endothelial cell health, which is critical for cardiovascular system.

This blog will be scheduled to be published on the date when I get back from my vacation.

References


Read More...

Monday, January 07, 2013

Download Video and Audios

This is scheduled blog during my vacation China. I think that this blog is still not accessible during my stay there. This blog is about web tools to download videos and audios.

Before I leaved for China for my vacation, I wanted download some Youtube videos from WongFu Production. One is a serials of Away, we happened, and another is When it counts. I wanted to write my Chinese blogs based on those videos. Since I could not access to Youtube when I am there, I wanted to download them.

Soon I found a very convenient way to do it. There is a web service for this kind of downloading: SaveFrom.Net. This web service provides a simple way to download videos:

  • Coy URL of a video, such as one from Youtube.
  • Open SaveFrom.Net web site
  • Paste URL to download text box.
  • Click on Download button.
  • Select one video format you like such as MP4 360p


One thing I noticed is that if the size of a video is too large, larger than 150MB, you would not be able to get the video. It seems that there is limit to download.

Reference


Read More...

Tuesday, January 01, 2013

My StackOverflow Reached to 5k

My StackOverflow reputation reached to 5k on Dec 21, 2012. I wrote this blog on the same date, but scheduled for publishing on Jan 1, 2013. This is new start date. As you mentioned in my previous blog that in the year of 2012, my contract job was changed to focus on application support. As a result, I spent less time on codes.

However, since I was active on SO, my previous contributions and efforts have been recognized by other users on SO. As a result, my reputation has been kept grow. The following is the snapshot of my 5k moment:



By the time of the first date of 2013, this blog will be published. I will be on my vacation in Beijing and Wuhan by that time.  Even my work will be less coding, I'll continue my effort in iOS and Mac OS development and I hope I'll get my first app release soon. I will write my programming experience in iOS and Mac OS more in this blog.

Read More...