A Review of New Words With Friends

There’s this really awesome educational game I came across recently while surfing popular games on Google Play. It’s called New Words With Friends. Having given the Android version of this game a thorough test, I’ll share my review. Published by the famous game studio, Zynga, New Words With Friends is an excellent and engaging educational game to play with both friends and new folks. Essentially, it’s like playing Scrabble on a phone and it works cross-platform as an Android app, iOS app and even a Facebook app. Without further ado I’ll discuss the high points.

First, the game has really cool graphics. The game has a cool trendy look easy on the eyes and sure to please. It’s got a Facebook-like theme and a good combination of warm and cool colours. There really isn’t much to fault in terms of its looks. The game icon even has a winter feel to it.

Second, New Words With Friends is very social. It’s possible to invite Facebook friends to play. You can even nudge those unresponsive friends to get them in faster. You get ranked alongside friends you’ve played with by total and average scores, ramping up that competitive spirit as you strive towards first place! New Words With Friends also has a Community Match feature that allows you to find avid players nearby just waiting to play with you or to choose who you will like to play with. There’s even a Smart Match feature that immediately finds a game for you to play. The game also has a handy chat tool to help you converse with your buddies or new found friends as you play.

Next is Statistics. Being a lover of all things mathematical and scientific I naturally enjoy a healthy dose of Statistics. New Words With Friends keeps track of your game statistics daily showing valuable metrics of how your verbal aptitude appreciates over time. Some statistics tracked include highest scoring words, longest words used, highest score in any game, average game score, score of words over time, etc.

Fourth is the Educational value. While playing this game, you have access to an in-built dictionary apparently based on the famous Dictionary.com. There is also a Word of the Day feature showing you new words each day to beef up your vocabulary.

Alright alright. So it’s obvious I really like this game. That doesn’t mean there aren’t any criticisms. First of all is the adverts. You have to watch an ad for at least a few seconds after every game move. I understand the makers of the game have to make some dough so it’s not so bad though. There’s an option in settings to buy the game.

Second, the dictionary is quite laggy. When searching for words in quick succession the dictionary doesn’t always keep up. For example you may open the dictionary feature and search for a word only to discover after a moment the meaning of a previous word show up. I feel the dictionary should be made a little more responsive. The app could cancel pending searches for example when a user submits a new query.

Third, there are some words you can play but can’t find meanings for using the dictionary. I suppose this is because that dictionary does not have the words. Perhaps Zynga could integrate other dictionaries to find meanings of words outside the default one.

By and large, New Words With Friends is a fantastic game with great social tools and educational value. I highly recommend this game to anyone with a decent smart phone looking for a game to pass time.

A Visit to Red Dog Saloon

Just earlier this evening I had the privilege of visiting an excellent  restaurant in the heart of Hoxton Square called Red Dog Saloon. I remember having a welcoming feeling as my colleagues and I approached the building with its bright lights. The interior was very cosy. Having made a reservation before arriving, we were met by a dashing young lady just by the entrance who took our details and aptly directed us to our table.

The place was packed. It was a average sized restaurant and just about every table was occupied. Voices of light chat could be heard from all directions as people talked very freely over a variety of dishes and drinks.

At the table, menus were already lying in wait alongside cutlery. So, naturally, we perused the menus as we settled down. Having looked at several menus in several restaurants in my time, I must say I was impressed with the wide variety Red Dog offered. They even had some very curiously named dishes like ‘The Punisher,’ ‘Double Trouble’ and ‘The Devastator’.  How cool is that? ‘Waiter, can I please have some Double Trouble?’

We were promptly attended by a waiter who took our orders for drinks, gave us ample time to peruse the menu and eventually took our orders for food. He was patient and polite in explaining what some of the dishes were when asked.

Our milkshakes were served in rather interesting metallic cups which looked like they had been specially kept in some freezer along with the shakes themselves. After considerable waiting, our orders eventually arrived, consisting of several plates of briskets and ribs among other things. Boy, Red Dog sure serves some delicious ribs! Needless to say, I haven’t tasted meat so good in ages. I got a helping of some mashed potatoes, again which tasted decent. These were very reminiscent of having a proper meal way back in Texas.

