Category : Daily Inspiration

software-testSoftware Test Engineer impact on Successful Businesses

Software Test Engineer impact on Successful Businesses

Now days we are fully aware of the cost associated with the lack of quality of software to companies who buy a software product as well as also to the companies who generates the same software part. The job of improving quality on a restricted cost base is a hard one.

A client will never like a costly and hectic problem with software that doesn’t work, isn’t completed on time, does not encounter specifications, effects customers adversely, has bugs or is too difficult to use! The importance of testing as well as related activities began at the start of a project.

The STE plays a part in the SDLC as testing is not just finding bugs but it is the systematic valuation of an application’s fitness for the purpose it has been designed for.

Properly perform STE is not just so much verification of functionality of your product, though verification that your software expansion process produces high quality at each and every step. Testing implies throughout the lifecycle for maximum project benefit

• Requirement here test cases works on gathering requirements so no ambiguity left regarding requirements.

• Design test component addresses the desire to define the number of tests to be performed, the conducts that testing will follow and the test conditions that need to be work out.

• Implementation at this phase testing done to check the functionality basically.

• Verification it makes sure that the product is designed to deliver all functionality to the customer.

• Maintenance to ensure the quality of the product after handing it over to the customer.

The responsibility of STE, afterward, is not merely to make sure your product works. It is to make sure that the business you are building around your product works the method you planned, by make sure that your product’s satisfies the target audience well.

While there are a number of STE processes and tools that one can use, there is no silver bullet for ensuring that all STE requirements are completely managed. However as with development, there is a very rich pool of practices, skills and training to draw on. The basic problem I faced while testing projects was dealing with the time management and this was due to missing requirement. Test plans are related to the requirements that lead to effective testing. Often, the requirements are missing, incomplete, incorrect, ambiguous, or uneven. Low level requirements are mostly derived from high level sources. Likely verification methods may be vague and the tracing between requirements and tests may be missing.

Facts Corner

• In 2012, a leap year bug cause a leading multinational corporation’s cloud computing service outage, this affected Governments and also consumers. The same leap year date bug also affected an Australian payment system resulting in 150,000 customers being prohibited from utilizing private health care cards for two days.

• In 2011, two commuter trains hit following a landslip north of Wellington, while luckily no one was hurt. The investigation originate that a computer glitch meant KiwiRail did not warn on heavy rain condition, this could have minimized the damage.

• In 2010, a bug in the software system at Gisborne Hospital affected in one patient’s data being showed as however it were another patient.

Read More
reality-huntHow to Use Reality Hunt

How to Use Reality Hunt

App Overview

Ever wanted to have an application that can teach your kids valuable information while having fun and playing games? Reality hunt is the app you have been looking for. Reality hunt is an augmented reality based application to teach kids about different animals, scientists, and fruits.

You pick a category from among animals, scientists, and fruits to begin playing. A particular scientist, animal, or plant is assigned each time to find out using the camera; once it’s found you get valuable information about the object and answer some basic question about that information to continue to the next element.

 

Image set download link: Download and print this target that contains all images needed for the application: Print the downloadable image

Image can also be downloaded from /wp-content/uploads/2015/04/all-in-one2.jpg

How to Use

This step-by-step guide will tell you in detail about the steps to follow to use this application. The first thing you do is the selection of a game among scientists, animals, or fruits to begin.

Each of the three games corresponds to a particular category, and once the game is selected then you will be given the names of the objects of that category to find out.

 

After you have selected the game (in the below scenario: animals), then you will be given a name of the animal to find out. You will have to move your camera and take it to the picture of that particular animal from the downloaded and printed image set given below to detect it.

 

Once you have found a particular target in the camera, a new screen appears with the name, picture, and other basic and interesting information about the particular target as shown in the below picture.

After you have read the information, tap on the screen to see a random question about the presented information. You can re-read the information if the answer is not known, although re-reading contributes to losing score. Once the question is answered then you will be provided with the next target to found out.

After all the targets are found, you will be shown your score with the number of detected objects and number of answered questions along with the time to find the targets and the time to read the info and answer the questions.

 

Score Details

  • 20 points are awarded on succesfully detecting a target.
  • 20 points are given if the question is answered in the first attempt.
  • Each wrong attempt or re-reading of the information contributes in deducting 1 mark from your score.

 

Image set download link: Download and print this target that contains all images needed for the application: Print the downloadable image

Image can also be downloaded from /wp-content/uploads/2015/04/all-in-one2-1.pdf

 

Demo

Read More
app-blog-imgKick that Photojack!

Kick that Photojack!

Ever had those beautiful pictures with your loved ones taken, only to have some photojack appear? Then Abracadabra Snap! is the app for you. Abracadabra Snap! is a simple to use photo editing iOS application to move or completely remove objects within the picture. The app provides an easy to use interface to remove unwanted objects from the image, move different objects around, and remove photobombs or unwanted appearances in the image.

 

