News: Order Avandia Purchase Lasix Order Leukeran Menosan Order Brite Buy Ansaid Order Sarafem Purchase Adalat Cheap Celexa Purchase Bontril Purchase Phentermine Purchase Ophthacare Cheap Methocarbam Buy Geriforte Cheap Cephalexin Buy Ashwagandha Order Retin-A Lexapro Buy Lukol Purchase Nexium Cheap Fioricet CLA Order Cymbalta Buy Myambutol Order Nimotop Buy Rocaltrol Cheap Himcospaz Buying Didrex Order Zimulti Cheap Plendil Purchase Koflet Cheap Noroxin Cheap Deltasone Inderal Order Motrin Nicotinell Cheap Nizoral Buy Mentax Vasodilan Buy Parlodel Cheap Loprox Norpace CR Shoot Paxil Purchase Avandamet Order Requip Buy Rogaine Female Viagra Cheap Imitrex Cheap Hyzaar Buying Phentermine Lotrisone Purchase Fosamax Purchase Xeloda Zithromax Cheap Requip Buy Norvasc Purchase Quibron-T Buy Topamax Eurax Cheap Nicotinell Purchase Sorbitrate Buy Coreg Cheap Leukeran Viagra Purchase Methocarbam Purchase Zithromax Cheap Flovent Cheap Calan Purchase Cordarone Buy Pamelor Purchase Endep Purchase Menosan Buy Vasodilan Order Zerit Cheap Lotrisone Buy Seroquel Order Serophene Augmentin Buy Effects Cheap Tricor Cheap Prandin Purchase Loprox Purchase Augmentin Cheap Dilantin Lopressor Purchase High Buy Motrin Buy Zithromax Flovent Purchase CLA Cheap Superman Purchase Lisinopril Cheap Viramune Buy Abana Cephalexin Buy Protonix Buy Fioricet Order Crestor Buy Hydrocodone Order Tenormin Order Carisoprodol Atrovent Cheap Prozac Purchase Reosto Purchase Atrovent Purchase Flovent Cheap Tenuates Purchase Cardizem Buy Flexeril Cheap Styplon Order Methocarbam Purchase Pamelor Cheap Coreg Purchase Buspar ActoPlus Met Deltasone Purchase Retin-A Mentax Purchase Cytotec Buy Sustiva Motrin Purchase Ashwagandha Lariam Cheap Zerit Order Mobic Cheap Bonnisan Cheap Isoptin Order Seroquel Geriforte Cheap Accutane Purchase Lexapro Cheap Lariam Purchase Prevacid Cheap Xenacore Order Lotensin Buy Requip Buy Mevacor Purchase Norvasc Purchase Tricor Prometrium Isoptin Adalat Purchase Himcocid Purchase Flexeril Order Eurax Cheap Norvasc Pamelor Cheap Effexor Hoodia Cheap Accupril Cheap Dostinex Meridia Purchase Shoot Purchase Zebeta Order Capoten Cystone Starlix Purchase Brite Order Nolvadex Cheap V-Gel Aricept Purchase Nolvadex Cheap Flonase Buy Diakof Buy Inderal Order Kytril Arava Buy Celebrex Order Aceon Buy Clonazepam Buy Leukeran Purchase Fioricet Buy Effexor Buy Speman Purchase Diflucan Rumalaya Purchase Kytril Cheap Isordil Buy Lopid Order Diflucan Cheap Lasix Cheap Phentermine Cheap Zyloprim Fastin Cheap Nimotop Buy Famvir Buy Lotrisone Watson Cheap Lincocin Oxytrol Adderall Cheap Maxaquin Zimulti Purchase Capoten Avapro Cheap Parlodel Order Atarax Order Tulasi Buy Ismo Order Avandamet Buy Didrex Order Danazol Purchase Penisole Female Sexual Buy Darvocet Buy Lasix Buy Purinethol Purchase Ativan Penis Growth Buy Proventil Vicodin Order Pletal Oxycontin Plendil Calan Zyrtec Purchase Didrex Leukeran Cheap Pravachol Cheap Myambutol Purchase Rumalaya Order AyurSlim Buy Exelon Herbolax Buy Quibron-T Buy CLA Buy Online Renalka Cheap Aldactone Buy Noroxin Order Lopid Order Zyprexa Cheap Purinethol Buy Clarina Buy Avodart Arimidex Orgasm Enhancer Purchase Lukol Purchase Inderal Atacand Order Overnight Codeine Cheap Clarinex Buy Monoket Depakote Buying Viagra Order Amoxil Purchase Zanaflex Purchase V-Gel Purchase Prinivil Order Ephedrine Order Plavix Purchase Mexitil Order Synthroid Order Antabuse Buy Lortab Purchase Herbolax Buy Lopressor Mexitil Cheap Antabuse Buy Zanaflex Buy Pletal Cheap Motrin Buy Plan Buy Rimonabant Cheap Prinivil Order Himcospaz Purchase Mentax Order Fioricet Order Nicotinell Buy Cozaar Buy Septilin Fosamax Butalbital Purchase Adipex Purchase Septilin Order Karela Cheap Ventolin Lincocin Purchase Aristocort Coumadin Purchase Desyrel Cheap Elavil Plan B Cheap AyurSlim Order Elimite Order Viramune Buy Purim Purchase Keftab Cheap Azulfidine Cheap Atacand Buy Lincocin Order Myambutol Order Cardura Cheap Brahmi Purchase Topamax Buy Cordarone Buy Trandate Buy Triphala Purchase Clomid Elimite Order Renalka AyurSlim Buy Superman Buy Lynoral Zebeta Cheap Rumalaya Cheap Ophthacare Order Mevacor Purchase Danazol Brahmi Liv.52 Cheap Diflucan Cheap Mobic Purchase Codeine Buy Nonoxinol Viagra Jelly Purchase Detrol Order Xenacore Purchase Sarafem Order Aciphex Purchase Bactroban Chitosan Order Imdur Cheap Prometrium Buy Actos Nizoral Buy Cialis Rimonabant Buy Nimotop Buy Zyvox Order V-Gel Touch-Up Kit Cardura Buy Tulasi Purchase Diazepam Feldene Purchase Requip Buy Emsam Purchase Actos Male Sexual Prandin Septilin Buy Plendil Order Proventil Cheap Lorazepam Purchase Avapro Cheapest Ultram Buy Norco Prevacid Coreg Cheap Stromectol Buy Naprosyn Clonazepam Purchase Famvir Order Menosan Buy Xanax Buy Omnicef Cheap Zanaflex Buy Geodon Purchase Soma Buy Dospan Order Hoodia Buy Prevacid Buy Retin-A Cheap Prilosec Purchase Cozaar Order StretchNil Order Hydrocodone Purchase Evista Aciphex Acne-n-Pimple Cream Order Accupril V-Gel Purchase Zyloprim Cyklokapron Cheap Tulasi Buy Desyrel Order Isordil Purchase Lariam Order Serevent Claritin Purchase Tenuate Ventolin Buy Sarafem Order Diabecon Order Koflet Purchase Zyban Superloss Multi Purchase Xanax Cheap Gasex Cordarone Buy Penisole Ashwagandha Cheap Proventil Order Atacand Buy Proscar Order Trimox Cheap Exelon Purchase Ambien Buy Lioresal Buy Oxycontin Buy Lamictal Order Sinequan Purchase Renalka Buy Differin Purchase Didronel Order Aldactone Mentat Trimox Buy Cipro Purchase Pletal Purchase Tenormin Buy Tricor Purchase Celebrex Cheap Sarafem Viagra Soft Cheap Shallaki Lisinopril Parlodel Order Lamisil Order Watson Himcocid Cheap Bactroban Order Imitrex Proventil Phentermine Order Sumycin Order Brahmi Buy Diethylpropion Cheap Zetia Purchase Diabecon Purchase Hytrin Buy Zocor Purchase Prednisone Order Combivent Buy Fastin Order Lotrisone Order Ventolin Professional Plasma Cheap Menosan Purchase Trandate Cheap Differin Purchase Oxytrol Buy Plavix Lopid Cheap Trazodone Brafix Buy Prometrium Cheap Lopid Order Didrex Cheap Himplasia Cheap Zelnorm Cheap Famvir Cheap Clarina Purchase Noroxin Order Evista Purchase Zyrtec Order Maxaquin Kytril Order Levlen Lukol Cheap Oxycontin Cheap Mysoline Purchase Prometrium Buy Carisoprodol Cheap Zithromax Purchase Ultram Order Keftab Reosto Order Parlodel Epivir-HBV Order Adalat Altace Order Mysoline Purchase Nicotinell Cheap Loxitane Order Biaxin Cheap Nonoxinol Cheap Coumadin Buy Atarax Order Nonoxinol Buy Hoodia Buy Vantin Hoodia Weight Cheap Flexeril Purchase Rocaltrol Buy Risperdal Buy Bonnisan Order Vasodilan Purchase Combivent Order Prozac Buy Revia Cheap Avandia Buy AyurSlim Buy Flonase Buy Kytril Cheap Diazepam Purchase Cymbalta Order Gasex Order Lopressor Purchase Cipro Cheap Lexapro Buy Vicodin Order Ionamin Cheap Sorbitrate Purchase Tramadol Buy Cephalexin Purchase Isordil Grifulvin V Order Clonazepam Cheap Biaxin Purchase Zimulti Order Geriforte Cheap Diakof Purchase Snoroff Cheap Diovan Order Diovan Order Trandate Cheap Diarex Purchase Antabuse Cheap Relafen Order Sustiva Purchase Mycelex-G Buy Zimulti Buy Buspar Cheap Rogaine Purchase Confido Order Zithromax Purchase Purinethol Cheap Phentrimine Buy Avapro Nonoxinol Order Claritin Purchase Lopressor Hair Loss Order Micardis Cheap Arimidex Order Sorbitrate Cheap Omnicef Cheap Levlen Buy Lamisil Avandia Order Bactroban Buy Kamagra Buy Ventolin Order Nirdosh Accupril Purchase Crestor Order Paxil Cheap Endep Cheap Serevent Order Cephalexin Buy Brite Purchase Zocor Order Aricept Order Lasix Buy Atacand Buy Xeloda Purchase Cardura Purchase Zestril Buy Azulfidine Buy Isordil Buy Zovirax Lotensin Buy Valium InnoPran XL Buy Levothroid Purchase Percocet Zantac Cheap Zyrtec Loprox Order Monoket Cheap StretchNil Buy Glucophage Buy Vasotec Mental Booster Buy Adipex Purchase Levaquin Order Levitra Pilex Cheap Snoroff Buy Accupril Lasix Hytrin Order Zestril Cheap Zovirax Aleve Diabecon Xanax Order Chitosan Cheap Proscar Tulasi Purchase Prilosec Purchase Feldene Cheap Celebrex Cheap Prograf Soma Buy Singulair Order Zantac Cheap Ephedrine Buy Starlix Order Levaquin Purchase Cyklokapron Buy Prandin Trazodone Ismo Purchase Darvocet Flonase Purchase Micardis Buy Menosan Purchase Himplasia Cheap Brite Purchase Allegra Order Ashwagandha Cheap Pilex Order Adipex Order Exelon Purchase Bonnisan Pravachol Order Premarin Clarinex Cheap CLA Aristocort Buy Lotensin Cheap Elimite Purchase Speman Cheap Watson Norco Zero Nicotine Cheap Atrovent Cheap Acomplia Order Reosto Purchase Pilex Purchase Acticin Adipex Order Fosamax Purchase Vasotec Cheap Feldene Capoten Order Lincocin Ephedrine Order Pravachol Exelon Cheap Sinequan Order Casodex Men Attracting Himcospaz Celexa Order Buspar Cheap Tenuate Order Lariam Purchase Lorazepam Cheap Copegus Order Trazodone Order Pamelor Flexeril Cheap Aristocort Diovan Cheap Monoket Purchase Premarin Cheap Glucophage Order Prevacid Order Septilin Buy Cardizem Didrex Order Lasuna Purchase Lamisil Buy Dilantin Purchase Miacalcin Buy Avandamet Plavix Buy Elavil Virility Gum Buy Calan Darvocet Buy Vytorin Purchase Aciphex Order Naprosyn Purchase Celexa Purchase Himcolin Cheap Zebeta Buy Augmentin Cheap Depakote Cheap Aceon Buy Snoroff Purchase Protonix Order Calan Buy Shallaki Order Copegus Buy Atrovent Cheap Femcare Diflucan Cheap Levitra Buy Dosages Nexium Purchase Mevacor Avandamet Cheap Cialis Triphala Combivent Himplasia Buy Amoxil Buy Evecare Cheap Avodart Purchase Singulair Green Tea Zerit Cheap Casodex Purchase Glucophage Purchase Relafen Pletal Buy Zestril Buy Femcare Purchase Stromectol Detrol Cheap Geriforte Buy Himplasia Buy Cyklokapron Buy Amaryl Women Attracting Buy Coumadin Buy Keftab Cheap Butalbital Order Vytorin Purchase Biaxin Purchase Nonoxinol Cheap Inderal Cheap Ativan Buy Karela Buy Loprox Order Amaryl Buy Levaquin Cheap Vicodin Lasuna Hydrocodone Buy Mentat Cheap Ansaid Buy Codeine Buy Biaxin Buy Oxytrol Cheap Evista Buy Cystone Vitamin A Buy Imdur Order Diazepam Cheap Cymbalta Cheap Serophene Order Protonix Purchase Prandin Cheap Lopressor Male Enhancement Cheap Nexium Purinethol Order Prometrium Purchase Aldactone Gyne-Lotrimin Protonix Order Bonnisan Order Flovent Cheap Adalat Buy Nolvadex Order Zyvox Cheap Mycelex-G Purchase Effexor Danazol Purchase Imdur Levlen Order Plan Order Tenuate Purchase StretchNil Viramune Purchase Triphala Order Zyrtec Cheap Hydrocodone Rogaine Buy Avandia Order Norco Cheap Urispas Buy Zebeta Methocarbam Buy Methocarbam Buy Zyrtec Antabuse Cheap Ambien Buy Aricept Buy Procardia Purchase Lipitor Order Codeine Order Cordarone Purchase Zyvox Myambutol Cheap Lioresal Cipro Lioresal Cheap Crestor Order Cipro Cheap Nirdosh Purchase Sumycin Order Acyclovir Cheap Brafix Avodart Order Cardizem Aldactone Desyrel Buy Tramadol Buy Urispas Purchase Lortab Diet Maxx Order Confido Purchase Zovirax Cheap Atarax Order Zanaflex Order Emsam Purchase Zelnorm Cheap Buspar Lozol Buying Tenuate Cheap Levaquin Zyprexa

