# Congratulations to the winners of a free C# Smorgasbord copy!

## Posted by Filip Ekberg on February 4 2013 2 Comments

Before I announce the winners, yes it’s plural because it was way too hard to decide one winner, I want to share some great news with all of you. Yesterday I summarized the amount of people that have my book based on the copies that I’ve sold/given away and this number is now above 500 and steadily increasing towards 600!

The feeling I got when receiving my first proof copies of the book is indescribable, it was pure awesomeness and this feeling is almost as great. It makes me very happy that so many developers have decided to get a copy of C# Smorgasbord, thank you all very much for that. All the great feedback and the amount of copies out there are the basis to why I want and can have these giveaways!

Now to the winners, I know that’s why you’re here anyways. As the giveaway was re-published on DZone I’m going to include those comments as well. Thanks everyone that participated and I really hope that if you didn’t get a free copy this time, you’ll enjoy the discounted price found at the end of this post.

The winners are:

Sergio with the following comment:

Checking the content this book has, it would be a good reference to create great architectures using advanced techniques like Reflection or runtime thing creation. It also shows last features of .Net framework so it will have good examples of how to understand them (I honestly can’t understand async :$and no good Spanish doc, besides that, I have no credit card to buy the book ) I read about the book on this Hacker News’s link: http://blog.filipekberg.se/2012/07/21/c-smorgasbord-will-soon-be-available/ (I said: “I need that book!!”) Adam with the following comment: I would like a copy of your book because everything i learn from it will go onto my blog hopefully passing knowledge onto many others. I feel your book will fill in various gaps in my knowledge, and will hopefully help secure that senior developer position and finally, i mentor the other developers around me and the junior developers, and this book will be an excellent resource, and with titles such as “Creating a challenge out of the trivial tasks” will hopefully help inspire the developers to take pride in even the trivial tasks. Henric with the following comment: Don’t leave a former Sigma colleague hanging! I’ll give you a blog post reviewing the book (on my massive 2 visitors a day blog) and I will spread the Smorgasboard love to current co-workers. Stay awesome! Daniel with the following comment: I would like a copy of your book, because I think this would greatly benefit my student project in which we are creating an application where stuff can be augmented and moved / edited with simple gestures Right now much of the code is hacked together, because no one in the group used C# before (the university teaches java ), what leads to “not-so-good” performance and way too many bugs! I am responsible for the code quality and C# teaching and the book would help me to be more helpful to the other guys. Malte with the following comment: Finished my CS degree last summer, and got a job as a software developer, primarily C#. I try to improve my programming skills every day, and found this blog and blogpost through the “Interesting Finds” blog series from Jason Haley. Hadn’t heard about your book, but after reading about it, it seems very “hands on”. And i would love to read it. I find it especially awesome that you self-published the book Congratulations on winning a free copy of C# Smorgasbord, I hope you enjoy it and help others become better programmers as well! Now to those of you that didn’t win a free copy. I’ve setup a discount code that can be used on CreateSpace (this is where the book is printed) and this will give you a 35% discount! Use discount code N9UV3WDP to get 35% off here (takes you to CreateSpace)! Pssst.. if you don’t want to wait for the printed copy to arrive due to (sometimes) long shipping, you can get the ebook the same day as you purchase the printed copy! Just fill out this form. Enjoy the read and spread the discount code to anyone and everyone! # Self-publishing a book – Part 3 – Using a good typesetting system ## Posted by Filip Ekberg on September 23 2012 5 Comments This is the third part of the blog series “Self-publishing a book” if you haven’t already check out Part 1 & Part 2. Word was acting up, I spent too much time trying to work around it and less time on the content — this was not going to work. I decided to drop Word. But for what and how would it make anything easier when all CreateSpace supplied was a Word template? ### Stepping out of the comfort zone Before I actually dropped Word completely I had gotten a lot of feedback from friends on IRC; Most of them recommended me to check out LaTeX. At this point I really had a very little knowledge about what LaTeX was and how to use it. Wikipedia describes LaTeX like this: LaTeX is a document markup language and document preparation system for the TeX typesetting program. The term LaTeX refers only to the language in which documents are written, not to the editor used to write those documents. In order to create a document in LaTeX, a .tex file must be created using some form of text editor. Being a geek by heart, I immediately got interested in trying this out. It sounded pretty much like I could code my own programming book. Which would be very cool. Comparing it to something else, LaTeX is pretty much like HTML and CSS. This makes it perfect for writing something both where you have and not have a known layout when you start writing. Since I didn’t know anything about LaTeX I needed a crash course and somewhere to get a little bit of inspiration/help. Fortunate for me, I found a LaTeX channel on IRC, #latex on freenode. As mentioned in the Wikipedia quote above, LaTeX is actually just a language used for the typesetting system TeX. This explains why the other place where I got a lot of feedback is called tex.stackexchange.com. Both of these (plus google of course) has been very helpful! Getting a crash course in LaTeX wouldn’t be enough, I still needed my book to conform with the CreateSpace guidelines. I hadn’t decided the trim size(page size) of the book yet. I was thinking about going for 7″ x 10″ but then I created a poll on this blog which later changed my mind. It actually turned out that the size I had in mind was the one you guys wanted the least. So before I could completely step from Word to LaTeX, I had to know if there was some information about LaTeX + CreateSpace. I googled and stumbled upon a forum post on the very good CreateSpace community forum. This post mentioned a CreateSpace package for LaTeX. Best of all, this was open source and available on github! Now I knew that I could use LaTeX to create my CreateSpace work, I knew that I wanted to step away from Word but I didn’t yet know how to write anything in LaTeX or what tools to use. ### LaTeX Crash Course Since I didn’t really know anything about how to write LaTeX markup, I searched for a free tools that could help me; I found a program called TeXnicCenter. However, just downloading and installing TeXnicCenter is not enough, you also need to install the “compiler”. According to TeXnicCenter, I could get something called Tex Live for this. Tex Live has binaries for both Windows, Unix and GNU/Linux. When I had both Tex Live and TeXnicCenter installed, I just had to learn how to write LaTeX code and what kind of “stuff” it produced for me. If you install TeXnicCenter and open it up, this is the first thing you will see: This looks pretty much like any word processor from early 2000. Just as with HTML, you need to define where your document starts, where it ends and if you have something in the preamble (header section). Here’s an example of how to define a document and just have some text in it: \documentclass{book} \begin{document} Hello there! \end{document } If we build(compile) and run this, we will see that we got no errors and that 1 page was produced. You run it by clicking the “Build & View current file” button or pressing Ctrl+Shift+F5: As you might have noticed, it says “LaTeX => PDF” just left of the build icon. This means that when we build the file, we will actually have a PDF created for us! This PDF will be styled as we’ve said, in this case it will use the default styling of a book. LaTeX allows us to produce much more than just books, we can create articles, papers and much more. This can be decided my changing the document class. In the above example I used the document class book. This seemed very easy and there was a lot of good information around the net that I could benefit from since TeX wasn’t something new. My next concern was the document structure, code samples, chapters, sections and much more. I soon found out that all of these was pretty easy to achieve; at least when using the standard layout it came with. I decided that I wanted to split my document up into seperate files, 1 file per chapter to keep the master document clean and each chapter as clean as possible. Luckily for me, this was probably the easiest thing to solve. All I had to do was create a new file, I named each file ChapterX.tex and just included it into the master file like this: \documentclass{book} \begin{document} \input{Chapter1.tex} \end{document } When installing TeX Live, I also got a lot of very nice packages that I could include that provided additional functionality. One of the most used packages that I found was listings. This package allowed me to embed code samples into the text with a lot of nice options to it. The following code sample produced a very nice looking output: \documentclass{book} \usepackage{listings} \usepackage{color} \lstset{language=C,keywordstyle=\color{blue}} \begin{document} \begin{lstlisting } int x = 10; if(x % 20){ } \end{lstlisting} \end{document } There were of course a lot of things not yet in place, the final design for the book was not done; since there was no content to style yet. Lots of packages and lots of tweaks was waiting along the way. ### Actually writing the content I was very happy with what LaTeX allowed me to do, I felt comfortable with the way that I could change layout as I went on. One of the most important things during the time that I wrote this book was to share early and share often. A good example of this is the initial draft; if I had not shown this until everything was done, the book would not have turned out as good as it did. Moving to LaTeX was a very good move and I have never regretted it. It took a couple of days to get used to everything but once everything was in place the focus was a lot more on the content than on the buzz around it. It also felt a lot better writing everything from scratch when doing it like this. I still had a lot of work to do, but I at least had a typesetting system that I was feeling comfortable with and I shared as much screenshots and snippets as possible to make content looking as good as possible. There are a couple of math equations in the first chapter of the book, in the first draft this equation was just plain text; but after sharing almost 15 different versions of the same equation (style wise), it turned out as it did. Again, if I hadn’t asked the potential readers and those people that have worked with typesetting before, it would never have turned out as it did! Now I just needed to write the content. As I wrote Chapter 1, I started to think about how I could ensure quality of the overall book and where to go from now. I knew that I wanted to write high quality content where each sentence had been revised many, many times. The focus so far had been to find a way to comfortably write the content; I now had to find a way to make the content as good as possible. Possibly with the help of the community, but where do I get such help and how do I organize all the feedback? ### Check out the other parts in the series # Self-publishing a book – Part 2 – Back at Square One ## Posted by Filip Ekberg on September 2 2012 7 Comments This is the second part of the blog series “Self-publishing a book” if you haven’t already check out Part 1. I was back to square one, with only my raw material. But the hope was not gone, I now had a goal; I am going to publish a book — but how? ### What now? At this time, the snow fell over Sweden and Christmas and New Years was just around the corner. I decided to just do some googling and researching over the holidays while I recharged my batteries. After all I needed all the power that I could get in order to achieve something like this. When New Years passed, I had found a great resource for information and a great print-on-demand service. I had found CreateSpace. I felt that CreateSpace would be the answer to all my questions and that it would indeed be very straight forward from here. I decided to create an account and contact their support with a lot of questions. Before I went any further, I wanted information about distribution and how everything worked. Remember that I didn’t have anything written yet, as for my content; I was still at square one. However, it was not only the print-on-demand services that I was researching, but also how to do proper type-setting. When registering with CreateSpace, everything is very straight forward. You get to add new titles very easily, select trim size, type of paper, color or no color and so on. The overview of a published project looks like this: There are a lot of very interesting things in the image above, we’re going to look at some of them in more depth later on. But for now, let us focus on all the questions that I had and why I decided that CreateSpace is what I want to use. ### Why CreateSpace? First off all, their community is outstanding. There are so many good authors, proofers, designers, typesetters and so forth on it. Secondly, CreateSpace is a part of the Amazon group of companies. This means that a title that you publish on CreateSpace, is automatically available on Amazon (US/EU). As you might recall, this was one of the issues that I had with the Swedish print-on-demand company Vulkan. If a great community and great possibility to get your book out there was enough you also get a lot of good help from their tools if you are new to publishing. To top this off, you can do what is called “Member orders” which means that you can place an order on your own book very cheap. CreateSpace supplies what is called a “Buying Copies Calculator”. For instance, if you want to buy 1 copy of your book that is in Black & White and has 500 pages. The price per book will be$6.85 and the Shipping (to Sweden) would be $14.38 that means a total of$21.23. This might seem like a lot, but if you were to order 100 copies instead, the price per book would be constant at \$6.85, but the shipping wouldn’t increase that much. Depending on where you live, there will also be a matter of value-added-tax and customs.

