New Releases

CakeOTP 1.1 - User Registration with One Time Password for CakePHP ReleasedCakeOTP 1.1 - User Registration with One Time Password... CakeOTP is a reference implementation of User Registration with a secure, table-less and expirable implementation of One Time Password for the popular CakePHP development framework. New in CakeOTP...

Read more

IPWEditor - In-Place WYSIWYG Editor 1.2.1 Released with TinyMCE bug fix and moreIPWEditor - In-Place WYSIWYG Editor 1.2.1 Released... IPWEditor provides easy in-place editing for Web pages with a layer of WYSIWYG. It allows you to seamlessly replace text on Web pages with inputs for on-the-spot editing. Up until now IPWEditor did...

Read more

AutoSnippet - automatically generate HTML and javascript code snippetsAutoSnippet - automatically generate HTML and javascript... Code snippets posted online are a great source of knowledge and simple way to share experience and to reuse code. As developers we always look to see if there is a 'code example' which we can modify...

Read more

Put Your Blog on The MapPut Your Blog on The Map World's Blog Map Want to put your blog on the map? Ever wondered where does the blog your reading come from? Where are most Bloggers Located? How would a World Blog Map look like? Here is the first...

Read more

Ajax persistent Data Objects - AjaxDo 1.1 released! Release 1.1 adds a fully functional JAVA server-side implementation to the pre-existing PHP server-side implementation. Now, Ajaxdo, AJAX persistent Data Objects, enables applications can work in...

Read more

  • Prev
  • Next

The World First Ever HTML5 Advertisement

Category : Google, HTML5, Open source, web

We all love new technology, its event better when it is open and standard. But getting your feet wet and actually using the new technology? and in production? and where there is money involved? that is totally a different matter…

Last week I started advertising a big developer event we are holding in November – a countdown clock that counts the seconds till Google Developer Day . We considered a Flash ad like we are all used to, but our marketing team though it would be cool to have HTML5 ad…

I am a little a shamed to say that at first I objected, saying that HTML5 is still not fully supported by all browsers. After much deliberation we decided it was worth the extra budget to serve HTML5 for browsers that support it and Flash Ad to deprecated browsers. The reports from the publisher is that this HTML5 ad beats all Flash ads CTR. This is something worth investigating – is HTML5 ads perform better than Flash ads?

So get ready – Here is the first world HTML5 ad (click to enlarge) -

For the next few days you would be able to view it (with Firefox and Chrome) here.

Gracefully Detect Old Browsers and Fallback from HTML5

Category : HTML5, JavaScript, Software development, web

HTML5 rocks! It even says so in this (highly recommended) great web tutorial, but there are still a lot of browsers out there, that still do not support HTML5, or some of it’s features.

First, What is HTML5?

Wikipedia defines HTM5 – HTML5 is a language for structuring and presenting content for the World Wide Web, a core technology of the Internet. It is the fifth revision of the HTML standard (created in 1990 and standardized as HTML4 as of 1997[1]) and as of September 2011 is still under development. Its core aims have been to improve the language with support for the latest multimedia while keeping it easily readable by humans and consistently understood by computers and devices (web browsers, parsers, etc.). HTML5 is intended to subsume not only HTML4, but XHTML1 and DOM2HTML (particularly JavaScript) as well.

How do I find out which features are supported in each browser?

HTML5Rocks keeps track for each features support in each browser another cool site to check would be caniuse.

Now, the really issue is what do you do at run-time? how do you gracefully fallback when there is no support for the great feature you have implemented using HTML5.

There are two way to detect and fallback from HTML5, the right way, and the wrong way

So here they are:

WRONG WAY – On the server-side, check the User Agent header and serve different pages based on the user agent header… Not recommended – first, there a lot of  User Agents, second, this is a very buggy approach because headers change and are not deterministic (FF can easily send IE headers).