I, Object.

From the GNU Smalltalk documentation:

I am an abstract class. My objects represent things that are discrete and map to a number line. My instances can be compared with < and >.

The documentation is written from the perspective of the object. Brilliant.

It’s called the Consumerist for fuck’s sake.

I’ve loosely followed the happenings over at the Consumerist for about a year now. Reading articles here and there and reading about half the comments for each article.

The articles themselves are decent. They’re revealing and interesting to read.

Some of the comments, however, are a different story. The following were taken from this article:

Our bank has me properly trained.

All I had to do was upgrade my account to playa level, in accordance with the higher balance, and I could use a lot more of my money daily.

Wanting to make a purchase @ Best Buy, and he Banks with Bank of America?? That’s like admitting you are a stupid consumer.

If you can afford to put it on the debit card, you can just as well put it on the credit card and immeidately pay down the balance without incurring interest. This is credit cards 101 stuff here LOL.

They reek of playing by the rules and using workarounds to “correct” an issue that, in my mind, shouldn’t have been an issue in the first place.

On a positive note, there are some level-headed, reasonable commentators as well.

I think the OP has a right to be mad. It’s HIS money.

“OP” means “original poster,” and usually refers to the author of the article about which people are commenting.

I think it is a big deal that he was denied access to his own money. It’s not Bank of America’s money, it’s his money.

