Posterous theme by Cory Watilo

Show me a butterfly and I'll show you...

Silence-of-the-lambs-1-copy
Show me a butterfly and I'll show you a corpse
Show me sunshine and laughing angels
And you'll hear nothing but death and sorrow
Play me wonderful music
And I'll introduce you to children that cut themselves
I give thanks to those who sing, dance and play!
They express harmony
Skating down the middle
Along the center
Between the isles
Through the narrow path
Bowing to those who smile
Smiling to those who suffer
Yes, please, thank you
Ouch
Show me a corpse and I'll show you a butterfly

Boolean Logic and the Evolution vs. Creationism debate

Fish-kiss

In computer science there's this concept of boolean logic. It occurred to me a while ago that many debates could be settled (or abandoned in favor of more friendly/cooperative activity) if the debating parties decided to consider switching the boolean operator they were using.

For example, in most "versus" debates, such as "Evolution vs. Creationism", the boolean operator being used by the parties is  the XOR operator, that has the following truth table:

Xor_operation

If x here represents "Darwin is Right", and y represents "Creationism is Right", then we see that according to the truth table the debating parties only accept as truth one of two realities: either Darwin is Right, or Creationism is right, the two theories cannot be either both right, or both wrong.

Some people really enjoy getting blue and the face and yelling at each other and fighting one another. I don't know if this will ever happen, but perhaps one day those people who like to engage in "verses debates" might consider changing the boolean operator they're using, and in doing so save themselves the blue and angry faces.

For example, let us consider what would happen if they decided to switch to the OR operator:

Or_operation

Ah, what a fascinating change of possibility! Here we see that it might be possible that both propositions are correct, i.e. "Evolution is Right" AND "Creationism is Right". Personally, I have no problem with such a possibility and can see how both perspectives could be correct simultaneously. I don't see why one must preclude the other from being true. So I just sit back, and, for the most part, keep my mouth shut.

What would happen if we took every major "versus debate" and did the same thing with it? Why, we might end up with no debate at all! Determinism AND Free-Will. Creationism AND Evolution. What would we do with all that extra free time then?!?

As long as we see how such a thing could be possible, then maybe the whole blue-in-the-face grab-your-pitchforks reactionism could be toned down a bit. Perhaps then we might even be able to graduate to LEVEL 2: Humility and Admitting You Don't Know...

Hemp Seeds: A vegan/vegetarian's best bet for protein?

Shelled-hempseeds

On the topic of nutrition and taking care of the physical vessel one can find all sorts of advice. Each person finds what resonates for them, and this post is aimed at those vegans/vegetarians (or those considering switching to such a diet) who are wondering what might be their best source of protein.

Vegans and vegetarians have many sources of protein available to them! These include grains like Quinoa, the low-on-the-consciousness-scale items like Nutritional Yeast (both complete proteins), and various nuts, seeds, and legumes are available as well, like peanuts, sunflower seeds, pistachios and lentils.

The website Veganhealth.org has a section on protein sources for vegans, however it doesn't discuss the amazing nutritional profile of hemp seeds at all. What I find incredible about hemp seeds is their friendlinessbalance and protein density.

Friendliness

Many people have allergic reactions to nuts and seeds, but this doesn't appear to be the case with hemp seeds:
Hempseed is usually very safe for those unable to tolerate nuts, gluten, lactose, and sugar. In fact, there are no known allergies to hemp foods.[citation needed] Hempseed contains no gluten and therefore would not trigger symptoms of celiac disease.[25]
Highly stomach-friendly and digestible:
Seeds of the plant cannabis sativa, hemp seed, contain all the essential amino acids and essential fatty acids necessary to maintain healthy human life. No other single plant source has the essential amino acids in such an easily digestible form, nor has the essential fatty acids in as perfect a ratio to meet human nutritional needs.  

Balance

Hemp seeds appear to contain a "perfect" (or close to perfect) balance of proteins and omega 3/6/9 oils according to many sources:

