# Win a Pluralsight One Year Subscription and C# Smorgasbord

## Posted by Filip Ekberg on June 17 2013 23 Comments

It’s truly a pleasure to announce that as of Friday last week I am a published Pluralsight Author! The course that I published is called MSIL for the C# Developer, read more about it at the end of this post. There’s been some radio silence on the blog lately, it’s mostly due to a lot of effort that has gone into the production of the newly released course and also our move to Australia.

### Win a Pluralsight Annual Plus Subscription

To celebrate that I just published my course I’m raffling away the following:

• Pluralsight One Year Annual Plus Subscription + Signed copy of C# Smorgasbord + C# Smorgasbord Shirt
• 2 Signed copies of C# Smorgasbord
• 3 digital copies of C# Smorgasbord

#### How do I win?

It’s Simple!

Leave a comment on the blog telling me Why you should win a one year subscription for Pluralsight and why you’d like to see my course. A bonus is if you tell me why you also want to read my book!

Raffle ends on Wednesday June 26th 18.00 CEST

In this course we look at MSIL; the code that is generated when you compile C#. We explore MSIL so that you get a better understanding of how C# works and how it is compiled. Ultimately after completing the course you will feel like a better C# developer as you will know much more about what happens behind the scenes when we compile our C# applications.

View my course here and please rate it when you’re done!

# C# Smorgasbord ebook limited-time offer now only €4.99!

## Posted by Filip Ekberg on February 26 2013 10 Comments

About 7 months ago I self-published C# Smorgasbord which is a C# Programming book focusing on a lot of different and interesting things. I’ve had a couple of giveaways and a couple of sales so far to spread the word even more.

It’s now time for an ebook limited-time offer, when the offer ends is not yet disclosed so if you’re interested in reading this very well spoken off book get it today for only €4.99! If you don’t have PayPal just send me a message and we’ll figure something out.

#### Want to peek inside? Sample available!

There’s a “Look Inside” available on Amazon!

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
• Creating a challenge out of the trivial tasks
• Asynchronous programming with async and await
• Dynamic programming
• Increase readability with anonymous types and methods
• Exploring Reflection
• Creating things at runtime
• Introducing Roslyn
• Adapting to Inversion of Control
• Are you Mocking me?

#### Want a printed copy?

There’s a discount on that one too!

Discount code: N9UV3WDP