Here’s an example of the calculator:

As you might figure out, the margins aren’t super good, but they are a lot better than the royalty percentage that you would get from a publisher. If you are thinking that the margins are in fact very good, you’re neglecting marketing or any other things around your book that might have cost money during the time.

One last reason as to why I really enjoy CreateSpace: I ordered 5 copies to proof/review it took them 3 days to handle my order, make the books and ship them from USA to Sweden and deliver them to my door. That is pretty amazing.

### Print-on-demand it is!

I still had a lot of questions that needed answers so I started sending questions to their customer support and got a lot of Very verbose answers in return. In short, this is what I asked them:

• If I want to print my book elsewhere and sell that, is that OK?

CreateSpace answer: Yes, but you cannot use the same ISBN if the ISBN is generated by CreateSpace.

• I want to sell my book in book stores in other countries that USA, what do I need to do?

CreateSpace answer: You can use the expanded distribution to get a deal with “Barnes & Noble” in USA, but if you want to go outside that you need to order member copies and supply the store yourself.

• You are witholding 30% of my money for “tax reasons”, my country has a tax treaty with the US, what do I need to do?

CreateSpace answer: File a valid W-8BEN form

Now I had a lot of useful information, even if a lot of this information didn’t become clear until I actually pressed the “publish” button on the book.

