Friday, August 29, 2014

WebRTC: A conversation Between Chrome and Firefox, using WebRTC framework

I just found this google page that explains how WebRTC works. You can enable streaming between browsers without using browser plugins or installments.
demo link:

Thursday, July 31, 2014

SEO basic notes, Onpage | Offpage optimizations, White | Black hat SEO

I this post I plan to share what I have learned by reading a SEO book.

There are onpage and offpage optimizations.

Onpage optimizations include: 

  • using your main keywords in <h1> tag, 
  • using secondary most important keywords in <h2> tag. 
  • Put several of your main keywords to construct the <title> tag usually separated with | sign. 
  • Avoid repeating same keywords in the title tag because Google may detect it as spamming and ban your site. 
  • Every <image> tag in your site should contain alt attribute with your main keywords plus the word image or picture. It is meant for blind people and to give additional info when the image was not fetched properly. 
  • Put your site url and main keywords in a footer of every of your site pages
  • Usually it is always better to let Google read first your body text then continue with navigational links if they stand in a left hand sided panel. Put an empty cell or row above your navigational panel so the page parsing could start with the body text
  • Use Google Trends or WordTracker or other tool to find best keywords for your website. Avoid using keywords that are used by many websites because the competition will be very fierce and you will achieve nothing. 
  • Google does NOT use keyword metatag for calculating your page rank. Check this page:
  • Google may use description metatag if it finds it is something useful and show it as a snippet in the search result. Yes you should always try to describe your website within description metatag or your <header> tag.
  • You should also bold and or italicize keywords at some place if you think it looks appropriate for the website design. It will help in the search results.
  • Avoid using hidden text, because Google can see it and if there is keyword spamming it may ban your site. 
  • Avoid image tag spamming, meta tag stuffing, and title tag stuffing with keywords. You will surely get banned. 
  • Keep good inner website structure, aka every webpage should be linked to some hub page where we all can easily find it. This is commonly known as a site map. Google checks this and it doesn't like orphan pages.
  • If you want to use keywords in your url you should separate them with hyphen, not with underscore. And yes Google, MSN and Yahoo index pages that contain keywords in their url however smaller search engines may or may not use this information to index your page. Check this page:

Offpage optimizations include: 

  •  Onpage optimization is what you should do, however offpage is what really brings traffic to your website.
  • Do NOT use Google, MSN or Yahoo submit pages to submit your site to their index. It is worthless and may give worse results than leaving search engines to index your page by them selves.
  • You site may appear in Google's index in 1 or 2 days without effort on your side. 
  • You can purchase reciprocial links to your site from link directory sites like
  • One site of PR 5 pointing to your site may increase traffic several times in difference with several sites with PR 2 or 3.
  • Google and other well known search engines use several criteria to evaluate your website. That include: Which websites point to your site, the number of sites pointing to your site, PR value of sites pointing to our site, page title of websites pointing to your site, anchor text used in the link linking to them, the number and type of links linking to your site, the number of sites linking to sites that link to your site, are these sites deemed as authority sites by Google, the IP address of sites linking to your site (are they all on same IP address).
  • You should use "link" keyword in Google to check all sites that contain that url address. Example: type in Google: link:
  • Google checks IP address of sites linking to your site and it cannot be tricked by pages pointing to your site that lay on same IP address.
  • You can search link directories for link exchange using this technique, type in Google: keyword "Please also suggest my link to the directory". Replace keyword with your own keyword. I have tried this, it brings some results but not much what I expected. You can contact sites with a submit form for link exchange. 
  • Avoid linking to site that doesn link back to your site. You PR value suffers.
  • Use SEO Elite to check for sites with PR 0 whether they are banned by Google. If yes, they don't exist in Google's index than you may NOT want to link them anymore, because your site will get penailzed or banned too.
  • You should create link hub pages with up to 25 reciprocial links to other sites withing your website. 
  • You can calculate your page rank with a formula. Check this wiki page:, this also may come in handy You can also use some of the GoodKeywords tools to check your page rank, or Google's toolbar.
 There are two types of SEO techniques, White hat SEO and Black hat SEO.

 Black hat SEO is more concentrated on search engines and for short term financial return.That means using agressive techniques like keyword stuffing and spamming, that leads to fast financial return but for sure your site will get banned by search engines sooner or later.

