Skip to content


How to Win Friends and Influence People

I just realized that Dale Carnegie’s principles are less than 140 characters each ;) So – here they are in bite size. [retweet URLs reference the wiki article]

And here they are in YAML

Fundamental Techniques in Handling People

  1. Retweet Don’t criticize, condemn, or complain.
  2. Retweet Give honest and sincere appreciation.
  3. Retweet Arouse in the other person an eager want.

Six Ways to Make People Like You

  1. Retweet Become genuinely interested in other people.
  2. Retweet Smile.
  3. Retweet Remember that a man’s Name is to him the sweetest and most important sound in any language.
  4. Retweet Be a good listener. Encourage others to talk about themselves.
  5. Retweet Talk in the terms of the other man’s interest.
  6. Retweet Make the other person feel important and do it sincerely.

Twelve Ways to Win People to Your Way of Thinking

  1. Retweet Avoid arguments.
  2. Retweet Show respect for the other person’s opinions. Never tell someone they are wrong.
  3. Retweet If you’re wrong, admit it quickly and emphatically.
  4. Retweet Begin in a friendly way.
  5. Retweet Start with questions the other person will answer yes to.
  6. Retweet Let the other person do the talking.
  7. Retweet Let the other person feel the idea is his/hers.
  8. Retweet Try honestly to see things from the other person’s point of view.
  9. Retweet Sympathize with the other person.
  10. Retweet Appeal to noble motives.
  11. Retweet Dramatize your ideas.
  12. Retweet Throw down a challenge & don’t talk negative when the person is absent, talk about only positive.

Be a Leader: How to Change People Without Giving Offense or Arousing Resentment

  1. Retweet Begin with praise and honest appreciation.
  2. Retweet Call attention to other people’s mistakes indirectly.
  3. Retweet Talk about your own mistakes first.
  4. Retweet Ask questions instead of directly giving orders.
  5. Retweet Let the other person save face.
  6. Retweet Praise every improvement.
  7. Retweet Give them a fine reputation to live up to.
  8. Retweet Encourage them by making their faults seem easy to correct.
  9. Retweet Make the other person happy about doing what you suggest.

Posted in General, Professional.

The Peoplenet

Now, it’s becoming even more vivid. The Internet has grown beyond its abstract boundaries and further into reality.

Iran election has started as may be yet another election, peaceful and hopeful. For all parties. With the spread of voter fraud allegations, and suspicions over the way and speed by which the votes were counted, Iranian masses started to mobilize.