RIGHT WAY – Use JavaScript to detect when there is no support for a HTML5 feature (AKA object detection) here is an example:

 function start(){ if(supports_canvas()){ // Do funky HTML5 canvas fun }else{ // fallback to boring old HTML } } function supports_canvas() { return !!document.createElement('canvas_bogus_name').getContext; } 

 

Have fun and support HTML5:

Finally I Have a Budget to Support Open Source

Category : Google, Open source

I have been an Open Source enthusiast for a very long time. I have written several open source projects, and although I have yet to find a perfect open source revenue model, I still contribute and enjoy the ride.

I think that open source, even if still not fully main stream, constantly improves our lives, even for those of us who are not a tech-geek like me.

Now things are radically different, it is now part of my job to support and ensure the success of open source in my region. Now I finally have some budget to do what I love and believe in.

Last week was my first (and very humble) contribution in August penguin, a local open source event. The organizers did not want us to officially sponsor the event but agreed that I bring food :)

So here it starts, my first monetary contribution to  an open source initiatives. I hope and plan to support multiple events and projects in order to drive a more open future.

Voice Recognition API in Android Apps Using RecognizerIntent

Category : Android, Google, Java, Open source, Software development

Voice interface is not a common application user interface, we do not usually interact with application using voice. But when it comes to mobile it makes more sense.
We are used to talk to a phone all day – why not talk to our phone apps?
Not all voice interaction should look like this video:


Here is how you use Android Voice Recognition API:

  1. Call the RecognizerIntent  - your application call the Voice recognition Intent that records the voice.
  2. Intent processes the voice recording – sends it to the voice Recognition Service and returns
  3. A list of string is passed to an implemented callback method in you application
  4. You process the string and continue the interaction with the user

Here is a simple call to the intent:

     /**
     * Fire an intent to start the speech recognition activity.
     */
    private void startVoiceRecognitionActivity() {
        Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
        intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
                RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
        intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Speech recognition demo");
        startActivityForResult(intent, VOICE_RECOGNITION_REQUEST_CODE);
    }


And here is the callback:

      /**
     * Handle the results from the recognition activity.
     */
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (requestCode == VOICE_RECOGNITION_REQUEST_CODE && resultCode == RESULT_OK) {
            // Fill the list view with the strings the recognizer thought it could have heard
            ArrayList matches = data.getStringArrayListExtra(
                    RecognizerIntent.EXTRA_RESULTS);   

          //DO SOMETHING WITH THE MATCHES

        super.onActivityResult(requestCode, resultCode, data);
    }

Here is a full code sample – I played with it today and will very little effort created a Pizza ordering application for my next demo session.

Leaving Microsoft and Joining Google

5

Category : Best practices, Google, Microsoft, Open source

I try to talk about myself as little as possible in this blog, but this is a personal post – so if you are looking for a tech-post, wait for next week.

In the last 5 years I have worked for Microsoft in several positions and done a lot of exciting things – presenting at events, doing business development with Startups, and doing technical sessions for developers and architects all the way to managing the sales of Microsoft Cloud Platform, Azure, in Middle East and Africa.

Lately, I have been approached by Google to do a very exciting role of a Developer Relationship Manager – working with developers, startups and enterprises. Last week, I have decided to accept the offer!

Working for Microsoft has been a great learning experience –big corporate mentality, cross group work, presentation skills, breath of technologies, as well as sales management and processes. Having said that, being an open source guy at heart and working for Microsoft was always challenging – I tried to compensate by collaborating with SUN and the open source community and even presented in their events and invested in joined effort, but in general people around me were not as enthusiastic about openness and free software as I was (what great surprise there!!) so I always felt a little like Dr Jackal and mister Hyde.

In my new role in Google, driving open source projects and FOSS development will be an integral part of my job description. This brings me great childlike joy and excitement, something we tend to forget or loss along the way in the high-tech business.

On Premise vs. Cloud – Pricing Model

Category : Architecture, Cloud, SAAS, web

Everybody is talking cloud – every startup I meet, every CTO I work with, and all the software vendors are now cloud-oriented.

But when it comes to implementation it is a different story all together – most companies realize the value of the cloud (or at least say they do) but very few are ready for the paradigm shift – especially when it comes to the pricing model.

How do we do pricing on premise?

Before the cloud, architects and IT engineers used to perform an activity called “sizing exercise” or ”sizing estimation” before buying the actual servers for production. These activities are based on past experience, combined with buffers and optimism:
These exercises would go (very generally) like this:

Sizing exercise -
1) We think we are going to have around 10,000 users per day
2) On the weekends we hope are going to spike to 50,000 users per day
3) The system should support at most 100,000 user per day
4) A user views 3 pages in average
5) …
6) …
7) We estimate that a server would hold 1000 users per day
Conclusion – we need 10 servers, a nifty Database and 100GB of storage
Production environment cost is $35K