Ideally, one third of the fat consumed should be EFAs. At least 10% of daily calories should be LA and at least 2% LNA. The optimal ratio of LA to LNA in the diet is between 2 to 1 and 5 to 1. The 2 to 1 ratio of LA to LNA is more advantageous in stemming fatty degeneration diseases. Flax seed oil is 58% LNA, possibly making it the best seed oil to combat degenerative disease, but it contains only 14% LA. Hemp seed oil is 55% LA and 25% LNA, or 2.2 times more LA than LNA, making it the best seed oil for optimal health and prevention of fatty degeneration. 

Hemp is not unique in having all the essential amino acids in its embryonic seed. Flax seeds also contain all the essential amino acids as do many other seeds in the plant kingdom. What is unique about hemp seed protein is that 65% of it is globulin edistin. That is the highest in the plant kingdom. 

Hemp seeds can contain up to 36% protein. In the 1950s, scientists worked to determine lab models for foods, the vegetable protein model was derived from hemp seed and was called edestin. The protein in hemp seed is comprised of approximately 65% of edestin and can be found only in hemp seed protein. Edestin aids digestion, is low in phosphorus and is considered the backbone of human cellular DNA. The other one third of hemp seed protein is Albumin, another high quality globulin protein similar to that found in egg whites.

 

Protein Density

From the nutrition facts label at my local whole foods, just 2 tsp contains 6 grams of protein! Another site says 5 grams per 3 tsp. Whatever the case may be, it appears that hemp seeds will get you more protein, in better ratios and more easily absorbed, than many other sources (including flaxseeds and almonds). Hemp seeds have the 2nd highest amount of protein available by weight (after soy).

If you are looking for a high protein food for a high protein diet but you would rather not eat meat, or are not interested in bulking up on whey or soy, hemp as a high protein food is perfect for you. With just a couple of handfuls equalling a full days worth of protein, it is the ultimate high protein food.

Growing hemp is "illegal" to grow in the US! Join some causes!

While many hemp related products can be found on the shelves in various stores, they are still very expensive because of legal issues related to growing it in the United States:

Hemp is not legal to grow in the U.S. under Federal law because of its relation to marijuana, and any imported hemp products must meet a zero tolerance level. It is considered a controlled substance under the Controlled Substances Act (P.L. 91-513; 21 U.S.C. 801 et seq.). Some states have defied Federal law and made the cultivation of industrial hemp legal. These states — North Dakota, Hawaii, Kentucky, Maine, Maryland, Oregon, California, Montana, West Virginia and Vermont — have not yet begun to grow hemp because of resistance from the federal Drug Enforcement Administration.[78]
Please consider this invitation to join some causes and spread the word through your social networks:

Her Dreams

Pastedgraphic-4
Her dreams, only she can see
(Or so she thinks) 
The others do not understand 
(Or so she thinks)
The possibility
Even she has doubts
Pity
Whose dream are we in?
It seemed impossible
Just a while ago
Just a dream they said
Patience
Not a stretch from here to unicorns
Put the lithium down
Be here now
Be you
Be
By worrying about the past
By worrying about the future
By worrying
You spoil the moment 
Relax... 
I think I just saw a unicorn

Facebook Chatter and the Q

Pastedgraphic-2
While they chatter chatter
The rain goes pitter pitter
patter patter
Up, down, to the side
Stop.
Time to write poetry!
No. No one here.
Just us dogs.
Haven't you got anything to contribute?
Eat. Sleep. Work. Drama.
Words.
Sound.
A wise man talks nonsense.
Move along, you're in the way.
Smile, fool.
Hush
It's not what you say or do.
It's not who you are.
It simply is.
Look at it this way.
No that way.
Or close your eyes and don't look.
Sleep.
The energy comes back and it continues all over...
In the Q continuum... hay rolls.
In the world, people want to be Q.

(download)

Sprint's Opportunity: "We don't spy on you."

During today's market trading Sprint (S) fell over 16% on the news of AT&T's intention to acquire T-Mobile. Just days before, rumors of merger talks between Sprint and T-Mobile had circulated the web, so the stock hit shouldn't be a surprise.