### Time to start writing?

I had a lot of information about where I wanted to publish the book and how to do it. But I still didn’t have a clue on how to typeset the book. There was still a lot of work to do and a lot of questions unanswered.

I downloaded a word template from CreateSpace that used a trim size (book size) that would yet to be changed and I started aligning things as I wanted, writing a stub for the first chapter. Then something happened, I wanted to be able to easily change the layout of elements; because I knew early that this was going to be something that grew over time.

Word was acting up, I spent too much time trying to work around it and less time on the content — this was not going to work. I decided to drop Word. But for what and how would it make anything easier when all CreateSpace supplied was a Word template?

# Self-publishing a book – Part 1 – Where it all began

## Posted by Filip Ekberg on August 27 2012 10 Comments

### What’s this blog series going to be about?

It might not have been clear to everyone that my book C# Smorgasbord was self-published. In short self-publish means that I did not have a publisher that backed me up when writing this book.

But if I don’t have a publisher how do I get my book printed? How did I get the book up on Amazon? How do I market my book?

Those are some of the questions that I receive on a daily basis. I’ve had in mind to write this blog series even before those questions arise. So I am going to try to answer as many questions as you might have, I don’t know how many blog posts there will be. Those that have followed this blog before knows that I tend to like lengthy posts, but this time I will try to do more posts that are a bit “shorter”. Because covering all of this in one post will just be too lengthy, I’ve joked about it and said that I can probably write a book about writing a book (bookception!).

