Monday, October 28, 2013

How to migrate from Twitter API version 1 to version 1.1

If you have a twitter API widget on your website using Twitter API version 1 that is no longer working, its probably because Twitter recently launched API version 1.1. The response body that you will get for API version 1 will look like "{"errors": [{"message": "The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.", "code": 68}]}"

Now, How to migrate from Twitter API version 1 to version 1.1

The upgrade process is different for everyone. It's best to look at how you're using the API today and compare that to the documentation for API v1.1. Some API methods have changed paths. Some no longer exist. There are also newer ones. All requests require a form authentication, for which you can either useObtaining access tokens or Application-only authentication. There are docs for these topics throughout this site, but admittedly they speak mostly to programmers.
App-only auth is the easiest way to use auth with the API. It barely requires programming anything to get up and running with it.
For some developers, it really is as easy as changing paths they're using from /1/ to /1.1/. For other developers, you're going to be learning about authentication for the first time. You may find that things you were able to do in the past aren't possible anymore -- or at least aren't possible in the context that you're trying to do them.
If you're just trying to get tweets on a website, Embedded Timelines are really the best bet. If you want to do something more custom or complex, explore Twitter Libraries for a library in your preferred language.
Finally, if you already have an API-based integration with OAuth and are moving to API v1.1, keep in mind that API v1.1 is much stricter from the perspective of HTTP 1.1 and OAuth 1.0A spec compliance. They require all reserved characters to be encoded correctly. Most non-alphanumeric characters are reserved. Many libraries, including some core libraries, perform some of this encoding incorrectly. 

Thursday, October 24, 2013

Key differences between MyISAM and InnoDB databases in MySQL

The main differences between InnoDB and MyISAM ("with respect to designing a table or database" you asked about) are support for "referential integrity" and "transactions".
If you need the database to enforce foreign key constraints, or you need the database to support transactions (i.e. changes made by two or more DML operations handled as single unit of work, with all of the changes either applied, or all the changes reverted) then you would choose the InnoDB engine, since these features are absent from the MyISAM engine.
Those are the two biggest differences. Another big difference is concurrency. With MyISAM, a DML statement will obtain an exclusive lock on the table, and while that lock is held, no other session can perform a SELECT or a DML operation on the table.
Those two specific engines you asked about (InnoDB and MyISAM) have different design goals. MySQL also has other storage engines, with their own design goals.
So, in choosing between InnoDB and MyISAM, the first step is in determining if you need the features provided by InnoDB. If not, then MyISAM is up for consideration.
A more detailed discussion of differences is rather impractical (in this forum) absent a more detailed discussion of the problem space... how the application will use the database, how many tables, size of the tables, the transaction load, volumes of select, insert, updates, concurrency requirements, replication features, etc.
MYISAM:
  1. MYISAM supports Table-level Locking
  2. MyISAM designed for need of speed
  3. MyISAM does not support foreign keys hence we call MySQL with MYISAM is DBMS
  4. MyISAM stores its tables, data and indexes in diskspace using separate three different files. (tablename.FRM, tablename.MYD, tablename.MYI)
  5. MYISAM does not support transaction. You cannot commit and rollback with MYISAM. Once you issue a command it’s done.
  6. MYISAM supports fulltext search
  7. You can use MyISAM, if the table is more static with lots of select and less update and delete.
INNODB:
  1. InnoDB supports Row-level Locking
  2. InnoDB designed for maximum performance when processing high volume of data
  3. InnoDB support foreign keys hence we call MySQL with InnoDB is RDBMS
  4. InnoDB stores its tables and indexes in a tablespace
  5. InnoDB supports transaction. You can commit and rollback with InnoDB
In modern versions of MySQL, that is 5.1 and 5.5, you should use InnoDB. In MySQL 5.1, you should enable the InnoDB plugin. In MySQL 5.5, the InnoDB plugin is enabled by default so just use it.
The advice years ago was that MyISAM was faster in many scenarios. But that is no longer true if you use a current version of MySQL.
There may be some exotic corner cases where MyISAM performs marginally better for certain workloads (e.g. table-scans, or high-volume INSERT-only work), but the default choice should be InnoDB unless you can prove you have a case that MyISAM does better.
Advantages of InnoDB besides the support for transactions and foreign keys that is usually mentioned include:
  • InnoDB is more resistant to table corruption than MyISAM.
  • Row-level locking. In MyISAM, readers block writers and vice-versa.
  • Support for large buffer pool for both data and indexes. MyISAM key buffer is only for indexes.
  • MyISAM is stagnant; all future development will be in InnoDB.