App Overview

The first thing you do is selection of a picture for editing. You can select the photo from image gallery or take a snap on the fly. You can also load one of your previously edited photos from within the application.

Abracadabra Snap!

To change the orientation of the selected picture, you can rotate the photo in any direction you want. Once the photo and its rotation is finalized then Abracadabra Snap! assists in the process by the help of automatic object detection and it provides a photo with all the objects marked in red.

You can simply tap on any detected object that you intend to move and it will get selected.

Abracadabra Snap! photobomb remover

The customization tool in the application gives you complete freedom to manually select and adjust an object of choice if the automatic detection does not work perfect or if you want to create a manual selection with multiple objects at once.

Each selection point can be moved with a simple drag and drop to make an object of choice.

Abracadabra Snap! iOS

After manually creating the final selected object, you simply have to drag the object to move it. When you start to drag the object, a trash icon appears either on the left or the bottom of the screen.

If you choose this options and drop the selected object in the trash, it gets removed from the original position and is thrown out of the image and the background is modeled in the location to reduce the effect of any movement of object from that location. It gives the impression that the object never existed in that place.

Abracadabra Snap! app

If the user places it somewhere else in the image, the object is removed from its initial position and placed at the final position, which can help you do fun stuff with your application by moving different objects around and rearranging the whole setting of objects or people in the photo.

Abracadabra Snap! Android

The background modelling algorithms model the background in place of the moved object to reduce the effect of object movement.

Another feature of ‘copy object’ is provided in the application that can be used for two different purposes.

  1. If you think the background adjustment at the place of moved object is not perfect then you can further improve the background modelling at the place from where the object is moved. It can be improved by manually selecting a small background texture area and placing it everywhere where the background needs to be improved.
  2. If it is intended to make multiple copies of the objects in the image

The object is selected in the copy object option in the same way as in the move object option but a duplicate copy of the object is created at the dropped place instead of removing the object from the original place.

The below image depicts this functionality by creating multiple copies of the same object at two different locations:

abracadabra snap ios app

App Features

  • Pick an image from gallery or take a picture from camera
  • Rotate the object to adjust to the required orientation for further processing
  • The application automatically selects and marks all objects in the image
  • Manual objects can be selected and marked manually by the customization tool
  • Objects are moved or completely removed from the image by a simple drag and drop
  • The modified images are automatically saved in the workshops so that the user can keep modifying the images on next launch of application
  • Save the modified image in the photo gallery and share it on facebook and twitter
Read More
Introduction-to-Basics-of-RSpec-in-Ruby-On-RailsA Brief Introduction to Basics of RSpec in Ruby On Rails

A Brief Introduction to Basics of RSpec in Ruby On Rails

RSpec is a library that focuses on testing the behavior of your everyday projects for Ruby programming language. Developers are usually reluctant to use it because probably testing practice is the most difficult mindset a developer has to learn.

But once Rspec testing habit is developed and Test Driven Development is in , it becomes really useful in diagnosing problems in large scale applications once they are modified for some changes in future.

In the long term, a developer will not have to check each web page every time a new feature is added, but he will only check if the specific test passed and so handling of large applications becomes a convenient task.

Born under the banner of Behavior-Driven Development, Rspec is a productive and enjoyable automated testing experience with features like:

-a rich command line program (the rspec command)

-textual descriptions of examples and groups (rspec-core)

-flexible and customizable reporting

-extensible expectation language (rspec-expectations)

-built-in mocking/stubbing framework (rspec-mocks)

The post is a brief step by step process to setup RSpec with your project and use it. The tests for rspec will be written in capybara language, which is similar to natural language and is widely used for testing purposes. Capybara helps you test web applications by simulating how a real user would interact with your app.