If you have any questions just give me a comment, tweet or e-mail, I will try to answer all questions.

### Where did the idea come from?

It all began long before I decided to make a book. During 2011, I blogged a lot, had a lot of in-house presentations for co-workers, did screencasts and spent a lot of time on StackOverflow.

So here I was, with all these great raw materials that I didn’t know what to do with. I felt that I wanted to reach out to the people that didn’t attend my presentations, that didn’t read everything in my blog and that didn’t even know about my work in the first place. This started to grow on me, in late November 2011 I started doing some research on how to convert a blog to a book. My initial thought was just to copy and paste everything from my blog into a (what I thought at the time) nice Word template.

This resulted in something looking like this:

At this time, I didn’t have any experience at all with publishing, authoring, type-setting or anything at all like that. Once I had copy and pasted everything from my blog, I had a Word document with about 120 pages.

I showed this to a couple of other developers and got comments like:

This is the worst type-setting I’ve ever seen

This got me thinking, if the first reactions are not even constructive, something must be wrong. I had an idea that I liked, I wanted to take a vast variety of different, interesting and new/old concepts/technologies.

So what now?

### Doing it right

I am not the kind of person to give up and once I put my mind into something, I want to make it as good as possible. I decided to contact a bunch of publishers, just to see if they liked my idea. Never ever had I contacted a publisher before so I had no idea on what they expected from me.