Virtually the only reason to use MyISAM in current versions is for FULLTEXT indexes. And that's due to be supported in InnoDB in MySQL 5.6 (update: indeed InnoDB supports FULLTEXT in 5.6, but it's pretty buggy still, as of 5.6.13).

Monday, October 14, 2013

Code to Quit or Exit Android Application

Question
I have an application where on the home page I have buttons for navigation through the application.
On that page I have a button "EXIT" which when clicked should take the user to the home screen on the phone where the application icon is.
How can I do that?
Solution
Android's design does not favor exiting an application by choice, but rather manages it by the OS. You can bring up the Home application by its corresponding Intent:
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
I added the following code to my quitGame function in my MainActivity.java file and it worked
 /** Called when the user clicks the Quit Game button */ 
 public void quitGame(View view) 
{
        // Do something in response to button
 Intent intent = new Intent(Intent.ACTION_MAIN);
 intent.addCategory(Intent.CATEGORY_HOME); 
 intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 
 startActivity(intent); 
 } //end function quitGame

How To Set Background Image in Android Application


How To Set Background Image in Android Application


It's quite simple to set background image for your android application. Below I have an example code for this as well. Now, just follow the steps..

1. Create a new android application in Eclipse. (click here if you need some help)


2. Copy your image file to /res/drawable directory. You will need to access the worksplace file directory directly. This should be in your C Drive eg. C:\users\<username>\workspace\<appname>\res\drawable-mdpi
This directory should already have your app icon image file in it.
  
3. Open your  layout xml file activity_main.xml
    and add below line;  


android:background="@drawable/bg"
 Here 'bg' is the name of the image without extension

So final layout file will look like;

Value Stream Mapping Current State Mapping for a call center

The first step in Value Stream Mapping is the Current State Mapping. In this step, the current process is documented as a diagram. The flow of the entity through the process is recorded. The volume of entities processed at each step of the process is also documented. Here is a sample current state diagram for a BPO call center that I created from a project that I worked on where "ticket" is the entity that passes through the process. The ticket volumes are recorder at each step. If you do not have the exact volumes, use a best guess estimate. The processing time and lead times are measured and calculated for each step. Click on the current state map image below to see full size image. This diagram was created using Microsoft Visio. Please leave any questions in the comments section below.


Thursday, October 10, 2013

Free PMP exam simulator questions

Rita Mulcahy book recommends that anyone appearing for the PMP or CAPM certification test, take atleast two full PMP simulation exams to get a feel of the exam environment. The book recommends that unless you get atleast 70% in the two simulation tests, you are not ready to take the actual exam. So here's a site I found that offers a three day free simulation of PMP exam questions http://free.pm-exam-simulator.com They also offer 110 free questions at http://www.free-pm-exam-questions.com.
The following PMP® exam sample question is taken from the Free PMP Exam Simulator 
------------------------------
To calculate the total project cost, you use a technique that uses input values selected at random from probability distribution of possible cost. Which of the following options best describes this method?
A) Automated Schedule Development  
B) Monte Carlo Analysis  
C) Schedule Risk Analysis  
D) e-Pert
------------------------------
Hint: This is a simulation technique.
------------------------------

Answer and Explanation:
The Correct Answer is B. Monte Carlo analysis is a simulation technique. It uses computer models and estimates of risk usually expressed as a probability distribution of possible costs or durations at a detailed work level.

Wednesday, October 2, 2013

Free PMP exam prep questions

Free PMP exam prep questions
Preparing for the PMP exam, you should answer "tons of sample questions" in order to:
  • gain routine with answering difficult questions
  • review your current level of knowledge*
  • find gaps that need to be filled
  • compare your level of preparation with PMP exam requirements
*: Score 75% or more in difficult questions and you are probably well prepared.
See: www.oliverlehmann.com/pmp-self-test/75-free-questions.htm#providers_
  1. 75 free sample questions as an online test with timer.
     
  2. Links to over 3,000 free sample questions (PMI members: 4,000)
     
  3. For download:
  4. Further downloads:
  5. Free offerings for CAPM candidates:
    1. Find a collection of free sample questions developed by my colleague Herbert G. Gonder, PMP, and mehere.
    2. At https://sites.google.com/site/capmvirtualstudygroup, you will also find a virtual study group with further sample questions. You can develop and contribute own questions which can then be answered by other candidates, too.