Monday, February 26, 2007

Code that changes the world

Today we talk about the code each developer of us would dream of writing, it is the code that changes the whole world. Yes, we are to write code that affects the whole world around us, making the world no longer the same. Just before getting into the details, can you just give it some time of pure thinking, Zen or do whatever you do to concentrate and give it your best shot...

To be continued.


Web Content Accessibility Guidelines (WCAG) are part of a series of Web accessibility guidelines published by the W3C's Web Accessibility Initiative (WAI). They consist of a set of guidelines on making content accessible, primarily for disabled users, but also for all user agents, including highly limited devices, such as mobile phones.

Web "content" generally refers to the information in a Web page or Web application, including text, images, forms, sounds, and such. More specific definitions are available in the WCAG documents.

WCAG technical documents are developed by the Web Content Accessibility Guidelines Working Group (WCAG WG), which is part of the World Wide Web Consortium (W3C) Web Accessibility Initiative (WAI). Other accessibility guidelines include the Authoring Tool Accessibility Guidelines (ATAG) and the User Agent Accessibility Guidelines (UAAG).

The WCAG are intended for all Web content developers (page authors and site designers) and for developers of authoring tools. Following them will make Web content more available to all users, whatever user agent they are using (desktop browser, voice browser, mobile phone, etc.) or constraints they may be operating under (noisy surroundings, hands-free environment, etc.). These guidelines do not discourage content developers from using images, video, etc., but rather explain how to make multimedia content more accessible to a wide audience.

There are currently two versions of the WCAG. WCAG 1, contains 14 main guidelines with a total of 65 in all. WCAG 2, has reorganized and combined many of the WCAG 1 guidelines to create 21 new ones.

Each guideline has a one or more ‘checkpoints’ which developers should consider to ensure the accessibility of a Web page. Each checkpoint has a priority level based on its impact on Web accessibility. The WCAG provides a number of examples and techniques to help Web developers to implement the guidelines.

WCAG Priority Levels

Each checkpoint has a priority level assigned by the Working Group based on the checkpoint's impact on accessibility:

[Priority 1]
A Web content developer must satisfy this checkpoint. Otherwise, one or more groups will find it impossible to access information in the document. Satisfying this checkpoint is a basic requirement for some groups to be able to use Web documents.

[Priority 2]
A Web content developer should satisfy this checkpoint. Otherwise, one or more groups will find it difficult to access information in the document. Satisfying this checkpoint will remove significant barriers to accessing Web documents.

[Priority 3]
A Web content developer may address this checkpoint. Otherwise, one or more groups will find it somewhat difficult to access information in the document. Satisfying this checkpoint will improve access to Web documents.

WCAG Conformance

The WCAG guidelines have three levels of conformance:

Conformance Level "A": all Priority 1 checkpoints are satisfied. This is known as 'WCAG A' compliant.

Conformance Level "Double-A": all Priority 1 and 2 checkpoints are satisfied. This is known as 'WCAG AA' compliant.

Conformance Level "Triple-A": all Priority 1, 2, and 3 checkpoints are satisfied. This is known as 'WCAG AAA' compliant.

Note that conformance levels are even spelled out in text so they may be understood when rendered to speech.

In the following posts, insha Allah, we will go through the main guidelines of different versions of the WCAG.

Sunday, February 25, 2007


I have been introduced to rails for about 30 days ago. I really don't spend much time on developing my coding skills. I almost know nothing about the ruby syntax, I took the shortest way and dig into my tasks.
Many people think that the best way is "do it yourself"; don't spend much time on reading tutorials, couple of days are enough and then release your skills to go further. me too, I believe in this. But I think also, that you have a good view to know when to stop digging.
It's true that i did good progress in my programming tasks, but i still find that this is not enough. I believe it's time to make some readings to enlarge my dictionary.