My e-mail to the publishers contained an introduction to myself, a Little bit about my ideas and a link to the 120 page PDF with horrible type-setting. It didn’t take long before all the publishers that I contacted responded to my inquiry. Some of them had a more personal touch than others, some of them just felt auto-generated. Basically they (all) asked me to write a proper proposal and attached a quite robust PDF on how to do so. The proposal should be a chapter from the book with about 20 pages. It shouldn’t be the first nor the last chapter, but a chapter somewhere in the middle of the book.

Another thing that they asked was about the name of the project. Instantly when I got that question, I thought to myself:

What is a good Word for “a vast variety” that also is connected to me being Swedish?

Smörgåsbord!

Since the programming language in this book was about C# I instantly gave it the name “A C# Smorgasbord” (why “A” was removed is a later story!).

What about the proposal? Let’s go back to that for a second. None of the “chapters” in the PDF that I sent to the publishers contained 20 pages, I didn’t have a 20 page proposal. This gave me an idea of what a publisher expects. If the publisher expects 100%, the reader expects 500% quality.

With that in my hands, I now had a goal.

### What kind of goal did I have before me?

You might think now that the goal was to create 20 pages and send a proper proposal to each publisher. On the contrary, I knew that there was a lot of work to do to meet everyones expectations so I wanted to focus on making something that the end-users liked, instead of something that was according to a guideline from a publisher.

I “threw” away the PDF that I had created, never to be looked at again (not entirely true, I just took a screenshot of it). I still had a lot of raw material and what I didn’t get into my first in-proper proposal was my presentations and screencasts, this is something that I wanted to cover as well.

Before I gave the idea up completely on the PDF, I did some research on “print-on-demand”. I found a company in Sweden called “vulkan“, I even created an account and had a dialog with them about how everything worked. There was a lot of problems with them though, one being the integration possibility with foreign stores (Amazon etc.). It was also a pretty expensive process, compared to what I later found.

I was back to square one, with only my raw material. But the hope was not gone, I now had a goal; I am going to publish a book — but how?

# The winner(s) are….

## Posted by Filip Ekberg on August 26 2012 1 Comment

### Congratulations to the winners!

It was so hard to decide just one winner, so I decided that I will give away 5 books to those that gave me the best reason to!

Here are the lucky winners:

#### Iris Classon (@IrisClasson)

I should be the lucky winner because I will use the book to spread your knowledge to other developers that really need it.

You know I love questions, and I have many,- and I often look to good books for answers. I hope, and believe, that this book will do just that.

So send me a book, and let me spread some answers! I’ll make sure of course that when the book is used for answers I will provide a link to the book for purchase.

So it’s a win for you, for me, and even more important, for the developers that we can reach

#### Peter (@clanstyles)

I always love different perspectives on programming and do own quite a lot of books on C# already. I would love to add your book to the list and it received fantastic reviews!

I’m a young student just looking to learn more and if you did happen to choose me as a winner this book wouldn’t go to waste. It’d go right on my desk with the rest of my references after I’ve polished through every page.

Also sharing on Twitter and FB!

#### Dmitry (@0x49d1)

The book is among not many ones that can show how can i use the primary programming language in a more effective way. From the “about book” section i guess that the book is a mix of Skeet’s “C# in depth” and Wagner’s “Effective C#”. Im willing to constantly improve skills in all and im not going to save money on this book, because using advices from it i will make much more money from work(im sure ) But why not try to win a free copy of the book from its author?..So im in, participating! By the way, thank you for the work. I know that its really difficult to write reasonable tech book.

#### Kirin Yao (@kirinboy)

