What is my opinion about Knockout vs. Angular ?

My Angular.JS video is getting way more traction than I thought, with over 2K views and a lot of comments on Youtube and Facebook. One of the comments on Facebook came today was:

What is your opinion about Knockout VS Angular what is the best !! and thanks for the Good tutorial Mr Mohamed

An interesting question. There is an easy answer that is both technically and politically correct, that goes like: There is no “best”, each has pros and cons. For which one to use, “it depends”.

But I bet this is not good enough for anyone interested in the question, so, I’ll expand a bit here…

A Personal Opinion

“A personal opinion you ask, a personal opinion you get, so, treat it like one, no more”

Mohamed Meligy

Angular.JS does more than binding DOM to JS objects, like routing and enforcing code organization, and connecting to REST server APIs, etc., so, the more accurate comparison is against Durandal.JS, which uses Knockout for DOM binding, Sammy.JS for routing, Breeze.JS for REST data interaction (can be used with Angular), etc.

Knockout is old, and very mature. It was designed to be very easy to plug it into any jQuery plugin or jQuery UI widget. It was also designed to work with all browsers down to IE6. With Durandal.JS you also get the other parts that Knockout itself does not cover. If you are writing an app that depends on very complex “existing” jQuery components that you didn’t write yourself, it may be a better option.

Angular.JS is relatively new. It doesn’t feel like new when you see so many tutorials around and very enthusiast community around it, but it does feel so when you look at things like how the official UI components are in complete refactor/reorganization mode for quite a while. Mind you, they still work nicely though.

Angular.JS does not care as much about legacy browsers. The lowest they support is IE8 and only with DOM/EcmaScript5/JSON shims, and when things don’t work in IE, the whole thing fails with no particular error line to start with.

Having said that, “for me” Angular is the future. I’m not saying that KnockoutJS will die or whatever, it’ll be stupid of me to think so. Angular.JS is very functional as it is now and I used it to save us time in a current project (yes, even with IE support), and along with time and very passionate community (just like Knockout started), it’s expected to get better.

Does this answer the question?

Maybe, and maybe not. I have done quite a bit with KnockoutJS, but not much Durandal.JS, hence this should be taken with a grain of salt. There are several comparisons on the web that go into more detail. I just wanted to write my personal take here so that I can refer to it later when people ask.

Of course, like many opinions, my opinion itself may change as I learn more or as both libraries evolve more.

So, yeah, I highly encourage you. Go ahead and make your own conclusion. Needless to mention, those two libraries are not the only two in their category too ;)

My 2nd On YouTube: Chrome Website App Shortcuts

The first video I published on YouTube (on Angular.JS directives and data-binding) seemed to be going very well. This made me easily fall into the issue I avoided before, which is worrying too much about what might follow. To get that worry off me, I chose a simple topic targeting different audience, recorded and edited it in one night, and just published.

The Video

This video targets Google Chrome user. It shows a productivity tip that I heavily rely on on my daily PC usage. I have many application-like websites pinned to my taskbar, ranging from TweetDeck to Outlook 365 Web Access. In this video, I simply show how to create these icons. the video is only about 5 minutes in length.

Load any website like an application using Google Chrome

Going Forwards: Suggestions Please!

There are several things I need to work on to make these experiments more useful (and fun) for everybody. Mainly I need to get used to talking to the mic so that I don’t get that dry throat that I don’t usually have even when facing many people in my offline live events, but also, I need to find topics that YOU guys and ladies are interested in. I’ll try to stick with short videos for now, but please, if you have any idea for the next video, just let me know, and I promise to consider it seriously.

Thank you very much.

Easy Ways To Discover Feed URL of A Website / Page

All blogs and news websites provide some sort of aggregation feed, usually RSS or ATOM. This allows users to add the feed URL to their favourite aggregator and stay updated with future stuff when they come. This post shows how to get a URL to subscribe to, and how to get multiple URLs if the site provides multiple formats.

A .NET library

One easy way to do this in .NET is using the Argotic Syndication Framework library, the code will look like:

Here is what you get when you run the code against wordpress.com:


A few notes on this approach:

  • You must have realised the `Where` check in the code, the library seems to capture any `related` link in the HTMl, not just syndication links. that’s why we needed to filter them explicitly
  • Quite often when you have a main site that has different branches, you get more than one feed link, for CNN for example you get different feeds for certain site languages, for wordpress.com you got one for the site itself and another for members of the service. Arguably, this is not always what you want when you add the site to a reader kind of application
  • As expected, this code is quite slow in debug mode, takes about 1.5 seconds to run alone! In release mode (build configuration set to “Release” and so web,config)


Google API

In its simplest form, the syndication discovery is a matter of finding a `link` tag with a proper `rel` attribute (typically set to `alternative`), and a `type` attribute holding the attribute, however, in real life, at least historically, there used to be many variations of the way the discovery was implemented (read the next section for more).

One of those who managed to get right URLs for different edge cases was Google Reader. Apart from Google Reader itself, whose closing was part of the reason I wrote this post, Google allows you to use their systems to get the right syndication feed URL of a given page via simply calling a public JSONP API.

This is the structure of the `data` parameter returned by the previous call:


To learn more about this specific API, check:

To learn what’s special about JSONP requests and why jQuery needs to treat it differently, read the $.getJSON() documentation:


Background Of The Problem

Even though social media has made people depend on links shared on social media sites (by their peers, or the creators of the feed), the trend of adding a syndication feed to website is a trend that continued to increase in many product and subscription websites, especially that it’s easy to automate social media posts from the feeds after that.


As Google Reader will be retired in July, I thought for a minute about what it’d take to put some web based reader together. This was before I learned about the existing awesome alternatives like Feedly and so many others.

Then I remembered there was an application I was working on in 2007, one feature we needed and a colleague worked on was getting RSS posts from personal blogs of the site members. I remember seeing him doing all sorts of crazy Regular Expression matches of so many formats to get the URL. Turns out at least at this time different blog providers used different ways to advertise the feed URL in blog homepage markup, there were so many cases, it took my colleague several days to cover a large set of test cases from different providers that we knew our users were using.

I wanted to see whether this problem was still a thing n 2013, and tried to see what options we had, hence came this post, you know, just for fun :).

Hope some of you were interested in this too!

Some Google Chrome Hidden Gems For Developers, Power Users

Google-Chrome-64While troubleshooting some hosting company #FAIL, I got the “Access Denied” HTTP Throttling page (happens when you keep refreshing a page that returns a server error response)

In the page it tells you how to disable it by going to:

Try:chrome://net-internals/#httpThrottlingChrome Only, Open In NEW TAB


And man, that’s an entire set of handy tools for you….

Check them all yourself

Try:chrome://net-internals/ Chrome Only, Open In NEW TAB


Some 1st impression favourites:

Try:chrome://net-internals/#tests Chrome Only, Open In NEW TAB


Something new I learnt about It from there, "HTTP Strict Transport Security":

Try:chrome://net-internals/#hsts Chrome Only, Open In NEW TAB


Of course I assume most of you would know about the other nice tools for power users in general:

Try:chrome://flags (or ‘about://flags’, same)Chrome Only, Open In NEW TAB


Important Notes

To have the nicest experience with trying new stuff in Chrome, and ensure as much as possible of what’s referenced here actually work (no guarantee), I highly recommend that you use the "Developer Release" of Google Chrome. This is the most updated release (feels like weekly) that you can set as your default browser on Windows.



Also, be warned, if you want to go play with this stuff, especially the browser flags, you could harm your browsing experience or maybe anything worse. Do it on your own responsibility.

Finally, don’t be offended if you knew all of these already, this is just in case! ;)

Google Chrome Frame: Use Chrome Inside IE

Some of you who use Firefox (FF) might know about a Firefox plug-in called “IE Tab” which allows you to view a page/tab using the Internet Explorer (IE) rendering engine INSIDE Firefox (so, if some page displays better in IE, you don’t have to leave FF and go open an IE window).


Now, Google is doing something similar, but the other way around!

Google has recently released “Google Chrome Frame”, a plug-in for IE that allows you to view a page/tab using the Google Browser “Google Chrome” rendering engine INSIDE Internet Explorer.


This is interesting in two ways, first, it may decrease IE problems with crashes and such, and second, that Google maybe later will drop support for IE rendering engine in its products (like Google Mail, Reader, Video, Youtube, etc..), so that you have to use Firefox, Safari or Google Chrome (or Google chrome Frame) to use these applications.

Interesting enough, this is the case already with one of Google’s new products, called Google Wave!