White hat SEO includes using SEO techniques according to search engine guidlines. It means doing all things that will not harm your site's page rank, for a long term results and meant for real people. Wirting human readable articles, onpage/offpage optimisations, without using keyword stuffing or spamming. Maintaining goot site structure, recirprocial links etc...

You may want to recall to this post

"Search Engine Optimization made easy" by Brad Callen - book review

In this post I will share my thoughts on a book called "Search Engine Optimization made easy" by Brad Callen. I don't know when it was published because it is not stated in it, nor I could find on the Internet. There are some PDFs circling around for free :)
This book is more like a beginner’s guide to SEO. It gives a glimpse into all necessary things that optimizing a web site may include. It gives general strategies how and where to start optimizing your web site and it is a good tool if you don't have time to read large books like 300 to 600 pages. But some aspects of SEO are not thoroughly covered with theory so some things may be still unclear even if you read the book twice without using information from Internet. For example there is explanation how to calculate Google's page rank and it mentions some iterations of the same formula with different values but I couldn't figure out how those different values are calculated.
Also some of the tools/links recommended in the book are obsolete and do not exist anymore, so you may have to search some things by yourself. For example the tool GoodKeywords mentioned for searching keywords related to a given keyword directly from Google doesn't exist anymore, or I simply couldn't figure out how today’s GoodKeywords software works. I used Google Trends instead.
The book however contains good exercises how to manually search info about specific websites and optimize yours better that those sites. There is a software called SEO Elite which does lot of work for you, and of course it is not free but may save you some time. However you can do all the job manually which is recommended as a practice. 
There are 10 chapters in about 90 pages and those include:
  1. searching good keywords for your site/brand. Installing Google toolbar. Analyzing competitor's website's html code. 
  2. Onpage optimiziation for your website, using <h1>, <h2>, alt image tag attribute, bolding, italicizing etc...
  3. Getting started with offpage optimization. Never use Google's page submit form, neither MSN, Yahoo, Altavista, Alltheweb submit forms. Buying text links that point to your website. 
  4. Offpage optimization criteria basics. Collecting useful information from Internet about competitor's SEO strategy. Using SEO Elite.
  5. Contacting link sites for link sharing, using SEO Elite to contact 1000 link directory websites at once. Create link page withing your website. 
  6. What things to consider so that you don't get banned by Google. Using hidden text, alt image tag spamming, meta tag stuffing, title tag stuffing.
  7. Is your website linking banned websites aka bad neighbours? Make sure you don't link to bad neighbours so that your site don't get banned too by Google. Use SEO Elite to check for sites with PR 0. Using submit forms to link directory websites. 
  8. Exercise chapter. Find out why Adobe's site is closely related to keyword: "click me" though you may think, isn't Adobe related to graphics design software, Photoshop etc...
  9. Using alt image tag attribute to maintain good website structure. 
  10. What Google's Page Rank is all about. Calculating formula for Page Rank. How do you calculate yours website page rank. Do not link websites that don't have reciprocal link to your website. Your page rank will suffer because of this.
As I mentioned earlier, it a very well made book and it works good if you are a SEO beginner. But because of not enough theory coverage some things may stay unclear. Therefore I give 3.7/5

Useful links:

Next good read:

Monday, July 21, 2014

"Selenium 2 Testing Tools" - book review

In this post I will do a book review about a book called "Selenium 2 Testing Tools" written by David Burns. It is a beginners guide for Selenium 2 published 2012 by Packt © Publishing.

