Papierkrieg - ein Bewerbungsvideo für die Filmakademie

Ich drücke dem Ersteller alle Daumen, die ich habe. Super gemacht, oder?

Loading mentions Retweet
Filed under  //   creative   paper   video  

Comments [0]

Loading mentions Retweet
Filed under  //   chatroulette   interesting   video  

Comments [0]

Update auf Aperture 3.0.1 funktioniert nicht? / Update to Aperture 3.0.1 doesn't work?

Wenn das Update (http://support.apple.com/kb/DL1006) auf Aperture 3.0.1 mit der 30-Tage-Trial nicht will, hilft es, die Datei

 
/Library/Preferences/com.apple.AECT.plist 

zu löschen. Die Release Notes gibt's hier: http://support.apple.com/kb/TS2518


If the update (http://support.apple.com/kb/DL1006) for Aperture 3.0.1 with the 30 day trial doesn't work, try deleting

 
/Library/Preferences/com.apple.AECT.plist 

which shall fix the problem. Click the link for the release notes: http://support.apple.com/kb/TS2518

Loading mentions Retweet
Filed under  //   aperture   apple   error   fehler   update  

Comments [0]

I know those thoughts...

Loading mentions Retweet

Comments [0]

Loading mentions Retweet

Comments [0]

So einfach vergeht einem die Lust am Schreiben

Da sich bei Twitter gerade mal wieder gewisse Tendenzen anbahnen, muss ich dahingehend mir mal meinen Frust von der Seele schreiben.

Während meine Studiums musste ich immer wieder umfangreichere Dokumente anfertigen: Berichte, Dokumentationen, Hausarbeiten. All diese Dokumente hatten einen gewissen Qualitätsanspruch. So sollten sie natürlich ein Inhaltsverzeichnis haben, eine Seitennummerierung, ggf. ein Deckblatt, vielleicht auch noch ein Quellen- und/oder Abbildungsverzeichnis. Eigentlich kein Problem für eine moderne Textverarbeitung, sollte man meinen. Leider aber ist es das doch. Ich habe das Schreiben solcher Dokumente immer gehasst.

Begonnen hat meine "Textverarbeitungskarriere" natürlich mit dem Klassiker, Microsoft Word. 1989 (!) verwendete ich schon Microsoft Word 4 unter MS-DOS 3.2 auf einem 8086. Das Programm ließ sich flott bedienen, ich konnte meine Texte für die Schule damals problemlos verfassen. Weiter ging es mit Word 6.0 unter Windows. Die nachfolgenden Office-Versionen nahm ich alle mit: Office 95, 97, 2000, XP, 2003. Bei meinem Wechsel zum Mac im Jahre 2005 versuchte ich eine Weile, die vorinstallierte Trial des MS Office 2004 for Mac zu verwenden. Zufrieden war ich aber nie, weswegen ich OpenOffice.org und iWork eine Chance gab. Das OpenOffice.org war mir eindeutig zu langsam, iWork wurde das Programm der Wahl, wenn auch Pages nicht so ganz mit dem Funktionsumfang von Word oder Writer mithalten kann. Und genau deswegen versuchte ich immer wieder, mit dem OpenOffice.org Writer, gelegentlich sogar mit Microsoft Word, umfangreiche, komplexe Dokumente zu setzen. Es ist ein Graus. Ich meine, ich gebe Schulungen in Word, ich kenne das Programm ziemlich gut, eine flüssige Arbeit, sofern es nicht nur um das Verfassen von Briefen geht, ist aus meiner Sicht nicht möglich. Zu viele Inkonsistenzen, Abstürze, verlorene Informationen. Ich persönlich finde das neue UI des Office 2007 nicht schlecht, viele Anwender fühlen sich aber von Microsoft vor den Kopf gestossen, was der Verwendung des OpenOffice.org in der Wirtschaft einen ziemlichen Boost gegeben hat.

Vor einigen Monaten nahm ich mir dann ein Herz. Ich installierte eine LaTeX-Distribution auf meinem Mac und startete TextMate. Das erste Dokument startete ich mit einer Vorlage, die TextMate mir anbot, um erst mal einen Einstieg zu finden. Und ich war begeistert. Wer HTML lesen und schreiben kann, der kann quasi auch LaTeX, die Konzepte sind verflucht ähnlich. Und der Textsatz. Ich fand das Schriftbild, das Word und Konsorten produzieren schon immer furchtbar hässlich. LaTeX macht das so viel besser, der Text ist gut lesbar, sieht wunderschön aus. Und das Beste: ich muss mich nicht händisch um das Setzen von Inhaltsverzeichnissen, Seitenzahlen, etc. kümmern. Hat man erst einmal eine Vorlage geschaffen, muss man sich nie (!) wieder um solche Elemente kümmern. Die Einarbeitungszeit ist natürlich abhängig vom technischen Verständnis des Anwenders, die typische Sekretärin, ohne den Berufsstand verunglimpfen zu wollen, mag damit anfangs überfordert sein, technisch versiertere Menschen hingegen dürften binnen weniger Stunden mit dem System klar kommen.

LaTeX führt eine sehr strikte Trennung zwischen Inhalt und (Text-)Satz durch, die anfangs gewöhnungsbedürftig ist. Ein vernünftiger Texteditor unterstützt einen aber in der Arbeit und nimmt einem vieles ab. Windows-Nutzer sollten also bitte nicht auf das Notepad zurückgreifen, damit dürfte einem ziemlich schnell der Spaß vergehen. Unter Mac OS kann ich ganz klar eine Empfehlung für TextMate aussprechen, unter Linux (Gnome) empfiehlt sich Gedit und unter Windows sollte man vermutlich zum NotePad++ greifen.

Jedem meiner Leser, der immer wieder mit dem Verfassen komplexer Dokumente betraut wird, kann ich die Einarbeitung in LaTeX nur empfehlen. Eine gute Quelle für den Einstieg ist meiner Meinung nach http://latex.mschroeder.net/. Solltet ihr nur Briefe schreiben müssen, kann ich die Verwendung von LaTeX weder empfehlen noch davon abraten. Der schönere Textsatz allein dürfte aber Grund genug für die Einarbeitung in dieses System sein.

Loading mentions Retweet

Comments [3]

9 Startup Steps, Learned over 22 Years « Lance Walley

I had a great conversation several Saturdays ago with Logan in Louisiana. The conversation was really cool because he just turned 20 and he’s the prototypical college student, web entrepreneur, and Chargify user in middle America.

Logan and I spoke for 45 minutes. He’s never started a business before, so he had a lot of questions. I started my first business 22 years ago and I’ve started many businesses along the way. Some worked and some failed. I’ve learned a lot with friends and co-founders, from company formation to credit card processing (which tends to be a confusing area).

I was happy to give advice and hopefully save Logan some time and pain. When we wrapped up our conversation, we agreed that I should write this stuff down so it could, just maybe, help other young entrepreneurs and startups out there.

I hope this story will grow and evolve as I get feedback from others. Please note that this is NOT about finding customers or how to market or any of those very important things that warrant their own blog post. Instead, this post is about building the business infrastructure that can be used over and over to try ideas. You will fail more than you succeed, but at least you don’t have to keep re-creating the basic structure to do business.

I assume that an entrepreneur or startup is responding to a market need that they’ve noticed, and that reaching at least part of that market (to test their hypothesis) is do-able before they spend a ton of time and money.

I assume that any entrepreneur or startup realizes that customers are paramount and to be treated accordingly.

Finally, you should “fail fast” if the market doesn’t want what you’re offering. This one is tough, because it’s hard to know if you’re just mis-marketing. In my experience, the market at least gives some signal pretty quickly. I didn’t always listen to that signal, and when I didn’t, it was my loss.

A couple of  people have said that this list is too “mechanical” – too simple. Well, here’s the problem with that: a lot of intelligent people don’t know these steps. They may have an interesting idea to pursue but they just don’t know the business steps to get up and running. Why not help them save a ton of time to create a re-usable structure?

This blog post turned into a true monster, so here’s an overview of what’s in the post:

1. Find Some Partners

2. Find a CPA, maybe also an Attorney

3. Set up a Business Entity

4. Get a Tax ID

5. Get a Business Bank Account

6. Get a Merchant Account (for credit card processing)

7. Get a Payment Gateway (for credit card processing)

8. Get a Business Credit Card

9. Get a Business Line of Credit

Please note that THIS IS NOT LEGAL ADVICE, but rather, just recounting my experience. You should seek counsel, as noted below.

1. Find Some Partners

This one is not absolute, but I think it’s generally a good idea. I have a friend who’s done very well by himself and that works well for him, but I think most people will be better off with 1 or 2 partners, especially if they’re inexperienced.

I’ve always had at least 1 partner. The biggest advantage is complimentary skills and interests. It also helps in very practical ways: when one of us was sick, the other could help customers. Oh, and having partners like Ezra and Tom at Engine Yard helped us immensely in terms of connecting with our customers and knowing the technology landscape. I could never do what they do.

There’s a belief going around that 2 partners is the ideal. It’s probably true, but other combos work. We had 4 at Engine Yard. But I can understand that if you have too many and especially if no one is the leader, then you can easily have disagreements later that will hurt the company.

Logan has some partners.

2. Find a CPA, maybe also an Attorney

I know that when someone is just starting out, affording a CPA and/or attorney can be *very* difficult. I remember starting my first company when I was 19. My friend and I started Parallax.com and we had almost no money. I had an $8/hr full-time job and a credit card I could use when needed.

My friend’s dad had a friend who was an attorney, so we got advice from him cheaply, probably free in the very early days. Not a lot of time, but just enough. I don’t think we had a CPA, but in retrospect, I think a good CPA is perhaps the role you need even more at first, just someone you can bounce high-level questions off of, *and* someone who can help at least once a year to make sure you’re doing your taxes correctly.

As your businesses grow in revenue and complexity, you *will* want a good attorney. I only said “maybe” above because I think you can start something small and simple without an attorney. But as soon as you want a corporation or LLC, as soon as you have any significant revenue and employee count and potential liabilities, you should already have an attorney you can turn to.

If your businesses prosper over the years, you will make lasting relationships with these people and they will become part of the overall infrastructure that helps you in your business and personal endeavors.

You can also expect to find new professionals to help you out as your needs change. I’ve found over the years that attorneys can vary a lot, and so can CPAs. Good ones cost more, great ones cost even more, but they know their stuff and are a pleasure to work with. After some time, you’ll be working with professionals who are really good in specific niches.

3. Set up a Business Entity

A “business entity” can take many forms. Here are a few that I know. This can be very simple (a couple of hours) or relatively complex. My advice is to start simple and increase complexity/”features” as the business warrants.

* Sole Proprietorship or Partnership. I’m 99% sure that California (and probably other states) sees these as the same type of entity, just with 1 or more than 1 person involved. These are easy to set up. In fact, in California, it’s the default if you do nothing other than file a Fictitious Name Statement (see below). When I formed a 1-man company to represent myself as a Perl programmer in 2001, that’s what I did. I went to City Hall and registered myself as “PerlUSA”. And in Engine Yard’s very early days, we did not file anything officially, so we were, by default, a California partnership.

Filing a Fictitious Name Statement (also known as a “DBA”, meaning “Doing Business As”) with your local city government is easy. I think this is all you have to do to start a Sole Proprietorship or Partnership in many states. If you live in a non-city/unincorporated area, I assume you can do this with your County government. This filing simply registers you (or a group of partners) under a business name. For PerlUSA, I went to San Francisco City Hall and filed the papers for something like $40. I then went to a local newspaper and paid $30 to have the listing published. I believe this is typical anywhere in America. Total cost in time & dollars: 1-2 hours, <$100. Is this a great country or what?! In one afternoon, I was legally “PerlUSA”.

— This was good enough for PerlUSA for its first 4 years. I only converted it to a corporation when it felt necessary, which was Jan 1, 2005.

* Corporation. Corporations offer a more formal business structure than sole proprietorships and partnerships. They generally offer increased legal and financial separation between the company and its owners/managers. They offer a long-established framework for selling shares to investors and for having a management structure that’s not the same as the owners/investors (though it can be the same and usually is with small corps). They also convey a sense of “establishment” to potential customers, vendors, banks, etc.

As PerlUSA grew and started getting large corporate and government clients, I noticed that they just *assumed* we were a corporation and anything else was a yellow flag to them. And the company had multiple contractors and a few employees, so it was time to be more formal and add the legal and financial advantages.

Apple and Engine Yard are “C Corporations”. Most large companies are C Corps. Income/loss stays in the corporation and the corp files its own taxes, completely separate from the shareholders, employees, etc, which have their own personal financial/tax picture. C Corps can own shares in other corps and do various things that “S Corporations” cannot. I think only C Corps can have different classes of stock with different voting rights per class, etc.

I spoke with my CPA and attorney and we decided on an “S Corporation” for PerlUSA. S Corps are generally good for a small number of owners or professionals who want to represent their services through a corporation. With S Corps, income/loss in the company flows through to the shareholders’ individual tax returns. This is generally considered advantageous.

Apple and Engine Yard are “C Corporations”. Income/loss stays in the corporation and the corporation files its own taxes. C Corps can own shares in other corps and do various things that S Corps cannot, like the different classes of stock mentioned above.

A long paragraph about shareholders, corporations, and corporate governance: A corporation is owned by people who have purchased or otherwise acquired shares in the corporation. The management and employees of the corporation are typically not the same people as the shareholders. There are, of course, many exceptions to this, especially when a corporation is very small. When I incorporated PerlUSA in 2005, I was the sole shareholder, plus I was CEO (which is both an employee of the corp and an executive officer), plus I was Chairman of the Board. Can you say “abuse of power” :-) ? A corporation has a Board of Directors, who are charged with choosing the CEO and generally giving high-level advice and keeping an eye on the long-term direction of the company and its finances. If they think the CEO is doing a poor job, they can replace him/her. The CEO is a member of the Board and *usually* plays the role of Chairman of the Board, meaning that he guides the Board agenda. I could go on… there are examples of CEOs at public companies who formed Boards of their friends, which greatly negated the Board’s effectiveness at checking the CEO’s power. Ideally, you have a Board that trusts the CEO and helps guide the company. Ultimately, the Board and top management answer to the shareholders. And ultimately, the shareholders expect a good return on their investment, and they look to the Board and top management to deliver on that.

Note 1: S Corps can later convert to C Corps, but not vice versa.

Note 2: If you’re going to take on formal investors, they’ll want a C Corp, and probably a Delaware C Corp, because Delaware has laws that are favorable to the corporation and, I think, to shareholders. Interestingly, if they are formal investors like VCs, they will probably want to form a new corporation even if you already have one, just to be totally new & clean. I’m guessing here.

* LLC or LLP. I frankly don’t know a lot about LLCs (Limited Liability Companies) and LLPs (Limited Liability Partnerships). But Chargify is an LLC! Here’s how that happened: my co-founders in Chargify were familiar and comfortable with LLCs, and my attorney said an LLC was approximately as “good” as an S Corporation. Given my trust in my partners and my attorney and the fact that I’ve seen plenty of successful businesses as LLCs, I figured, “What the heck? Might as well try something new.”

What I do know is that our LLC does not officially have “shareholders”, because there are no shares. There *are* “ownership interests”, which a lot of people casually call “shares”. I’m sure there are legal differences and I defer to my attorney and CPA to know where those differences matter.

Logan, the student I mentioned above, formed an LLC with his friends. I was like, “Whoa, you’ve already done that? Cool!”.

4. Get a Tax ID (most business entity types)

Get a tax ID for your new entity. With the less formal business entities (especially sole proprietorship), I think your SSN *is* your business tax ID, but my memory is foggy. I *do* remember that my bank was quite helpful with this when I went to open a business checking account… they had an 800 number they called to get a tax ID if I needed one. For the more formal business entities like corps and LLCs, you will definitely need a business tax ID that’s not your SSN, because the business is legally separate from you; it will file its own taxes and produce W-2s and other tax-related documents that are completely unconnected to you personally.

5. Get a Business Bank Account

So, with PerlUSA, I went to Wells Fargo to open a checking account. My clients expected to make payments to “PerlUSA”, not Lance Walley. Incidentally, I had bounced a couple of checks earlier that year and was on a “bad list” with banks, so I couldn’t open a new account with my SSN. I will forever be grateful to the branch manager for trusting me and over-riding the system. She asked that I please not betray her trust. I never did, and PerlUSA (and later, Engine Yard) went on to bring Wells Fargo a *lot* of business! I hope she was rewarded. I stopped by a few times over the years to say ‘thanks’.

BTW, get a business savings account, too. It’s a good idea to save some percentage of your revenue right off the top, say 10%. Just a good habit to start early.

6. Get a Merchant Account

This is, unfortunately, a big mystery to a lot of people. A Merchant Account allows you, the merchant, to charge your customers’ credit cards directly, so your business name and contact phone number appear right on the consumer’s credit card statement.

This takes work, but it makes your business look real!

Merchant Accounts are kind of hard to get – on purpose. There is a lot of credit card fraud every year and that costs everyone a lot of money. Consumers/buyers have pretty generous rights about getting their money back if they think a charge is fraudulent, so banks are understandably careful about giving out Merchant Accounts.

You can get a Merchant Account from your bank, but most major banks probably won’t give you one if you’re a brand new business with no personal or prior business history. If you *do* have prior good history with that bank, especially business history, your chances increase and I would recommend that simply for convenience and for building a long-term banking relationship that will come in handy years later.

If your bank is not the right option, there are specialized entities ready to help! Your Merchant Account does not need to be at the same bank as your other accounts, and it doesn’t even need to be at a bank that you can walk into. There are banks and resellers that handle only Merchant Accounts all day long.

At times when I’ve needed a Merchant Account and was not in position to use Wells Fargo, I turned to a company called Millenium Bankcard (www.mbankcard.com). They and another, TransFS (www.transfs.com), will help you get a Merchant Account. At Chargify, we refer people to both parties and I think both are good. Personally, way back in 2000, Millenium helped me get set up for my online ringtone business, which was new and very risky from a bank’s perspective.

What’s cool about these kinds of companies is that they’ll learn about your business and do their best to get you set up. It’s *well* worth it when you’re starting out. You can later get a better deal when your company has 3 years of financials. And don’t sweat a half-percent or even a full percent.

Costs: Merchant Accounts typically have a cost structure something like this: 2.5% plus 30 cents per transaction. So if you’re charging your customer $10, the Merchant Account will get 25 cents + 30 cents = 55 cents. There are usually some other misc fees, such as a monthly minimum (I think like $20-30), maybe an application fee ($50-100), etc. The main thing is that the Merchant Account will cost you something like $30 min per month just to have it.

To the best of my knowledge, Merchant Accounts are specific to the Merchant’s country. Since I’m in the USA, I get a Merchant Account with a US bank. This allows me to charge credit cards from almost any country and the received funds will flow into my US Merchant Account. Charges are done in US Dollars and converted from Euros or Canadian Dollars or whatever the customer was using to pay if he’s not using US Dollars.

Finally, the funds flow from the Merchant Account into my regular bank account, presumably my business bank account. When you set up a Merchant Account, you’ll be asked where the funds should go (what bank account to route them to).

To be clear, your customers/buyers can be anywhere. You do not need to set up Merchant Accounts in every country. You do need to set up a Merchant Account in your country.

The companies I mentioned above can only help with US Merchant Accounts. Most Canadians, Brits, and Aussies I know have some idea of how to get a Merchant Account in their country.

7. Get a Payment Gateway

This is CLOSELY related to your Merchant Account, and sometimes it’s hard to tell them apart.

A Payment Gateway is a service that communicates with your Merchant Account. I don’t know the details, but I’ve been told that interfacing directly with a Merchant Account is quite difficult. So Payment Gateways came about to solve that problem.

You communicate with the Payment Gateway and they, in turn, communicate with your Merchant Account. The Payment Gateway actually adds a lot of value, such as secure storage of credit card info, an online credit card “terminal”, address verification services, fraud detection software, etc.

Costs: Payment Gateways have costs similar to Merchant Accounts, but I think they’re usually less expensive. By that, I mean it’s common for the Payment Gateway to charge a small percentage and/or flat fee per transaction, and perhaps a minimum monthly fee. My recollection is that the Payment Gateway fees, while not zero, are much less significant than the Merchant Account fees.

Authorize.net is one of the best-known Payment Gateways, but there are many more. Braintree is another, Cybersource is another, TrustCommerce, etc, and that’s just a few in the USA. There are others for merchants in Canada, the UK, Europe, Australia, etc.

Some Payment Gateways, like Auth.net, only work with US Merchant Accounts.

Other Payment Gateways work with Merchant Accounts in other countries. For instance, Beanstream works with Merchant Accounts in Canada.

7.5 Merchant Account + Payment Gateway

I hope this is starting to make sense. Your Merchant Account and Payment Gateway work together as a pair. Generally speaking, your Merchant Account must be in your country (wherever the funds are ending up), and your Payment Gateway must work with your Merchant Account, which I think pretty much means using a Payment Gateway in your country, too.

Fortunately, almost any of these companies is happy to sell you the missing half. I look at beanstream.com and I see a note about selling me a Merchant Account in Canada. And if I go to Wells Fargo to get a Merchant Account, they will bundle Authorize.net as my Payment Gateway. See how that works? It’s almost hard to buy them separately.

Ditto with the companies I referred you to above for getting this all done in the USA, anyway. They will make all the complexity go away for a small fee :-) .