It is agnostic about the driver running your tests and comes with Rack::Test and Selenium support built in. WebKit is supported through an external gem. (http://rubydoc.info/gems/capybara/2.2.1/frames)

1. Include gem ‘rspec-rails’, gem “capybara”, “~> 2.1.0”, gem “shoulda”, “~> 3.3.2”, gem ‘factory_girl_rails’

In your command line install the rspec gems:

2. gem install rspec

3. gem install rspec-rails

4. gem install capybara

Generate the rspec testing module files using this command

5. script/rails generate rspec:install

Run bundle installer

6. bundle install

Run required migrations

7. rake db:migrate RAILS_ENV=development

8. Include require ‘rspec/rails’, require ‘capybara/rspec’ in you spec_helper file

9. Add config.include Capybara::DSL in the same file to make Capybara available in all test cases deriving from ActionDispatch::IntegrationTest:

Generators

Once the environment is set. Its time to generate the testing files. There are different test types including, model , view, controller,and integeration tests. Other types of tests are request, mailer and helper tests.

They are written as per requirements to cover every aspect of the application. This article will cover commands and examples related to the most commonly used type of Rspec Tests.

-rails generate rspec:model model_name

-rails generate rspec:controller contoller_name

-rails generate rspec:view folder_name view_name

-rails generate integration_test feature_name

Execution Commands

To run specific tests from command line following commands should be used:

Models: bundle exec rspec spec/models/search_phrase_spec.rb

Controllers: bundle exec rspec spec/controllers/users_controller_spec.rb

Views: bundle exec rspec spec/views/search_phrases/index.html.erb_spec.rb

Integration: bundle exec rspec spec/features/search_phrases_spec.rb

The Naming convention for the Rspec Testing files:

Models: modelname_spec.rb

Controllers: controllername_controller_spec.rb

Views: viewname.html.extensionname_spec.rb

Integeration: featurename_spec.rb

Example of Tests

Stub method to simulate dummy user creation and devise sign_in authentication before tests

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
before :all do
@user = User.find_by_name('testuser')
@user ||= begin
user = User.new(email: "test@gmail.com",
password: "$2a$10$T",
uid: "10000697585", name: "testuser",
authority_token: "AUExuiUkFoBAEsYd")
user.save!
user
end
end
 
before :each do
User.stub(:current_user).and_return(@user)
sign_in @user
end

OR USE FactoryGirl to create the user for model test

1
2
3
4
5
6
7
8
9
10
11
FactoryGirl.define do
factory :user do |user|
 
user.email "testformodel@gmail.com"
user.password "$2a$10$T"
user.uid "10000697585"
user.name "testuserformodel"
user.authority_token "AUExuiUkFoBAEsYd"
end
 
end

You can use either of the above mentioned codes as per need.

Models

Here is an example code for the associated models:

class SearchPhrase

2. # bowling.rb

1
2
3
4
5
6
7
8
class Bowling
def hit(pins)
end
 
def score
0
end
end

Following are the related Rspec tests:

Test

First of all:

1. # search_phrase_spec.rb

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
require 'spec_helper'
class ValidatingWidget
2. # bowling_spec.rb
<pre class="brush: ruby">require 'bowling'
describe Bowling, "#score" do
it "returns 0 for all gutter game" do
bowling = Bowling.new
20.times { bowling.hit(0) }
bowling.score.should eq(0)
end
end
</pre><p>
These tests will pass when executed</p>
<h3>Controller</h3>
<p>In this example a controller method creates search phrases for a specific user using keywords and saves them in database<br>
#search_phrase_controller.rb</p>
<pre class="brush: ruby">def create
@search_phrase = current_user.search_phrases.new(params[:search_phrase].permit(:keyword))
if @search_phrase.save
redirect_to search_phrases_path, notice: 'Search Phrase was successfully created.' }
end
end
</pre><p>
Following are the related Rspec tests:</p>
<h3>Test</h3>
<p>#search_phrase_controller_spec.rb</p>
<pre class="brush: ruby">require 'spec_helper'
describe SearchPhrasesController do
include Devise::TestHelpers
describe "POST #create" do
it "should pass params to search phrases" do
post :create ,search_phrase: {keyword: 'testkeywordnew'}
assigns[:search_phrase].keyword.should == 'testkeywordnew'
end
it " should redirect to 'index' with a notice on successful save" do
post :create ,search_phrase: {keyword: 'testkeywordnew'}
response.should redirect_to(search_phrases_path)
end
end
</pre>
<h3>View</h3>
<p>This example is shows the index page of the search phrase example app for which the tests are written<br><br>
#index.html.erb</p>
<pre class="brush: ruby"><div> </div>
<h2> </h2>
<div> <button>Add Keyword</button></div>
<br><div>
 
 'new' %>
</div>
 
<div>
 
<table><thead><tr><td>Keywords</td>
<td>Options</td>
</tr></thead><tbody><tr id="table-row-<%=keyword.id%>"><td>
<div></div>
<div>
 'edit', :locals => {:search_phrase => keyword} %>
</div>
</td>
<td>
<button id="button-edit-<%=keyword.id%>" class="btn btn-info"><i class="icon-pencil icon-white"></i></button>
 
</td>
</tr></tbody></table></div>
</pre>
<h3>Test</h3>
<p>Following are the related Rspec tests:</p>
<p>#index.html.erb_spec.erb</p>
<pre class="brush: ruby">require 'spec_helper'
 
describe "search_phrases/index.html.erb" do
include Devise::TestHelpers
 
<put user="" sign="" in="" stub="" here="" if="" devise="" authentication="" required="">
 
