Friday, December 16, 2011

Facebook javascript error - perms should now be called scope

From December 13th onwards, facebook supports only OAuth 2.0 for authentication. First introduction of Oauth 2.0 in the javascript SDK was in July 2011. All apps were given time untill October 11 to migrate to OAuth 2.0.

Please ensure that response.session will be replaced with response.authResponse.

Cool Resignation Letter



Dear HR MANAGER NAME,

Please accept this letter as my formal notice of resignation from COMPANY NAME, effective DATE. The associations I’ve made during my employment here will truly be memorable for years to come.

The feeling is mixed as this the first company that provided me with a platform to help me find what I am, by giving me the right opportunity. Even though this should be a formal letter I cannot help to express my gratitude and feelings by a simple poem :

I love This Job
But I have to Go
Because I have Got Something
Which I cant Ignore

I Aimed for the Sky
I got the Stars
And I Saw the World Beyond
That I want to Explore

This isn’t for Money, this isn’t my Greed
This isn’t about People that make me Crib
But this is about the Dreams I have always had
A flick of Hope that makes me Mad

I am Upset, I feel Sad
To leave the World I created from Scratch
But now is the age to take more Risk
And this is the Opportunity I could not Miss


Separation will be Painful that’s what it Seems
For I would miss the Boss and the Entire Team
Our Relationship is Eternal and the world is small
And I would be in touch with One and All

I hope 2 weeks notice is sufficient for arranging new employee as my replacement. I can train the new employee during my notice period. Also I am available to tie up any loose ends if there is need of it.

Thank you very much for providing golden opportunity to be part of your organization.

Sincerely,

NAME,
DESIGNATION
COMPANY NAME

Monday, December 12, 2011

Parse blog to find keywords

We are using php to find relevent blogs based on keywords

$blog_data = array(
            'campaign_id' =>$campaign['campaign_id'],
            'campaign_name' => $campaign['campaign_name'],
            'mandatory_keywords' => $mandatory_keywords,
            'extra_keywords' => $extra_keywords,
            'page_url' => $get_blog['page_url'],
            'page_id' => $get_blog['id'],
            'html' => $get_blog['page_text']
        );
        $blog_parse_result = parse_blog_data($blog_data);









function parse_blog_data($data)
{
    show( "Parse text for: ".$data['page_url']);


    $keywords = array_merge($data['mandatory_keywords'],$data['extra_keywords']);
$page_id=$data['page_id'];//Page id for statistics_pages
$page_url=$data['page_url'];//Page id for statistics_pages
#show( "page url= ".$page_url."<br>");
    if(empty($keywords)){
#        update_blog_row($data['id'],"","NOT_OK",$page_id);
    #    show( "\n************** END: NO KEYWORDS {$data->campaign_name} ($data->campaign_id) ****************\n\n");
        return;
    }

    require_once("blog_parser/phpQuery.php");
    $doc = phpQuery::newDocumentHTML($data['html']);

    $text = "";
    $images = array();

    foreach(pq('p,h1,h2,h3') as $p)
    {
        $p_text = pq($p)->html();

        foreach($keywords as $key)
        {
            #show(  "{$key} > ");
            if(!empty($p_text) && !empty($key) && strpos(strip_tags($p_text), $key))
            {
                // Retrieve text
                $text .= !empty($text) ? "\n\n".strip_tags($p_text) : strip_tags($p_text);

                // retrieve blog images
                foreach(pq($p)->children("img") as $img)
                {
                    $src = pq($img)->attr("src");

                    if(!empty($src) && @GetImageSize($src))
                        $images[] = $src;
                }
                #show("MATCH ************************************************************");
                continue 2; // Finished parsing this p-tag
            }else
            {
                #show("NO MATCH");
            }
        }
    }

    return array(
        'status' => (!empty($text) ? "OK" : "NOT_OK"),
        'text' => utf8_decode($text),
        'images' => $images
        );
}

Cakephp mode rewrite issue

Please type the following commands, one by one in your terminal

sudo rm /etc/apache2/mods-enabled/rewrite.load

sudo a2enmod rewrite

sudo service apache2 restart

Salary increment request letter

Hi HR,

I have been employed with this company since last May 2011, as an software engineer, during which period I have discharged my duties to the best of my abilities. I have been sincerely dedicated and continuing hard-work for our company. According to my commitment to job and obeyness the management as well as experience.

So, may I now request you to consider my an increment. I hope you will take a favorable view and I feel confident that the management will be generous in recognizing and rewarding my merit.
I'm looking forward to a favorable response from you.