The only small criticism I and a colleague of mine had was that our orders weren’t delivered completely. However, the waiter rectified this and brought the remaining items after some time.

While enjoying ourselves, we took an ample number of pictures of the group as is the tradition when we go on outings. You know, something for the album.

After a very hearty meal, drinks and cool conversation we were ready to go. A waiter promptly took away our used dishes and happily offered to package some of our leftovers in case we wanted to take it away. Now, how cool is that? I, having a delicious brisket in front of me but very sated from the ribs eaten earlier, accepted the offer without hesitation.

By and large, Red Dog is an awesome restaurant to visit alone or with friends and family. The atmosphere is relaxing and the food is delicious. I can definitely see myself going there again in the near future.

 

 

True Friends

True friendship is something we all aspire to have in our lives. You can’t place a price on friendship as the intervention of a friend can very well be the difference between success and failure or even between life and death. Of course the individual is very important. Nevertheless, there is only so much you can do in life without support from your friends, be it family, spouse, children or other friends you pick up on the course of daily life. So, being someone who has travelled a bit and had the good fortune of having some true friends, I will share my thoughts on what I consider true friendship. Here are ten questions I recommend asking yourself when wondering if a person is your true friend. This is by no means exhaustive and is subjective, but may serve as a decent guide.

1. How often does the person ask after you? If he or she checks up on you sufficiently frequently and consistently whether in person or via various social media, there is a good chance he or she is a friend. Otherwise, think twice. Of course, this is assuming you also make an effort to check up on the person.

2. How often does he or she keep his or her promises to you? Does he or she make conscientious effort to keep promises or does he or she frequently keep you hanging. A person who keeps promises likely values you as a person and is more likely to be your friend than someone who doesn’t.

3. How much time is he or she willing to take out to be with you? Try calling this person to hang out for drinks for example. Is he or she someone who usually enthusiastic about being around you for example, or does he or she seem adept at cooking up the most curious excuses for not attending. True friends take out time from their busy schedules to hang out with each other.

4. How willing is he or she to help you when you are in need? An old saying goes: A friend in need is a friend indeed. There are many friends who rejoice with you when things are rosy. They will praise you like no other when they have something to gain from you. No sooner do you get into trouble than they disappear rather inexplicably into thin air. So, is he or she someone you can call at twelve midnight should you have problems and expect to get moving? If so, you need no more proof that you have a true friend in him or her. Otherwise, think twice.

5. Does he or she caution you when you mess up? A true friend is not afraid to caution you or even tell you off when you go down a slippery slope. He or she is likely to be an adviser and confidant, quick to point out areas where they feel you are better off. So, here’s a simple experiment to try. Do something silly knowingly in the presence of this person. How likely is he or she to call your attention to it? If he or she frequently remains as silent as a mouse, then think twice.

6. Does he or she celebrate with you on events you find significant or on your achivements? A true friend is likely to remember your birthday for example. When you make that breakthrough in whatever field of endeavour you dabble into, who pops champagne with you and makes you feel really good about your achivement? You got it, true friends.

7. Is he or she keen to share insights with you that could better your life in some way? Someone who easily and freely gives you tips on things you can do to accomplish your goals even without asking is very likely your friend. Of course, not every insight a friend gives you will make you a millionaire or even be a good tip in the first place. However, you will usually know if he or she has good intent.

8. Does this person know where you live and has he or she cared to visit? Here is an experiment. Invite this person to your place for lunch on a weekend. What is he or she likely to say? The home is a very important place. It is a place where most people are most at ease in. We all know the cliché: There is no place like home. A person who is enthusiastic about visiting your home is likely a friend. He if or she on the other hand frequently cooks up excuses to not come, think twice.

9. Is he or she honest? Does he or she tell you things they way they are or does he or she try to sugar-coat things? A true friend is likely to let you know in no uncertain terms when he or she does not like something and otherwise. Watch out for consistent honesty in anyone you venture to call your true friend. If he or she lies to you with impunity, watch out!