#Mock model is creating a virtual model to write view tests
let(:search_phrase) do
mock_model('SearchPhrase',
:id => 1,
:keyword => 'testkeyword2',
:user_id => @user.id,
:created_at => Time.utc(2000))
end
 
before do
assign :search_phrases, []
end
 
#displays and renders the pages
it "renders the template 'index.html.erb_spec'" do
 
puts "*--Search Phrases #{@search_phrases.to_yaml}"
render
expect(view).to render_template( "search_phrases/index","search_phrases/_new")
end
 
#displays script
it "displays the script tag '<script>
<!--//--><![CDATA[// ><!--
<!--//--><![CDATA[// ><!--
'" do
render
expect(rendered).to match /<script>/
end
 
it "displays the user image in index" do
render
expect(rendered).to include(@user.image)
end
 
it "displays the user name in index" do
render
expect(rendered).to include(@user.name)
end
 
it "displays the button Text 'Add Keyword'" do
render
expect(rendered).to match /Add Keyword/
end
 
it "displays the button 'Add Keyword'" do
render
puts "*Rendered View #{rendered}"
rendered.should have_button('Add Keyword')
end
 
it "displays the heading'Keyword'" do
render
rendered.should have_content('Keyword')
end
 
it "displays the button 'Add Keyword'" do
render
rendered.should have_button('Add')
end
 
end
 
//--><!]]]]><![CDATA[>
//--><!]]>
</script></put></pre><h3>Integration</h3>
<p>Integration tests deal with the integration functions of a complete set of application function. For the scope of this post, we are taking example of a page, where user opens a web page, the application checks if user is signed in or not, if user is signed in, the user has authority to perform search function using a keyword phrase, and edit or update the search phrases.</p>
<h3>Test</h3>
<p>The tests show how these functions are tested:</p>
<pre class="brush: ruby">describe "SearchPhrases" do
 
#@user stub code for authentication or phrase creation>
 
#===========TESTS START=========================================================
# '/' refers to home of application
 
def logged_in?
page.has_selector? "username", text: "Sign Out"
end
 
describe "Go to Application Start" do
 
it "should not have user logged in before" do
visit '/'
logged_in?.should == false
end
 
it "should have the content 'Welcome to Demo Application'" do
visit '/'
expect(page).to have_content('Welcome to Demo Application')
end
end
 
describe "check images and icons" do
 
it "should have the Demo logo" do
visit '/'
puts "*Demo Logo xpath-> #{:xpath.to_s}"
page.should have_css("img[src*='arkhitech']")
end
end
 
describe "After User Logs In", js: true do
 
before :each do
 
unless logged_in?
visit '/'
OmniAuth.config.mock_auth[:provider] = {
provider: 'provider',
uid: @user.uid,
credentials: {
token: @user.provider_token
}
}
click_link "Sign in"
end
end
 
it "should be logged in" do
logged_in?.should == true
end
 
it "should show the name of user" do
page.should have_content "#{@user.name}"
end
 
it "should show the display picture of user" do
page.should have_css("img[src*='#{@user.image}']")
end
 
#------------------------------- Now Add Key Word Button Pressed----------------
 
it "click button 'Add Keyword' and display Keyword heading" do
find('#toggleKeywordAdd').click
expect(page).to have_content('Keyword')
 
end
 
it "click button 'Add Keyword' and display edit and remove buttons" do
find('#toggleKeywordAdd').click
fill_in('search_phrase[keyword]', :with => 'KEYWORD_3')
click_button("Add")
expect(page).to have_content('KEYWORD_3')
page.should have_css("button[class*='btn btn-info']")
page.should have_css("a[class*='btn btn-danger remove_fields']")
end
 
it "click button 'Add Keyword', adds keyword and click update button to update" do
find(:css,"button[id*='button-edit-#{@search_phrase.id}']" ).click
page.should have_css("input[class*='btn btn-medium btn-primary']")
page.should have_css("input[id*='search_phrase_keyword']")
fill_in('search_phrase[keyword]', :with => 'KEYWORD_EDIT')
click_button("Update")
expect(page).to have_content('KEYWORD_EDIT')
end
 