Hunting the best opportunity to do so is the most important part. It's not a silly H.W you do to raise your salary. It's the willingness of tasting some craft.
We were working on a small forum, when it comes to define a forum/thread to be closed, blocked, forbidden..bla, bla...whatever anybody calls these restricted access issues.
Yeah, it's simple. A tiny flag in some few minutes will solve the whole story...."NOW Let's move to another real task".
I started to think for something different. Why we don't just add some craft to this part; although it doesn't deserve all that panic.

My proposed solution to go for using a rails plugin. I know I may look silly, but Just I felt that I need to make more interaction with plugin.
I made a quick lookup for the available plugins, it was difficult at the beginning as I was looking for something without knowing what it can be called. Finally, I found the acts_as_enumerated plugin, it should be the one. I succesfully installed it, at the end it didn't work with me ( I may be missing something) but i decided not to give aq second try for now. I thought it doesn't satisfy my design. Instead i started to think of something which should like this:
Did I make something wrong here? It seems no sense to make a relation of many-to-many. Why could any forum have more than one state!!!
Well, I made this on purpose. What if we want in the future to expand our feature to be supported on the user-level. I mean, we may want to support (for example) "block option" for a forum on the user-level. In this case the forum will have more than one state depending on the user. We will need to add to the staging-table a new column carrying the user_id. Let's keep it simple for now, this is my first plugin, I don't want to get stuck.

Steps to create a plugin:
Note: the following steps are provided as guidance to create plugins.

1. In your project directory run the following command.

$ruby script/generate plugin acts_as_statable
create vendor/plugins/acts_as_statable/lib
create vendor/plugins/acts_as_statable/tasks
create vendor/plugins/acts_as_statable/test
create vendor/plugins/acts_as_statable/README
create vendor/plugins/acts_as_statable/Rakefile
create vendor/plugins/acts_as_statable/init.rb
create vendor/plugins/acts_as_statable/install.rb
create vendor/plugins/acts_as_statable/uninstall.rb
create vendor/plugins/acts_as_statable/lib/acts_as_statable.rb
create vendor/plugins/acts_as_statable/tasks/acts_as_statable_tasks.rake
create vendor/plugins/acts_as_statable/test/acts_as_statable_test.rb

2. Edit "vendor/plugins/acts_as_statable/init.rb" to look like this

require 'acts_as_statable'
ActiveRecord::Base.send(:include, ActiveRecord::Acts::Statable)
require File.dirname(__FILE__) + '/lib/stating'
require File.dirname(__FILE__) + '/lib/state'

3. your real work will be in this file "vendor/plugins/acts_as_statable/lib/acts_as_statable.rb"
you will need to define your methods just right here

module ActiveRecord
module Acts
module statable

4. create the new classes stating and state

class Stating < ActiveRecord::Base
belongs_to :state
belongs_to :statable, polymorphic =>true

class State < ActiveRecord::Base
has_many : statings

Wednesday, February 21, 2007

Two hours with Oracle

I attended the Oracle technology day. "Join Us for an Oracle Technology Day Highlighting Successful Implementations of Grid Computing".
The title seems very interesting; and the most interesting is that it was in Hilton green plaza, Alex. I decided to go and attend, it is a good chance, I thought so.

The seminar didn't introduce something new, it was based on the Oracle10g. Oh yes, "g" stands for "Grid". It didn't meet my expectations at all.
I couldn't stand for more than two sessions. the seminar was behind schedule by more than 45 minutes at the moment I left!!

The first session included an example with Amazon, it was the best part of the seminar probably. The problem facing Amazon is that they have machines:
  • Order entries: it easy to expect that these machines got the peak load in December.
  • Financial: dedicated for reporting and statistics. these machines will face the peak load in January to extract the reports needed to put the plan for the next year...etc
Enterprise grid computing model for IT

Anyway, although oracle10g is the most scalable database, it is still lacking when it comes to time and usability concerns.
Number of steps and time in oracle10g is almost 2x or more than DB2, and SqlServer.
There are a lot of improvement comparing to 8i, for example Enterprise Manager can be accessed through Browser and PDA clients.