# 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! # Want a free copy of C# Smorgasbord? ## Posted by Filip Ekberg on January 18 2013 32 Comments C# Smorgasbord has been out for about 6 months and as you might have seen previously on this blog and on my twitter, the book has gotten great feedback! I’m very happy that so many people have decided to buy the book and that some of you have taken the time to review it. To give something back to the community for all the support during my writing process and after (self-)publishing the book, I had a give-away after about 3 months and now I want to give away one (or maybe more!) copies of the book! ### I want to win a free copy! Unfortunately I can’t give everyone a copy of the book so if you want to win a free copy of C# Smorgasbord, all you need to do is follow the two steps below: 1. Leave a comment down below with the reason as to why you should be the lucky winner. It’s a bonus if you include why you like to read this blog. 2. Share this post with your friends on twitter: 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. You’re e-mail address will never be visible to anyone else than me! That’s it! Good Luck to you all! The draw ends February 1 (6pm CET) and all comments will be published once they’ve been received ### What’s C# Smorgasbord? 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. Is there a digital version(ebook)? Yes there is! Everyone that purchases the printed copy will get the ebook for free. Instructions for how to receive the ebook is inside the printed book. Table of Contents 1. Introduction to Parallel Extensions 2. Productivity and Quality with Unit Testing 3. Is upgrading your code a productive step? 4. Creating a challenge out of the trivial tasks 5. Asynchronous programming with async and await 6. Dynamic programming 7. Increase readability with anonymous types and methods 8. Exploring Reflection 9. Creating things at runtime 10. Introducing Roslyn 11. Adapting to Inversion of Control 12. Are you Mocking me? Who this book is for This book is for those developers that find themselves wanting to explore C# but do not know how or where to start looking. Each chapter contains hands on code examples that can be compiled and tested on your machine. Although each chapter has code samples, you do not need to use a computer to appreciate the content of this book. The code samples are divided into smaller portions of code, so that you can follow each example and the thoughts around it in an easy way. 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. It is not required that you have worked with C# before but being familiar to the fundamentals in any of the .NET programming languages will help you on the way. If you are just now starting to learn C#, this can be a great way for you to learn about different techniques, best practices, patterns and how to think in certain scenarios. But if you have worked with C# development for many years, this book can give you a refreshing view on how to always improve and challenge yourself into becoming a better software engineer. ### I can’t wait and want to buy it now! Thanks for the support! Below is a link to Amazon where you can buy the book. It’s available on all Amazon regions. There’s also an ebook bundle available here. # 2012 was an amazing year, here’s a summary! ## Posted by Filip Ekberg on January 8 2013 1 Comment Saying that a lot happened in 2012 is probably an understatement. At least both on this blog and in my personal life, a bunch of amazing things have happened. I really hope that your previous year was good and let’s hope for an even better 2013. To start this year off I want to summarize all the great posts that were shared on this blog in 2012. Personally the two biggest achievements of last year was me getting engaged to my lovely Sofie and publishing my book C# Smorgasbord. As you might have seen already this year has already started very good as I have been awarded Microsoft MVP in Visual C#! Let me know what you found most interesting on this blog from the collection of posts below! Here is the 2012 summary! Architecture Tips & Tricks Screencasts Software & Tool information Windows 8, Windows RT, WinRT and Surface C# Smorgasbord and Self-publishing Other I hope you found this collection of posts useful and that you’ve learnt a lot in 2012! Enjoy 2013 and let me know what you think of the posts! Before we take part for this time, I want to share with you an image that describes the feeling I got when I held the first printed copy of C# Smorgasbord: # Questions for a Software Engineer ## Posted by Filip Ekberg on November 30 2012 2 Comments A couple of weeks ago I visited my old upper high school. This is where you take your last three years of high school in Sweden and focus on a certain area. I focused on IT and Programming and now a couple of weeks ago I was invited to come back and talk to the current students. My initial idea was to talk about programming and inspire these young people (16-20 years old) to continue studying in the field of software engineering. But when I found out that more than half of the attendees actually studied something else such as economics or entrepreneurship, I had to change focus of the presentation. The new focus on the presentation was entrepreneurship and how to become awesome at selling yourself. I recorded this presentation, but since it’s in Swedish I will not bother embedding it into this post; it’s available on my YouTube channel for anyone that wants to have a look at it! ### The questions for a Software Engineer The students had put together a list of questions, 19 questions to be precise and most of the questions were aimed at me and my career. But I think that many of these questions are among the commonly asked ones, I’d like to share the questions and the answers with you all. So here goes, have an awesome Friday and enjoy the Q&A! If you have additional questions for me or any comments on the answers that I gave, please leave a comment! #### When you started upper high school, how good were you at programming? I was somewhere between 10 and 12 years old when I first saw programming in action. Back then we didn’t have fancy computers, of course they were fancy at the time but not as todays computers. I remember my best friend back then showed me QBasic and how to do basic input, conditions and output. So I just wrote some basic programs in QBasic that asked me a question over and over again until I gave it a certain answer. This was fun and all, but it kind of stopped there. I didn’t have my own computer until I was 12 years old and at this time my friend had learned VB which I gave a try but never really got into it. I was young and my focus at that time wasn’t to become a programmer. I liked computers and I liked exploring them but the games on my computer was calling out to me. As I was born 1987, being 12 years old puts us in 1999. We had no high speed internet at this time and some of the operators in Sweden actually charged per megabyte that you downloaded. So googling for video tutorials wasn’t really an option. So let’s speed it up a bit, when I was 16 years old I started upper high school. I had chosen to become an electrician just as my father. But after 1-2 weeks I felt that something was missing, so I actually changed schools, mainly because the programming kids got their own laptops at the school. Up until now I had actually played a lot with computers so I wasn’t a completely newbie on that area. But my programming skills wasn’t that good and fortunately for me, they didn’t expect that in high school either. This means that the short answer is, I wasn’t any good at programming at all when I started high school. I had tried some when I was younger, but that wasn’t enough. Eventually we started looking at HTML and this being static and all, I wanted some dynamic behavior in my web pages so I bought books and learned PHP. In the final years of high school we were doing C# and I were de-compiling the teacher’s examples and changing stuff and then re-compiling them. Programming had by then became a part of what identified me and who I wanted to be. #### What was the hardest part about writing/releasing your own book? There were a lot of bumps in the road when writing the book. I’ve written about the writing process and what decisions that I made along the way. But if I need to choose one of the most hard parts about writing the book. That would probably be: handling all the input from proof readers. The hardest part about releasing the book has been all the rules and tax stuff. Since I use CreateSpace which is a USA based company there are a lot of different rules regarding taxes that are very hard to get your mind around. I’ve spent countless of hours trying to figure all that out. #### How did you experience studying in Blekinge (the county where I studied for my BCs in Software Engineering)? This county is in the southern of Sweden and the town that I studied in is called Ronneby. It’s hard to compare this to any other cities that you might have heard about. This town (if you can even call it that) is so small that when you go out to buy something, you know Everyone and everyone knows you. Ronneby changed my life, if I would have never met my wonderful girlfriend if I hadn’t moved to Ronneby. The school itself is awesome, we had the highest number of researchers in the field of Software Engineering in Sweden. #### Have you earned any money off the book, if so how much? It depends on how you look at it. If you take all the time that I’ve put down on writing the content and then multiply that with whatever my time is worth. It would be so much that this book would have to sell as good as Harry Potter before I can say that I earned money from it. The royalties are much better when self-publishing, but a lot of that money needs to go on additional marketing if you want to sell more books. I didn’t write the book for money, I wrote it because I love what I do and I want to share this with everyone. #### Why did you write a book? There are so many different things that inspired me to write the book. A lot of the great authors that I met at NDC in 2011 and a lot of people that I’ve met in my career prior to that. But the definitive moment that changed everything was when I applied for a job that I didn’t get. For some reason there wasn’t enough “evidence” that I was a good enough programmer for that position. This inspired me to write a lot more in my blog. I’ve focused my energy on other things before and I’ve always enjoyed talking and writing about programming and technology. So I started writing my blog because I was inspired, sort of by myself, because I wanted to do more for the community and I wanted to share my experience and knowledge. As I wrote before, there were a lot of reasons to why I started writing this book. Mostly inspiring has been all the people around me and the developers that I look up to. #### How are the sales of the book going? It’s going great! I’ve been selling around 70-100 books per month since it was released and all feedback that I’ve gotten has been very positive! #### How do you sell the book and how do you market it? I sell the book through CreateSpace. CreateSpace is a print-on-demand company that sells the book through different channels such as Amazon. It’s also available on Kindle and as an ebook bundle! My girlfriend has bachelor degree in marketing, so I try to get as much help from her as possible on this. Lots of the marketing that I’ve done so far is the discounts that I’ve handed out and the books that I’ve raffled away. Most importantly: Word of mouth. #### Who read the manuscript during the writing process? At one point I had 8 people that wanted to dedicate their time to read and proof the book. This was all during the writing process and after I had finished writing. I’ve thanked all these amazing people in the Acknowledgement section in my book, be sure to check that out when you buy my book! #### Do you have your own business, if so what type of business is it? Yes, I’ve got a sole proprietorship. #### When you started your own business, did you make an initial budget? No. I should have made one though. A couple of years after I started my sole proprietorship I found out that it would have been better to actually know what money comes in and comes out in the long run. Everything worked out for the best though! I really recommend you to do a budget and a business plan if you’re thinking about starting up something. #### What kind of system do you use to keep track of all invoices and papers in your company? I wrote my own system to create invoices. I was 18 years old when I started my sole proprietorship and I didn’t really want to buy a system for this since I could write one myself. #### What is the best way to learn programming? This is way too subjective to give one answer to. I learn best by being inspired by someone. It can be watching a video on Channel9 or maybe attending a conference where there’s all these amazing people talking about new and fun technology and how to use it. If you like reading buy books. If you like listening watch screencasts. Nowadays there are ways for everyone! #### What is the hardest part about programming? Understanding the system requirements. The customer or whoever you talk about the system you are going to build with have one way of expressing what they want, when they really want something else. One of the biggest problems that is actually fundamental in domain driven design is that you need to speak the same language! #### Why C#? Why not? Seriously though, C# is a living language as I call it. There’s a lot of changes happening to the language and how you work with it. If you look back at .NET 1.1 and compare the C# code from then to code from today, both of them are understandable and similar. But there are so much more help in the newer versions of C# that helps you write even cleaner, faster and easier to understand code. Another important thing, at least for me is that I’ve always loved Microsoft. I’ve got a hard time staying away and not preaching their stuff. #### What other programming languages do you know? I started off with PHP when I was 16 and then I learned Java. From there I’ve learned to love some of the following: C#, C++, ASM (MIPS+X86), Python. Probably forgot one or two languages but those are the ones that I would be comfortable doing projects in. I would probably have to do some reading up if someone threw a MIPS project in my face. #### Do you have a role model? There’s too many people that I look up to. My parents and my family has always been what drives me to do greater things. In the profession there’s also a lot of great people that I look up to such as Bill Gates, Steve Ballmer, Eric Lippert, Steve Jobs, Scott Hanselman, Scott Guthrie, Jon Skeet and many more. To be honest, I look up to everyone that loves what they do and do everything to share that passion. #### How long did it take to write your own book? If I include the time it took to prepare all the raw content, I think it lands somewhere around 2000 hours. #### Do you also work as a Software Engineer or are you just an author? I work as a full time Software Engineer at Star Republic in Gothenburg meanwhile as I have my own sole proprietorship and doing all the work with the book. I’m a man with many hats and I like to have many projects in the pipe! #### Will there be a sequel to the book? Depends on who you ask. If you ask my girlfriend the answer is no. All joking aside, she supports me in writing another one but currently I am focusing on C# Smorgasbord and everything that is needed to be done after a release of a book. I’ve got plans for more books, but time will have to tell what happens. End of Q&A I really hope you enjoyed reading these Q&A’s, I sure did writing them! # C# Smorgasbord Sale! ## Posted by Filip Ekberg on November 20 2012 8 Comments C# Smorgasbord has been out for 3 months and has already gotten a lot of positive feedback and great reviews(See below)! To thank you all for your support, I’m giving away a discount code for 35% discount on C# Smorgasbord! This offer is for a limited time only, the discount will be available from November 20, 2012 to December 31, 2012! The discount code works only on CreateSpace; this is where the book is printed. CreateSpace is a DBA of On-Demand Publishing LLC, part of the Amazon group of companies. Buy yourself, your spouse or your kids an early Christmas present! ### Discount code: N9UV3WDP Note that the Discount Code only works on CreateSpace! The printed copy includes access to the ebook bundle; so you don’t need to wait for the printed copy to arrive. After you’ve purchased the book just fill out the form on the book’s website! CreateSpace ships globally and their shipment times are in most cases a lot shorter than what it says in their website. ### Want to know more about C# Smorgasbord? #### Want to peek inside? Sample available! There’s a “Look Inside” available on Amazon! #### 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. #### Table of Contents • Introduction to Parallel Extensions • Productivity and Quality with Unit Testing • Is upgrading your code a productive step? • Creating a challenge out of the trivial tasks • Asynchronous programming with async and await • Dynamic programming • Increase readability with anonymous types and methods • Exploring Reflection • Creating things at runtime • Introducing Roslyn • Adapting to Inversion of Control • Are you Mocking me? #### Want only digital versions? If you don’t want to get the printed version you can get the ebook bundle on the book website or the Kindle version on Amazon. Enjoy the read and spread the word! ### Update 2012-12-02 I am extending the offer the rest of 2012! Enjoy the holidays! # 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 # Roslyn CTP 3 released — breaking changes ## Posted by Filip Ekberg on September 17 2012 1 Comment Microsoft has released yet another CTP version of Roslyn and this doesn’t come as a big surprise. Since the previous CTP (CTP2) does not work very well with Visul Studio 2012. Now with Roslyn CTP3, we have Visual Studio 2012 support! However, this upgrade does come with a price, there are some breaking changes in the third version of the Roslyn CTP. You can download the latest Roslyn CTP3 here. This unfortunately breaks some code samples in my book C# Smorgasbord, but not to worry. The changes are pretty easy to figure out and I’ve put together an Errata that covers all the code samples that are affected by the breaking changes. You can find the Errata here. If you’re using Visual Studio and you have intellisense enabled, it’s going to be pretty easy to figure out what has changed. Below is a short list of what I’ve found and what is in the Errata. ### No longer possible to run Scripts through ScriptEngine directly To execute a snippet you need to create a session first, like this: var engine = new ScriptEngine(); var session = engine.CreateSession(); var result = session.Execute("var x = 10; x"); Console.WriteLine(result); ### ParseCompilationUnit is removed You can now use ParseText and ParseFile instead. ### The auto generated GetIssue method has changes. When creating a Code Issue project, the generated file is changed a bit. Instead of GetText() on the token, you now use ToString() and instead of CodeIssue.Severity.Warning you use CodeIssueKind.Warning. ### Method AnalyzeStatementDataFlow is renamed The method AnalyzeStatementDataFlow on SemanticModel has been renamed to AnalyzeDataFlow(). There are probably a lot more changes to Roslyn than the ones listed above. If you have any questions regarding the code samples in C# Smorgasbord or if you want to chat about Roslyn, leave me a comment or an e-mail. Even though these are breaking changes, it does not ruin the reading expreience of C# Smorgasbord! # 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?