Oct 26

Needless to say, we are definitely in a time of crisis.
People spend less, VCs spend less, and thus small businesses are feeling the pinch

Small businesses are our clients and prospective clients. In case the worst happens, what should a service, people-intensive business like us anticipate? It’s easy. We can simply fire our idle employees and the bulk of our costs are gone.

Just kidding :)
That’s not what we do. First, we dont treat our employees as ‘cost’. They are assets.
Second, I believe it’s gonna be a clear day after the storm, sooner or later.

So for example, for an IT consultancy business like us, it’s better to:

  • equip the idle guys with the technologies that they havent had experience with before, yet in high demand (like rspec)
  • or equip them with the technologies that is interesting to know, like ExtJS
  • or have them build reusable application components (like login and registration code), to be used on new projects
  • or have them write new plugins to contribute to the Rails community, and also to make a name (I’ve already thought about some useful plugins to write)
  • or have them help build / upgrade internal company apps, like knowledge management or HR management systems or the company website or a demo site
  • or promote them to management positions, so as to create a stronger company foundation that’s ready for 2009

Well, it’s like benefiting from the difficult times :)

Sep 26

Is there an SaaS knowledge management system out there?

More and more we need some kind of a knowledge management system (KMS) in our company.

For example:

- A developer knows about something that others dont. How can we make sure this knowledge doesnt disappear when the employee suddenly quits?
Right now it’s pretty simple. I make sure the developer who handles a Flex project works in a team with another developer.
Or the developer who handles a Merb project, also works in a team with another developer.
This is still manageable with a 30-engineer company. But what if when we grow bigger? We need KMS!

- A developer doesnt know something that others do. How can we make sure he knows he just needs to ask instead of research, and whom to ask?
This is very important so that productivity is not lost, and convention is preserved.
With a KMS, this is gonna be more streamlined

But, it looks like there isnt (that I know of) a web-based knowledge management system out there (?)
So I guess we’ll just build a simple one our own.
Who knows we may open it up and let it become a free/paid web-based app :)

Btw, I cant seem to find a good online HR SaaS either!

Aug 22

Like Facebook Connect, Myspace Data Availability enables your site to take advantage of Myspace accounts. For example, you can have your users login to your site using their Myspace accounts, or list their Myspace friends on your own site.

I didnt find an easy step-by-step tutorial even on a basic thing like getting the myspace user id of the logged in user in the external website; so I figure I’ll write this post to help other Rails developers out there who are new to this.

This is an example. First, in your rhtml, you’ll want a link whereby if the user clicks on that, the user can login using his myspace account and then he can see his myspace user_id in your site (if you can get to this step, it’s easy to add more complicated social features).

<%= link_to ‘See my myspace_user_id’, {:action => ’see_my_myspaceuserid’} %>

Now, how to implement ’see_my_myspaceuserid’ ? You probably are looking at this tutorial here:

http://developer.myspace.com/community/myspace/dataavailability.aspx

Dont be daunted when you read over the ‘Access Delegation’ part. It’s actually a basic Oauth authorization mechanism, and the Rails ‘oauth’ gem will help us a lot. Read about the gem here: http://oauth.rubyforge.org/ , or as usual, the best documentation usually are inside the code itself (in my Windows computer it’s here: C:\ruby\lib\ruby\gems\1.8\gems\oauth-0.2.4\lib\oauth\consumer.rb).

So here’s how the controller looks like:


def see_my_myspaceuserid
@consumer = OAuth::Consumer.new('your OAuth Consumer Key‘, ‘your OAuth Consumer Secret‘, {:site => ‘http://api.myspace.com’, :http_method => :get, :request_token_path => ‘/request_token’, :authorize_path => ‘/authorize’,:access_token_path=>’/access_token’})
@request_token = @consumer.get_request_token
redirect_to @request_token.authorize_url + ‘oauth_callback=display_myspace_user_id’
end

So once the user clicks on the link, he’ll be redirected to myspace to login there. After he logs in there, he’ll be redirected back to your site. Let’s say the callback url is called ‘display_myspace_user_id’, so here’s what it’ll look like:


def display_myspace_user_id
# You can save the @request_token from action 'see_my_myspaceuserid' and use it here
response = @request_token.get_access_token.get('/v1/user.xml')
# Now use REXML::Document to parse response.body, and you'll get the user_id !
end

How do I know that the parameter to access_token is ‘/v1/user.xml’ ?
Read here: http://developer.myspace.com/community/RestfulAPIs/resources.aspx

That’s it. You can use the access_token to do all sorts of REST API calls to Myspace now!
I hope this helps.

Jul 26

We have been approached by potential clients who ask, “How much for this project?”, or, “How long would this take?”

The problem is, some do not even have specs nor wireframes…

As a developer, what you should do?

First. You can ask clients to draw page sketches and some specs, otherwise you cant quote any fees.
Although this is a very reasonable and responsible approach, this can potentially drive clients away.
Irresponsible developers who can generate estimates based on a 100-word specs, or as simple spec as ‘a clone of site X’, is most probably, well, irresponsible; but they could be more attractive to clients who are shopping for developers

Two. You can be a consultant and together with the client, milk your ideas, and help draw page sketches and write some simple specs. Although this is very noble, this is most probably not good for you.
You have spent lots of time, and you may not get the deal after all.
You should write an NDA before giving up your ideas. After all, you dont want to draw specs, not getting the business, and have that specs sent to a cheaper developer :)

