About Me

My photo
PhD Candidate at Purdue University, Computer Science.

Monday, February 19, 2007

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 tags.id, tags.name, 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 taggings.taggable_id=posts.id"
query << " group by tag_id)AS t1 ON t1.tag_id=tags.id"
query << " order by #{options[:order]}" if options[:order] != nil
query << " limit #{options[:limit]}" if options[:limit] != nil
tags = Tag.find_by_sql(query)
end

Following the link, everything should be working well now.

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

Tuesday, February 13, 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: Epinion.com 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 Match.com was started. The "social software" was called "viral market".

Friday, February 09, 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 reasons 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.

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.


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)

4-Knowing About Business.

Client-side:
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.

Tools-prespective:
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.

5-Listening

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.


6-Flexibility

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 behaviours.

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.


Saturday, February 03, 2007

دع الأيـــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــام

دَعِ الأَيَّـامَ تَفْعَـلُ مَا تَشَـاءُ
وَطِبْ نَفْساً إِذَا حَكَمَ القَضَـاءُ
وَلا تَـجْزَعْ لِحَـادِثَةِ اللَّيَالِـي
فَمَا لِحَـوَادِثِ الدُّنْيَـا بَقَـاءُ
وَكُنْ رَجُلاً عَلَى الأَهْوَالِ جَلْداً
وَشِيمَتُـكَ السَّمَاحَةُ وَالوَفَـاءُ
وَإِنْ كَثُرَتْ عُيُوبُكَ فِي البَـرَايَا
وَسَرّكَ أَنْ يَكُـونَ لَهَا غِطَـاءُ
تَسَتَّرْ بِالسَّخَـاءِ فَكُلُّ عَيْـبٍ
يُغَطِّيـهِ كَمَا قِيـلَ السَّخَـاءُ
وَلا تُـرِ لِلأَعَـادِي قَـطُّ ذُلاً
فَإِنَّ شَـمَاتَةَ الأَعْـدَاءِ بَـلاءُ
وَلا تَرْجُ السَّمَاحَةَ مِنْ بَـخِيلٍ
فَمَا فِي النَّـارِ لِلظَّمْـآنِ مَـاءُ
وَرِزْقُـكَ لَيْسَ يُنْقِصُهُ التَأَنِّـي
وَلَيْسَ يَـزِيدُ فِي الرِّزْقِ العَنَـاءُ
وَلا حُـزْنٌ يَدُومُ وَلا سُـرُورٌ
وَلا بُـؤْسٌ عَلَيْكَ وَلا رَخَـاءُ
إِذَا مَا كُنْـتَ ذَا قَلْبٍ قَنُـوعٍ
فَأَنْـتَ وَمَالِكُ الدُّنْيَا سَـوَاءُ
وَمَنْ نَزَلَـتْ بِسَـاحَتِهِ المَنَـايَا
فَـلا أَرْضٌ تَقِيـهِ وَلا سَـمَاءُ
وَأَرْضُ اللهِ وَاسِـعَـةٌ وَلكِـنْ
إِذَا نَزَلَ القَضَـا ضَاقَ الفَضَـاءُ
دَعِ الأَيَّـامَ تَغْـدِرُ كُلَّ حِيـنٍ
فَمَا يُغْنِـي عَنِ المَوْتِ الـدَّوَاءُ

Friday, February 02, 2007

Donormyl


Still fighting to sleep :(
2day i took "Donormyl"which contains Doxylamine succinate which is an antihistamine of the ethanolamine class which has a high incidence of sedation.
My sister recommended it for me. it is supposed that it reduces the time taken to fall asleep & improve the duration & quality of sleep.

i hope it makes a good effect to make me sleep.

Monday, January 29, 2007

Sleepless in Alexandria

It was week...i don't sleep more than couple of hours per day.

I feel my head is going to explode. I tried to sleep late at night, at the morning and the afternoon. and everythg was useless till now.

i need to sleep but i can't, I will have a busy week :(

Wednesday, January 24, 2007

Zimbra Review


I had the chance to work on the open source edition of zimbra collaboration suite (ZCS). It was planned to deploy that mail server as part of a fully integrated system containing CRM and Workflow. the three major components should be integrated together to automate all the business intelligence these company's needs.
well, it was logic to start by searching for Zimbra reviews. Unfortunately, all the reviews at that time were functional reviews. I have to confess that i was impressed by its functionalities and specially the "Zimlets". I also started to check the forum and I found it promising. After working on zimbra; I really have to say that I appreciate their forums very much, guys are really helpful on this forum .
I will focus on usability and not functionality.
so, I took the responsibility of deploying and supporting the ZCS.
talking about interface: when I get an eye on the zimbra interface, i felt that I am opening a desktop application. mmm, I forgot to say that opening the zimbra client for the first time is a miserable situation. it was a bad experiment for me. opening the browser for more than 60 secs waiting to see login screen is a terrible thing for user satisfaction.
well, to be honest, the client interface is not only slow for the first time; but actually the peak is on the first opening time. my client was complaining that they get very slow response till they get the login screen. now, let's talk about the browser you can use with ZCS.
IE 5,6,7 were terrible. i found it very bad to enforce the client to change his browser in order to prevent the terrible message appearing with IE with the client interface.
Briefly, if u aim to use ZCS forget the Internet Explorer.
the "Internet Explorer" becomes "Internet Explosion" .

The firefox is much better, it is better in performance than IE but still terrible comparing with gmail for example.
I didn't try opera nor Mozilla on zimbra, i was depressed enough at that time.
as a user, i find the selection is not friendly at all. Majority interfaces use check boxes. in order to apply an action on a selected message i had to be very fast, because after some while the selection is lost!!!
also, there is no progress bar; i click and find nthg changing (due to response time, or the selection problem i pointed to before) so wt i was doing is keeping clicking:S

the administration interface is not reliable at all. sometimes it doesn't refresh the server status. also there was deleted domain, but it remains within the domains list for sometime, which made me confused.

the stability wasn't better than the interface. i faced a lot of problems with stability, users had many problems with accessing their messages, or logging in. well, i don't want to get deeper in technical details and how they could be solved. at the end i had to made some batches to solve the problems happening frequently with users.
I tried to search in the HW configuration but i didn't get anythg. the memory had never reached 100% of usage.
maybe later i will post about these monitoring results.

Tuesday, January 23, 2007

Back to Blog

It has been 5 months since I quit blogging.

I think that I need to be back.