it "log out user on Sign Out" do
click_link("Sign Out")
current_path.should eq root_path
logged_in?.should == false
end
end
end
</pre><p>
These are some comprehensive examples which I practiced as a beginner. Again practicing brings perfection, so keep practicing with RSpec and get in control of your huge big applications. For your ease, here is quick summary of capybara language commands to write your tests. [courtesy: github/zhengjia]</p>
<p><em>=Navigating=</em><br><em> visit('/projects')</em><br><em> visit(post_comments_path(post))</em></p>
<p><em>=Clicking links and buttons=</em><br><em> click_link('id-of-link')</em><br><em> click_link('Link Text')</em><br><em> click_button('Save')</em><br><em> click('Link Text') # Click either a link or a button</em><br><em> click('Button Value')</em></p>
<p><em>=Interacting with forms=</em><br><em> fill_in('First Name', :with => 'John')</em><br><em> fill_in('Password', :with => 'Seekrit')</em><br><em> fill_in('Description', :with => 'Really Long Text…')</em><br><em> choose('A Radio Button')</em><br><em> check('A Checkbox')</em><br><em> uncheck('A Checkbox')</em><br><em> attach_file('Image', '/path/to/image.jpg')</em><br><em> select('Option', :from => 'Select Box')</em></p>
<p><em>=scoping=</em><br><em> within("//li[@id='employee']") do</em><br><em> fill_in 'Name', :with => 'Jimmy'</em><br><em> end</em><br><em> within(:css, "li#employee") do</em><br><em> fill_in 'Name', :with => 'Jimmy'</em><br><em> end</em><br><em> within_fieldset('Employee') do</em><br><em> fill_in 'Name', :with => 'Jimmy'</em><br><em> end</em><br><em> within_table('Employee') do</em><br><em> fill_in 'Name', :with => 'Jimmy'</em><br><em> end</em></p>
<p><em>=Querying=</em><br><em> page.has_xpath?('//table/tr')</em><br><em> page.has_css?('table tr.foo')</em><br><em> page.has_content?('foo')</em><br><em> page.should have_xpath('//table/tr')</em><br><em> page.should have_css('table tr.foo')</em><br><em> page.should have_content('foo')</em><br><em> page.should have_no_content('foo')</em><br><em> find_field('First Name').value</em><br><em> find_link('Hello').visible?</em><br><em> find_button('Send').click</em><br><em> find('//table/tr').click</em><br><em> locate("//*[@id='overlay'").find("//h1").click</em><br><em> all('a').each { |a| a[:href] }</em></p>
<p><em>=Scripting=</em><br><em> result = page.evaluate_script('4 + 4');</em></p>
<p><em>=Debugging=</em><br><em> save_and_open_page</em></p>
<p><em>=Asynchronous JavaScript=</em><br><em> click_link('foo')</em><br><em> click_link('bar')</em><br><em> page.should have_content('baz')</em><br><em> page.should_not have_xpath('//a')</em><br><em> page.should have_no_xpath('//a')</em></p>
<p><em>=XPath and CSS=</em><br><em> within(:css, 'ul li') { ... }</em><br><em> find(:css, 'ul li').text</em><br><em> locate(:css, 'input#name').value</em><br><em> Capybara.default_selector = :css</em><br><em> within('ul li') { ... }</em><br><em> find('ul li').text</em><br><em> locate('input#name').value</em></p>
<h3></h3>
<h3>Further Reading</h3>
<p>Furthur information and best practices can be reviewd on RDocs:</p>
Read More
check-facebook-fan-page-like-in-phpHow to Check if a User is Following Your Facebook Page in PHP

How to Check if a User is Following Your Facebook Page in PHP

Social media optimization is really essential these days and awarding your site users some points or badges for liking your Facebook fan page is a nice trick to swiftly increase your Facebook fan base. In order to award a user some social bonus, we first need to check whether that user has actually liked the Facebook fan page or not. In order to check this we need the user to login into its Facebook account and allocate all the necessary permissions that our Facebook app will ask (OAuth 2.0).

In case you are NOT OK with user giving the permissions you can skip this tutorial as this tutorial specifically requires OAuth permissions from the users. And, if you are OK with OAuth permissions and your site happens to be a PHP based website, follow this step by step tutorial to easily detect whether a user has liked your fan page or not:

 

Step: 1

Create a new Facebook app here. Enter the URL of your site in Settings->Platform->Website->Site URL and note down the ‘App ID’ and ‘App Secret’ as we will be using these in step 5!

 

Step: 2

Download Facebook PHP SDK from here. Extract the files and place it in the same folder with the file in which you will paste the code given in the step 5 below!

 

Step: 3

Get your Facebook Fan Page ID using this tool.

 

Step: 4 (Optional)

Generate Facebook like box code for your page from here. You can display this like box if a user hasn’t already liked the page.

Step: 5