10. How often does he or she invite you to celebrate his or her successes? When you succeed in that grand endeavour, first you pat yourself on the back for a job well done, right? Then you inform your family to rejoice with you if they are your friends, right? And after that you consider informing your true friends to rejoice with you, don’t you? So, when this person succeeds in his or her goals, if he or she invites you to celebrate, then he or she is very likely your friend, otherwise, you may want to reconsider.

That’s a wrap. If you have that special someone who satisfies several or all of the criteria above, then you very likely have a true friend. Cherish him or her every day and most importantly, be a true friend to others.

An Interesting Rivalry: Facebook and Google

A few days ago, a good friend of mine invited me to a wedding. I was checking the details of the wedding location on Facebook when I noticed to my delight that Facebook displayed a map of the location below the address. How nice of Facebook to make it so easy for me to visualize locations. So I thought, with a bit of scepticism, what if the map isn’t right? After confirming with Google maps, I was happy to know Facebook’s map was accurate. It was at this point I made an interesting realization: Facebook does not use Google maps! Facebook uses Bing instead. We all know Google is the king of maps, so what prompted Facebook to avoid Google. Surely, there’s more to this than coincidence. So I did a bit of digging.

It turns out that Zuckerberg had had talks with Google in the past about possibly letting Google handle search queries Facebook can not handle itself, but he wasn’t satisfied with Google’s terms of service. Apparently, Google’s privacy policy was too inflexible for Zuckerberg’s liking. Microsoft, on the other hand, was more flexible in their privacy terms. Facebook wants its search suppliers to be able to remove Facebook users’ details quickly if need be based on user privacy settings. So, it will seem that Google takes its mission statement: to organize the world’s information and make it universally accessible and useful much more seriously than keeping data private for business customers. Well, we can’t blame Google much for this. What else will you do if you are the biggest Search Engine company in the world? As a side note, how much of the world’s internet traffic does Google actually handle? According to Forbe’s article ‘Fascinating Number: Google Is Now 40% Of The Internet’, Google is responsible for 40% of internet traffic. To get a more visual context of this figure, consider this: On August 16, 2013, all of Google services were down for a few minutes. Here’s what the graph of global internet usage looked like in that period.

google-downtime

Courtesy of GoSquared in their article https://engineering.gosquared.com/googles-downtime-40-drop-in-traffic

Also, it turns out that Microsoft is a Facebook investor, which must have given it some leverage in negotiating with Facebook. That’s the way, Microsoft! Do your thing.

Now, having cleared up why Facebook doesn’t use Google for search, I found out something even more interesting. Facebook is testing its very own search engine! Facebook introduced Graph Search in March 2013. Graph search is considered to give you results instead of links like traditional search engines and you can use it to search for places, people, pages, check-ins, objects with location information, posts and comments. Imagine being able to search for people ‘who are single in London and from Nigeria’. If you’re looking for buddies to go watch that geeky movie, you could search for people ‘who like star wars and star trek’ and Facebook will check through your friends list and potentially through the rest of its 1 billion user base to find answers based on what your friends have shared with you privately and what Facebook users share publicly. That this could take a chunk out of Google’s search shares should be quite obvious. It appears that English users in the USA have now been using Graph Search since August last year. Hopefully we here in the UK get to try it out soon. Facebook is most likely looking to get more and more of its users to become comfortable searching for things on Facebook, starting with social entities, which Facebook is already well known for. I assume they believe it’s only a matter of time before they roll things out into general search. Eventually, Facbook could also make a killing in advertising revenues as businesses fight tooth and nail to rank highly on Graph Search.

So, what can Google do about it? Well, Google will need to continue what it’s already doing – engaging its huge user base. From the recent Google I/O we can see that Google has big plans for the future, from integrating Android into smart watches, to cars – Android Auto, to improving the OS and user experience on Android phones, to allowing you use Android apps on TV (Android TV), to making it possible to use your cherished Android apps on Chromebooks. Basically, Google plans to make your life revolve around Android in the near future. If things go according to plan for Google, you may wake up a few years from now and think back saying “How did we ever live without Android back in the day?” From what we’ve seen in recent years, Google has been making conscientious efforts to integrate its services, providing a rather seamless experience for users. On my Nexus 4 phone for example, I can start doing a Google search at a tap of a button and the search will be done both on my phone and on the web. How cool is that? The idea is that the tighter Google keeps you around its ecosystem of products, the more reluctant you will be to try out other things.