The key here is that on premise (in a non-virtualized environment) it is hard and expensive to provision new servers. That is why we need to size properly and put the cost in the IT budget in advance. These costs are Capital expenditures (expenditures creating future benefits)

Cloud advocates would say that these calculations are limited and do not take under account things like backup, IT cost, electricity, and other run-time costs. But in typical Sizing exercise these services are taken or granted.

How do we do pricing in the cloud?

In the cloud we do not need to do this initial “sizing exercise”, we start with one or two servers and if we need more we just easily provision more as we see fit. But when it comes to pricing we need to start thinking in terms of usage (I call it “metering exercise”):

Metering exercise –
1) How much bandwidth are we going to consume?
2) How much storage and storage transaction are we using?
3) How many CPU hours do we need?
4) Are there periods where we need more/less CPUs
5) ….
6) ….
7) Our database is going to start with 100MB of data and grow as time pass
Conclusion –We estimate that the initially we would be spending $150 per month with a growth rate of 5% per month.

Pricing in the cloud is based on actual usage – meaning you only provision what you need right now and you only pay for what you use. This cost is an operating expenditure (an ongoing cost for running a product)

The Needed Paradigm Shift

The problem is that most people are used to “sizing exercise” and Capital expenditures. They want to put something in the budget and forget about it – even if it costs much more. Moreover, some IT pros are not experienced in these “metering exercises” and often get it wrong the first couple of times. I think that making this error is a learning exercise and you often get it right after a few times -“metering exercises” errors often cost much less than “sizing exercise” errors and are more easily corrected.

Some IT organization try to do “sizing exercise” for the cloud – that is a common pitfall these days because you loss the elasticity and “pay for what you use” and in most cases pay much more that you should have- and even if you do this “sizing exercise” you still do not have the predictability that you are used to.

IT managers need to embrace the shift, they need to understand that pricing is changing from “buy” to “lease”, and that they should now treat compute costs in the same way they manage their electric bill or cellular cost – because that is the way of the cloud…

How to Make Web Pages Fit and Scale Nicely on Android Web Browser

2

Category : Android, CakePHP, PHP, Software development, web

I just released an Android version of my Cats Idol pet project – it lets you browse through photos of cats submitted by other people, rate the cats, and set the photos as your Android wallpaper.

One of the things I wanted to do was to provide users with the ability to upload photos straight from their phone. I decided that a web interface would be the easiest way to go at it. So, my application has a button called “Add cat” that launches the Android web browser with a URL of my server-side CakePHP-based upload HTML form.

The Problem

Then I ran in to a problem -  The HTML upload page was “zoomed out” on android, seemed like the browser did not scale the HTML properly and you needed a lot of zooming in order to work with it.

I thought this was a problem with my android code but found that it was actually a server-side issue.

After some digging, I found a solution to this issue.

The Solution

Adding these two Meta Tags in the head Tag of the HTML page solved this issue:

<meta name="HandheldFriendly" content="true" />
<meta name="viewport"
          content="width=device-width,
                 height=device-height, user-scalable=no" />