In the end, you can expect to pay something like $50-70/mo to be able to accept credit cards.

Finally, some Payment Gateways and Merchant Accounts allow you to specify the currency in which to charge your customers. Maybe you want run one website that charges in US Dollars and another that charges in Euros. Definitely doable with the right stuff in place.

And, yes, Chargify is working to make this all possible without tearing our your hair!

8. Get a Business Credit Card

Even if you can only get a Visa or MasterCard for your business with $200 of credit, it will be useful for paying for stuff, and it will start building your business credit. People may argue with me here (ie, credit is bad), but I don’t buy it. Credit is a tool that can be used wisely.

This harks back to my comment much earlier about buidling a relationship with a bank that you can actually walk into and get to know the personnel and management.

I know that American Express became a large tool for Engine Yard and now for Chargify. Frankly, I wasn’t the person who set those up, but I think Amex may be easier than Visa/MasterCard when it comes to new, small businesses. At least that’s how they come across in advertising! I went with Visa early because it was offered/pushed on me by Wells Fargo.

I also know that if you’re really young and have no credit, then you may need a co-signer for some of these banking/credit-related steps. My dad co-signed my first credit card when I was 16, so my credit history started building early.

9. Get a Business Line of Credit

Just like #8, but bigger :-) .

When I was building PerlUSA, we had a common cash flow problem faced by small consulting companies: we needed to pay our guys before clients paid us.