After 1, 2, 3 and 4 steps are complete, you can check if user has liked a page or not with the following code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!--?php require('facebook.php');
    $config = array(
         'appId' =?--> 'your facebook app id',
         'secret' => 'your facebook app secret code',
        'allowSignedRequest' => false
    );
    $facebook = new Facebook($config);
    $user_id = $facebook->getUser();
    if (isset($user_id)) {
        try {          
            $likes = $facebook->api('/me/likes/your_facebook_page_id_here', 'GET');            
            if (!empty($likes['data'])) // if user has liked the page then $likes['data'] wont be empty otherwise it will be empty
            {
                echo 'Thank you for liking our fan page!';         
                // you can write some custom code here to award users some points or some badge        
            }
           else {
                echo 'You have not liked our fan page! Like it now:';
                ?>                  
                <iframe src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Farkhitech&width&height=290&colorscheme=light&show_faces=true&header=true&stream=false&show_border=true&appId=1392604484339363" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:290px;" allowtransparency="true"></iframe> //replace this with your own Facebook like box code
                <!--?php }
        } catch (FacebookApiException $e) {
            $login_url = $facebook-?-->getLoginUrl();
            echo '<a href="' . $login_url . '">Please click here to login into your Facebook account.</a>';
            error_log($e->getType());
            error_log($e->getMessage());
        }
    } else {
        $login_url = $facebook->getLoginUrl();
        echo '<a href="' . $login_url . '">Please lick here to login into your Facebook account</a>';
    }
    ?>

 

Output

The user will click on the “Please click here to login into your Facebook account.” text which will redirect it to our Facebook app’s (created in step 1) permissions page, once the user grants the permissions to the app, the code will fetch user’s data and will display the likebox if user hasn’t liked the fan page.

If the user has already liked the page then it will display the thank you message (and will run some custom code included in this section to award some points/badge to the user).

 

Prevent Cheating

In order to award points only once (so that users cant get points again and again by liking and unliking the page), you can attach a Boolean field (with a default value of 0) with all user accounts which you can turn to 1 once the bonus points have been awarded. An additional conditional check at line 14 in the code given above like “if (!empty($likes[‘data’] && $userfield != 1 ))” will do the trick.

You can also print a message like “You already got the bonus for liking the page!” for users that have already got the bonus points by adding another if statement like this “if (!empty($likes[‘data’] && $custom_user_field == 1 ))”.

 

Feel free to discuss any issues that you may face in the comments section below!

Read More
why-you-should-learn-to-code-infographicWhy You Should Learn to Code [Infographic]

Why You Should Learn to Code [Infographic]

You may have heard about coding over the years, but what is it exactly and why is it all the rage in recent years? Well, simply put, coding is a phase within the process of computer programming. It allows us to tell a computer what to do. When I say computer, I do not just mean the laptop you have lying around, I mean every bit of sophisticated technology you use, from tablets to PCs, smartphones to PDAs. With our modern world being dominated by so many electronic devices, the least we can do is learn how to code in order to effectively make something for these devices. Here are four solid reasons why you should learn to code this year:

 

You Will be in Great Demand!

Since 90% of our world’s multi-million business transactions and telecommunications take place via sophisticated devices, people who can code are needed for a wide variety of reasons, ranging from security, to developing programs, to creating servers or even small but significant stuff like designing web layouts.

As per reports, the number of software development jobs is set to grow twice as fast as any other type of job within this decade. If you need any proof for that indication, fortune 500 companies such as Twitter, Facebook, Microsoft and Google are scrounging around and looking for the best coders on the planet to safely secure them for the upcoming years. Talk about high demand!

 

You Will Learn it Faster Than Anything Ever Before!

Learning how to code a particular language is actually faster and less time consuming (and also conveniently less of a headache) than trying to learn any spoken language. It doesn’t matter whether you choose JavaScript, HTML, C++, Python, Ruby, PHP or any of the other hundreds. Each and every one is guaranteed to be learnt quicker than an actual spoken language.

An example of this is the SF developer Bootcamp, which teaches one of the hardest coding languages around, Ruby in less than 10 months! Sure, for that kind of crash course, they are asking a whopping $12,000 + for it, but what most people don’t see is that 17 out of 21 people who complete the camp receive jobs with salaries that pay over $79,000!

For comparison, average Master’s Degree requiring jobs pay about $70,000 even after all of the years put into attaining that degree.

 

It’s More Than Women Friendly!

As per 2012 stats, there is about 1 female coder out of every 10 coders. While this may seem off putting to many women, it was not always like this! In fact, in the 1980s, 1 out of every 3 coder was a woman. What does this mean? Simply put, coding is women friendly. It is not labor intensive and women can more than ace it.

In fact, let it be known that most of the computer programming pioneers were none other than female coders. In 1842, Ada Lovelace designed the very first algorithm that was to be processed by a machine, effectively making her the world’s first computer programmer.

In 1946, a team of 6 women programmed the world’s first electronic computer. Even in 1952, Grace Hopper’s language compiler had earned her the nickname of the Mother of COBOL. How is that for a little girl power?

 

Just About Anyone Can Learn it!

From young kids to middle aged adults, just about everyone can learn how to code. Every year, more and more schools are integrating computer studies into their curriculum for children as young as 12. Aside from that, people can even learn it for free right at their home using online tutorials.