The telecom market is remarkable in many ways right now, but what strikes me most about it is that everyone sucks.

When the bar for quality is set at not spying on your customers without a court order, and responding to their phone calls, it seems to me like Sprint's future is not necessarily a dark one.

At the moment, Sprint can't compete with Verizon or AT&T on coverage, so perhaps they should compete along a different dimension.

Nsa-eagle-no-circle_small
When your competition is voluntarily playing the role of Big Brother, the marketing writes itself!

Sprint-spy
Sprint-bigbrother

Sprint-priority

Normally, I'd appeal to your altruistic side, point out that you'd be supporting a constitutional right, etc., but considering your status as a corporate giant, appealing to your bottom line might be more prudent.

The notion that people don't care about privacy is hogwash. One need only to look at the anger in politics over "Big Government" to see the significant interest there. Sprint should leverage this concern. A campgain along these lines, if competently executed, would deal a significant blow to AT&T. The geeks will back you up too and provide a halo effect (recommendations to the less tech-savvy Mom & Pop).

In the future, when we've gone further down the surveillance-society rabbit-hole, such an opportunity might not even be possible. Now is the time to do this.

 The future could be bright for you...

Boys, it's time to reel this one in.

(If you can't tell, this was written, tongue-in-cheek, but only somewhat.)

What the fuck is up with Jobs?

A Samurai Warrior wins battles, he takes care of his troops, and at the end of the day, his work done, he reports to his Master with Good News.

But. Both, the Master and the Warrior, know, that before battle can be done on the Green Hillside, there had better be a damned hillside to do Battle On!!

The warrior fights, he takes care of his troops, his family. He reports to his master, but NO ONE forgets that EVERYONE is in the Service of the Great Provider, for whom they are THANKFUL. Thankful for providing the green pastures to do battle on, for providing the food to nourish their troops, for giving the clear air through which they charge, which fills their lungs with the life affirming energy that it needs.

Take Care of the House! Take care of the Home! Take care the Earth!

The Battle is Important, but do not get caught up in it, or you will forget that it can only take place in a BattleGround.

On Lisp's Readability and Parenthesis Stacking

Pop Quiz!

Inside of what form (function/macro) is the println on the highlighted line located?

Lisp_indentation

 

I don't know about you, but it takes me a while to figure that out.

Whereas in other languages I can usually rely on the indentation of code to understand its structure, with most Lisp formatting I often end up having to rely on the editor, like a crutch, to figure it out.

It's not just me. Lots of other people have the same issue. You may have heard people complain about Lisp's parenthesis. Some have called it a "parenthesis jungle" or a "parenthesis zoo." The historically poor readability of Lisp has nothing to do with parenthesis and everything to do with how they're used, or rather, abused. That is the underlying complaint.

Without the help of fancy editor tricks, the only hint at where the 'println' function is located are just a few spaces (often no more than two) that are separated by many lines of code. Lisp is the only language that I'm aware of where this happens.

To address this issue, people will often rely on their editors. Rainbow parenthesis, visible whitespace, and indentation guides are some of the editor features that attempt to address this issue. The problem though, is that these features aren't universally available across editors, nor are they available when the source code is viewed outside the editor, for example, on Github or some other code hosting site.

For every language I've used (other than Lisp), these editor tricks are completely unnecessary. The only time I've ever wanted rainbow-parenthesis support in my editor is while I'm looking at someone else's Lisp code.

In short:

The readability of your source code should not depend on the editor used to view it.

Lisp code can be just as readable as C, Ruby, and Python. The only thing stopping it is a community adopted convention, and I find that both sad and disappointing. Lisp is a beautiful language, so why make the structure of its code unreadable?

Let's have a look at that same block of code, this time formatted differently:

Lisp-indentation-2

 

Now try the question again, in what function or macro is the highlighted line located in? Was it easier to answer this time?

This style is called "trailing your parenthesis," and is almost a taboo in the Lisp community. When asked why it is a taboo, you'll often hear answers like, "So that your parens don't end up lonely," and "It wastes lines!" In other words, no real reason. Parenthesis cannot get lonely, and the "importance" of "line count" is second to that of readability, at least I hope you'll agree.

What I found most puzzling and ironic about all of this is the irreverence that some Lispers treat parenthesis with. I've actually heard it said that parenthesis aren't even meant to be looked at. Sometimes this attitude and disdain for parenthesis is laughably obvious:

Stacked
Nothing says "Get out of my sight" like piling up, or "stacking" parenthesis. I think the root of these feelings stem from the fact that parenthesis aren't used to help structure code, and when that's true, I can see how it's possible to feel that they're just "in the way."

They are treated as merely a necessary evil of the prefix syntax of function calling in Lisp.

This not only hurts readability but it hurts writability as well. Say I want to insert a new function call at the end of the body of a let call, only to discover that the closing parenthesis that I need to find is buried inside a paren stack. In this situation, you have to resort editor tricks, either the highlighting of matching parenthesis or a keystroke to jump to the matched paren. Those are some interesting hoops to jump through when in other languages it would be a simple point-and-click.

Detractors of "paren trailing" will say that you shouldn't use parenthesis to delimit scope because they are not scope delimiters (as braces are in C or Java). I think this is a very weak argument because they do delimit a scope. "Scope" does not only refer to variable scope, but it can also refer to the scope of a function call. Why treat parenthesis with such disrespect, and at the cost of the readability of your code, when by using them you are enhancing the readability of your code and giving them the respect they deserve?

No other language that I'm aware of stacks scope delimiters or has a community where the standard indentation width is two spaces wide, and where sometimes even a single space is considered acceptable.

Supposing this wasn't the case though.

What would it look like if C developers adopted this convention?

With apologies to the developers of Aquaria for this experiment, here's C++ code, showing Lisp-style stacking on the left, and what for C code is considered "normal" brace trailing on the right:

C
It's obvious which code is shorter, but which is easier to read and understand?

 

Conclusion

Code style is an almost religious affair, and debates over it can get heated.

I am not asking you to change your style if you're comfortable with paren stacking. I am merely explaining the reasons why some choose not to do so.

If you feel that parenthesis stacking actually improves the readability of your code, by all means, feel free to do so! However, "everyone else is doing it" is not a good reason to sacrifice the readability of your code.

(P.S. If you want trailing paren support in Emacs, I've written a simple 'lisp-indent-line' function you can use or build off of.)

 

Update: Another argument made is that "Lisp nests more than C" and therefore stacked parens are good. I think this is a poor excuse for a couple reasons:

  1. I've written and seen a lot of Lisp code. Most of it doesn't nest any more than regular C++/Java code. If your code is nesting a lot, it's likely an indication that you should be refactoring something out.
  2. Even if your code is nesting a lot, stacking your parens only worsens the readability, because when there's a jump back down several indentation levels, then it's a long way up to figure out what function you're in. Trailing your parenthesis gives you immediate local knowledge about what blocks of code you're outside of.

Clojure development with IntelliJ's La Clojure Plugin

In the spirt of helping out n00bs, I've made a quick video for anyone interested in using IntelliJ IDEA for Clojure development.
 
I discuss the basic setup and some of its features, and I also describe how Leiningen can be setup with IntelliJ.
 
Once you've gotten past the initial setup, it's a really nice IDE (I've tried the others, and I prefer IntelliJ). You can watch this video on YouTube in HD.
 
 

 
Some additional notes:
 
  • You can use different clojure.jar files (and add clojure-contrib.jar) by editing the project's Module Settings (as shown in the video) and going into the Libraries panel to add them.
  • The quick documentation lookup works great for clojure functions, but lookup on Java classes like JFrame etc. is kinda flaky. If the docs don't show up, use it on the fully qualified name (i.e.: javax.swing.JFrame).
 
Hope it's helpful!