I will appreciate if they enhance the usability before releasing the next release. I can't think of getting Oracle and wasting more than double my time, and hiring a DBA with a big salary .
For now, Oracle is forbidden for me.

Tuesday, February 20, 2007

Web Accessibility

Reference to my last post, Web Standards Movement, Web Accessibility is a very important issue behind the Web standards: not only does it mean allowing the Web to be fully used by people with disabilities, it also means allowing people with unconventional browsers to have access to any web page.

The DDA (Disability Discrimination Act) states that service providers must not discriminate against disabled people. A web site is regarded as a service and therefore falls under this law, and as such must be made accessible to everyone.

Accessibility involves two key issues: first, how users with disabilities access electronic information, and second, how web content designers and developers enable web pages to function with assistive devices used by individuals with disabilities.

For the user with a disability, the challenge is to identify tools that provide the most convenient access to web-based and other electronic information. For the web content designer/developer, the challenge is to remove the obstacles that prevent accessibility tools from functioning effectively. In many cases, these challenges are relatively simple to overcome, but sometimes the solutions require some additional thought and effort.

Yes.. Accessibility Has Standards

Accessibility standards help designers and developers of web content identify and address accessibility issues.

The Web Content Accessibility Guidelines (WCAG) from the W3C represented the first major effort to establish guidelines for accessible design. This standard consists of 14 guidelines, each with three checkpoint levels for web developers to meet: Priority One, Priority Two, and Priority Three.

In individual countries, national standards emerged later. Section 508 of the Federal Rehabilitation Act in the United States is based on WCAG Priority One checkpoints. These same checkpoints serve as the basis for standards in Australia, France, Germany, and many other countries. The Common Look and Feel standard in Canada and Guidelines for U.K. Government Web Sites in the United Kingdom are based on Priorities One and Two of the WCAG.

The World Wide Web Consortium (W3C)'s Web Accessibility Initiative (WAI) is an effort to improve the accessibility of the World Wide Web (WWW or Web) for people using a wide range of user agent devices, not just standard web browsers. This is especially important for people with physical disabilities which require such devices to access the Web.

Monday, February 19, 2007

Web Standards Movement

Back in early '96, the Web was no more than a long list of text documents linked together by "a" tags, displaying an occasional image from time to time. In those days, there wasn't much of a need for standardization as we mean it today.

Nowadays, in this period of tremendous growth, the Web needs a guidance to realize its full potential. Web standards are this guidance. These standards help ensure that everyone has access to the information we are providing, and also make web development faster and more enjoyable.

Web standards are technologies, established by the World Wide Web Consortium (W3C) and other standards bodies, that are used to create and interpret Web-based content. These technologies are designed to future-proof documents published on the Web and to make those documents accessible to as many as possible.

Currently, most of the standards have been officially implemented by the W3C. One standard, however, originated at another organization, called ECMA.

The European Computer Manufacturers Association (ECMA) is an organization officially founded in 1961 in order to meet the need for standardizing computer operational formats, including programming languages and input/output codes. In 1994, the organization’s name was changed to the ECMA - European Association for Standardizing Information and Communication Systems, in order to reflect its broader range of activities.

W3C Standards


Hyper Text Markup Language (HTML) is widely used on the Web for adding structure to text documents. Browsers interpret these documents, representing the structure in media-specific ways to the user.


Extensible Markup Language (XML) is a markup language like HTML, but instead of having a single, fixed set of elements, it allows you to define your own - or use a set made by someone else.


XHTML is a reformulation of HTML as an XML application. XHTML 1.0 can be seen as ideologically coming from HTML 4.01, and being technically stricter because of XML’s influence.


Cascading Style Sheets (CSS) is a mechanism for changing the appearance of HTML or XML elements, by assigning styles to element types, self-defined classes of elements or individual instances.


The Document Object Model (DOM) allows the full power and interactivity of a scripting language, such as JavaScript, to be exerted on a web page. In programming terms, the DOM is an Application Programming Interface (API) for interacting with web pages.

ECMA Standards


