Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

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. Zend.com 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 ZendDebugger.so (download linkfrom https://github.com/mkb2000/zend_debugger.

Step 2. Put ZendDebugger.so 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]
zend_extension="/the/path/to/the/folder/you/made/in/step2/ZendDebugger.so"
zend_debugger.allow_hosts=127.0.0.1, localhost
zend_debugger.expose_remotely=always
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 https://github.com/mkb2000/zend_debugger/blob/master/debugger.ini which is shipped with zend server.)

Step 4. Download dummy.php from https://github.com/mkb2000/zend_debugger/blob/master/dummy.php. 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.



        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:
        http://ichart.finance.yahoo.com/table.csv?s=MSFT&a=02&b=13&c=2001&g=d&ignore=.csv
        The following lists the parameters of this URL
        ParameterDescription
        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
        2012-05-03,31.88,31.90,31.61,31.76,31501300,31.76
        2012-05-02,31.85,31.93,31.64,31.80,37385300,31.80
        2012-05-01,32.05,32.34,31.95,32.01,43832300,32.01
        2012-04-30,31.98,32.11,31.92,32.02,35697200,32.02
        2012-04-27,32.12,32.22,31.88,31.98,41419100,31.98
        ...
        Here's a neat way to download stock data from Yahoo, perhaps into a spreadsheet (so you can play with the data):
        http://finance.yahoo.com/d/quotes.csv?s= a BUNCH of STOCK SYMBOLS separated by "+" &f=a bunch of special tags
        for example: http://finance.yahoo.com/d/quotes.csv?s=XOM+BBDb.TO+JNJ+MSFT&f=snd1l1yr
        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


        http://www.jarloo.com/yahoo_finance/