Marketing Internship, Chennai, India

 by vinay  on   22 Sep 2011

As part of our plans to grow our operations, we are looking for promising interns who can work as Marketing Coordinators.

While we have the marketing know-how and the sales strength, we need smart young people who can execute our ideas in these areas. We’re thus looking for people who are energetic, can understand markets quickly and communicate clearly.

We have products that do most of the selling themselves, so your job is that much easier, and that much more fun! The team is comprised of some of the most interesting people you’ll come across in the city. And the icing on the cake? – a monthly paycheck. So if you want to take a shot at this enviable position, and subsequently a possible full time position at Tenmiles, shoot an email to jobs@tenmiles.com and tell us why you think you’ll fit this role. Be sure to include your mobile number. A resume is optional but make sure it’s in PDF format if you send it.



Tenmiles is growing and we’re hiring!

 by vinay  on   21 Sep 2011

Tenmiles just turned eleven last week and we are celebrating by expanding our team!

Tenmiles is known as that small bunch of interesting people in Chennai who churn out world class software products. We build software that looks great, works like a charm, does the job and doesn’t take water breaks.

With world class products at hand, we’re now looking to scale our global reach and operations rapidly. We’ve been one of the few successful and profitable software product companies in the country, and we’re proud of it. If you would like to be a part of our growth story, have a look at the current openings in our team :-

Engineering

  • Rails Developersread more
  • Django Developers
  • iOS Developers – read more
  • Linux Engineers
  • QA Engineers

Sales & Marketing

  • Channel Managers
  • Account Managers
  • Product Marketing Manager – read more
  • Product Evangelist – read more
  • Marketing Coordinators (open to Interns) – read more

If you think you will fit under any of the above, tell us why you think so by shooting an email to jobs@tenmiles.com. We’re more interested in your practical experience and your passions than how much you scored in 12th grade mathematics. If you want to include your resume, make sure it’s in PDF format.



Rails Refactoring tip: Dry up your constants

 by Lakshman  on   04 Aug 2011

If you observe your rails app, you might come across some set of values constantly being used. It is a good idea to identify them and dry them up. For example, in the models, you might have used a Regular expression for checking the validity of email attribute.

in app/models/account.rb

 validates_format_of :email,:with => /(^([^,@\s]+)@((?:[-_a-z0-9]+\.)+[a-z]{2,})$)|(^$)/i 

in app/models/delegate.rb

validates_format_of :email,:with => /(^([^,@\s]+)@((?:[-_a-z0-9]+\.)+[a-z]{2,})$)|(^$)/i

Don’t you see, its very hard to keep using it across models or any other ruby files. For this, We can create a file called constants.rb in config/initializers and declare a constant (with a good, rememberable name) there.

In config/initializers/constants.rb

EMAIL_REGEXP = /(^([^,@\s]+)@((?:[-_a-z0-9]+\.)+[a-z]{2,})$)|(^$)/i

Restart the server now. Then in the model file shown above, we can use it like

validates_format_of :email,:with => EMAIL_REGEXP

We can use the same technique with other constant values that are used more than once in the application.



Equality Gotcha of ActiveRecord Objects

 by Lakshman  on   22 Jul 2011

Two Activerecord objects when compared over == operator returns true when they are instances of the same ‘model class’ && if they have same ‘id’ values. This operation is not an attribute-by-attribute comparison. Beware, this behavior can give problems when you do a lot of == operations b/w Activerecord objects, in your application, in which case you need to override == operator of ActiveRecord::Base according to your needs.

Here is a sample behavior of == operator.

ruby-1.9.2-p180 :001 > p1 = Person.first
=> #<Person id: 1, name: “John”, email: “john@gmail.com”>
ruby-1.9.2-p180 :002 > p2 = Person.first
=> #<Person id: 1, name: “John”, email: “john@gmail.com”>
ruby-1.9.2-p180 :003 > p1.name = “somethingelse”
=> “somethingelse”
ruby-1.9.2-p180 :004 > p1.save
=> true
ruby-1.9.2-p180 :005 > p1
=> #<Person id: 1, name: “somethingelse”, email: “john@gmail.com”>
ruby-1.9.2-p180 :006 > p2
=> #<Person id: 1, name: “John”, email: “john@gmail.com”>
ruby-1.9.2-p180 :007 > p1 == p2
=> true



Bootstrapping a business without shortcuts

 by Shalin  on   20 Jul 2011

It is not hard to Bootstrap a company. Many people think bootstrapping is all about thinking short-term. Generate money for the company today. I think otherwise.

Bootstrapping successfully needs a long-term vision. Doing services to bootstrap a product company is short-term. Building minimum viable product, selling as soon as you have a prototype is long-term.

Bootstrapped entrepreneurs are not in business because they see a gap in the market. They start companies because of their ideas and ideology. Sticking to long-term vision is the shortest path to remain viable.



ActiveRecord Finders: Returns nil or Throws Exception

 by Lakshman  on   19 Jul 2011

ActiveRecord finders behave differently for various types of finders. Suppose you have a model called Account. Here are the ways you can get a record with id 34 in the `accounts` table.

acc = Account.find(34)
acc = Account.where(:id => 34).first
acc = Account.where(:id => 34)

Suppose a record with id = 34 does not exist in `accounts` table. Most programmers would think that the finders will throw ActiveRecord::RecordNotFound exception in all cases. No, thats not the behavior here. In the first case, using ‘find’ method returns ActiveRecord::RecordNotFound exception. Where as in the second case using ‘where’ method, it returns nil object. In the third case it returns an empty array []

ruby-1.9.2-p180 :001 > Account.find(34)
ActiveRecord::RecordNotFound: Couldn’t find Account with ID=34
ruby-1.9.2-p180 :002 > Account.where(:id => 34).first
=> nil
ruby-1.9.2-p180 :003 > Account.where(:id => 34)
=> []

If we find records using ‘find’ method, it is assumed that we have prior knowledge of the table ‘accounts’ and the primary key values. So, if there is no record with that id, an exception is thrown. If we use ‘where’ method to find records, we are querying based on some conditions. If the query finds anything that matches our conditions, it returns the result. If it cannot find any record that matches our conditions, it returns an empty array or nil object.

Empty array is returned when we fire a non-singular query (as in third case). A Nil object is returned if we fire a singular query. This behavior have to be kept in mind when find records and apply conditions on them, in the Rails controllers.