Monday, July 7, 2014

Website development work - pilesbd

Today I completed my recent website development work PilesBD. It is a website of, Dr. Tanvir Jalal, who is a renowned colorectal surgeon in Bangladesh.

So here are the basic job descriptions:

  • Complete redesign with bootstrap css
  • Bilingual content (bangla and english)
  • Question answer system
  • Photo Gallery
  • Facebook Integration
  • Admin panel

Here is the screenshot of the completed work:


Technology I used:

What I have done:

All the works are done by me. I also used some CakePHP plugins like upload plugin, facebook plugin to reduce work load. All the coding is done using Aptana Studio, used XAMPP as a local development environment and Draw.io for workflow drawing.


Facebook Graph API v2.0 - No more real facebook user_id

I am not a full fledged facebook app developer. Recently working on a website that will use facebook login for user authentication. I am using CakePHP framework to build the website.

When I create new app in facebook developer page, I noticed that my newly created app is using Graph API v2.0 instead of v1.0. I found this when I saw facebook, after authorization my app, giving me user_id of facebook user which was something different then the original user_id. Then I discovered facebook is hiding the actual user_id and give us app_scoped_user_id instead. This id is app specific meaning that same user have different app_scoped_user_id in different facebook app. So there is no way to get the actual facebook user id anymore.



Facebook released Graph API v2.0 which has lots of things to look at. These include facebook login, permission, dialog etc. Here is the upgrade guide from v1.0 to v2.0. Also look here for permissions for facebook login. Don't forget to look at the best practice guideline for facebook login.

Tuesday, July 1, 2014

Keywords suggestion using AlchemyAPI

I was developing a web application for client which has a CMS (Content Management System) feature. Client will be able to manage website pages through this CMS module. One of the requirements was to ensure page SEO by meta keywords and meta description.

I was thinking a possible use case to accomplish SEO feature may be automatic generation of keywords based on page body. So I was searching for keyword generation API (Application Programming Interface). I found AlchemyAPI. Now I am going to implement this API.

I am using CakePHP (php framework), Bootstrap (css framework), jQuery (javascript framework). So here is my use case:

  • There will be a link of "create keywords" by meta-keywords form field
  • After clicking the link, an ajax request is being made to my CakePHP controller
  • In controller, a request will be sent to AlchemyAPI server and grab the response
  • If success, return the results by json
  • In CMS page, ajax response will be populated to the meta-keywords form field.
Now lets look at the page screenshots:
Sending ajax request
Received the response

Lets make the code:

Html Link code
Create Keywords
Javascript code
function createKeywords(source, target){
 var target = target;
 var source = $('#'+source).val();
 tinyMCE.triggerSave(true);
        $.ajax({
            type: "POST",
            url: 'http://website.com/cms/get_key_words',
            data: {'words': source},
            dataType: "json",
            cache: false,
            success: function(msg){
                //alert(msg);
                //console.log(msg);
                if(msg.msg == "Success"){
                    $("#"+target).val(msg.result);
                }else{
                    alertify.alert("An error occured. Try again."+msg.result);
                }
            }
        });
        return false;
}
PHP Controller code
public function get_key_words(){
     if ($this->request->is('post') || $this->request->is('put')){
         App::import('Vendor', 'Alchemyapi', array('file' => 'alchemyapi' . DS . 'alchemyapi.php'));
            $words = trim($this->request->data['words']);
            
            if(!empty($words)){
                $alchemyapi = new AlchemyAPI();
                $response = $alchemyapi->keywords('html', $words, array('sentiment'=>0));
                //debug($response);exit;
                if($response && $response['status'] == 'OK'){
                    $key = Set::extract('/text', $response['keywords']);
                    if($key){
                        $keywords = implode(', ', $key);
                        $msg = array(
                            'msg' => 'Success',
                            'result' => $keywords
                        );
                    }else{
                        $msg = array(
                            'msg' => 'Error',
                            'result' => 'No keywords'
                        );
                    }
                    
                }else{
                    $msg = array(
                        'msg' => 'Error',
                        'result' => 'Keyword Server Error'
                    );
                }
            }else{
                $msg = array(
                    'msg' => 'Error',
                    'result' => 'No Source text'
                );
            }
            
            Configure::write('debug', 0);
            echo json_encode($msg);
            exit;
     }
 }

AlchemyAPI client

I used their php API client available here and github. Also read their documentation.

Monday, June 30, 2014

Tiny Story of Hobby Lobby

Once upon a time there was a girl named hobby. She lived in a jungle full of tallest rain forest tree. She lived there alone but a dream of wonder full company with a boy, first saw in the lobby of his house.



Its raining, raining and raining. It seems all the forest tree is crying. Hobby is crying in the lobby. But nobody heard her. She is waiting there... Hobby is waiting there... alone!

Saturday, June 28, 2014

My workstation

I am currently working on some projects. You probably know working environment is the important factor for best productivity outcome. So I arrange my room with some simple setup.
Working on hp ProBook 4440s
White board needs to be hanged

Saturday, October 5, 2013

An easy cheap reliable SSD solution for Virtual Private Server (VPS)

