Sunday, 9 March 2014

How to solve User Kernel Not Responding mac LOL

After a battle, the program crashed and asked me to send a report. Since then, I'm able to match a team, but cannot open the play screen any more. In Active Monitor, the Userkernel is not responding.

Here is a solution, this works to my case, may be not applicable for other problems that cause userkernal not responding.

1. Open Terminal.
2. enter "rm -r ~/Library/Application\ Support/LolClient" and press return button.
   enter "rm -r ~/Library/Caches/LolClient" and press return button.
3. Reopen LOL it should be work.

These commands just clear caches and some configuration of LOL, so it is safe. Alternatively, you can open the path with Finder and delete the folders there.

Sunday, 29 December 2013

Install zend debugger for php 5.4.x on Mac OSX 10.9 64bit

After updating to OSX10.9, the default php shipped with OSX is updated to 5.4. doesn't publicly provide a zend debugger for php5.4. The files used in this article are shipped with zend server. Here is the steps to install zend debugger for php5.4 on Mac OSX 10.9 64bit.

Step 1. Download (download linkfrom

Step 2. Put to somewhere like /Library/WebServer/Documents/zend_debugger.

Step 3. Modify php.ini. The default configuration file used by Mac OS is at /private/etc/php.ini. Admin permission is required to modify this file. So go to /Applications/Utilities and open Terminal. Enter sudo nano /private/etc/php.ini. Jump to the end of this file and add 
zend_debugger.allow_hosts=, localhost
Control+x to save this file. You'd better comment out Xdebug if it is enabled. (There is also a full version of debug configure available at which is shipped with zend server.)

Step 4. Download dummy.php from Put it in your web server root document fold. By default, it is /Library/WebServer/Documents.

Step 5. Restart apache. In Terminal, enter sudo apachectl restart.

Step 6. Choose to use zend debugger in zend studio or eclipse.

        Monday, 2 December 2013

        iOS development: CLLocationManager gets some problem to monitor regions

        By using the CLLocationManager and <CLLocationManagerDelegate>,  people can make geoRegions to be monitored by system . And get notified when user location enter that region. How to use them, see:

        However, according to my tests on Simulator and discussion on forum (, the performance of the region features are poor. In Simulator, the - (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region method often get triggered 2km far away from the defined region, regardless the desired accuracy (cllocationManager.desiredAccuracy=kCLLocationAccuracyBest) and the radius of region ([CLCircularRegion alloc]initWithCenter:o.coordinate radius:o.radius identifier:name). 

        The discussion on forum implies that the region features are based on cell and the accuracy could only be at kilometre level. I haven't test it on device. But currently, it seems not qualified to use for small region detection.

        iOS development: customise GPS path for Simulator

        When developing location-based apps, sometimes we want to simulate a path or movements on Simulator. Xcode provides the ability to change "current user location". Rather than a single location, it can also continuously change the "current user location". And it looks like the user travels along a route. To enable this, a GPS path file is required.  Here is a way to create a path for Xcode to run after.

        Step 1. Generate gpx file.
        Go to or some similar websites to generate a gps path file which ended with .gpx. Download it, and it shall looks like:
        <?xml version="1.0" encoding="UTF-8" standalone="no" ?>

        <gpx xmlns="" creator="" version="1.1" 
            <bounds minlat="-37.900140" minlon="144.662850" maxlat="-37.897000" maxlon="144.673920" /> 
            <rtept lat="-37.897000" lon="144.673920">
            <rtept lat="-37.897970" lon="144.671830">


        Step 2. Modify the gpx file.
        This format is not compatible with Xcode. So we need to do some fix. First, delete the content which is meaningless for Xcode (shown above). Then, replace all rtept with wpt . It should looks like this after modification:
        <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
        <gpx xmlns="" creator="" version="1.1" 
            <wpt lat="-37.897000" lon="144.673920">
            <wpt lat="-37.897970" lon="144.671830">

        Step 3. Load the modified gpx file to Xcode.
        After launching app from Xcode and running it in Simulator, go back to Xcode and add the gpx file to your project (following graph). Then the your new location/path will be showed in this list. Click to choose it.
        Step 4. Check it.
        When your app is still running in Simulator, click the "home" button of your iPhone/iPad Simulator. Then open the default map app, and show the current location. The movement will be exactly the same as you made from

        Something worth mention:
        1. Several default movements are available from Simulator menu ->Debug->Location.
        2. The speed of customised path seems possibly to be controlled by the <time> rag in gpx file? I am not sure about this. But anyway, you can set the speed when you make the path on the website.

        Friday, 8 November 2013

        yahoo stock data url

        Historical quotes can be requested for any period in the past. To request historical quote an URL in the following format is used:
        The following lists the parameters of this URL
        s=MSFTSymbol for quote requested
        a=02Start month of quote requested (Zero based). 00-January, 01-February, 02-March, etc
        b=13Start day of quote requested
        c=2001Start year of quote requested
        g=dFrequency of quote requested. Value d here stands for "Daily"
        An example of the returned data is as follows:
        Date,Open,High,Low,Close,Volume,Adj Close
        Here's a neat way to download stock data from Yahoo, perhaps into a spreadsheet (so you can play with the data): a BUNCH of STOCK SYMBOLS separated by "+" &f=a bunch of special tags
        for example:
        where some special tags are:
        aAska2Average Daily Volumea5Ask Size
        bBidb2Ask (Real-time)b3Bid (Real-time)
        b4Book Valueb6Bid SizecChange & Percent Change
        c1Changec3Commissionc6Change (Real-time)
        c8After Hours Change (Real-time)dDividend/Shared1Last Trade Date
        d2Trade DateeEarnings/Sharee1Error Indication (returned for symbol changed / invalid)
        e7EPS Estimate Current Yeare8EPS Estimate Next Yeare9EPS Estimate Next Quarter
        f6Float SharesgDay's LowhDay's High
        j52-week Lowk52-week Highg1Holdings Gain Percent
        g3Annualized Gaing4Holdings Gaing5Holdings Gain Percent (Real-time)
        g6Holdings Gain (Real-time)iMore Infoi5Order Book (Real-time)
        j1Market Capitalizationj3Market Cap (Real-time)j4EBITDA
        j5Change From 52-week Lowj6Percent Change From 52-week Lowk1Last Trade (Real-time) With Time
        k2Change Percent (Real-time)k3Last Trade Sizek4Change From 52-week High
        k5Percebt Change From 52-week HighlLast Trade (With Time)l1Last Trade (Price Only)
        l2High Limitl3Low LimitmDay's Range
        m2Day's Range (Real-time)m350-day Moving Averagem4200-day Moving Average
        m5Change From 200-day Moving Averagem6Percent Change From 200-day Moving Averagem7Change From 50-day Moving Average
        m8Percent Change From 50-day Moving AveragenNamen4Notes
        oOpenpPrevious Closep1Price Paid
        p2Change in Percentp5Price/Salesp6Price/Book
        qEx-Dividend DaterP/E Ratior1Dividend Pay Date
        r2P/E Ratio (Real-time)r5PEG Ratior6Price/EPS Estimate Current Year
        r7Price/EPS Estimate Next YearsSymbols1Shares Owned
        s7Short Ratiot1Last Trade Timet6Trade Links
        t7Ticker Trendt81 yr Target PricevVolume
        v1Holdings Valuev7Holdings Value (Real-time)w52-week Range
        w1Day's Value Changew4Day's Value Change (Real-time)xStock Exchange
        yDividend Yield