We solved this by building up cash savings and by getting an “LOC” (Line of Credit). I think it eventually got up to $50-75K and savings got up to $70K. Between the two, we were able to buffer payments between clients and consultants. Your workers and sub-contractors (and you) are much happier when you don’t have to wait for that next check so y’all can get paid!

And, btw, those resources helped finance the first year of Engine Yard, so the money plus credit really came in handy.

It took several years to reach those amounts of cash & credit, so you might as well start early. Start with a business savings account and a $200 business Visa.

10. DONE!

I’m sure I’ll think of more in future revisions of this incredibly long story, but I’ve been writing for hours and it’s getting late and I think I’ve covered all the major things I’ve run into in 22 years of businesses.

What I told Logan in Louisiana is that, although some of these steps are difficult, the cool thing is that once they’re in place – once you have the experience – the next time will be easier.

In fact, my advice to Logan was to set up a generic company, and that’s exactly what he and his buddies had done. Do not set up MyWebProjectManagement.com, LLC. Instead, set up Web Services, LLC. Get an 800 number that rings your cell phones. Set up your bank and merchant accounts, etc. Find a CPA.

Depending on which steps you follow above, you can start with just a few days’ effort to get going, then add more, as needed. Getting all the above stuff in place will not happen in a few days – it will take at least some weeks to iron out Merchant Accounts and such, and more weeks or months if you decide on corporate formation with the help of an attorney.

