For basic configuration of octopress blog, go to official site for references.

Issue with OS EI Caption (10.11)

After updating OS to EI Caption (10.11), there is some bugs when we run rake preview. You need to update your ruby version, and reinstall dependencies of octopress.

Refer to Errno::ENOENT: No Such File or Directory - Jekyll ~ Octopress and El Capitan post for more details.

If you can still not update your ruby version using the way in the above post, try the following commands (Refer to Using Rbenv to Manage Multiple Versions of Ruby for more details.) before install new ruby version:

  • Add rbenv init to your shell to enable shims and autocompletion:
1
2
$ echo 'eval "$(rbenv init -)"' >> $HOME/.bash_profile
$ source ~/.bash_profile
  • Restart shell as a login shell so that the PATH changes take effect:
1
$ exec $SHELL -l

Themes

Go to here to choose the theme you like. Personally, I like the boldandblue theme. It is simple and elegant.

Read on →

Google Maps Android API utility library (the github repo and the documentation) supplies multiple cool features, including

  • Marker clustering — handles the display of a large number of points
  • Heat maps — display a large number of points as a heat map
  • IconGenerator — display text on your Markers
  • Poly decoding and encoding — compact encoding for paths, interoperability with Maps API web services
  • Spherical geometry — for example: computeDistance, computeHeading, computeArea
  • KML — displays KML data (Caution: Beta!)
  • GeoJSON — displays and styles GeoJSON data
Read on →

Description

A .dSYM file is a debug symbols file. It is generated when in xcode:

  • Generate Debug Symbols setting is enabled
  • Debug Infomation Format is set to DWARF with dSYM File in the build settings of your project.
Read on →

Contents:

Description

In Cocoa, the Model-View-Controller pattern, a controller’s responsibility is to keep the view and the model synchronized. There are two parts to this: when the model object changes, the views have to be updated to reflect this change, and when the user interacts with controls, the model has to be updated accordingly.

Key-Value Observing helps us update the views to reflect changes to model objects. The controller can observe changes to those property values that the views depend on.

For more details, refer Key-Value Coding and Observing from objc.io;

Read on →

All the attributes of a property defines how the compiler generate the getter and setter accessors.

  • atomic / nonatomic
  • strong / weak: used for ARC.
  • assign / retain / copy: go to here for reference. These properties define how the compiler generate the setter accessor.
  • readonly / readwrite: if a property is declared as readonly, the compiler will only declare the getter accessor, so that you can not call setter accessor.
Read on →
ios

Location Service Authorization

1. Set info.plist

For iOS SDK 8.0 and later, we need to set NSLocationWhenInUseUsageDescription and ‘NSLocationAlwaysUsageDescription’ in info.plist file. A sample case is:

1
2
3
4
<key>NSLocationWhenInUseUsageDescription</key>
<string>Do you allow the app to use your location?</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>Are you willing to allow the app to use your location?</string>

The string will appear in the popup dialog. You can leave it as empty, and only the system message will appear in the popup.

Read on →
ios

MKOverlay

Write your own overlay class (for example, MapOverlay) confirm to MKOverlay, synthesize coordinate and boundingMapRect, so that we can assign value to them while initializing it.

Note that the type of coordinate is CLLocationCoordinate2D with latitude and longitude, while boundingMapRect is MKMapRect. And we need to use MKMapPointForCoordinate method to convert a CLLocationCoordinate2D type data to MKMapPoint type data. If we assign the CLLocationCoordinate2D data directly to boundingMapRect, the overlay will be too small to draw, and the mapView:rendererForOverlay: method will not be called at all. It is very hard for debugging.

Read on →

[updated 2015.09.13] This adding method is only for my project pages (gh-pages) GitBlogs, and for octopress, the way is builded in.

[updated 2015.06.07] For adding category or tag automatically through python script, go to here.

Introduction

The index page includes cat_tag_for_index.html for showing all the categories and tags, and the number of the corresponding posts.

The _layouts/default.html describes the content of a post, because post includes it. In the _layout/default.html file, it includes the cat_tag.html template as the category and tag info in the beginning of the post. And cat_tag.html also includes the date behind.

_data/categories.yml and _data/tags.yml describe all the categories and tags.

Read on →