Who wants a Stack Overflow T-shirt?
Still in beta (not announced on the SO blog yet). A shirt is $12, shipping to Israel is $11 fixed price + $4 per shirt. Let me know if you want one and we can do a shipment together.

Stuff Ron Gross Finds Interesting
Posts tagged ‘Stackoverflow’
Still in beta (not announced on the SO blog yet). A shirt is $12, shipping to Israel is $11 fixed price + $4 per shirt. Let me know if you want one and we can do a shipment together.

I blogged before about the StackExchange platform for questions and answers.
A few months have passed, and a whopping 218 different “stacks” emerged (there might be some more off the radar). While most of them are still ghost towns, a few are starting to be rather useful (some more and some less):
Regarding my own experience, I am nowhere close to breaking even. Until now, StackExchange has been a free (beta) platform. When it come out of beta, they will start charging $120/month. But, I’m optimistic, and I don’t mind funding Draw3Cards from my own money for the next year – it is picking up in terms of traffic. Meanwhile, I have also done a little bit of development of a similar open source, though I hadn’t perused it beyond a “programming exercise” yet.
P.S.
Needless to say, the original Trilogy – StackOverflow, SuperUser and ServerFault – continue to be an invaluble assent in programming, using a computer and IT. Rock on!
P.S.S.
I just found Shapado, a free, open source hosted version of Stack Exchange. They are taking a lot of heat from some of StackExchange’s users, but I think their existence can only be good news to StackExchange’s users. I probably won’t be switching Draw3Cards to Shapado any time soon because the platform is still not ready (less features, not as smooth), but time will tell.
Edit – just so you know, since writing this I found Shapado and OSQA, which seem well underway to becoming viable Stack Exchange alternative. I don’t think I will continue developing this project, although it has taught me a great deal nonetheless.
I wanted to share a small learning exercise I underwent recently. I decided to learn how to build a website, and share the experience here. Lacking an original idea at the moment, I decided to create yet another StackOverflow clone – not original, but a good exercise nonetheless. The code for the project is hosted at GitHub, although I don’t have a live showcase up at the moment. Yes, I am aware a google search reveals an existing open source SO clone called Stacked – I thought building one from scratch might teach me more than reading someone else’s code base (I could be wrong, but this is how I wanted to roll).
The choice of database engine was easy: The one database I had any experience with was mysql, and being open source, free and easy to work with, I went with it. Next, an ORM library. After some digging, I’ve decided to go with NHibernate + Castle ActiveRecord. ActiveRecord is great for easily mapping simple classes and relations, and NHibernate to complement it in ‘advanced queries’. I don’t get any LINQ magic from these ORMs, which is a pity. I then proceeded to create a solution and some projects, added NUnit as a test framework, and setup Castle MicroKernel as an IOC framework.
I tried to found an open hosted source CI server, but didn’t find anything that worked. Oh well, not essential for now.
Before proceeding any further, I had to choose a source control provider. If this were a production project I would probably have gone with SVN hosted on Google Code. However, Ken told me about Git long ago, and I thought this was a good chance to experience it. So, on to GitHub. Opening the project was a no brainer, but finding a decent client was more challenging. I had some fun learning about Git’s private keys, and configuring TortoiseGit (I tried GitExtensions, but it doesn’t support Visual Studio 2010 beta 2 yet). Overall, TortoiseGit gets the job done, after some tweaking and .gitignore files.
Git’s distributed source control model is interesting and worth a try.
I created the User, Question & Vote tables, learned about composite keys in AR, and wrote my first NH query:
GetVoteCount – “SELECT Vote, COUNT(*) FROM ” + VotesTableName + ” WHERE PostId = :postId GROUP BY vote”
I currently don’t have any caching on the vote count – am simply storing the votes as relations between users and questions, and counting them on the fly.
I would like to implement full features, not write the entire DAL first and then the application logic. So, it’s time to start learning about web development. At work people are using Monorail, but after reading this question I decided to try out ASP.Net MVC instead. So, I read a basic tutorial and starting coding. Some things I learned:


