- A User Friend Relationship Model in Rails
In building my first Ruby on Rails app, I needed to create a facebook / social-networking style friend relationship between users. The simple requirements were that it the friendship should require approval (e.g. a friend request followed by an accept or ignore) and it should be lightweight (not using two records for a single relationship).
This method and code is inspired by two blog posts, which got me started but neither of which really fulfilled my complete requirement. The first used two records per friendship and the second was a twitter-style friend/follower without the approval process.
So, here I break down my Friendship model which hopefully you will find useful and/or insightful as a complete solution or a starting point for your own implementation.
- Lesser-known Truths about Programming
A nice list of “truths” about programming. I would agree with 99% of what David says. Especially including:
Programming is hard work. It’s an intense mental activity. Good programmers think about their work 24/7. They write their most important code in the shower and in their dreams. Because the most important work is done away from a keyboard, software projects cannot be accelerated by spending more time in the office or adding more people to a project.
I would also add that good programmers get bored very easily and need constant challenges and mental stimulation to stay interested and keep “in the zone” working. This is why so many great programmers are working on multiple projects at once, including using their free time to write software, contribute to opensource projects, or the like.
- Annoying Zune Behavior – Ordering “By Rating”
I want to sort my music “By Rating” in the Zune media player software. This is natural. But what’s wrong with this track order here?
Yeah, the software puts the songs which have ratings above the songs without ratings, which in itself isn’t a bad idea. But this means that if you just start playing down the list of your favorite songs right after your favorite songs it’s going to play the songs you hate the most. Then it continues with the rest of your library in alphabetical order.
Come on, Microsoft… you can do better. Just put the most hated tracks at the bottom of the playlist when I sort by rating.
- Still Tweaking the Blog Layout
Decided to drop the rightmost sidebar when in single post view, to give a wider reading column. Hopefully it’s slowly getting better. Still spending a few minutes every day tweaking the new layout… hopefully it will solidify over the next week or so. Then I need to move the whole blog from my old staging server to my more reliable colo.
- Rails Deployment: Engine Yard or Heroku?
As I’m thinking about beta launching my first Rails app, I need to decide how to do the deploy. Heroku and Engine Yard stand out as the most popular hosts, from what I see. Heroku also has a free option, which appeals to me. Is one much better than the other?
Long-term, I will probably host the app myself at my colo, but to keep things simple at first I don’t want to learn the intricacies of Rails hosting right now…
- Quickie: Learning Ruby on Rails Series
I’ve started a series about learning Ruby on Rails (quick jump to: Day One, Day Two) while building a web app called Whirlfood. It’s not instructional, but rather is reflective of the process of learning the language and my thoughts about the language and framework as I attempt to use it for the first time for a real project I intend to release to the public soon.
- Learning Rails – Day II
Well, I spent the second half of today (and >4 hours at Farmer Boys) working on my Whirlfood project in Rails and made a surprising amount of progress. Took some time to start to get used to the Rails methodology and the Ruby language syntax, but I think I’m in pretty good shape now.
Got to admit, I’m starting to like Rails for rapid development. After 2 days, I feel like I can build a simple web app almost as quickly as I can using C#. Which completely amazes me. Of course, there are lots of complex things and specialized functions that I still don’t know how to do in Rails, but still, I’m pretty stunned. In a good way.
- Psychology Research: How to Apologize
An interesting article looking at several different types of apologies and which apologies yield maximum effectiveness among differing groups of individuals.
Ryan Fehr and Michele Gelfand at the University of Maryland have drawn on research in other disciplines, including sociology and law, to explore the idea that apologies come in three forms and that their impact varies according to the character of the victim
The three apology types or components are: compensation (e.g. I’m sorry I broke your window, I’ll pay to have it repaired); empathy (e.g. I’m sorry I slept with your best friend, you must feel like you can’t trust either of us ever again); and acknowledgement of violated rules/norms (e.g. I’m sorry I advised the CIA how to torture people, I’ve broken our profession’s pledge to do no harm).
The message, the researchers said, is that when apologising you should consider your audience. ‘This need to meta-cognize about what a victim is looking for in an apology is particularly important when victims’ and offenders’ worldviews diverge,’ they added. Of course, if in doubt about the character of your victim or victims, the researchers said that ‘detailed apologies with multiple components are in general more likely to touch upon what is important to a victim than brief, perfunctory apologies. Offenders should therefore offer apologies with multiple components whenever possible.’
I could see research like this leading to additional analysis modules in our Talent Scan product, since we already measure for things similar to empathy, individualism and teamwork to help companies communicate and understand their employees. Not a far leap to helping companies apologize to their employees (and maybe even customers) when things go bad.
- The Building-Learning Paradox
If you want to learn a new langauge or framework you need a good project idea as the basis for what you’re building as you learn. But if you have a good project idea to work on, you want to get it to market as soon as possible. I present to you The Building-Learning Paradox.
I conjecture that this paradox is the reason that highly motivated people tend to learn in smaller incremental steps rather than diving head-first into a new technology. It’s basically impossible to satisfy both these main motivators at once. Not 100% sure what I’m going to do for this project I’m working on right now, but I think I’m going to sacrifice speed in order to learn something new. We’ll see if I can keep that up for very long.
How do you deal with this paradox? I’m curious.