Three. Just like number Two, but charge the client for your consultation. I’m not sure yet if clients are open to this though.

Four. Find clients who already know what they want. In general they are the more serious & more solid budget-wise after all.

What do I suggest out of these four?

In general I suggest number (4). But if it’s not possible, the answer is ‘it depends’.
You should have a mechanism to know what type of client the person is.
Does he represent an established company with solid budget?
Is he a startup with an idea? If he is, does he have the necessary funding?

Note that albeit we want to help as many clients as possible, we have to be concerned about client’s budget. Most of the time, relationship goes messy because the client doesnt have anymore funding…

All in all, I suggest number (2), especially if you have the time and resources. Number (3) sounds an overkill; unless you can give a very good consultation.

Number (1) is good too, since if the client is serious and interested in you, he’ll draw some specs and get back to you. If he doesnt get back, follow up!

OK now with page sketches and specs, you can now answer “how much” and “how long” :)
Still an estimation though. Suggest for Agile Development, the client is probably interested…

Mar 15

I’ve been depending upon an HTMLer to do the our HTML work.

Although he is good, it becomes apparent that we’re being too dependent, and the business just cant scale that way.

I believe everyone at Kiranatama should be empowered. I believe every engineers should be able to write Rails, write unit tests, do QA, deployment, caching, and also write HTML and CSS.

And so Kiranatama decides to train every engineers on HTML and CSS. Materials will come from Bulletproof Web Design.

This way, business can scale, and the skillset of our engineers improve.

Mar 13

If you have a Rails application that needs to include models from another Rails application, oftentimes you will want to add features to those methods, but you cannot since you cannot touch the other Rails app’s codebase.

If this is the case, you can use class_eval, which Neeraj explains nicely.

For example, if you want to add an after_save to a class Example :

Example.class_eval do
after_save :somemethod

def somemethod
end
end

Note that you dont wanna put that code under vendor/plugins/ . Instead, put it under a place where it’s executed everytime.

Feb 4

I confess. I havent had time updating this blog.
One of the more interesting projects that we have been working on is developing a facebook application using Rails.

I cant tell you what is this application about yet (the client wont let me)
But it’s a very exciting car/race game application, sort of like Speed Racer, but much better!

In developing this application, there are several issues I want to share with readers…

1) We wanted to use Rails 2.0, but unfortunately rfacebook doesnt seem to be compatible yet.
As I need ActiveResource for the project, I use Rails 1.2.4 instead…

2) We wanted to customize the profile box depending whether the viewer is the profile owner or not, like in this liverail tutorial (which we follow, but pretty outdated). But unfortunately, I can no longer do that…

3) We use lots of javascripts, such as tooltips and redbox plugin, but doing them in FBML is impossible(?), so we decided to use iframe, which works as good.

4) But using iframe can mean an ugly vertical scrollbar. One way to get rid of the scrollbar is to have the app rendered as FBML, and then use fb:iframe (so that javascripts still work) with a longer height.

5) Yes, we can know whom the user just invites on facebook (so that we can reward them with points, for example). On the ‘action’ parameter of fb:request_form, that’s where facebook will POST to after it’s done. It will give us params[:ids] as an array of user_ids just invited by the user.

Jan 2

This is useful if you want to have a hash that contains values of your ‘development’ or ‘production’ configuration.

If it is after the Rails app started, we can just do:

config = Rails::Configuration.new
database = config.database_configuration[”production”]
(Now you have access to database[:password], etc)

Without Rails, we can do

file_handle = YAML.load(File.new(”path/to/database.yml”)
hashes = file_handle.each {|value| value.inspect}
(Now you have access to hashes[”production”])

Dec 28

There are times when we want to install a gem as a plugin (or to be more precise, freezing the gem), so that we dont need to worry about installing the gem on other servers that may host the app.

Or so that we can modify the gem to suit individual applications.
For example, if we want to run multiple database migrations to different databases within one rake task script, then we need to modify the rake gem. Since modifying gem is usually not possible, we need to install rake as a plugin then modify it from there.

Basically, use gemsonrails instructions. If set up correctly, you’ll then have vendor/gems/[somegemname] and vendor/plugins/gemsonrails .

But an easier way to freeze gems is on err.the_blog.

Dec 18

I figure it is much much better to just use a great third party application like Wordpress to blog, rather than trying to come up with our own blogging system.

So here it is, I’m now using Wordpress (on a different domain) to write blogs for the Kiranatama site.

By the way, the two blog previews on the Kiranatama’s home page are retrieved from the Wordpress database, by creating a WpPost model in the rails app.

This new site just needs to be skinned. We’ll get to that later, for now, at least I have a much better blogging experience :)

« Previous Entries