In CakePHP I added these Meta Tags to the mobile.ctp layout so it will affect all pages using the mobile layout.

Using these Meta tags fixed the way Android showed the HTML web page – The page looks zoomed-in and fits the screen very nicely:

Integrating CakePHP with Facebook Graph API

2

Category : Facebook, Open source, PHP, Wordpress

I just move my site (Cats Idol) from Drupal to CakePHP. It has definitely been a good move – in two weeks, working at night, I have gain a lot of control and flexibility I needed and did not have in Drupal.

CakePHP is an easy to use and agile development framework that provide an MVC,  a great ORM, and other useful tools for rapid application development.

But more on that in a different post..

Another major feature I needed was integration with Facebook:

  1. I wanted to use Facebook Auth and provisioning rather than t write it myself
  2. I wanted users to be able to comment and Like content on the site
  3. I wanted to publish content on users wall when they add content to Cats IdolCakePHP : the rapid development php framework

I found a very useful plugin, developed by Nick Baker, which provides this functionality and more.

So check the plugin here.

And you can see a demonstration of it in action here.

And CakePHP app integrated into Facebook here.

Thanks Nick, Great Job!

Type of Cloud-Based Offering

Category : SAAS, web

The market is now buzzing with Clouds, it seems that everywhere you go in the hi-tech industry you see cloud application, cloud conferences and cloud offerings.

I was Asked by some friends – What you get out of this  “cloud”?

In a high level, there are three types of cloud-based offering:

Software as a service (SaaS)

Sometimes referred to as “software on demand,” is software that is deployed over the internet and/or is deployed to run behind a firewall on a local area network or personal computer. With SaaS, a provider licenses an application to customers as a service on demand, through a subscription or a “pay-as-you-go” model.

Example of SAASGoogle apps, Microsoft BPOS

Platform as a service (PaaS)

The delivery of a computing platform and solution stack as a service. PaaS offerings facilitate deployment of applications without the cost and complexity of buying and managing the underlying hardware and software and provisioning hosting capabilities, providing all of the facilities required to support the complete life cycle of building and delivering web applications and services entirely available from the Internet.

Example of PAASWindows Azure

Infrastructure as a Service (IaaS)

Delivers computer infrastructure, typically a platform virtualization environment as a service. Rather than purchasing servers, software, data center space or network equipment, clients instead buy those resources as a fully outsourced service. The service is typically billed on a utility computing basis and amount of resources consumed (and therefore the cost) will typically reflect the level of activity. It is an evolution of virtual private server offerings.

Example of IAASAmazon EC2

Some of these offering could be implemented without cloud technologies. You could, for example, have a software-as-a-service hosted on a single computer in your garage, but in general these offerings are moving more and more to cloud-based infrastructure.

Ad Supported Open Source Site/Blogs – Poor Revenue Model

4

Category : Open source, Opinion

If you are reading these lines, chances are you will not click on any of my ads.

In one of my previous articles, I have explored several revenue models for open source projects. I have promised to update on ad-supported revenue model as a way to make money from open source. In this article I report back on the relatively poor revenues you get out of this channel.

I have confirmed this fact with many open source bloggers and they all provide the same feedback – Software developers in general and open source developers even more so, are not interested in clicking on advertisement.

Spacebug, for example, is a dev-blog and has some open source projects hosted in it. Spacebug.com has moderate popularity – it gets about 60k unique visits a year. The revenues I see from it is about 100-200$ a year. It covers the expenses but is nothing to write home about.

These are some possible reasons why visitors to dev-blogs do not click ads:

  • Developers are not here to shop – they are not interested in anything other than free content provided in the site.
  • Developers are so accustomed to ad-supported websites the advertisement are transparent to them.
  • Developers use ad-blockers and do not get the ads served in the first place
  • Advertises and ad networks fail to deliver interesting content that fits the developer needs

I base these reasons on my behavior as a developer who visit dev-sites and from feedbacks from other open source bloggers