It is fairly new and it covers basic information about all aspects  of Selenium 2.
In 11 chapters and two appendices it manages to help reader get basic understanding about Selenium using code examples and little chapter quizzes. First of all you need to install necessary software like Java jdk, InteliJ Idea, selenium - server standalone, selenium IDE plugin for Firefox, Firebug and Firefinder.

  1. Getting started with Selenuim IDE, where you get the basics of using Selenium IDE Firefox plugin. Recording your own test case and test suites. Adding test comments. Asserting and verifying tests with Selenium commands. Using multiple windows and testing Ajax applications.
  2.  Locators, where you learn basic HTML element locating methods. Searching tag elements by ID, name, CSS selector, XPath, DOM and text link again using Selenium IDE. 
  3. Overview of Selenium WebDriver, where you get introductory text about creation of Selenium tools and how it is structured. 
  4. Design Patterns, where you use Page Object and Page Factory patterns to code your selenium tests. Also using LoadableComponents in your tests
  5. Finding Elements, where you use Java code, junit testing frameworks and Selenium WebDriver run tests for finding html elements by ID, name, XPath, CSS, DOM and link text. In Selenium API you find one html element or you can find a list of elements that cover certain criteria.
  6. Working with WebDriver, where you get know all basic drivers for each of the most popular browsers, Firefox, IE, Chrome, Opera and you do some basic Java tests. In this chapter I found that FirefoxDriver is part of Selenium WebDriver while IE and Chrome need additional libraries to run from selenium. As for Opera there is a library that covers only versions up until Opera 12.x built on presto engine. For newer versions there is still no support by Opera team(not sure, have to check). Libraries: selenium downloads, IE driver, IE driver downloadsChrome driver, Opera driver
  7. Mobile devices, where you get to test web applications that run in Android, iPhone and Opera Mobile browsers. Libraries: Selendroid (replacement for the obsolete AndroidDriver).
  8. Getting started with Selenium Grid, where you get to understand how to make selenium tests that run in parallel on several machines and on several browsers at the same time. Also on different operating systems, like Windows and Linux. So basically selenium server can be run as a grid hub, but also as a node. 
  9. Advanced user interactions, where you use selenium webdriver to run keyboard and mouse based tests. Also you will use Actions java class for performing sequence of mouse/keyboard actions which is handy. 
  10. Working with HTML5. In this chapter you are visiting application cache, browser connections (online/offline), WebStorage (local and session storage).
  11. Advanced topics. In this chapter you will learn, how to capture screenshots when error appears with selenium webdriver, use XVFB buffer to test application without interference with the tests (works only on Linux) and Browsermob Proxy to monitor web application traffic.
  12. Appendix A, Migrating from Remote Control to WebDriver
  13. Appendix B, Pop quiz answers
Some useful links:

According to my experience, it does what is meant to be, aka introducing selenium 2 trough examples and information. Apart from some code errors and obsolete tools like AndroidDriver which today is replaced by SelendroidDriver it is very well made book. If you are just starting with selenium 2 testing tools this is the book to choose. I give it 4.5/5

Perhaps this is the next good read, Selenium testing tools Cookbook,
Selenium WebDriver Practical Guide

Friday, July 11, 2014

"Ext JS 4 First Look" and "Mastering Ext JS" - book review

Hello. In this post I shall explain my thoughts on two books, Ext JS 4 First Look and Mastering Ext JS written by loiane Groner.

Ext JS 4 First Look

It is an intruductory book for Ext JS 4 framework, specifically version 4.2. You can find lot of comments and posts across the Internet about previous version of Ext JS 4, 4.0 and 4.1, it is said that were buggy. So my advice is use Ext JS 4.2 for your future projects. Not sure about Ext JS 5, it is a new release.

In about 300 pages Loiane managed to cover all aspects of Ext JS 4 framework. It has lot of useful information and you can get a general understanding about the framework's capabilities. However is a bit techincal, so I recommend reading each chapter at least twice. It also a good practice to try and write the code from the book on the a real machine and see how it works. From this point of view I think it needs more code examples. So if you want to learn Ext JS 4 framework, I think this book is a good start. 4/5