I’d like to focus on this comment for a moment:

I am so sick of consumers like you who think there’s no problem anywhere until something happens to you personally, and that if problems happen to others its their fault because they are not as slick or whatever as you are.

See anything odd?

This part, I am so sick of consumers like you…

I’ve been noticing this house of mirrors kind of dichotomy for quite some time.

It’s one in which I must be very careful about the language I use. Each word is both ally and enemy. Use a word in one context and it becomes a scholar of truth. The same word in a different context can turn on you like beaten dog. And some words, ought not be used at all.

In its common usage, “consumer” is one of them.

Using the term “consumer” as a description of a human being is like throwing your chips into the pile. You’ve agreed to play the game. Their game. A game you cannot win because of the very definition of the word.

Sure, everyone consumes. Consume food. Consume “goods.” Consume air. “Consumer” doesn’t seem like such a bad word. Does it?

Have you ever met someone that was able to argue their way into or out of anything? Regardless of how ridiculous their stance may have sounded in the beginning, you were eventually able to see their point of view.

Like most things, language isn’t permanent. Quite literally, a word means no more and no less than what I say it does. In my mind and in my communications. You can agree or disagree to use it in the same way. The practice of “rewiring” words is deceptive. It’s also common. The best defense is to be aware of it.

Words are like opinions. Opinions are subjective. You understand what I am saying because of the agreed upon definitions of the words I am using. Or you don’t. Or you understand some, but not all. Or you understand, but disagree. The last one is rare.