You can try different business ideas and utilize the legal and financial structures you’ve put in place. Imagine how easy it will be for Logan to try his 2nd or 3rd idea! And if one really catches, then he can change the company name or form a new company for that particular business.

The point is to repeat these steps as few times as necessary! Spend some months up front, then spend years benefiting.

I hope this is helpful. I know this document is super long, but it’s useful stuff and it takes years to stumble upon it.

Loading mentions Retweet
Filed under  //   enterprise   entrepreneur   startup  

Comments [0]

Haml Sucks for Content

I am not writing this blog post in HTML, and I’m certainly not writing it in Haml. I’m using Markdown. Markdown is a great syntax for content. It’s so good at it, that all of the content for the Haml website is written in markdown.

When I say content, I mean the meat of a web page. The stuff that is left after you take away the header, footer, sidebar, ads, etc. The stuff the user is there to read. Don’t use Haml for adding markup to your inline content.

Paragraph of Content in Haml
%p
  Please,
  %strong
    For the love of
    = succeed "," do
      %a(href="http://www.god.com/") God
  don't use
  %a(href="http://haml-lang.com") Haml
  for marking-up your content!

 
Paragraph of Content in Markdown
Please, **For the love of [God](http://www.god.com/),**
don't use [Haml](http://haml-lang.com) for marking-up your content!

Haml is for Layout & Design

Haml’s use of CSS syntax for IDs and class names should make it very clear: The markup you write in Haml is intended to be styled by your stylesheets. Conversely, content does not usually have specific styling - it is styled by tags.

Haml documents do two things to make you faster:

  1. Make the structure of the document obvious by forcing indentation.
  2. Make it easier to switch between styles and markup.

Work-Arounds

When I asked Nathan, the man behind both Haml & Sass, if he would mind it if I wrote this post he responded:

No, it’s true.

Nathan’s acknowledgment of Haml’s weaknesses is one of its strengths. He has done a lot to sand down Haml’s rough edges over the two years I’ve been following Haml’s development. But first and foremost, I think there is a misconception that Haml’s indentation-based tags are the only way to create markup in a Haml document. This is not true. Here are several ways you can embed inline content within a Haml document:

• Inline your HTML

That’s right. Just put some HTML into your Haml document. Don’t be afraid, it’ll be just fine.

Inline HTML
%p
  Please, <strong>For the love of God,</strong>
  don't use Haml for marking-up your content!

• Use Filters

Haml lets you pass any block of content through a filter. If you find yourself thinking that Haml is getting in the way, that’s probably because you aren’t using a filter. In any filter, you can use #{} to insert output from code. The following filters are available for processing your content:

  • :plain – Simply passes the filtered text through to the generated HTML.
  • :cdata – Surrounds the filtered text with a CDATA escape.
  • :escaped – Works the same as :plain, but HTML-escapes the text before placing it in the document.
  • :erb – Parses the filtered text with ERB – the Rails default template engine.
  • :textile – Parses the filtered text with Textile. Only works if RedCloth is installed.
  • :markdown – Parses the filtered text with Markdown. Only works if RDiscount, RPeg-Markdown, Maruku, or BlueCloth are installed
  • :maruku – Parses the filtered text with Maruku, which has some non-standard extensions to Markdown.
Inline Markdown
.content
  :markdown
    Please, **For the love of [God](http://www.god.com/),**
    don't use [Haml](http://haml-lang.com) for marking-up your content!

• Partials

Haml is framework agnostic, but at least within rails, the framework will compile partials and insert the compiled content into your page. At Caring.com we use the Amor rails plugin for markdown content. This makes it easy for us to compose templates, partials, and layouts of different formats into a single page.

Haml with Rails Partials
.content= render :partial => "some_content"

 
_some_content.html.md
Please, **For the love of [God](http://www.god.com/),**
don't use [Haml](http://haml-lang.com) for marking-up your content!

Some Other Haml “Gotchas”

So let’s just get it all out on the table. Haml is really good at what it is good at, but it is really bad at some other things. Here they are in no particular order:

• Preformatted Content

Haml’s default mode is to pretty-print your output. This wreaks havoc with preformatted text in <pre> and <textarea> tags. Haml provides a :preserve filter that inserts the filtered text into the output with whitespace preserved. For some reason, it still never quite works right for me. So I’ve found that the simplest way is to just turn the pretty-printer off by adding this to my environment.rb:

Haml::Template.options[:ugly] = true

More on Whitespace Preservation.

• Performance

The :ugly option was actually added to make haml faster. With it on, Haml is approximately the same speed as ERB. With it off, Haml is 2.8 times slower than ERB. NOTE: the production environment default is to turn :ugly on.

But with tools like firebug, I just don’t see the point in having pretty-printed html even in development. So again, I recommend you just turn :ugly on and treat it is a debugging tool.

• Stand-Alone

Haml comes with a command line tool that lets you process Haml files into HTML. This is useful for small, quick documents, but it’s not the basis for a website. Haml is a templating engine and it doesn’t provide many of the facilities you need for building a maintainable website. If you want to build a static site with Haml, please consider using one the following:

• Out of Order Processing

You cannot use haml to emit malformed HTML. This is a feature, but it is sometimes in the way. For instance a nice trick in ERB is to join an array like so:

<ul><li><%= @items.map{|item| item.name}.join("</li><li>") %></li><ul>

Haml’s answer to this is the list_of helper. Which is pretty nice for blocks of formatted code.

%ul= list_of(@items) do |item|
  = item.name

Unfortunately, this helper assumes you’re generating a list and requires that you pass a block even when the array consists of simple strings.

• Multiline Code

Haml is meant to be a designer-friendly template format, and as such it encourages code that is readable by folks with a minimal understanding of code APIs. One of the ways Haml encourages this is by making it hard to write code that continues on the next line. Multiline code ends with a | at the end of the line. Example.

If You Must

If you decide that you’re going to write some inline markup with Haml anyway (hey, some folks are masochists), then you should read up on Haml’s precede and succeed helpers as well as the alligator operators: < and >. May God have mercy on your soul.

Conclusion

Despite its flaws, Haml is a very nice template language that optimizes the work my team and I do on a daily basis. We recommend it often. But the goal is that coding will be faster, easier and more enjoyable. If you have a different technology that fits better with how you think, then you should use that. But if you find Haml documents to be easier to read, but that you find yourself fighting it to make the output you need, then I hope this post has helped you understand how to play to Haml’s strengths and avoid its weaknesses.

What I hope is clear is that if your job is to produce content, then Haml is probably not the template language for you.

Postscript

Some might think because of my involvement in Sass that I’m equally involved in Haml. This is not the case. Most, if not all, of my Haml patches have been to help it support Sass better. I’m just an experienced Haml user who wants to be honest about Haml’s Pros and Cons.

I've been using HAML for a while now and I liked it, compared to RHTML. But I suppose that I'll give Markdown another try as it seems to be very well readable AND writable. RHTML simply is very ugly.

Loading mentions Retweet
Filed under  //   haml   markdown   rails  

Comments [0]

Rails-Applikationen mit nginx und Thin

Wer Rails-Applikationen deployen möchte, wird vermutlich als erstes auf die Kombination Apache + Phusion Passenger stossen. So ging es auch mir. Praktisch insofern, da auf fast jedem Webserver ohnehin ein Apache läuft und der Passenger in Windeseile installiert ist. Beim Passenger handelt es sich um ein Apache-Modul (mod_rails), die Konfiguration in einem vHost ist ein Dreizeiler. Also eigentlich alles toll... wenn da nicht die Geschwindigkeit wäre. Wenn der Passenger erst mal läuft, ist die Geschwindigkeit durchaus als gut zu bewerten, aber wehe, wenn die fragliche Rails-Applikation eine Weile nicht mehr benutzt wurde. Dann werden die Passenger-Instanzen meiner Beobachtung nach nämlich vollständig abgeschossen und müssen neu gestartet werden, wenn doch wieder auf die Applikation zugegriffen wird. Auf meinem Server (AMD Athlon64 X2 5.600+, 4 GB RAM, 2 x 400 GB HDD im RAID-1; drei virtuelle Maschinen) dauert das mitunter ca. 20 - 30 Sekunden und macht in dieser Zeit die komplette VM unbenutzbar, andere Webseiten werden also nicht mehr ausgeliefert, der SSH-Daemon reagiert nicht.

Seit ich angefangen habe, mich mit Rails zu beschäftigen, lese ich einige Blogs von Firmen, die sich "hauptberuflich" mit Rails auf die eine oder andere Art und Weise beschäftigen. Dazu gehören unter anderem amerikanische Unternehmen wie Engine Yard [1], Rackspace[2] und GitHub[3]. In Deutschland ist Rails leider noch immer nicht so recht angekommen, die Anzahl wirklich interessanter, innovativer Unternehmen in diesem Bereich hält sich also stark in Grenzen. Die soeben genannten Unternehmen betreiben entweder für sich selbst oder im Kundenauftrag große Rails-Installationen und können sich solche Probleme, wie die im vorherigen Absatz geschilderten, absolut nicht erlauben. Insbesondere Engine Yard und GitHub betreiben viel Social Networking und haben sehr aktive gepflegte Blogs. Und in diesen bin ich auf so einige interessante Informationen gestossen, unter anderem auch mein Problem betreffend.

Wenn man eine Applikation in Rails entwickelt, verwendet man während der Entwicklungsphase der Einfachheit halber einen sehr rudimentären kleinen Webserver namens WEBrick. Er tut das, was er tun soll, startet schnell, eignet sich für den Produktbetrieb aufgrund fehlender Sicherheitsfeatures und ziemlich mauer Performance nur bedingt. Alternativ kann man Mongrel nutzen. Auch dieser ist fest mit Rails verbunden, bietet aber deutlich mehr Performance als WEBrick. Mongrel existiert auch in einer speziellen Cluster-Version. Mit Clustering ist hiermit gar nicht mal das verteilte Rechnen auf verschiedenen Systemen gemeint, sondern nur die Tatsache, dass mehrere Instanzen gestartet werden können. Dies ist ein im Rails-Bereich meinen Informationen nach ein übliches Setup. Es ist einfach aufzusetzen und Mongrel genügt für die meisten Zwecke. Aber Mongrel ist nun mal kein Apache und steht diesem in seinen Konfigurationsmöglichkeiten massiv nach. Einen reinen Mongrel-Cluster zu betreiben scheint also auch kein probates Mittel zu sein.

Nach dem Studium einiger Blog-Artikel entschied ich mich dann für den Toolstack, um den es hier gehen soll: nginx und Thin. nginx[4] als voll-funktionalen Webserver mit wenig Ressourcenhunger und Thin[5] als Application Server. Thin beschreibt sich selbst als die optimale Kombination aus dem Mongrel parser, Event Machine (einer Netzwerk-I/O-Bibliothek) und Rack (Minimal-Interface zwischen Webserver und Ruby-Applikation). Dieser Toolstack begeistert mich noch immer, ob er das auch unter wirklicher Last tun würde, kann ich (noch) nicht sagen, ich werde dann berichten.

Nun zur Installation.

Der erste Schritt sollte die Installation des entsprechenden Gems (und eines zugehörigen) sein. Mittels

 
sudo gem install thin; sudo gem install eventmachine --source http://code.macournoyer.com 

installieren wir Thin. Um zu testen, ob alles in Ordnung ist, nehmen wir einen Verzeichniswechsel in zu unserer Rails-Applikation vor und tippen

 
thin start 

ein. Es sollten ein paar Statusmeldungen ausgegeben werden, danach könnt ihr über http://domain.tld:3000 eure Rails-Applikation aufrufen. Sollte Thin nicht starten, was bei mir der Fall war, müsst ihr Thin noch zu eurer PATH-Variable hinzufügen. Thin liegt auf meinem Server (Ubuntu 9.04 Server) im Verzeichnis

 
/var/lib/gems/1.8/bin 

Stellt sicher, dass dieser Eintrag als allererster in der PATH-Variable steht. Ich habe zu diesem Zweck meiner ~/.bashrc einfach am Ende folgende Zeile hinzugefügt:

 
export PATH=/var/lib/gems/1.8/bin:$PATH 

Da das aber nicht das ist, was wir wollen, installieren wir nun nginx. Ich habe mich dafür entschieden, die aktuelle Stable aus dem Source Code zu kompilieren. Ein Blick auf http://nginx.org/en/download.html zeigt uns alle verfügbaren Versionen. Ich arbeite aktuell mit Version 0.7.65. Nach dem Download mittels

 
wget http://nginx.org/download/nginx-0.7.65.tar.gz 

entpacken wir das Archiv mit

 
tar xvfz nginx-0.7.65.tar.gz 

in das aktuelle Verzeichnis. In dieses Verzeichnis wird nun gewechselt. Ich habe meinen nginx mit den folgenden Optionen kompiliert:

Den abschließenden Build und die Installation erledigen wir so:

 
make && make install 

Damit wir den nginx nun auch automatisch starten lassen können, brauchen wir ein init script, den folgenden Code legen wir in /etc/init.d/nginx ab:

Nun geben wir noch

 
sudo thin install && sudo /usr/sbin/update-rc.d -f thin defaults && sudo /usr/sbin/update-rc.d -f nginx defaults

ein, um Thin und nginx automatisch starten zu lassen.

Weiter geht es mit der Konfiguration.

Konfigurieren wir als erstes Thin für den Live-Betrieb:

 
sudo thin config -C /etc/thin/railsapp.yml -c /var/www/railsapp --servers 2 --socket /var/run/thin/railsapp.sock -e production 

Dieser Einzeiler legt im Verzeichnis /etc/thin/ eine Konfigurationsdatei im YAML-Format mit dem Namen railsapp.yml an. In dieser Datei wird festgehalten, wie Thin arbeiten soll. In diesem konkreten Falle wird, was sehr empfehlenswert ist, eine Socket- anstelle einer TCP/IP-Verbindung verwendet. Es werden zwei Serverinstanzen gestartet, die parallel laufen. ACHTUNG! Wer hier die Zahl zu hoch wählt, macht es seinem Server ganz schnell ganz schön schwer. Also vorsichtig erhöhen und nur, wenn es unbedingt nötig ist. Bemerkt man einen Flaschenhals, kann man hier natürlich rumschrauben. Das Hauptverzeichnis der Rails-Anwendung ist in diesem Falle /var/www/railsapp und die Sockets werden in /var/run/thin/ angelegt. Der letzte Schalter legt noch die Rails-Environment fest, hier wird also das Production Environment genutzt.

Die Konfiguration von nginx ist recht simpel. Meine /etc/nginx/nginx.conf sieht wie folgt aus:

Als Systembenutzer setzt dieses Setup einen Benutzer mit dem Namen www-data voraus. Außerdem werden zwei Worker-Prozesse gestartet. Wer in seiner Rails-Anwendung eine Benutzerverwaltung einsetzt, sollte natürlich auf https anstelle von http setzen. Wie man einen https-Container mit nginx einrichtet werde ich gesondert an dieser Stelle beschreiben.

Im Verzeichnis /etc/nginx/sites-available legen wir nun einen vHost-Container für unsere Rails-Anwendung an. Dieser sollte einen sprechenden Namen als Dateinamen erhalten, also bspw. railsapp.domain.tld. Bei mir sieht der Inhalt wie folgt aus:

Mittels

 
ln -s /etc/nginx/sites-available/railsapp.domain.tld /etc/nginx/sites-enabled/railsapp.domain.tld 

legen wir einen Symlink in das Verzeichnis sites-enabled an. In diesem befinden sich alle vHost-Container, die nginx bedienen soll.

Nun starten wir noch nginx und Thin neu

 
sudo /etc/init.d/nginx restart; sudo /etc/init.d/thin restart 

Gebt Thin ein paar Sekunden, um wirklich antworten zu können. Danach sollte eure Rails-Anwendung über Port 80 ausgeliefert werden.

Sollte ich beim Erstellen dieser Anleitung einen Fehler gemacht haben, lasst es mich bitte wissen, möchte ja keine falschen Informationen im Netz publizieren.

[1] http://www.engineyard.com/
[2] http://www.rackspace.com/
[3] https://github.com/
[4] http://wiki.nginx.org/Main
[5] http://code.macournoyer.com/thin/

Loading mentions Retweet
Filed under  //   nginx   rails   thin   ubuntu  

Comments [0]

Loading mentions Retweet

Comments [1]

About

This is the new centre of my digital life. Almost everything I commit to my personal Web 2.0 you'll find here. Please bookmark or subscribe to this place to stay in touch :-).

Follow me: http://twitter.com/ulfklose
Read my German-only blog: http://www.netzlogger.de/
See my tumble log: http://ulfklose.name
My Flickr galleries: http://flickr.com/photos/ulfklose