Mastering Ext JS

In this second book about Ext JS 4 you get to develop real world Ext JS 4 based application (using sakila sample database). It has lot of code and reading it is a bit dificult task since you need to understand what the code does. While reading it I set up my working environment and started coding from the book. It begins ok, all things that were necessary were covered in the book. However when you get deep into it like 150 pages which is middle of the book, you can clearly see that some application modules are not finished, or a code is missing. I managed to find code base here. It easens up things a little, if you copy code form github. But I also found that some php files had commented code and weren't working. It has a bit of inconsistency with the book. You get the feeling it is not made for beginner web developer :) I managed to find solutions to most of the problems while developing my practice app here: but that was the case because I already knew PHP 5, firebug, MVC architecture, Aptana, JavaScript basics, html etc...

- still in development. Use vlado as user and 123456 as password to log in. You can change to different language, now English US and MK(Macedonian) available. If you get loading errors or it doesn't want to show up, refresh the tab. Still things to be done. 

  • Some php file had commented code out in the github package. Why should I bother understanding what the php code does when I learn Ext JS?
  • It happened to build a production version of the app and when uploaded to server it doesn't work as it works locally. Charts aren't drawn, login window stays after loging in, loading notification stays forever.  Not sure why it does that, a testing is neccesarry. Ok I set up Siesta as mentioned in chapter 12 - Debugging and Testing, I run the test from the book and get error Application.js not found in Firebug. :) Ok I deployed (prebuild app) masteringextjs4 zip package from github to my server and try the tests, some strange error appears, "j is undefined" :D So now I cannot test even the prebuilt application. Maybe I have missed to read some guide or whatever, but overall I am a bit lost as Ext JS beginner.
I give points for ingenuity. Really good use of available learning resources like Sakila sample database. You will get to work with MySQL db, MySQL Workbench, exporting/importing data. Also PhpMyAdmin which is a really good admin tool.

All in all it is a good book, but you will not learn much if you don't code the code yourself and try to debug yourself. It is very techincal and as I said cover each chapter twice. Once reading, once, coding. It contains lot of general information about Ext JS 4 and lot of advices about tools to develop. According to my experience reading it I give it 3.75/5

Thursday, July 25, 2013

Simple Gallery App in Android

I have recently worked on a simple Gallery application in Android.

It has one ImageView component, two buttons, previous and next and one TextView for description. It is a gallery application for European cars. Actually I have 27 car brands and one model (image) for each brand. I added 27 images which are all 640 x 480 pixels (You can download images from Google) into CarTestApp/res/drawable-mdpi folder.

I was testing my app on Nexus 7 AVD emmulator.

Here is how you application should look like.

I will show you some tricks I used in this small app, like how to access all drawable objects.

Ok so here is my layout file:

My strings.xml file

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

    <string name="app_name">CartTestApp</string>
    <string name="action_settings">Settings</string>
    <string name="hello_world">Hello world!</string>
    <string name="image_view">Image description</string>
    <string name="prev_btn">prev</string>
    <string name="next_btn">next</string>
    <string name="car_name_text_view">Car Name</string>

I added file for a helper function. It is only one function but I guess I will expand the application future.

package com.testpkg.carttestapp;