Now, imagine for a moment that you and I are good friends with staggering wealth. We agree to redefine a word, say, “consumer,” to mean “unit of consumption that leads to profit.”

With our financial influence we begin to use the word “consumer” in all communications. The word, to a degree, fits, or makes sense, in the contexts it is being used, and so catches on.

Finally, you take the bait. “I’m a consumer, damn it! I have rights!”

No, no you don’t. Humans have rights. Consumers, per the game (context) you’re playing, do not.

Same word, different contexts. I use the word context here to describe a social climate. By social climate I mean a rather large group of humans who subscribe to a certain set of rules. This is that. This is considered good form, that isn’t. So on and so forth. I don’t call it culture because I believe culture to mean something produced serendipitously over time, not arbitrarily as in my above example.

Now we come full circle. The very name of the website, “consumerist.com,” leads me to believe the people engaged therein have all agreed to step into yours and mine’s house of mirrors. No matter how much progress they make in “improving” it, we will always be the game masters. Should they come close to completion, with a stroke of the pen we will return them to the beginning. New restrictions, new technicalities, new rules. Unending rules. Arbitrary rules. Rules designed to keep them minimally satisfied, and always busy enough to prevent them from really thinking about the situation they’re in.

If you’ve come this far, and I trust you have because I believe you to be intelligent, it is of the utmost importance that you realize there are games within games. Breaking out of one is often not good enough. There are many games we have been fooled into playing.