Nevertheless, Google may want to consider this so-called semantic search method Facebook is using in one way or another rather than just sticking to keywords.

As these two companies continue to innovate and compete, we can expect to see more and more interesting features produced to make our lives easier and more pleasurable. Let’s see what these tech giants have up their sleeves as this rivalry unfolds.

Continuous Integration in Android with Jenkins and SVN

In this article I discuss how to implement continuous integration for an android project using a Continuous Integration (CI) server, Jenkins, and SVN.

Setting up project and test project

First, create an application project in eclipse. Let’s assume it’s called ‘project’ and is at /home/user/Documents/project

Next, create a test project for the aforementioned project. Let’s call it ‘test project’. So, in eclipse, go to File > New > Android Application Project. Uncheck ‘Create Project in Workspace’ and set the Location field to /home/user/Documents/project/tests. This way, both project and test are under one folder and can be managed easily with version control software. Also, uncheck the Create Activity checkbox.

After creating test project, we need to add the main project to its build path so that it can access the main project resources. To do this, right click the test project in Package Explorer view and click Properties. Then click ‘Java Build Path’ in the left sidebar. Click on Projects tab, click Add and choose project. Click OK to save.

Update the AndroidManifest file of the test project so it reads something like:

<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.project.tests"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<instrumentation
android:name="android.test.InstrumentationTestRunner"
android:targetPackage="com.example.project" />
<application
>
<uses-library android:name="android.test.runner" />
</application>
</manifest>

Setting up Ant

Jenkins, our CI server, requires Ant in order to manage Android projects. So we must supply Ant information to the project (build script and properties file). Thus we need to install Ant

Get Ant from http://ant.apache.org/bindownload.cgi. Unpack it somewhere on local machine. Create an environment variables ANT_HOME and JAVA_HOME and add the path to the directory containing ant binary to your PATh by adding the lines below to your ~/.profile file. Be sure to adjust the paths accordingly.

export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64

export ANT_HOME=/home/user/development/apache-ant-1.9.2

PATH="${ANT_HOME}/bin:$PATH"

Test that ant is installed properly by running the command ‘ant’ on a terminal. You should see something like

Buildfile: build.xml does not exist!

Build failed

Generating ANT build scripts

cd to your project directory and run the following command:

android update project -p .

This will update and rebuild your project, then generate a build.xml file in your project’s root folder which will be used by ANT to build your project.

cd to your test project directory and run the following :

android update test-project -m .. -p .

Note that the general form of the command is: android update test-project -m _PATH_TO_ANDROID_PROJECT -p _TEST_PROJECT_PATH_

This will update and build your test project, generating a build.xml file in its root folder. So we now have two build.xml files.

Add the test project’s build.xml and ant.properties file to version control. Also add the project’s build.xml to version control. Do NOT add the test project’s local.properties file to version control as that is machine-specific.

Building with ANT

cd to your project’s root directory and run the following :

ant clean debug

This should build the project.

Next, cd to your test project directory and run the following code:

ant clean emma debug install test

This will build the test project, run code coverage with the EMMA code coverage tool, install the application on your emulator or device and run your JUnit tests on the application.

Install Jenkins

Now we will install Jenkins on the CI server. Website: http://jenkins-ci.org/. For ubuntu servers, this involves running the following code:

wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key \
	| sudo apt-key add -

sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > \ 
	/etc/apt/sources.list.d/jenkins.list'

sudo apt-get update

sudo apt-get install jenkins

By default, Jenkins listens on port 8080. To avoid having to type this port number in the browser everytime, you could proxy the web server to point port 80 to 8080. For that, assuming you use apache, create a file /etc/apache2/sites-available/jenkins and add the following code to it:

<VirtualHost *:80>


	ServerAdmin webmaster@localhost

	ServerName ci.company.com

	ServerAlias ci

	ProxyRequests Off

	<Proxy *>