ECMAScript is a standardized object-based scripting language, based largely on Netscape’s JavaScript. The main use of ECMAScript is to manipulate the objects in web pages which are specified by the DOM. This lets web developers implement such effects as animated text, graphic roll-overs, and pages that change based on user input without having to be reloaded.

Why should you care?
  • The structural information present in compliant documents makes it easy for search engines to access and evaluate the information in those documents, and they get indexed more accurately.
  • Standards are written so that old browsers will still understand the basic structure of your documents. Even if they can’t understand the newest and coolest additions to the standards, they’ll be able to display the content of your site.
  • Compliant documents can easily be converted to other formats, such as databases or Word documents. This allows for more versatile use of the information within documents on the World Wide Web, and simplified migration to new systems - hardware as well as software - including devices such as TVs and PDAs.
  • Accessibility to a wide audience is guaranteed. Web pages are accessible by people using browsers other than the usual ones - including voice browsers, Braille browsers, hand-held browsers, teletext displays, and other unusual output devices.
  • Web standards offer a set of rules that every Web developer can follow, understand, and become familiar with. When one developer designs a site to the standards, another will be able to pick up where the former left off.
As you see, using web standards will let you build websites in a way that saves time and money for the developer and provides a better experience for the visitor. More information is available at the W3C and the Web Standards Project.

Acts_as_Taggable Tag Cloud

I am using the Acts_AS_Taggable plugin in one of my applications. the application is a forum where users can add tags to any thread.
The forum includes a set of forums which in turn include a set of threads.
When a user displays the forum/show.. he should see a tag cloud involving all the tags attached to the threads in this forum.
I found this link describing the code for the tag cloud; but it doesn't satisfy my need as it can be used only on the threads level.
I should confess that the performance was not my concern this time.
in the vendor/plugins/acts_as_taggable/lib/tag.rb file I added this code:

def self.tags(options = {})
query = " select,, t1.count"
query << " from tags INNER JOIN"
query << " (select tag_id , count(*) as count FROM taggings, posts "
query << " where"
query << " posts.forum_id=#{options[:forum]} and "if options[:forum] != nil
query << " taggings.taggable_type='Post' and"
query << " group by tag_id)AS t1 ON"
query << " order by #{options[:order]}" if options[:order] != nil
query << " limit #{options[:limit]}" if options[:limit] != nil
tags = Tag.find_by_sql(query)

Following the link, everything should be working well now.

OOPS...Don't forget to restart the server!!!

Wednesday, February 14, 2007

Web Roots

Reading About REST applications....It is not something new introduced recently. It's not an innovation, it's an old trend, old standard , it's not Web2.0.
I found this article very good. It seems that there are some characteristics which did not get the deserved attention. What is really great, is that Web2.0 represents a return to the essential principles that guided the Web.
  1. Open Source: Yahoo was built on the foundation of open-source operating system(BSD Unix) and open-source language(Perl). The core of the Web was (NCSA Mosaic browser, NCSA and CERN HTTP Servers)
  2. Collaboration: Tim Berners Lee inventor of the World Wide Web and the leader of DIG put an original design for the Web to enable researchers to collaborate.
  3. Simplicity: we can find a lot of web2.0 products very elegant, simple, and focusing on only one single point; "make a single focus and do it well". This isn't an innovation. the RocketMail was one of the first major free webmail services, and it was focusing just on "e-mail".
  4. Architecture of participation: is a review site that was established in 1999. we can see now the success story of Amazon and eBay
  5. Lightweight programming model: many of the Web1.0 generation were built using scripting languages (example: Perl used in yahoo). Large companies used widely the complex web services stack and forgot the REST which was originated in 2000. (Amazon provides the web services in both forms SOAP and REST)
  6. Social Software: in 1994 was started. The "social software" was called "viral market".

Saturday, February 10, 2007

Catching the "A"-Team

"I am a geek, I am friendly, I am a designer, I am strict, I am a business guy..Woow, I should be in the company's "A"-team!!"