After allowing users to login and post questions, the next thing I wanted to implement was voting. So far all the code was server-side, but voting requires javascript because when a user votes you don’t want to refresh the page, but rather just change the vote icon. So:


This is it for now. I hope I didn’t make too many glaring mistakes in the process. As I mentioned, the code is available at GitHub – if you’re interested in helping develop it or have any questions, please let me know.
As you probably know, I joined the new wave and got my own Stack Exchange site. It’s really amazing how many different SE sites are emerging so rapidly. There’s a strong sense of (meta) community with most of the site owners heavily participating in discussions on meta stackexchange.
There is some overlap between different sites, but most sites I’ve seen are original and useful. The owner/s of one SE site have been nice enough to post links to other SE sites, including Draw3Cards, at the top of their homepage!
Today I convinced a friend at work to open his own website, and I think you should to – before all the good ones are taken. Come and join us, it’s really that easy.
For the last couple of days I’ve been obsessing over a new toy. Jeol & Jeff, the powers behind StackOverflow, have launched a public beta of StackExchange – a platform for hosting Q&A sites. Browsing the list of stack exchange sites, I saw several more and less successful sites, including:
I decided to try and open my own site, about Magic: The Gathering. The setup itself was rather easy. I:
Now what remains to be seen is whether the site can accumulate the needed critical mass. For now, the site is in beta, meaning I don’t have to pay anything to keep it running (except time and effort). When the beta is over, the cost will be $129 a month, which is quite challenging to make using adsense.
Keep your fingers crossed for me
P.S.
Just got a $100 coupon for AdWords by visiting Google Webmasters Tools – how cool is that? In a second look, it appears the coupon was lying in my Webmasters Tools inbox for two months now, just waiting for the perfect opportunity.
I also forgot to mention opening a uservoice forum (+ adding the widget to my site).
Well, I said this would happen.
StackOverflow’s flood gates are open, and there are many new sites based on the stackoverflow engine.
One of those that I think has great potential is Ask Science, though at the moment it’s rather desolate:

StackOverflow is branching out heavily in the past months. First, SystemFault, a sysadmin-targeted site. Then, they purchased SuperUser.com (coming soon) – a site for home users (questions like ‘how to configure my router’).
And now, a meta discussion forum. It seems the process of cloning or ‘flavoring’ SO is now almost streamlined. I wonder how many stack overflows will we have a year from now. In two years? I think it’s rather unfair that only us programmers (and now sysadmins) have such a great resource. What do you think – will SO clone into Q&A forums for other non-computer topics (a suggested name for a law-based SO – ObjectionDenied
)
P.S.
Apparently, there’s already a release date for the platform! Prepare for the onsalught of StackOverflows.
Corollary: Never write a recursively method with an unbounded stack depth.
I previously posted a recursive implementation of Factorial, and asked the readers “not to bother saying it’s inefficient because of recursion, since it will probably be optimized away anyway”. Not true.
I don’t really understand why (just posted a question to StackOverflow), but C# does not generally perform tail recursion elimination (at least as my measly test show).
The following method can be easily optimized, both to work faster, consume less space and not to cause a StackOverflowException … but it is not optimized by the compiler (verified by Reflector and the fact a StackOverflowException was indeed thrown).
private static void Foo(int i) { if (i == 1000000) return; if (i % 100 == 0) Console.WriteLine(i); Foo(i+1); }
So … if for some reason you prefer writing recursive methods over using loops, do it only where performance is not a consideration and you have a good understanding of the maximal stack depth.
C# programmers – you should read this question and its many answers, I’m sure you’ll learn a thing or two. For example, ThreadStaticAttribute – a clean, type-safe way to get thread local storage in C#.
A few days ago, stackoverflow.com launched in public beta. I’ve played with it a bit and I think it has the potential to become a great tool for programmers.
It’s basically a combination of blog/wiki/digg/forum. Seems like a most questions get answers (on various degrees of relevance) within minutes-hours. Here are some of the questions I’ve asked, in case you’re interested.
Here’s a review of the beta site (about a month old), but instead of reading it I encourage you to just try it next time you need a programming question answered and Google fails you (don’t forget to subscribe to your question’s RSS feed).