Order deny,allow Allow from all </Proxy> ProxyPreserveHost on ProxyPass / http://localhost:8080/ </VirtualHost>

Enable mod proxy, enable the site and restart apache using the following code:

sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2ensite jenkins
sudo service apache2 restart

Now Jenkins is installed. You should be able to access it by going to http://ci.company.com/

Install Android SDK on the server and all relevant versions.

Install Android Emulator Plugin. This involves, going to the main page, then clicking on Manage Jenkins > Manage Plugins. Then click on Available tab, find the plugin, check the checkbox next to it, and click ‘Install without restart’ button.

Check if Subversion plugin is installed. If it isn’t, check if it available for download. If it isn’t, download and install it manually. To do this, visit the plugin page at https://updates.jenkins-ci.org/download/plugins/subversion/, download the latest plugin, and move the downloaded file into Jenkin’s plugin folder at /var/lib/jenkins/plugins/

System Configuration

Configure required paths (e.g. to ANT, SDK, etc) by going to Manage Jenkins > Configure System

Create Project on Jenkins

Create a new job by going clicking New Job. Enter name of job and check the Build a free-style software project radio.

Next, configure the new job.

Go to the homepage and click on the job. On the job page, click Configure link on the left sidebar. Enter the project name and description. Under Source Code Management, check Subversion Modules. Enter the url for the repository.

If your repository requires authentication, then an error message will show saying Jenkins couldn’t access the repository. To fix this, first create a new svn user for Jenkins on your repository. On the error message section, there will be a link for Credentials. Click that link and enter the username and password of a user you have just created. The error message should disappear. Click the Save button.

Now test that the job can access the repository. On the job’s page, click Build Now. Jenkins should checkout the project and create a workspace. On the workspace you should see files for the project.

Building project with ANT

Next, we will configure Jenkins to build the job with ANT.

Go to the job page and click Configure.

Under Build section, click Add Build Step button. Select Invoke Ant build step on the dropdown that appears.

In the build step’s command textfield, enter the following:

clean debug

This will build a debug version of the app. Test that it runs fine by saving and clicking Build Now link.

If there’s an error about sdk.dir not found, you can add this to the step by visiting Configure page, clicking Advanced button for the build step, and entering the following line, where the path is changed to reflect where you installed the sdk. I assume you should see this error if you entered the data under System Configuration:

sdk.dir=/home/user/android-sdks

Run android emulator to run tests

On the configure we need to run the emulator in order to run tests, so check the Run an Android emulator during build checkbox. A form will appear asking for avd details. Fill it in as shown below

Add another build step.. Choose Invoke Ant. Set the command to

clean emma install debug test

Next, tell Jenkins where the build file is for this step. To do this, click Advanced button, and enter the following for Build file:

tests/build.xml

Test it by saving and clicking Build Now link. If there’s an error about sdk directory, then go back to the Configure page, click Advanced for this step, and enter the following for Properties:

sdk.dir=/home/user/android-sdks

where the path is updated accordingly.

Save and build the project.

Tip: while build is in progress, you can move the mouse next to the build time on the main page, click the down arrow button that appears and click Console output in the dropdown that appears. This will show you the commands being run in real-time.

Publish JUnit and EMMA coverage report

Next, we will make Jenkins generate JUnit test result and EMMA coverage report when tests are run.