If you really think that a company can have different classes of teams, then you are totally wrong. We can prove this by contradiction :)
Let's assume that a client calls for your service; a team will be assigned to provide the client for his needs. If he is lucky, he will get the "A"-team and get what he really expected; otherwise, of course he will be unlucky. When you claim that your company possesses a "A"-team, the later unlucky client will smash your head "Where the hell was that team when my project was under construction?".
On average, your company has not an "A"-team, customers will certainly turnover.

So, we agree that the dilemma is not individual; it's a team work by the end.

Now, you can start to ask yourself about your chances to catch the world's "A"-team.

6 Great Factors to catch it

1-Possessing Positive Attraction:

We are all influenced by the "Law of Attraction". Everyone has his own impact on his environment. You should increase your positive impact. Are you trying to deal positively with events which you observe around you? Or you just complain your bad luck and the lack of resources?

You should also have the ability to reject negative thoughts from people surrounding you and substitute it by your own positive ones. Know that what anyone or any source offers you; it is only one view, one description or interpretation of an event or truth. It is only one perspective of an interpretation gained from other third parties who in turn focuses on the topic and did not experience the subject first hand.

Positive attraction will help you more for the team spirit, you will think for the best of the team on the long run. your colleagues will be inspired by your attraction. You will be a good team player who has a positive effect on his environment.
the Secret is a very good movie indicating the effect of positive attitude on your life.

2-Building Trusts

Why trust is important?
" If you don't have trust, people won’t cooperate, won’t be committed, and won’t know where they stand.”

In The 7 Habits of Highly Effective People, Stephen Covey talks about an “emotional bank account”which is the reserves of trust that we build up in our relationships with people. T
he bank account becomes full when there is a lot of trust between people. You feel safe, committed, and comfortable with the other person. Trust is what makes us feel understood. It’s what makes work groups get along. It’s what makes us believe in people, organizations, and causes. Trust is the thing that makes us commit and stay committed, despite problems and misunderstandings.

Gaining trust:
Before searching for trust you must trust yourself.

  • Be reliable and available. Try always to be available when the client wants to talk directly to the people working on his project whenever he wants. Don't let him feel that he has to send 100 emails and 100 phone calls to make you appear online.
  • Keep your promises and follow through with commitments
  • Forgive and move on
  • Don't be threatened by people who are different from you
  • Tell the truth
  • Communicate openly and honestly

Be aware that Trust is bidirectional relation. You should evaluate how much trusting you are in order to make a successful trust construction.

Check plenty of resources about building trusts here.

3-Self Motivated.

Why anybody needs self-motivation?

Because if you want to improve your self esteem or improve yourself in any way at all you first need the inner desire and will to do it. Of course, anybody may be motivated by external factors, others may encourage you to start something new or begin moving in a positive direction.

But you cannot always rely on others to encourage you. To take up a new activity, hobby or challenge. The self-motivation is the way to "Initiative", without motivation you can't take any initiative on any level.

Increase your self-motivation

  • Focus on what you really enjoy doing. Think about giving it priority to start doing what you love doing.
  • Always keep a list of things you'd like to improve on and how you're going to do it.
  • from time to time, try to totally forget all the negatives you have faced and review all the success in your life.
  • Contact positive people.
  • Give your soul a break to read some good books.(NLP, How To increase your energy, Getting things done, Motivated Mind, How to Raise your Self Esteem, Self Help Stuff that Works..etc)
You can find recommended books here

4-Knowing About Business.

Keep in mind the budgetary and time constraints that the client faces. This will help you define the customer goals and priorities in concrete terms. Further, it will help you to deliver a robust business solution through usable deliveries.

Constitute a cross-industry perspective of the technologies you can consider in developing. You should keep some kind of aim at the different technology trends. Your attention should be varying significantly across industries. This can be done based on continuous data entries for the "benefit Vs mainstream-adoption" (can be called "Priority Matrix") for each technology such as Web 2.0, Ajax, Grid Computing, RFID, DNA Logic, Social Network Analysis, wikis..etc

