Using AutoComplete with ActiveScaffold forms
This is a quick guide to set up auto_complete text fields in forms rendered by ActiveScaffold plugin.
I am not a huge fan of ActiveScaffold, but found these steps worth publishing after doing this for one typical project requirement.
1. Models
2. Install ActiveScaffold and AutoComplete Plugins
3. Controller Configuration
This renders a drop down list for country field, instead of the default create/replace form. However, we need to render an auto completing text box for which we need to replace the form column.
4. Form column override
Next step is to override the form column. Create a file named _country_form_column.html.erb in app/views/cities folder.
The second option :method => :get is needed to avoid the InvalidAuthenticityToken error generated by the ajax post request.
5. Since the form now returns country[name] instead of record[country_id] in params, we need to assign country object before creating city record. The CitiesController finally looks like:
Tweetdeck on mimo-740
Having tweetdeck open on same workspace often cause distractions during work. This even made me to abstain from using twitter for last two weeks. Now I have a setup of a special device for twitter in the form of Mimo 740 7″ Touchscreen monitor. I was impressed with the features packed in this device and that too in affordable price (150£). Although the mimo website shows ‘out of stock’ for this model, it is still available for sale on amazon and play.
I have always loved adding monitors to my notebook, but this model offers features of more than just a monitor. I find it most suitable as a secondary monitor for my macbook, dedicated for tweetdeck. The best part is, you need not worry about video cards and graphic ports for your machine, as it connects using the standard USB port (without using external power supply) and works with XP/Vista/OSX. The user experience with the touchscreen is decent but certainly not comparable to that of iPhones. You can switch between replies/direct messages/facebook status updates, scroll the tweet list by dragging the scrollbar using the touch features. The main drawback is the size of UI controls with the traditional desktop applications (button size, scrollbar width etc) which make it slightly difficult to control using fingers.
The inbuild mic and camera helps to configure it as a portable skype device (of course with cords), which can be kept away from the computer and controlled using touch screen. Some more applications, which I found appropriate for use on this device are youtube (in full screen mode), a dedicated console/terminal while coding, Colloquy for IRC, iChat, etc. It would be interesting to see how people build applications targeted for such touch enabled devices to enrich the user experience for commonly used services.
Dealing with Escalations
Last week, I got a call from a friend and former client, whose project under development was turning out into a runaway system. The application was being developed by an agile shop, which claimed to be proficient in Scrum project management process (an iterative incremental process model). He was mainly worried about the lack of progress after missing budget expectations and projected deadlines. This prompted me to write a post about my experiences in the past to figure out the causes of such slippages and escalations.
An escalated project can be defined as an escalation of commitment to a failing course of action. It can be an incomplete project, or which came over budget and behind schedule, or with fewer functions than originally specified. These projects, after going out of control, land in a need of redirection or end up into termination of contracts. In the previously mentioned case, it is purely a failure of the coordination mechanism and management to strictly adhere to scrum. However, taking a more generic view of agile project development processes, this is an attempt to find answers for some common questions. Why do these projects escalate? Can we identify the issues involved in project management following this particular methodology and process?
A project gets escalated if the management and development team hide any negative information about the project by keeping mum or heavily discounting the consequences. Keeping a mum over delays/wrong choice of decisions to protect their interests gives rise to a deaf effect. If the project status information is biased, incorrect, unavailable or interpreted incorrectly it gives rise to escalations making the project management as one of the major cause.
Additionally, an agile iterative development process needs more involvement from the developers in terms of decision-making. One mostly observed trend is that managers continue to commit resources to a failing project, to self-justify an initial development approach. These commitments are often result of psychological and social self-justification by the managers and team members who justify their acts with a fear of loosing credibility with others.
In such circumstances the developer’s experience level also plays an important role in decision-making. If a developer has an option to select between a path with high probability of ‘a sure loss’, ‘an initial loss’ or ‘a larger loss but with a possibility to return to the point where he left’, the decision to go with one of these depends on the prior experience of decision maker. A less experienced individual, who has not come across a loss earlier, is more likely to engage in a risk seeking behavior.
Another observation is from the context of relationship between clients and contractors, where a client engage a contractor to perform the development work on their behalf and involves delegating some decision making authority to the later. Such cases give rise to information asymmetries, where the contractor is assumed to have private information inaccessible to the client. If for instance, a contractor’s reputation was hurt by a decision to discontinue a project that would negatively affect the contractor’s future career opportunities, thus providing an incentive to shrink. In such cases, goal incongruence between client and contractors can create a situation where the contractor focuses more on maximizing his utilities rather than acting in best interests of the client. Mostly, contractors are expected to reach decisions that maximize self-interest at the expense of the client’s interests.
However, we can follow some practices to make sure project escalations do not happen frequently, or at least can be controlled:
- Maintain good communication with all actors involved in the process
- Avoid information asymmetries by monitoring projects closely
- Implement early warning systems, to detect escalations as early as possible
- Define de-escalation trigger points at the outset of the project. At these trigger points managers can take steps to de-escalate the project and contain the damage.
- Defining termination conditions at the outset of the project.
After all, if you are working with agile methodologies, it is extremely difficult to work on a pre-defined/agreed schedule and to expect the project delivery without a room for tolerance. We should not believe that project escalation is a rare event, but be prepared to detect and control it in its early stage.
Jobmigo - Real time job bookmarking on twitter
JobMigo.com, inspired from the ‘#rtjobs’ movement, is an application created to help people find and sort jobs using twitter. So what does Twitter have to do with finding a job? Twitter has also become a place where users have begun to post listings for job openings. There are many ways in which this is done in the “Twitterverse”. Some users are actually job portals, “tweeting” posts from their website for the benefit of anyone who is receiving the tweets.
One of these tags was especially of interest. #RTJOBS was a tag that was created especially for the ‘re-tweeting’ of posted jobs. This tag essentially solved the third reason for overload by allowing users to stay current by re-tweeting posts that were still relevant, and popular on Twitter. By tracking these posts we are also assuming that the community has some kind of valuable information to add relating to importance or relevance of the post simply by the action of tweeting that post.
There are plenty of search tools available to search for job related keywords in tweets. JobMigo doesn’t try to index all job related information on web, instead it tries to figure out which job posts are genuine and of real interest to people. Users can see which job post (posted url) was ‘the most discussed’ or ’shared’ among twitter users within a given time frame. Additionally, JobMigo enables users to search by date, locations and job types. It has some pretty smart logic to bookmark the final urls discussed in tweets along with a tagging of places (state, country) and job types.
JobMigo is an example for application of the text filtering and information processing tool, which is being developed right now. I’ll post more about the tool and its evolution soon.
Url: http://jobmigo.com
Follow Jobmigo on twitter: http://twitter.com/jobmigo
Team behind JobMigo.com: Anup Narkhede, Ebru Kivanc and Ranmini Perera.
Tips: Replace Missing Images using JQuery
Checking for non-existing images and replacing them by placeholders is simple when the images are handled on server (db/filestore). However, for externally linked images, we can do something like this using JQuery:
This script will replace the broken image urls with ‘/images/noimage.jpg’.