Twitter (the platform, not the application as mistakenly analyzed) became the favored topic-centric communication tool (#IranElection, Tehran messages) [twitter postponed maintenance in response to usage]. YouTube helped promote videos of mass protests. Flickr hosted numerous images. Meta-applications like TwitPic and news portals like BBC, have carried varied media propagating information much further. Reddit and other on-demand news aggregators enrolled worldwide symphathizers and activists.

I’m reading now about a twitter campaign encouraging people to change their location on their twitter profile in an effort to cripple down location-based filtering (not sure if it’s not a double-edged sword).
Update:
“Senior officials say the [US] State Department is working with Twitter and other social networking sites to ensure Iranians are able to continue to communicate to each other and the outside world.” (via CNN)

Even further, a widespread campaign coordinating a DDoS attacks against .ir government websites out of casual web users. Wired is now saying that this might provoke the Iranian regieme into a reverse Cyber attack (Dr. Strangelove anyone?).

I’m not taking sides in this elections (yet?). I know for fact it’s hard to track down reality in the middle east, and I can’t rule out herd-mentality in this case.

Nonetheless, I’m fascinated with how the Internet has grown in the past years to have such influence on people’s lives. An influence that shouldn’t be taken lightly.

Will we be one day able to coordinate election monitoring over the Internet out of Mom and Pop teams? Will we have expats volunteering to watchdog government activities?

Ladies and gentlmen, welcome to the age of the Peoplenet.

Posted in General, Professional, Web.

Multiple has_many_polymorphs in one model

I’m trying to define multiple polymorphic relations (`has_many_polymorphs plugin`) from a single parent to same children.

Note has many viewers
Note has many editors
Viewers could be either Users or Groups
Editors could be either Users or Groups
Permission is the association model with `note_id`, `viewer_id`, `viewer_type`, `editor_id`, `editor_type` fields

Everything works out as expect as long as I have only one has_many_polymorphs relation defined in Note model


class User < ActiveRecord::Base; end

class Group < ActiveRecord::Base; end

class Note < ActiveRecord::Base
has_many_polymorphs :viewers, :through => :permissions, :from => [:users, :groups]
end

class Permission < ActiveRecord::Base
belongs_to :note
belongs_to :viewer, :polymorphic => true
end

Note.first.viewers << User.first # =>  [#<User id: 1, ....>]
Note.first.viewers << Group.first # =>  [#<User id: 1, ....>, #<Group ...>]
Note.first.viewers.first # => #<User ....>
Note.first.viewers.second # => #<Group ....>

Now, problems start to appear when I add the second relation


class Note < ActiveRecord::Base
has_many_polymorphs :viewers, :through => :permissions, :from => [:users, :groups]
has_many_polymorphs :editors, :through => :permissions, :from => [:users, :groups]
end

class Permission < ActiveRecord::Base
belongs_to :note
belongs_to :viewer, :polymorphic => true
belongs_to :editor, :polymorphic => true
end

Note.first.viewers << User.first # => [#<User id: ....>]

# >>>>>>>>

Note.first.editors << User.first

NoMethodError: You have a nil object when you didn't expect it!
The error occurred while evaluating nil.constantize
... vendor/plugins/has_many_polymorphs/lib/has_many_polymorphs/base.rb:18:in `instantiate'


—-

I’ve tried refining the definition of `has_many_polymorphs` but it didn’t work. Not even with an STI model for `ViewPermission < Permission`, and `EditPermission < Permission`.

Any thoughts / workarounds / issue pointers are appreciated.

Rails 2.3.0

Posted to:

Posted in Ruby.

In Saturn’s Shadow

With giant Saturn hanging in the blackness and sheltering Cassini from the Sun’s blinding glare, the spacecraft viewed the rings as never before, revealing previously unknown faint rings and even glimpsing its home world

Posted in General.

Is it Microsoft?

This exchange happened today between me and a client while presenting the final release of an application:

Me: So, let’s now log in to the system…
Client: Actually, I wanted to ask about something. Is this written using Microsoft technologies?
Me: No, it’s written on a different stack.
Client: Shoot!
Me: Why?
Client: What technology is it written with?
Me: It’s written in Ruby, connects to MySQL and runs on Linux. Why?
Client: Shoot! Shoot! Shoot!
Me: Well. It was laid out clearly in my proposal that we’re going to use that particular stack.
Client: Is it easy to migrate the application to Microsoft technology. You know: IIS, .Net, etc…
Me: Not unless we re-wrote the whole thing. why?
Client: A friend told me that I could get a Microsoft funding for my application if it was written in Microsoft technologies.
Me:

That’s after 2 weeks of wireframes and initial design, 5 weeks of implementation, a mid-way release presented to the client in person.

What a way to ruin a good application release.

PS: I have a bad feeling about this, the client hasn’t paid (yet) for the implementation.

Posted in Professional, Ruby.

The Finishing Touches

Yesterday, I caught myself saying “I’m now putting my finishing touches to the application”. Twice.

It is a true and accurate meaning to the state of an application I’m currently delivering.

So, does a “Finishing Touch” apply to software? A web application? It is a term that is probably more tied to a work of art. A painting.

I won’t delve into how developers are close to composers, or increment vs iterate, but from the outskirts, even a simple feature delivery IS a work of art.

Given the numerous ways of how an application could function, there are only few ways of making it appeal, and that’s a work of art.

Posted in Professional, Web.

WordPress Compromised

Again, my wordpress installation has been compromised. Spammers are just fond of it.

I found hidden code in wp-blog-header.php, a new user in the database and a few dozen templates :) I couldn’t even modify few files on the server (virus?) even with sufficient rights!!

So, I had to install a fresh copy of wordpress and hand-pick few items here and there to migrate.

Let’s see how long this installation stands :)

Posted in General, Web.

has_many_polymorphs broken for Rails 2.1.x

The guys on has_many_polymorphs are doing a great job keeping the plugin up to date with edge Rails.

This commit broke the plugin with Rails 2.1.x

NameError: uninitialized constant ActiveRecord::Reflection::ClassMethods::ThroughReflection

Just revert to the AssociationReflection instead of ThroughReflection logic and all should be fine.

Posted in Ruby.

Human Forms

The Huff-Duffer has came up with, in my opinion, a remarkable signup form (below). The signup form has this unique ‘human’ feeling that led to the following exchange between me and, Adam, a work colleague.

Huff Duffer Signup Form

Me:

New approach to signup forms
http://huffduffer.com/signup/
I personally like it. More ‘human’.
What do you think?

Adam:

I have mixed feelings about this…

First off, as I am sure is the same with each of you, it was clear this was intended to mimic a paper form (which is where the “more human” comment comes from, I assume).

Though the immediate familiarity is there, I can’t help but be reminded of the circumstances where I am required to fill out a paper form – entering a contest, filling out important records (medical, legal, otherwise), etc.  Most of the circumstances I associated with filling out a paper form were not remembered as particularly comfortable, let alone pleasant – there is, in fact, a feeling of anxiety associated with the task of filling out a paper form…  Just an observation…

Second, one problem with paper forms of this nature is that often is it easy to “skip” past areas which require data entry as they “blend easier” into the body of the form itself.  In fact, 3M has made millions of dollars with little sticky arrows to attach to forms to help users find where they need to enter information.  If used to collect a significant amount of information, this method may also suffer from the same problem.

The standard form objects have moved into the general mindset as recognizable elements which require user attention, not to mention the fact that they provide a whole host of interaction methods (sliders, dropdowns, etc.) not offered anywhere else…  I do think that something like this has its place though…  I am just not quite sure, yet, as to where this would be…

Me:

You’re right. It’s more of [a] mimic of a paper form. Might not be the best way of collecting information online (especially with larger set of entry fields), yet still, there’s something human about it.

May be it’s the way the application is talking to me as a user, or me talking to _it_ (I was about to use ‘him’ instead of ‘it’). May be because of the perception I get that this form will be eventually read by a human being, wearing a reading glasses and handling my signup request with care and passion instead of a cold, heartless ‘Internet’ sitting somewhere down the wires. May be because it’s merely _different_ from the gazillion signup forms I’ve had to fill out to date. May be because I get that this huff/duffer guy(s) wants to be ‘remarkable’ and in doing so will give me a better service.

I agree it’s not applicable in many cases, but being notable/remarkable/different is worth a shot (not sure where though) :)

Putting that mail together, I remembered the Moo Tools. It took us no less than 15 minutes to discuss it, not even knowing what the huff/duffer guys do :D
Isn’t that remarkable?

http://thinkremarkable.com/

Posted in Professional, Web.

[10 seconds ad] AJAX requests synchronization

For you AJAX requests synchronization needs, don’t forget to use Locking! – The mechanism that might save your day. *

(*) not recommended for all uses. consult your requirements, framework API, and DB engines before you apply.

Posted in Ruby, Web.