To do this, go the Configure page of the job. Under Post-build Actions, add an action called Publish JUnit test result report. Set Test report XMLs to tests/junitreports/*.xml

Add another Post-build action and this time choose Record Emma coverage report. Set the Folders or files containing Emma XML reports to tests/bin/coverage.xml

Save.

Note that JUnit reports get stored on the emulators and Jenkins doesn’t have access to this. To get around this problem we can use the android junit report by Jason Sanky.

Here are the steps:

Visit the Jsanky github at https://github.com/jsankey/android-junit-report. Go to the downloads page and download the latest android-junit-report jar.

Place the jar file in your test project’s libs folder.

Update the test project’s AndroidManfest file. Specifically, change the android:name attribute of the instrumentation tag from

android.test.InstrumentationTestRunner to com.zutubi.android.junitreport.JUnitReportTestRunner

cd to the test project’s root folder and edit ant.properties. Add a line as follows:

test.runner=com.zutubi.android.junitreport.JUnitReportTestRunner

We also need to update the run configuration of the test project to use the library. To do this, click on the arrow next to the Run button and click Run configurations. Under Android JUnit Tests, click on the test project. In the Test tab, update the Instrumentation runner to com.zutubi.android.junitreport.JUnitReportTestRunner

Click Close .

Next, we need to add a target called fetch-test-report to the test project’s build.xml file. Edit that file and add the following code:

<target name="fetch-test-report">
<xpath input="${tested.project.dir}/AndroidManifest.xml"
expression="/manifest/@package" output="tested.package"/>
<echo>Downloading XML test report...</echo>
<mkdir dir="junitreports"/>
<exec executable="${adb}" failonerror="true">
<arg line="${adb.device.arg}"/>
<arg value="pull" />
<arg value="/data/data/${tested.package}/files/junit-report.xml"/>
<arg value="junitreports/junit-report.xml"/>
</exec>
</target>


Save and close the file.

Finally, update the second Ant build task in the Configure page of the job in Jenkins. Change the command from

clean emma debug install test

to

clean emma debug install test fetch-test-report

Press Save button.

Click Build Now. The project should build and you should get both coverage and junit report.

Automatic Build

If you want to notify Jenkins immediately commits take pace and trigger a build automatically, you can do this using a post-commit hook. Here’s how.

In the project’s repository, create a file called post-commit in the hooks folder.

Add the following code to the file:

#!/bin/sh
REPOS="$1"
REV="$2"
UUID=`svnlook uuid $REPOS`
/usr/bin/wget \
  --header "Content-Type:text/plain;charset=UTF-8" \
  --post-data "`svnlook changed --revision $REV $REPOS`" \
  --output-document "-" \
  --timeout=2 \
  http://ci.company.com/subversion/${UUID}/notifyCommit?rev=$REV
# let's build the project too
/usr/bin/wget \
  --output-document "-" \
  --timeout=2 \
 http://ci.company.com/job/job/build

Note that on the last line, the general format of the link is

http://ci.company.com/job/YOUR_JOB_NAME_IN_JENKINS/build

Save and close the file. Make it executable and make sure the svn user (e.g. apache) is able to execute it.

That’s it. When you commit henceforth, Jenkins will create a build.

How to Run Raw SQL Query on Zend Framework

This tutorial describes how to run raw SQL script inside a controller on Zend Framework.

For running non-queries, use the following:


Zend_Db_Table_Abstract::getDefaultAdapter()->query($sql);

In order to return a single row, use the following:


Zend_Db_Table_Abstract::getDefaultAdapter()->query($sql)->fetch(); 

To return all rows, use the following:


Zend_Db_Table_Abstract::getDefaultAdapter()->query($sql)->fetchAll(); 

How to get VIM-like functionality in Eclipse

This article describes how to get VIM-like functionality in Eclipse. It’s for the user who enjoys the speed of VIM but also needs to use Eclipse for software development.

There’s a great eclipse plugin called Vrapper. It is obtainable from the Vrapper website. It gives you VIM-like functionality while retaining the power of eclipse. It works pretty well.

How to copy from vim in ssh session to local clipboard on Mac

If you are using a Mac computer and editing vim inside an ssh session, then you can’t copy from the remote vim session to your clipboard using the familiar “+y. This is because the remove vim doesn’t know anything about your local pc’s clipboard. So, how do we copy text from a remote vim session to your local clipboard? There are 2 options :

1. Highlight the text with your mouse then press cmd+c

Note: if you have

set mouse=a

in your .vimrc file, this won’t work as any highlight with mouse switches vim to visual mode making cmd+c invalid. In this case you could press and hold alt before highlighting.

2. Put the text in a temporary file and transfer it to your local pc by scp, then put it in a the clipboard with pbcopy, i.e. go to local terminal and run these commands:

scp username@remotehost /tmp/stuff.txt
cat /tmp/stuff.txt | pbcopy