public class Utils {
    public static String formatFirstLetterOfString(String str) {
        String result = "";

        result = str.substring(0, 1).toUpperCase()
                + str.substring(1).toLowerCase();

        return result;

Next class I added is called It has many static functions so that I don't need to instantiate an object of this class. No need to.

Here it is:

Check these lines:

public static Field[] nativeDrawables = android.R.drawable.class

public static Field[] drawables = com.testpkg.carttestapp.R.drawable.class

Function getFields() returns the fields in a given resource from our application.

For example android.R.drawable contains native android drawable resources while com.testpkg.cartestapp.R.drawable contains drawable resources that we have added to our application.

So actually we can search our resources with code.

I have two ArrayList objects, one for drawable ids and one for drawable string names. I also have a hash map with drawable id as a key and car string name as a value.

Here is the reset() function in which I fill my lists and the hash map:

public static void reset() {

     for (Field field : drawables) {
            try {
                if (!field.getName().equals("ic_launcher")) {
            } catch (Exception e) {

        for (int i = 0; i < carStringsList.size(); i += 1) {
            carNamesList.put(carIdsList.get(i), carStringsList.get(i));

You may noticed this function formatCarFieldName(); I can use java function toUpperCase() but that will make all letters upper case. I don't want that, I wan only the first letter upper cased. Strings are immutable values so I make a concatenation trick like this one:

result = str.substring(0, 1).toUpperCase() + str.substring(1).toLowerCase();

which will upper case only the first letter. You can find this in the Utils class.

Some screen shots:

Tuesday, July 16, 2013

Washing Machines App with images

I managed to improve the application by adding images of the machines to the project.

The complete source code is on git hub

- I added 6 images for each machine brand: LG, Samsung, BSH, Gorenje, Whirlpool and Videocon into the res/drawable-mdpi. You can add in other drawable folders for different screen resolutions but for this small application this is enough.

Note: Images and data for the washing machines are arbitrary and therefore not correct. 

In details.xml I added this ImageView component

        android:src="@drawable/bsh" />

Here it is:

- I added this line in strings.xml for the image view description attribute

<string name="machineImageDescrp">Current machine image</string>

- I dynamically change the image resource id for appropriate machine.

In like this

this.machineImage = (ImageView) findViewById(;       this.machineImage.setImageResource(this.setImageId(this.brandName.getText().toString()));      
where setImageId() changes the image id according to the brand name

private int setImageId(String brandNameStr) {
        int result = 0;
        if (brandNameStr.equals(WMConstants.LG)) {
            result = R.drawable.lg;
        if (brandNameStr.equals(WMConstants.SAMSUNG)) {
            result =;
        if (brandNameStr.equals(WMConstants.BSH)) {
            result = R.drawable.bsh;
        if (brandNameStr.equals(WMConstants.WHIRLPOOL)) {
            result = R.drawable.whirlpool;
        if (brandNameStr.equals(WMConstants.VIDEOCON)) {
            result = R.drawable.videocon;
        if (brandNameStr.equals(WMConstants.GORENJE)) {
            result = R.drawable.gorenje;
        return result;

- Now you can see some new class called WMConstants. It is a new class I added for the project to keep track of all constants because using constants is much easier than remembering many strings. And also immune to errors.

Here it is

package com.example.washingmachines;
public class WMConstants {
    public static final String LG = "LG";
    public static final String SAMSUNG = "Samsung";
    public static final String BSH = "BSH";
    public static final String WHIRLPOOL = "Whirlpool";
    public static final String GORENJE = "Gorenje";
    public static final String VIDEOCON = "Videocon";

    public static final String FRONT_TYPE = "front";
    public static final String TOP_TYPE = "top";
    public static final String HYBRID_TYPE = "hybrid";

    public static final String MACHINE_TYPE = "type";
    public static final String MACHINE_BRAND_NAME = "brandName";
    public static final String MACHINE_WEIGHT = "weight";
    public static final String MACHINE_MAX_RPM = "maxRpm";
    public static final String MACHINE_WASH_TEMP = "washTemp";
    public static final String MACHINE_HAS_ENERGY_STAR = "hasEnergyStar";
    public static final String MACHINE_POWER_USAGE = "powerUsage";

- Most of the files used are same as in previous tutorials but you can use them all from git hub link above without no problems as it has the latest version of this application.

Here is


Here are some resulting images:

list of machines

Gorenje Details

Videocon details

Whirlpool details

I have added sample images in the assets folder. You can use them for your project or you can use your own images. They should be 230x200 pixels