The end result should be awareness (or at least prediction) of the following regarding each technology:

  • Prevalence: How prevalent is it in the current crop ventures.
  • Essential: does this characteristic stem from expediency or is it a core part of competitive advantage, Newness, Longevity.
  • Newness: Is this characteristic really new, or just rediscovered or relabeled.
  • Longevity: Will this last during the next five years.
A characteristic can be:
  • User: content, metadata, usability,
  • Open: open SRC product, public API, open process, open source platform,
  • Lightweight: Ajax, REST, Scripting Languages,
  • decentralized: RSS/Content, Code, Development,
  • Still Missing: Security, Transactions, Durability, Global Audience, Mobile.


You start a project by learning and listening. The result will be a clear plan that ensures results for you and a great experience for your customers.
Listen is another aspect to the "trust", it is an important key on the building trust journey.
You should know how much you like to involve others and seek their opinions when working on a project.
  • When you are talking with someone face to face, don’t answer the phone, check e-mail, or sort the papers on your desk.
  • Make time to talk one on one with your spouse or partner.
  • Be a patient listener. Not everyone thinks or speaks as fast as you do.
  • Avoid putting words in people's mouths.


Referring to the IEEE, flexibility is the ease with which a system or component can be modified for use in applications or environments other than those for which it was specifically designed. Yess that's right, imagine that you are the system or the component. So, we mainly mean your flexibility to switch between different methodologies and dealing with new concepts and technologies.

"There is nothing permanent except change"; said Heraclitus. That has been true throughout the history, but it is especially true in our exciting and ever-changing field. You should value the "Responding to change" and may be "search for it".

After evaluating yourself, do the NLP H.W to change behaviors.

First step is to stand outside the 'creative state' and think of a time when you were acting creatively according to your own standards. You should refresh everything you saw, heard and felt while reliving that experience.

After you have created 'creative' states follow these steps:
  1. Stand in the state that represents 'behavior' and think of a behavior that you would like to change. Make sure that you already have a representation of the behavior in one of the three senses.
  2. Move to the 'intent' state, and then ask the question, 'What is the intent, of the behavior?'. Once you get a sense of the intent for the behavior move into the 'creative state'.
  3. Ask yourself 'how else can I fulfill the intent for the behavior?'. When you get plenty of alternatives behaviors you can go back to the state for 'intent'.
  4. Review the alternatives and select the best three options. Step back into the state for 'behavior'.
  5. Test out each of the three options one at a time by imagining using each new behaviour in the original situation. Check if there are any objections to any of the selected options. If so, step back into the state for 'intent' and repeat the entire process, until all objections are satisfied.

Monday, February 5, 2007

A Fishy Thought . . .

Actually, It is my first time to blog. I think maybe I have never had enough time to blog, but I intended to cross that barrier and here I am. So, I decided to share that experience. Once Samer published the announcement, "Here is your chance", I told myself, and so I clicked the link and started to join our blog.

It was then when the blog asked for the email and password, when my hacker spirit got aroused and remembered the phishing technique at once. "The barrier is back, again"; No offense Samer, but I thought you maybe phishing us :)

"Even if it was a phishing operation, I won't let is stop me", and so I created a new G-mail account just for blogging. But what is phishing in the first place, The term phishing is a variant of fishing, probably influenced by phreaking and alludes to the use of increasingly sophisticated lures to "fish" for users' financial information and passwords.

Phishers usually duplicate the login forms of the attacked sites, but they change the address to which login info is posted to another address where they extract those info and then redirect the user back to the normal site in order to hide from the victim that he has been freaked. But how would the victim reach the fake site from the first place, this is done by socially manipulating the victim for example via a fake email inviting him to test the new service features but unfortunately he has to login once from the following link.

Another idea of phishing maybe through blog invitations just like Samer did :P. Kidding with no offense Samer. But what about the blog spot that can collects a lot of email addresses with passwords... "I think I should destroy that barrier and investigate that topic more"