They say the reason is supporting IE6!! They did much effort to get it to work with it but it didn’t. Of course the Chrome Frame plug-in is supported under IE 6, so, is supposedly solves their problem!


Google Chrome Frame Homepage:


Related News:

Google’s Plan to Kill Internet Explorer? Google Wave

Google Has A Solution For Internet Explorer: Turn It Into Chrome


Firefox IE Tab Extension:



Small Tip: Use your Google Account OpenID URL. But, What’s The URL?

Simplified (Inaccurate) Background About OpenID

Some websites allow you instead of registering and logging-in (meaning re-entering the same information you entered before in so many other sites), to enter what is called Open ID URL, which is a URL given by a another website that you already logged in and has your information (called OpenID provider).

Once you enter the URL and continue, you get redirected to the OpenID provider confirmation page whether you want to be able to login to the new website using the same login,which gets redirected back to the new website but this time as logged in user.

If your OpenID provider is a popular provider, like Yahoo or Google or so, some websites will give you a shortcut to writing the URL at login by just selecting the provider from a predefined list of providers in the login page. If your provider is not in the list, or the website does not offer any shortcut list at all, you should be able to know your OpenID URL to enter same as you know your User ID or so.

Google and OpenID

The first relation between Google and OpenID started with Blogger. It first accepted logging in to write comments on Blogger using OpenID, and had Blogger itself become an OpenID provider (you enter your blog URL as your OpenID URL). Why Google did this to Blogger accounts only not all Google Accounts (used for Gmail, etc..)? I don’t know. I think this is because Blogger accounts were not yet merged with Google Accounts at this time.

Later Google as a whole became an OpenID provider for all Google Accounts (AKA Gmail Logins), with different OpenID URL. This means if you have Blogger account, you have two different OpenID URLs offered by Google each maps to DIFFERENT LOGIN. Again, maybe because of backward compatibility or whatsoever.

If your real blog is not on blogger, and you use your Gmail account primarily, you may want to use the Google Accounts Open ID URL as your OpenID login to all websites that support logging in with OpenID, but, unlike the easiness of remembering a Blogger blog URL, the Google Accounts Open ID URL is a bit ugly and you might not know about it.

Well, here is the Google Accounts Open ID URL (yeah, the entire blog post is about this single line):


Note: You do NOT replace the part “ID” with your Google Account user-name/email. The OpenID URL is “AS IS” above whatever the Google Account ID is..


Have fun!


How to Change Your Firefox Search Provider to Microsoft Bing

  1. Go to https://addons.mozilla.org/en-US/firefox/addon/10434 ( Update: This is the only official provider made by Microsoft itself)
    This is the URL I originally posted (from which the below screenshots come): https://addons.mozilla.org/en-US/firefox/addon/12205 – Of course you are recommended to go to the official URL above.
  2. Check “Let me install this experimental add-on” and click “Add to FireFox”
    Now the add-in is there.
  3. In the search bar, click the little triangle at the left and choose Bing.
  4. In your browser it may not the first item nor bold as in the pic here. Click “Manage Search Engines…”.
  5. Click “Move Up” to have it the first item
  6. If you have Google Toolbar, you need to check more settings:
  1. Go to Google Settings. In the “Layout” tab, make sure to choose “Classic Toolbar Layout”. Save that.
    image image
  2. In Firefox address bar, type:
    without “http://” or anything, and click the button that appears then.
  3. In the “Filter” field type: “browser.search.defaultenginename”
  4. Double click the only result that will show, you get a message box where you should  enter text. Replace the existing text “Google” with “Bing” instead, and click OK.
  5. Close the window. Your default provider is set.

Have fun :-)


Quick Hint: www.bing.com is Live (Microsoft New Search/Decision Engine)

If you are not on Twitter, let me spread this by @bing:

Ladies and Gentlemen, www.bing.com is live. :) (rollouts will continue however to partners and other mkts, more to come) ^betsy

Bing, if you don’t know, is Microsoft’s new search engine, also known as “Decision Engine” since it has features that help answer what you are wondering about rather than just display links.

For those wondering about Live Search. I think I read somewhere that both search engines will remain there for a while, then Live will be brought out to Bing. Nothing to confirm yet though. In Bing homepage you read “Live Search is Evolving. Welcome to Bing”.


For quick video of what Bing can give to you, check this.

For an official introduction about what Bing is, check this.