There will be a day when coding becomes a basic principle of education just like grammar and arithmetic. If billionaires like Michael Bloomberg are ready to start learning to get ahead of the curve, then what’s stopping you? Get out there and learn how to code today!

 

Here is a brief and beautiful infographic that sums up things for a better visual perspective:

why you should learn to code infographic

Infographic Courtesy: OnlineCollege.org

Read More
characteristics-of-a-good-software-engineer15 Characteristics of a Good Software Engineer

15 Characteristics of a Good Software Engineer

Everything nowadays is managed by computers and because of this one of the most emerging professions in the world is software engineering. Every aspect of life now relies on some kind of software. Even machines which were totally mechanical are now mostly software controlled. The software industry is one of the very few fields that didn’t slow down even during the recent global economic recession and software related jobs remained gettable throughout the period. From freelancing projects to software houses and multinational giants, there is always a demand for a capable software engineers. Let us see what traits put you ahead of so many others in this field and what are the real characteristics of a good software engineer after all:

Read More
WordPress-Vs-Joomla-Vs-DrupalWordPress Vs Joomla Vs Drupal

WordPress Vs Joomla Vs Drupal

WordPress, Joomla and Drupal are the 3 big names anyone will hear if they wish to create a website with a content management system. They are the three most popular content management systems (CMS) online and all of them are heavily used and packed with different features, capabilities and scale-ability. Although all the three CMS are open source and built on PHP + MySQL, but each one has a different learning curve and is suitable for different requirements.

So, how can a web developer know which of the three is best for a given site? Here’s a brief WordPress Vs Joomla Vs Drupal guide to help you find out the CMS that suits your requirements best:

 

Drupal

Drupal is the oldest and the most powerful CMS amongst the three, having been released back in 2001. Like WordPress and Joomla, Drupal too is open-source and based on PHP-MySQL, however, it differs in the fact that this CMS is for techies as it comes bundled with a lot of power.

All this raw power is quite difficult to master, resulting in lesser adoption rates. Drupal is used by at least 2.1% of the internet and because of its power and developer-friendliness, it is a popular choice for unique, content-intensive, feature rich websites like Whitehouse.gov, London.gov.uk, WWE.com etc.

 

  • Advantages of Drupal

Drupal is favoured by many due to its wonderful flexibility and strong content organization. Not only is it perfectly suited to host simple web sites with static pages, it is also great at handling a back-end that can support hundreds of thousands of pages and millions of users every month.

Unlike Joomla, Drupal was built from the ground up to be SEO friendly. Its installation, although very dry bone and difficult for layman users, provides a lot of depth for developers.

Drupal is extremely stable, no matter how many users it is serving. It is also a better option for those who want an enterprise friendly CMS due to its wide support for Access Control List (granting specific permissions to specific users).

Drupal modules such as Panels, offers revamping of the interface of a web page via simple drag and drop (CSS is generated automatically) – a unique feature that WordPress and Joomla developers can only dream about.

 

  • Disadvantages of Drupal

One of the main concerns with using Drupal is its difficulty for the layman. Unless you are the type that has strong coding capabilities and like to read tons of technical items, you’ll find Drupal extremely difficult to use.

To make matters worse, not only are Drupal’s core modules dry and boring, its lack of themes will force you to hire a web developer if you want any decent layout for your website.

Overall, Drupal is extremely powerful and can do things that CMS were never even envisioned to do, but on the other hand it has a daunting learning curve which only allows tech savvy developers to utilize its true power. For newbies, using Drupal as a CMS can be a nightmare.

 

  • Who Should Use Drupal?

Drupal should be used by those seeking to have a full-fledged, enterprise grade CMS or for those who need to organize huge volumes of data, military grade security and super stability.

It is best used by large websites with huge data belonging to various categories, Drupal is an overkill for small websites and for those who seek newbie-friendliness.

 

  • Drupal Statistics

Drupal — at the time of this write up — has 7 core versions (8th one is under active development and packs some amazing features that will make it a bit less complex yet more powerful), 14,212 different modules (Drupal name for plugins), 1,218 themes, 46,811 followers on Twitter, 58,775 fans on Facebook, and powers 39 of Alexa’s top 10,000 websites.

 

Joomla

Joomla is an open-source content management system from Mambo. It is a popular CMS solution and boasts over 35 million downloads till date and powers at least 2.8% of the internet. It is arguably the strongest of the 3 contenders when it comes to meeting the definition of CMS and powers noteworthy sites like Linux.com, Cloud.com, iHop.com, etc.

 

  • Advantages of Joomla

Joomla may be a bit tricky to learn at first, but website creators will be pleased to know that Joomla is very user friendly over all. The UI is polished, flexible, and quite powerful. Joomla also has a strong developer community that provides tons of open source, free to use plugins called “extensions”.