Virtual Private Server (VPS) is now-a-days become very popular for many developers and a good choice for production deployment of any website or applications. When cloud technology is added, it become very robust and stable option for any kind of deployment. Before going to actual point we need to understand some terminology.

VPS: A virtual private server (VPS) is one of many virtual machines running on a single computer and is dedicated to the individual customer's needs, has the privacy of a separate physical computer, and can be configured to run server software.

SSD: A solid-state drive (SSD) is a data storage device using integrated circuit assemblies as memory to store data persistently. SSD technology uses electronic interfaces compatible with traditional block input/output (I/O) hard disk drives. Compared with electromechanical disks, SSDs are typically less susceptible to physical shock, run more quietly, have lower access time, and less latency.

Uses of VPS: For those who is new to VPS, here are some uses:
  • Using as a hosting server for website (like your personal website) and web application
  • Using as a development server/sandbox for application
  • Using as a server for hosting business
  • Can be used in configuring switch used in VOIP
  • Can be used as a secure personal/business file storage server
  • As a email server
  • And what not?
If you are a novice linux system administrator, you can boost your learning by playing with VPS server.

Now the question is how to choose a VPS server?
We are running a couple of VPS server for different purpose of our organization for few months. All of the server is running with SSD drive, a very fast performing device with 100% uptime availability. So here are the tips before choosing your own VPS:
  • Hardware of the physical server
  • SSD drive is preferable
  • Data connectivity is very important
  • Support
  • Uptime
  • Cloud infrastructure
  • Flexible billing
  • Easy control panel
  • Affordable budget
  • Easy deployment
So why not try yourself for your very own reliable affordable VPS server now!

Friday, September 27, 2013

How to choose a best web host?

Sometimes we need a hosting provider to host our website or web apps. Now a days you will find a tons of hosting company with attractive offers. But how to choose the best among them? Well, choosing the best host is an important factor in your web presence. Lets see how we can evaluate a host. You can research the following factors before selecting any web host.

  • Uptime guaranty
  • Server technology
  • Datacenter facility
  • Support methods & response time
  • Terms of service
  • Review, reputation & online presence

Do not confuse with "Unlimited" features because everything is limited in this world. If your OS is Unix, try to host your site with "Cloud Linux" environment. In this environment shared hosting account can be limited to certain resource limit. For excessive usage of server resources by individual account, the whole server will not go offline anymore.

Saturday, June 30, 2012

Community Diagnosis

Definition

According to WHO definition it is "a quantitative and qualitative description of the health citizens and the factors which influence their health. It identifies problems, proposes areas for improvement and stimulates action."

The stages involved in the process of community diagnosis:

The process of community diagnosis involves four stages-
  • Initiation
  • Data collection and analysis
  • Diagnosis
  • Dissemination

Initiation

  • Dedicated committee or working group should be set up to manage and coordinate the project
  • The committee should involve relevant parties such as government department, health professionals and non government organizations.
  • It is important to identify the available budget and resources to determine the scope of the Diagnosis
  • Some of the common areas to be studied may include—
    • Health status
    • Life styles
    • Living condition
    • Socioeconomic condition
    • Physical and social infrastructure
    • Inequalities
    • As well as public health services and policies

Data Collection & Analysis

  • The project should collect both quantitative and qualitative data
  • Population census and statistical data e.g. population size, sex and age structure, medical services, public health, social services, education, housing, public security and transporting etc. can provide background of the district
The community data can be collected by conducting survey through
  • Self-administered questionnaires
  • Face to face interviews
  • Focus group discussion
  • Telephone interviews

Diagnosis

Diagnosis of the community is reached from conclusions drawn from the data analysis. It should preferably comprise three areas:
  • Health status of the community
  • Determination of health in the community
  • Potential for healthy city development

Dissemination

  • The production of the community diagnosis report is not an end in itself; efforts should be put into communication to ensure that targeted actions are taken
  • The target audience of the community diagnosis includes policy makers, health professionals and the general public in the community
  • The report can be disseminated through the following channels
    • Presentations at meetings of the health boards and committees or forums organized for voluntary organizations, local community groups and the general public
    • Press release
    • Thematic events

Phases of history of health development

Health

The World Health Organization (WHO) defined health in its broader sense in 1946 as "a state of complete physical, mental, and social well-being and not merely the absence of disease or infirmity."

Phases of history of health development

  • Phase of Disease control (1880-1920)
    • Not only the control of particular disease(s)
    • Control of man’s physical environment through sanitary legislation and reform.
  • Phase of Health Promotion (1920-1960)
    • Mother and child health
    • School health
    • Industrial health
    • Mental health
    • Public health nursing
    • Provision of basic health care
  • Phase of Social Uplift (1960-1980)
    • New diseases and disorders of chronic nature emerged as public health problems;
    • Cancer
    • Cardiovascular diseases
    • Diabetes
    • Drug dependence
    • Could not explain by germ theory or tackled by traditional approaches.
    • Social and behavioral risk factors
  • Phase of Health for All (1980-2000)
    • Health is a human right
    • Not uniformly dispensed to entire population
    • A vast majority of population was beyond any access of health services