After reading the content of this book, I think it’s a great book of C#. I can’t wait to reading it.
I’m a tech book translator from China. I translated several C# books into Chinese, including Jon Skeet’s C# in Depth and Andrew Troelsen’s Pro C# 2010 and the .NET 4 Platform. If the publishing house would introducing this book, I will be happy to be the translator.
Hoping to be the lucky one.:)

#### Dominic (@nazgjunk)

While I’m going into embedded systems next semester, the introduction courses used C# and I’d like to keep using it for desktop-ish things. Lacking the courses a good book like this – especially when it covers more general subjects as well – would be wonderful

Again, Congratulations!

All the comments have been published, thank you all for participating!

# Win a copy of C# Smorgasbord!

## Posted by Filip Ekberg on August 14 2012 35 Comments

C# Smorgasbord is getting great reviews, specially on Amazon UK and to celebrate this I want to give a away a free copy of C# Smorgasbord!

Best of all, it’s the printed copy (which also includes the ebook bundle)!

What you need to do to participate:

1. Leave a comment down below with the reason as to why you should be the lucky winner

The best motivation wins and the winner will be notified via e-mail, so be sure to leave your e-mail address when you’re commenting below.

That’s it! Good Luck to you all!

The draw ends September 20 August 26 (6pm CEST) and all comments will be published after that.

# C# Smorgasbord

## Posted by Filip Ekberg on August 10 2012 1 Comment

As mentioned in my previous post “C# Smorgasbord will soon be available!” I have been working on a C# programming book.

I am now happy to announce that this book is published and available on CreateSpace and Amazon.com!

Grab a copy and let me know what you think!

It is also available on the following other Amazon sites:

James Sugrue from DZone was able to get early access to C# Smorgasbord and has written an article about it. He also had the opportunity to do an interview with me.

I have gotten a lot of questions regarding the digital copy/ebook, I’m happy to share that the PDF, epub and mobi versions of the book are free if you purchase a printed copy!

If you’ve purchased C# Smorgasbord and are looking to retreive the digital copies, just fill out this form.

The Foreword to the book is written by Kevin Pilch-Bisson who works as a Development — Visual Studio IDE Services for C# and VB.Net. The Foreword is available online and can be read here.

C# Smorgasbord covers a vast variety of different technologies, patterns and best practices that any C# developer should master.

Looking at everything from testing strategies to compilation as a service and how to do really advance things in runtime; you get a great sense of what you as a developer can do. By taking his personal views and his personal experience, Filip digs into each subject with a personal touch and by having real world problems at hand; we can look at how these problems could be tackled.

No matter if you are an experienced .NET developer, or a beginner, you will most certainly find a lot of interesting things in this book. The book covers important patterns and technologies that any developer would benefit from mastering.

Be Inspired to challenge yourself

# C# Smorgasbord will soon be available!

## Posted by Filip Ekberg on July 21 2012 1 Comment

UPDATE: C# Smorgasbord is now available!

Since the fall 2011 I have been working on a book called C# Smorgasbord. The book is inspired by all the interesting topics that I’ve touched in this blog.

I’m proud to announce that the book will soon be available for purchase on Amazon and CreateSpace! You will also be able to purchase digital copies on the website for C# Smorgasbord.

It will be available for purchase August, 2012.

### The cover

The cover is produced by a very talented art directory, Christoffer Saltelid and looks like this:

### A little bit about the book

Looking at everything from testing strategies to compilation as a service and how to do really advanced things in runtime; you get a great sense of what you as a developer can do. By taking his personal views and his personal experience, Filip digs into each subject with a personal touch and by having real world problems at hand, we can look at how these problems could be tackled.

No matter if you are an experienced .NET developer, or a beginner, you will most certainly find a lot of interesting things in this book. The book covers important patterns and technologies that any developer would benefit from mastering.

• Introduction to Parallel Extensions
• Productivity and Quality with Unit Testing