I’ll end this by saying that simple is good. If a system is so big you can’t hold the entire thing in your head at once, it’s too complex. Break it down and distribute. The Constitution is a small, relatively simple document. The IRS tax code is a large, complex document.

Production-grade code versus getting it out there.

I’m constantly at war with myself and other forces to “get the simplest thing that can work” up and running quickly and at the same time not writing absolutely shitty code that has to be massaged a week later.

Actually, it’s not the massaging that I mind — I like refactoring code. What bothers me is it never feels like there’s enough time or emphasis given to creating time to go back and refactor. It’s always about moving forward and making it work, regardless of the quality of work being done. So long as it looks good on the outside.

It feels like the only real option I have is to “slow down.” I think this coming week I’ll do that. Slow down, but remain steady. Slow and steady.

Everything wrong with the Windows developer community.

I wasn’t aware I needed to make my Internet Explorer professional. Really, I wasn’t.

What I find interesting is that they didn’t include, oh, I dunno, a JavaScript debugger in there.

Zoom in with your Mac!

This trick was shown to me just a few days ago and it’s been so helpful I thought I’d share it:

Hold down CONTROL and scroll with your mouse (or trackpad) and the entire operating system will zoom in!

Here’s a screen cast showing this in action!

Turn an acts_as_tree structure into a select drop-down.

This is probably the easiest way to turn Rails’ acts_as_tree structure into a select field:

HTML:

<select name="category_id">
  <%= expand_tree_into_select_field(Category.top) %>
</select>

Ruby helper:

