Author: Ryan

  • Scope a variable to a block in your template code

    Sometimes you are coding a template and you need to refer to the same method chain over and over. For example, you’re coding a template that summarizes activity on recent messages. You iterate through a block of messages, and for each message you want to display some information pertaining to the last comment. You could do it like this:

    <div class="active_messages">
      <% @active_messages.each do |message| %>
        <h1><%= message.title %></h1>
        <div class="latest_comment">
          <div class="avatar">
            <%= avatar_for(message.comments.last.creator) %>
          </div>
          Latest comment <%= time_ago_in_words(message.comments.last.created_at) %> ago by <%= message.comments.last.creator.full_name %>
        </div>
      <% end %>
    </div>
    

    Everything inside of div.latest_comment deals with the exact same comment, but we have to use a method chain to get the comment each time (message.comments.last).

    One solution is to set a local variable inside the iterating block with the knowledge that the variable will be reset after each iteration:

    <div class="active_messages">
      <% @active_messages.each do |message| %>
        <h1><%= message.title %></h1>
        <% comment = message.comments.last %>
        <div class="latest_comment">
          <div class="avatar">
            <%= avatar_for(comment.creator) %>
          </div>
          Latest comment <%= time_ago_in_words(comment.created_at) %> ago by <%= comment.creator.full_name %>
        </div>
      <% end %>
    </div>
    

    One on hand, this is better because the methods called on `comment` are easier to scan. The whole div.latest_comment is more readable without the repeated method chain. On the other hand, setting a local variable is bad style. The local variable assignment creates state without explicitly showing where that state applies. It feels a little too PHP for my taste.

    A better approach is to use the `tap` method to scope a variable to a block:

    <div class="active_messages">
      <% @active_messages.each do |message| %>
        <h1><%= message.title %></h1>
        <div class="latest_comment">
          <% message.comments.last.tap do |comment| %>
            <div class="avatar">
              <%= avatar_for(comment.creator) %>
            </div>
            Latest comment <%= time_ago_in_words(comment.created_at) %> ago by <%= comment.creator.full_name %>
          <% end %>
        </div>
      <% end %>
    </div>
    

    The `tap` block shows exactly where the scope of the assignment starts and ends. I like how the template explicitly says “now we are going to deal with a comment in the following section, and this is the comment we are working with.”

    I just hit on this pattern today while working on a feature and I think it’ll come in handy in the future.

  • Quick Thought On Foreclosure and Debt

    by Ryan McKeen

    It has been a busy week for me. Not a lot of time or energy to post. So I’m going to borrow from a conversation that I had earlier in the week:

    “If you owe a bank a thousand dollars…they own you. If you owe a bank millions of dollars…you own them.”

    For whatever reason, that stuck with me.  It hits the nail on the head of a number of pressing legal, economic, and political problems that we’re experiencing.

  • You Need Clients To “Actively Practice” Law

    by Ryan McKeen

    So we’re back to the active thing again. Earlier today, Attorney General Blumenthal weighed in:

    …we conclude in response to your second question that the phrase “active practice” means more than simply being a member of the bar of the state in active status.

    Attorney General Blumenthal’s opinion is extremely well reasoned and researched. I completely agree with his analysis. He’s right when he says that Connecticut courts have not defined the words “active practice”.

    Over the past several weeks, I’ve read lawyers disclaim any idea what it means to be engaged in the active practice of law. Frankly, I’m shocked.

    Having given a lot of thought to the issue of what “active practice” means the answer is in part very simple.

    What do government lawyers, in house counsel, and lawyers in private practice have in common? They have clients. That’s the lowest common denominator.  The idea that in order to actively practice law requires having clients works in every instance I can think of.

    For example, I give you Bob. Bob graduates law school and passes the bar. Bob pays his client security fund fee every year for 20 years. In that time, nobody hires poor Bob.  Bob has never actively practiced law. No matter how popular Bob is, he’s not qualified to serve as attorney general.

    And therein lies the problem for Ms. Bysiewicz. Statutorily, the Secretary of State does not have clients.  The Secretary of State is the client.  The client for the attorneys that work for her. And a client to the Attorney General who represents her.

  • Does Anyone Have A Copy of Blumenthal’s Opinion Re: The AG Statute

    I can’t seem to find it.

    If you’ve got it, please email it to me rmckeen at lttnlaw.com

  • How A Rotary Engine Is Put Together


    How A Rotary Engine Is Put Together & How It Works

    Check out this nice animation video that goes over the basics of the rotary engine.


  • QUOTE: Men don’t like appliances. We want things t

    Men don’t like appliances. We want things that can do lots of different things, that we can tweak and fiddle with, and then argue with each other about which one is better. Women aren’t like this, and because of this I have a feeling that it’s women who actually determine the eventual winners in consumer tech.

    Ultimi Barbarorum on the iPad. Who knows if it’s true. But I can say this, whenever we hear praise from women on a product, it gives me more confidence that we hit the “useful” mark.

  • Connecticut To Get A MLB Team?

    by Ryan McKeen

    I haven’t written about baseball on this site in a long time but this topic is too good to pass up.

    There are smart people in the Major League Baseball offices wondering if there’s hope of even discussing a potential move of the Rays to New Jersey or Southern Connecticut over certain protests from the Yankees, Mets, Red Sox and Phillies.  – Peter Gammons, MLB.com 1/22/201o

    With all the recent talk of a Springfield-New Haven rail line, how cool would it be to hop on a train in Hartford after work, head down to New Haven, grab some pizza, and watch the Red Sox? A man can dream.

    To quote Rogers Hornsby “People ask me what I do all winter when there’s no baseball. I’ll tell you what I do. I stare out the window and wait for spring.”

    Whether or not a team ever comes to Connecticut, who knows? It’s probably not going to happen and I blame the Yankees for that. For now, I’m content to read Gammons, drink coffee on a cold January morning, and stare out the window and wait for spring.

  • More Important But 100% Less Sexy Than The Whole Bysiewicz Issue

    by Ryan McKeen

    I guarantee the media won’t pick up on this one.  Or at least they didn’t the two previous times that I’ve posted this.  But those were made before this site went  Hollywood.

    I feel very passionately about this topic. Making superior court decisions available on the google makes our courts more transparent and provides access to Connecticut residents who don’t have the dough to fork down big bucks to Wexis. Connecticut should be very proud of the quality of its superior court judges and the opinions they write.

    Two winters ago, I attended a seminar on “What Connecticut Judges Want You To Know.”

    In law school I learned that a lawyer should always cite cases from the highest court in the state while writing briefs. It was explained that superior or lower court opinions were useful only to the degree that they explained or applied the rulings of higher courts. All of this is true in theory.

    A Superior Court judge in Connecticut is bound to follow the ruling of a higher court (either the CT Supreme Court or the Appellate Court).  A judge is not compelled to follow an opinion of another superior court judge.

    At the seminar a panel of judges stressed the importance of citing the opinions of other superior court judges in briefs to the court. The judges explained that they are always interested in reading how their colleagues dealt with an issue.

    The point is that decisions of superior court judges in Connecticut matter. They are vital to the practice of law in Connecticut.

    The Judicial Branch website makes the opinions of the Supreme and Appellate Courts available online.

    Given the importance of trial court decisions in our State, the ease of publication of cases on the internet and the renewed spirit of openness in Connecticut courts I think that it’s time the judicial branch made superior court decisions available online for free on its website.

  • The Connecticut Client Security Fund Fee

    by Ryan McKeen

    For the past few days the discussion of Connecticut law and politics has been dominated by the exemption to the Connecticut Client Security Fund Fee. Exciting stuff.

    What is the Connecticut Client Security Fund fee? It’s a fee paid by lawyers to:

    A) reimburse claims for losses caused by the dishonest conduct of attorneys admitted to the practice of law in this state and incurred in the course of an attorney-client relationship, and (B) provide for crisis intervention and referral assistance to attorneys admitted to the practice of law in this state who suffer from alcohol or other substance abuse problems or gambling problems, or who have behavioral health problems. Conn. Gen. Stat. Sec. 51-81d.

    Every non-exempt attorney in Connecticut presently pays $110 per year into the fund.  Full exemptions are available to attorneys who have retired, are on active duty in the armed services for more than 6 months during the calendar year for which the fee is due, attorneys who have resigned, and attorneys who have been disbarred.

    Partial exemptions are available for attorneys who do not engage in the practice of law as an occupation. In that case, the attorney keeps his license active but pays $55.

    Here is a link to the Claim of Exemption for the Client Security Fund Fee Form (revised 11/2006). This form is only filled out by attorneys seeking an exemption.

  • We’re Talking About Practice

    by Ryan McKeen

    Bring the levity. I’ll be back with regularly scheduled posting on Monday. More to come on the attorney general statute.

    I promised Secretary of State Bysiewicz that if she elected to respond, I wouldn’t displace her post for a week. That week is now up. I’ve wanted to post this all week.

    Is AI talking about basketball or Connecticut law? I ask. You decide.

    Click here to view the embedded video.

  • Working Lego V8, 32 Valve Engine (Video)


    A real, working engine built from Legos.

    According to the guy who built it, this is a:

    Real working (electronic) V8 engine made from Lego Technic. This is not a Lego set, but I completely designed and build it myself. There is about 300 hours of work in this model.

    Make sure to check out the following instructions and photo galleries:

    Building Instructions With Photo Gallery
    Lego Engine Parts List


  • QUOTE: Perhaps my biggest interface pet peeve is

    Perhaps my biggest interface pet peeve is alarm clocks in hotels. I stare at the controls for about ten minutes, give up, unplug it, and use my BlackBerry as my alarm clock. I have to unplug it because the last guy might have accidentally set it for 3 AM.

    Scott Adams on bad interfaces

  • Bugatti Veyron Mouse Video From Conan O’Brien’s Tonight Show


    Bugatti Veyron Mouse Video

    Last night, Conan O’Brien, who’s leaving NBC and the The Tonight Show, introduced a new $1.5 million character for his final days (under the shtick that NBC would be fitting the bill).

    The blue Bugatti Veyron was seen wearing mouse ears and whiskers. The final days of Conan look like they are going to be classic if this is any indication so definitely tune in as he gives a big F*ck Y*u Bird to the Peacock.


  • Susan Bysiewicz Responds

    Dear Attorney McKeen,

    Thank you for the invitation to respond to your comments and questions.  While I’ll be the first to admit that this was not how I planned to spend my first few days as a candidate for Attorney General,  I believe the question was reasonable given the very vague wording of the statute.   I am pleased to have the opportunity to respond.  My only regret is that there were several media outlets that ran with a “story” before they had all the facts – before they did the proper research and before they gave me time to respond.

    The office of Attorney General is one of the most active and professionally demanding in our state government. Connnecticut’s legal system has been fortunate to benefit from twenty years of outstanding service by one of the nation’s premier Attorneys General, my friend Richard Blumenthal.  After two decades of such strong service, we need an Attorney General capable of filling the shoes left by Richard, an Attorney General not just qualified for the office, but ready for its challenging blend of legal practice and large organizational management. I am the only candidate with the experience we need to take on that role starting on Day One.

    For over twenty years, I have been honored to actively practice law in Connecticut as a member in good standing of the Connecticut bar. My strong and diverse legal qualifications include 8 years in private practice, and 16 years in public service as an attorney, first as a state legislator and later, as Secretary of the State. There is no legal basis to conclude that “active practice at the bar of this state” excludes those attorneys who are practicing in the public or corporate arenas.  To interpret “active practice” to mean only private practice would be a mistake.

    Over the years I have made all filings and paid fees consistent with the filings and fees paid by other practicing attorneys in the state, including the client security fund payment and the attorney occupational tax return. I am also registered on the State of CT Judicial web site as an active attorney in the State.

    This makes me eligible for the office of Attorney General. Furthermore, please review the definition of the “practice of law” in the Connecticut Practice Book, which governs attorney conduct in the state which demonstrates that, in my service as Secretary of the State, I am clearly practicing law. The relevant section is: Sec. 2-44A(a)(2), which includes as “practice of law”:

    Giving advice or counsel to persons concerning or with respect to their legal rights or responsibilities or with regard to any matter involving the application of legal principles to rights, duties, obligations or liabilities.

    My daily and active role in counseling businesses, voters, candidates, and elections officials on their rights and duties easily qualifies me as subject to bar discipline for these aspects of my Secretary of the State role.  That is to say, I am practicing law when I do this. This is not to suggest that this means only a lawyer can be the Secretary of the State; rather, what it means is that any member of the bar who becomes Secretary of the State will be considered by the bar authorities to be “practicing law” and thus needs to go above and beyond a non-attorney Secretary in terms of adhering to the bar rules in his or her work. This is standard; the bar authorities often impose additional ethical and other obligations on attorneys who are doing things that ordinary citizens also might do.

    The subject of this question has become a perfect illustration of a key part of the job of the Attorney General: interpreting the practical application of the law of the State of Connecticut.  I view this as an opportunity to preview the comprehensive, measured responses that I will provide the people of Connecticut when serving them as Attorney General and I thank you for that opportunity.

    Throughout the campaign, I invite a thorough review of both my qualifications for office, as well as my technical eligibility.  I am confident that, upon close examination, the voters of Connecticut will see that I am the best qualified candidate to serve as their next Attorney General.

    by Susan Bysiewicz

    Secretary of the State of Connecticut

    Candidate for Attorney General

  • Peugeot SR1 Concept Car (Video)


    Peugeot SR1

    New concept from Peugeot. Nice video. But whatchya think of the car??


  • RideLust Hiring Lead Writer

    RideLust is currently hiring for our lead writer position. This is a full time position with a $3000 monthly salary plus performance incentives that make a five figure monthly income possible with the right amount of effort.

    There are 5 main requirements for this position:

    1) You must have visions of greatness. You have to want to be the best.

    2) You must be a workaholic. You have to WANT to work your ass off building one of the best auto blogs on the net.

    3) You must be ultra productive. There will be a minimum set of daily expectations. And you’ll want to blow those expectations away.

    4) You need an intense and diverse love for all types of vehicles. Motor or no. Carbon puffing or green. Raw speed or creative design.

    5) You need to be able to write (quickly) in a conversational tone.

    If you’re interested in this position, send us an email explaining why you are the best person for the job: [email protected]


  • A Few Thoughts and An Invitation To Susan Bysiewicz

    by Ryan McKeen

    Prior to hitting “post”, I thought my post on Susan Bysiewicz would generate some buzz. It did. I’ve been taken aback by how much buzz it generated and how fast it generated it. It’s not easy being engaged in the “active practice of law” and responding to the media.  This blog is my hobby. I don’t make any money from it. I enjoy doing it but I am a lawyer first and a blogger second. My priorities are clear.  Addressing the needs of my clients in my ever growing practice comes before all else. Writing motions and responding to clients are more important to me than appearing on the local news.

    A few thoughts:

    1. I’m extending an open invitation to Susan Bysiewicz to post a response on this blog. This much is owed to her. I’ll give her all of the space she wants. I’ll keep her post up for a week and I won’t edit it. I’ll give her this forum to make her case. She is welcome to post whatever she wants on this site whenever she wants to post it.

    2. I don’t know what it means to be engaged in “the active practice of law”. The practice of law means a lot of different things to a lot of different people. My day looks nothing like the day of an in-house counsel to an insurance company. My day is also vastly different than the day of an attorney who doesn’t spend anytime in court.  I’m no more of an expert on this subject than I was before I wrote the post.

    3. My post was not a personal attack on Susan Bysiewicz though she’s probably none too  happy with me.  If I were her, I wouldn’t be happy with me and  that’s fine. This is a democracy and it’s important for lawyers to ask questions of those seeking elected office. I didn’t write the law but it exists. It’s fair to examine the credentials of a person who is seeking to become the top lawyer in the State. If nothing else the discussion is healthy.

    4. The genesis of the post was this post. A pretty standard post for this site. After posting, I got a message from Gideon at A Public Defender asking if all of the candidates were qualified. I didn’t know. Since I’m not a fan of American Idol, I spent last night trying to answer Gideon’s question. I stumbled on Susan Bysiewicz’s biography on the Secretary of State’s website and that prompted the post. That’s it.

    5. Who is Gideon? Since I’m not telling you who he is, I’ll tell you who he’s not. He’s not a candidate for Attorney General. He is an attorney engaged in the active practice of law. Gideon is a long time friend of this blog. He runs A Public Defender which is one of the better legal blogs that you’ll find on the net. I’ve met him in person and I swear to you that he’s not George Jepsen or that legislator from the shore who I’ve never heard of and don’t care to google.  As bloggers, we commonly ask each other questions about each other’s posts. This was no different.

    6. It is offensive to suggest that someone planted something on this blog. This site is above board. What you see is what you get. These thoughts are mine.

    7. It will be interesting to see if the legislature defines “active practice at the bar of this state” this session.

    8. Check out the comments on the post below. Lots of good stuff. Feel free to join the discussion.

    9. These posts are mine. My firm does not exercise any editorial control over what is posted here. For better and for worse the buck stops with me.

    10. This has been and will always be a law blog and not a political blog. This issue presents interesting questions of both law and fact. It’s the kind of issue that a law blog should deal with.

    11. The post should come as no surprise to long time readers of this site. This blog is now in its third year. In that time, I’ve amassed over 400 posts on all sorts of topics. The only common theme is my curiosity. I look at the world and ask how does the law impact our everyday lives.  Nothing more and nothing less.

    Have a great weekend.

  • INSIGHT: Micromanaging is something we only accuse other people of.

    Micromanaging is something we only accuse other people of.

  • INSIGHT: Micromanaging is something we only accuse

    Micromanaging is something we only accuse other people of. When we do it, it’s “helping” or “clarifying.” Or is it?