These extensions are divided into 5 categories; components, plugins, templates, modules and languages. Each of these have different functions, powers and capabilities, such as Components that act as ‘mini-apps’ and change the Joomla installation altogether and Modules that add minor capabilities like dynamic content, RSS feeds, and search function to a user’s web page.

Last, but certainly not least, Joomla was designed to be an enterprise-grade CMS from the ground up, which results in Joomla having impressive content management capabilities.

 

  • Disadvantages of Joomla

One of the main problems Joomla has is that it needs some learning before use. The learning curve is not that steep when compared to Drupal, but it is still steep enough to scare off novice developers. Another major issue is that it lacks proper SEO capabilities and has limited ACL support (comparatively).

Unlike its competitors, SEO on Joomla will require a lot of effort on the developer’s part if they want the same level of Search Engine Optimization that other CMS already offer easily.

 

  • Who Should Use Joomla?

Joomla should be used by developers who want to build a site with more structural stability and content as well as fairly intuitive interfaces. If you want a basic website with standard capabilities (blogs, static/dynamic front-end, forums, etc.) then use Joomla. Joomla is also a good option for small to mid-tier e-commerce stores.

 

  • Joomla Statistics

Joomla — at the time of this write up — has 3 core versions, 7,412 different extensions, 47,382 followers on Twitter, 126,784 fans on Facebook, CMS market share of 9.2% and is mostly used for e-commerce sites and moderately complex websites.

 

WordPress

WordPress is the most widely used CMS in the world. With more than 60 million websites, WordPress powers approximately a whopping 18.9% of the entire internet, leaving both its competitors in the dust.

WordPress is flexible and powerful enough to power fortune 500 company blogs and can also simultaneously handle sporadically updated personal journals. Some famous websites that use WordPress include Online.wsj.com, CNN.com, Forbes.com, Mashable.com and Reuters.com.

 

  • Advantages of WordPress

One of the strongest features that WordPress has is its ability to accommodate multiple authors. Secondly, the sheer number of plugins available for WordPress will be able to impress any open source community. There is very little that WordPress can’t do with its vast range of available plugins (of which mostly are free).

WordPress is also extremely user friendly. Just about anybody can select a theme, add a few plugins and start working right away. WordPress themeing is really easy and even with the most basic understanding of HTML and CSS, you can customize any WordPress theme to fit all your needs. This makes WordPress extremely popular among newbies. WordPress also has strong SEO capabilities; with plugins such as “All in One SEO”, “WordPress SEO by Yoast”, publishers can start publishing content straight away without worrying about on-page SEO.

Finally, WordPress is flexible. Really really flexible. You can practically do anything with it. Thanks to super easy theme hacks and a bunch of right plugins, you can make your site an e-commerce store, a video sharing site, a portfolio website or a company blog within minutes.

On top of that WordPress community is super strong and is tightly integrated with the blogosphere. You wanna know about the best WordPress plugins and themes of 2013 or last month? Just Google it and you will be bombarded with quality up-to-date posts. This isn’t possible for either Drupal or Joomla due to their relatively smaller adoption rate.

 

  • Disadvantages of WordPress

WordPress isn’t exactly perfect and lacks security. Being the most popular of the 3, WordPress is more often than not the number one target of hackers. It is not very secure on its own and requires third-party plugins to boost its installation security.

Further, no matter how many free themes WordPress may have, most of them offer similar designs with limited design options. Also, WordPress isn’t as strong as its competitors, since it was originally built to be just a blogging tool.

 

  • Who Should Use WordPress?

WordPress isn’t nearly as powerful or capable as Drupal or Joomla, but is easy enough for any newcomer. WordPress should be used by people who would prefer a simple, easy to use blogging or cms solution that looks good and can accommodate multiple users easily.

 

  • WordPress Statistics

WordPress — at the time of this write up — has 3 core versions, 28,169 different plugins, 2,140 themes, 302,589 followers on Twitter, 268,038 fans on Facebook, CMS market share of 59.6% and is mostly used for making quality blogs and small company websites with limited pages.

 

Final Verdict

wordpress joomla drupal types of sites

As we can see, each CMS has its own specific strengths and weaknesses. Some may prefer, technical configurations over raw power, or user friendliness over features. It all boils down to the requirements, however there is no arguing about which one is better in which category.

If you are unsure about the requirements or unaware of what requirements can come across your way in the future, have various types of content, want powerful, scalable and secure content management options, and can afford to lose user-friendliness, then go for Drupal.

If you want strongest content management capabilities, and can afford to lose some user-friendliness, Joomla is your pick.

However, if you just want to get your word out to the public or create a 7-8 pages company website, then by all means use WordPress. There is no denying that WordPress is the best choice for when you want to do is some serious publishing.

Read More