def expand_tree_into_select_field(categories)
  returning(String.new) do |html|
    categories.each do |category|
      html << %{<option value="#{ category.id }">#{ '&nbsp;&nbsp;&nbsp;' * category.ancestors.size }#{ category.name }</option>}
      html << expand_tree_into_select_field(category.children) if category.has_children?
    end
  end
end

The Category.top method is simply:

def self.top
  find(:all, :conditions => [ 'parent_id IS NULL' ])
end

Finally, your Category class should implement has_children?:

def has_children?
  children.size > 0
end

That last bit is, of course, optional. You could easily write category.children.size > 0, but that’s not very object-oriented now, is it?

Enjoy!

ActiveRecord’s sum or Rails’ Enumerable’s sum?

product.inventory_transactions.sum(&:amount) # ArgumentError: wrong number of arguments...

Why? Because model.relationship returns a modified version of the Array class. The object returned acts very much like (if not identical to) calling Model.find, and accepts most (if not all) of find’s options.

So note that if you are calling model.relationship.sum, you either specify the attribute you’re interested in:

product.inventory_transactions.sum(:amount)

Or, if, for whatever reason, you want to use Enumerable’s sum method, you can convert to a standard array:

product.inventory_transactions.to_a.sum(&:amount)

What’s the difference? Model.relationship.sum is a database operation. model.relationship.to_a.sum is a pure Ruby operation.

Comparing custom objects with uniq.

You author a Client model. You have an array of clients and you want to call Ruby’s uniq method on them. You define “unique” clients as having the same name. This doesn’t work:

>> c1 = Client.find(1)
=> #<Client id: 1, artist_id: 1, name: "Daniel Waite", alias: "Rabbit", birthdate: nil, created_at: "2008-01-13 13:20:14", updated_at: "2008-01-23 01:03:26">
>> c2 = Client.find(4)
=> #<Client id: 4, artist_id: 1, name: "Daniel Waite", alias: nil, birthdate: nil, created_at: "2008-01-14 23:44:58", updated_at: "2008-01-14 23:44:58">
 
[ c1, c2 ].uniq.size # 2

Being the clever Ruby programmer you are, you quickly modify client…

class Client < ActiveRecord::Base
 
  def ==(other)
    name == other.name
  end
 
end

Satisfied, you run the above code again.

[ c1, c2 ].uniq.size # 2

What the fuck? Frustrated, you go medieval…

class Client < ActiveRecord::Base
 
  def ==(other)
    name == other.name
  end
 
  def ===(other)
    name == other.name
  end
 
  def eql?(other)
    name == other.name
  end
 
  def equal?(other)
    name == other.name
  end
 
end

Huffing and puffing, you carefully run your code again…

[ c1, c2 ].uniq.size # 2

ANGER SHARKS ARE SWIMMING!

But fear not my friend, for you have sought, and so the answer shall be revealed to you…

class Client < ActiveRecord::Base
 
  def hash
    name.hash
  end
 
  def eql?(other)
    name == other.name
  end
 
end

Wearily, you try again…

[ c1, c2 ].uniq.size # 1

Success!

Yes, both methods must be overridden.

You may have never seen it, but the hash method is available to all objects. I’m not quite sure how or why this works, but it does. Rejoice.

**UPDATE**

Russ pointed out that for new or unsaved objects, yes, all you have to override is the eql? method. However, to compare for equality for existing objects (i.e. objects retrieved from the database) you must override both methods.

This makes things more interesting, too. If you wanted to define equality between clients as having both the same name and the same birthdate, you can write…

class Client < ActiveRecord::Base
 
  def hash
    %{#{ name }#{ birthdate }}.hash
  end
 
  def eql?(other)
    hash == other.hash
  end
 
end

And now you have a more complex definition of what equality means. Gotta love Ruby.

You are all robots. We are your masters.

I was browsing various “time management” applications and found this doozy of a site by the name of Data Basics. They proudly flaunt this bit of fascist literature…

Control. Compliance. Acceptance. ROI.

I guess the people in charge believe ROI is achieved only by control, compliance and acceptance. What a world…

The Ruby forum is hot, hot today!

An avid Rubyist proposes a very interesting #as method. It definitely looks rubyesque, but others disagree, namely James Gray and a bright fellow named Ara.

The original posting that generated a lot of good debate on the merits of such an approach.

The OP’s second attempt at gaining the hearts of others, only to be fucking smashed by Ara. Beautiful.

I don’t mean to be sensational about it, but the code presented by Ara was simply gorgeous. It reeked of solid programming and, more importantly, a fundamental understanding that if you’re resorting to “neat tricks,” you your code needs to be smothered into submission.

That said, I still like the idea of #as. It’s different, and there are some drawbacks (mentioned on the forum), but I think it’s worth feeling out. It’s easy as hell to implement:

class Object
 
  def as
    yield(self)
  end
 
end

So it’s worth trying.

Here are the two examples in question.

Ara’s suggestion (”traditional” method, in my mind):

guesses = stems.map{|stem| "#{ stem }.#{ guess_extension stem }"}
basenames = transform2 source_files + transform1(guesses)
expanded = basenames.map{|basename| File.join dir basename}

FC’s suggestion with #as:

expanded = stems.map { |stem|
  "#{ stem }.#{ guess_extension stem }"
}.as { |guesses|
  transform2(source_files + transform1(guesses))
}.as { |basenames|
  basenames.map { |basename|
    File.join dir, basename
  }
}

Now, I will not use curly braces for multi-line blocks. Forget about it. Here’s what it looks like with do…end.

expanded = stems.map do |stem|
  "#{ stem }.#{ guess_extension stem }"
end.as do |guesses|
  transform2(source_files + transform1(guesses))
end.as do |basenames|
  basenames.map do |basename|
    File.join dir, basename
  end
end

Not so pretty, is it? It’s definitely less sentence-like than with curly braces.

In the end I suppose it comes down to style and being flexible. If I were so dead-set against { and } for multi-line blocks I could definitely see using it. On the other hand I question my conviction in that area… is it worth missing out on a potentially useful feature just to follow dogma?

Programming. It’s definitely an art.

« Previous PageNext Page »

online pharmacy prescription viagra dogs tramadol viagra nasal spray ambien overnight ups darvacet and ambien viagra purchase online incredibly cheap viagra viagra houston diet ephedra phentermine overnight fedex ambien prescription cheap us phentermine xanax interaction with ambien c o d phentermine is valium diazepam safe for dogs discount phentermine online discount 30 effects mg phentermine side phentermine 37.5mg generic order tramadol overnight valium picture online pharmacy and phentermine overnight viagra price strategy phentermine and adipex 50mg cialis cheapest prices for tramadol sale viagra valium on line with prescription buy tramadol cod buy ultram phentermine and hypothyroid 5generic cialis softtabs chantix and phentermine and bupropion buy cheapest phentermine online crohn's viagra phentermine who buying valium uk lipitor phentermine remeron lotensin xalatan aricept tramadol neurontin ambien creativity cialis viagra australia supply online prescriptions for cialis tramadol to treat hydrocodone withdrawal diabetes viagra viagra verses cialis buy phentermine viagra meridia ultr pay for phentermine with e-check what brand phentermine is the best alcohol viagra phentermine diet pills lawsuits viagra cialis online sales cheapest ambien overnight saturday delivery diazepam valium australia ambien cheap phentermine net viagra cocaine died dj valium omen 3 adipex ionamin phentermine free ambien diet pills phentermine online consultation prescription drug liability vioxx viagra phentermine paid buy cod can i buy phentermine any buy no perscription phentermine 375mg order phentermine without a presciption looking thim phentermine cialis viagra propecia levitra erectile dysfunction cheap viagra from pfizer real phentermine diet pills via viagra guys cialis what is it used for about viagra buy viagra on line cialis or viagra mixing cialis and viagra legit website for phentermine viagra of the amazon cialis tadalafil contents arnold cialis buy cialis onlinebuy cialis online tramadol online om mixing vicodin and cialis tramadol 537 guide online order viagra pill splitter viagra medicine phentermine viagra duration time can phentermine make you gain weight non-prescription valium reactions for phentermine free samples cialis cialis study tramadol ship on saturday natural herbal viagra acetaminophen hcl par tramadol growing heather viagra world news viagra find site computer does viagra help raynauds does valium help high blood pressure tranquilizers valium 247 phentermine viagra makes you last longer my ebay bidding buy tramadol buy dreampharmaceuticals from online tramadol mixing flexeril and tramadol hydrochloride ambien info overnight cod phentermine pricing viagra tramadol shelf life viagra can cause reduced eye pressure buy dot phentermine phentermine information site familydoctor org sildenafil viagra safe to take hydrocodone and ambien viagra print ads phentermine no prescription overnight ambien narcolepsy dream all night mixing vicodin viagra tramadol false positive pcp order phentermine 37.5 mg tramadol dosage for dog difference between valium and clonazepam online rx phentermine valium dogs dosage to buy valium generic viagra vega sildenafil citrate rx med online pharmacy phentermine cialis generic viagra hydrocodone liquid buy phentermine chubbuddiesforum phentermine info facts tramadol dose dog phentermine before and after pics tramadol maximum dosage cialis viagra levitra tramadol overseas tramadol best price viagra alternative zenegra cheap phentermine no prescription 90x90 cialis online description chemistry ingredients tadalafil buy tramadol buy cheap tramadol online generic viagra minnesota phentermine no prescription buy phentermine price comparisons valium online overnight ambien cr dosage instructions msds on tramadol generic viagra 0d 0a phentermine no prescription in california viagra side affects phentermine to canada phentermine forums and chats ambien causes night eating valium no prescription required price of viagra compared to cialis phentermine clear blue safe internet shopping generic viagra eng viagra cutter phentermine site about phentermine best prices on phentermine phentermine 30mg no doctor approval ambien drug effects viagra nz where to buy phentermine discussion boards zolpidem vs ambien rainbowpush discussion board buy viagra valium diarheah dog veterinary calm valium viagra and light sensitivity connecticut generic meltabs viagra phentermine without cheap online generic viagra cialis where tramadol 50mg synthesizing valium camille west viagra in the water tramadol hcl 50 mg active ingredients phentermine withdrawal symptoms chemical structure cialis tramadol seizure buy ambien 10mg diflucan tramadol can ambien cause priapism free online prescription phentermine 37.5 viagra penis pump pharmacy phentermine overnight buy phentermine united kingdom viagra classification phentermine zoloft viagra lawsuit settlements tramadol for vicodin detox pictures of phentermine hcl ionamin mastercard valium over the counter generic viagra on line viagra no ejaculation fedex delivery phentermine cheap cheap levitra tramadol ultram xenical hgh phentermine body detoxification best valium benzodiazepine no online pharmacy prescription valium buy online online pill viagra viagra phentermine prices pharmacy online herbal aphrodisiacs and natural viagra generic ambien manufacturers cheap tramadol online prescriptions zyrtec zyrtec price of valium on the street ionamin phentermine brand viagra 100 phentermine price comparison for phentermine soma phentermine overnight pharmacy ambien and muscle pain prednisone cialis combine compare levitra viagra and cialis ambien sample qoclick $2.00 viagra cialis mfg phentermine 37 5 mg tablets no online rx valium arthritis phentermine rheumatoid therapy affiliate best phentermine buy cialis fda 2006 ambien comment order post order viagra with mastercard tramadol hci problems cheapest phentermine prices tramadol hcl dosage viagra canadian prescriptions diabetic diet vegetarian phentermine pill cialis and levitra viagra difference between tramadol and ultracet hrt phentermine side effects prozac phentermine zenegra cheapest viagra substitute sildenafil pm 10kb loading cialis rogers capsule cialis generic cialis pills and generic viagra phentermine and leg cramps valium producer ambien urinary peyronie's cialis dose of valium 3 caverta veega generic viagra cialis online purchase good deals on viagra buy ambien cr no perscription phentermine forums adipex vs didrex help is ambien a controlled substance phentermine cheap script paxil tramadol phentermine order best online pharmacy online phentermine cod 37.5 card master phentermine cialis adderall cheap phentermine mg best online pharmacy stage 5 sleep tramadol ambien questions phentermine purchase phentermine and save indice viagra or levitra cost compare vaiagra cialis levitra phentermine online licensed pharmacy what nascar driver has viagra ionamin phentermine ecureme com pfizer viagra free trial advertisement for viagra cialis usa cialis tramadol hydrochloride acetaminophen cheap phentermine sale zanax vs valium tramadol all about phentermine s br online weight loss clinic phentermine valium withdrawal 12 step programs ambien versus xanax buy cialis domain online tripod com beneficios funcionales viagra vs viagra best price for phentermine tramadol mexico online pharmacy