Tuesday, June 29, 2010

About C / C++ / C#: One Week to go for Programming Contest 36

If you can't see this email, click here

About.com

C / C++ / C#

Fundamentals

Tips & Tools

Going Pro



From David Bolton, your Guide to C / C++ / C#
I was advised that since more people search for programming contests than programming challenges that I should call them contests. Contest 36 is due up in a few days (details below) but you've got until next Sunday evening to submit your entry as I'm away for a short break. Of course Contest 37 is now up as well, so if you've ever fancied writing a simple search engine... See you next week!

What Powers Farmville and Cafe World etc?
Along with memcached (a caching system written in C), these web games with hundreds of millions of plays each month use Membase. It's written in C for the main code and C++ for utilities, drivers etc, with some Python thrown into the mix. Membase is another datastore of the NoSQL family. After looking at Cassandra, Hbase, Redis, Mongo, Voldemort and Tokyo, they decided that there wasn't anything just right for them and so wrote Membase; investing 20 man years of effort into it. It was written originally for Linux but can be built on other platforms. Membase was designed for low latency and high throughput. Low latency means it returns data very quickly after the request. In an environment such as Farmville, which had 18 million Daily Average users in June 2010 (Source ), this is essential to have high performance that keeps players interested.

Open Source C Compilers
Given the relative simplicity of building a C compiler (compared to C++), it's not surprising that the web is almost awash with different C compilers. I've mentioned Tiny C Compiler (TCC) which generates code for Windows and 64 bit CPUs. If you want to get immersed in the world of compilers (I did back before games), TCC is probably a very good place to start as it supports much of the C99 standard. It's also very fast at compiling: 859,000 lines per second on a 2.4 Ghz Pentium 4; that's 9 x faster than GCC! The penalty for fast compilation speed (made possible by code generation in a single pass) is of course lesser optimizations but for learning it's ideal. But there are other C compilers out there as well, lcc and sdcc are two compilers both linked to on the TCC site. Both are retargetable compilers for Standard C. While lcc generates code for the ALPHA, SPARC, MIPS R3000, and Intel x86 and its successors, sdcc is for Intel 8051, Maxim 80DS390, Zilog Z80 and the Motorola 68HC08 based MCUs. If you really want to know how a C compiler works there's a complete tour of the version 3.6 source code in the book: A Retargetable C Compiler: Design and Implementation (Addison-Wesley, 1995, ISBN 0805316701, ISBN-13 9780805316704). It's still available. Good reading! If you're interested in free C compilers, the link below has a fair number...

Programming Contest 37 Published
Number 36 has a few days to go but as I'm away next weekend, it won't get marked until July 5th so still time to get your code in. In case you're wondering, I've started calling them contests rather than challenges because more people look for contest! This time, you are provided with a block of text, some 1,000 questions, each on its own line and ten search phrases. So your code has to search the question text for the search phrases and return relevant answers as fast as possible. Full details are provided on the contest page. Have fun!

Never Programmed Before? Start Here
Learn how to program computers as a living or just for recreational fun. Find out how to make a computer do what you want.

 


C / C++ / C# Ads
Featured Articles
Other Blogs You might find Interesting
Welcome to the C Area with Articles about C Programming
Welcome to the C++ Area with Articles about C++ Development
Welcome to the C Sharp Area with Articles about C Sharp Development
Learn about Commercial Software Development
All about Games Programming

 

More from About.com

Plan a Unique Vegas Wedding
The minister, music and champagne are just the beginning -- why not get married aboard a helicopter or have a pirate swing in to deliver your rings? Arrrr! More>



Join About.com's User Panel!
Share your opinions and help us make About.com more relevant, informative and enjoyable to use. More>




This newsletter is written by:
David Bolton
C / C++ / C# Guide
Email Me | My Blog | My Forum
 
Sign up for more free newsletters on your favorite topics
You are receiving this newsletter because you subscribed to the About C / C++ / C# newsletter. If you wish to change your email address or unsubscribe, please click here.

About respects your privacy: Our Privacy Policy

Contact Information:
249 West 17th Street
New York, NY, 10011

© 2010 About.com
 


Must Reads
Programming Challenges
About C, C++ and C#
C++ for Beginners
C++ Programming
Intro to OOP

Advertisement

Tuesday, June 22, 2010

About C / C++ / C#: Back to Fundamentals

If you can't see this email, click here

About.com

C / C++ / C#

Fundamentals

Tips & Tools

Going Pro



From David Bolton, your Guide to C / C++ / C#
Over the last few days, I've started looking at fundamentals particularly in C initially about memory allocation in small bite sized blog entries. Even in C++ or C# this is still useful to know. Although .NET runs managed code, data structures are still ultimately dependent on hardware so a bit of knowledge may come in useful even though you're not supposed to need it. I'm back working on tutorials and reviews and will be publishing new ones shortly. Have a Great Week!

Running Your own Forge
Some of the software that I use is not written in C, C++ or C#. That's not really a big surprise as some of it is web based and more likely to be in PHP. I don't generally care what it's written in so long as I'm not modifying it. There are many useful open source packages written in PHP, such as the Mediawiki PHP software used in Wikipedia etc, WordPress etc! If you are developing multiple projects, say at school or college then you might find CodingTeam of interest. It's in PHP, so web based and lets you run your own Forge (like SourceForge etc). It's currently used by over 1,300 users and 300 projects. An alternative is http://sharesource.org/ (637 Projects, 1323 users) and it's good to see that both these forge systems are interoperable through an evolving standard OpenForge whose website uses the same MediaWiki that I mentioned. You will of course need a web server to run this software. It could be IIS running on your Windows PC or if you have a Linux box then the LAMP standard (Apache + PHP/MySQL) is pretty good. I taught myself to use Linux when I bought a new Windows PC by installing Ubuntu server on my old PC. If you go down this route, my personal recommendation is to also install Webmin as it simplifies a lot of the server administration.

Thinking About Fundamentals
Having learned assembly language the hard way by writing code, I suppose C has always been straight forward for me. I like to think in low level terms and understanding it helps me with my coding. Lets consider an array which is just a block of memory locations all located next to each other. If it's a single dimension array that's 64 bytes long, perhaps an array of char then it can hold 64 chars (63 if it's a string in C with the last one a terminating '\0'.. It could hold a chess or chequers board as a 2 dimension array of 8 x 8 chars. It could be an array of 16 ints on a 32 bit computer where each int occupies 4 bytes. It could even hold a 4 x 4 x 4 array of chars, representing three dimensions. My point is that as you get nearer to the hardware, programming in assembly language or C, you can think of the variables as just blocks of memory. With higher level languages like C#, the same is true but behind the scenes .NET manages all of the memory allocation and you shouldn't think quite the same way. For c and simple C++ programming thinking in terms of blocks of memory can be helpful.

Text Processing and Summarizing
I've been using writing tools for the last 30 years since WordStar on a SuperBrain in 1980. Text processing is one of those academic areas where much goes on and occasionally surfaces into the real world. One such area is Text summarizing. I've been a registered user of the commercial product Copernic Summarizer for several years. Bolton's 2nd law is: "That for every commercial application there is almost always an equal and opposing open source application". In this case Open Text Summarizer (OTS), written in C is used in open source software like Abi-Word and Gnome-Summarizer as well as the command line utility OTS in many Linux distributions. A Windows version (and VC6 compilable source code is also provided).

Code Library for C, Objective-C, C++ and C#
This is the code library with all examples, free downloads for this topic.

 


C / C++ / C# Ads
Featured Articles
Development Projects from Initial Design to Completed Code
Reviews of Software - Tools, Compilers, Editors etc
Book Reviews
Top Tools, Utilities and Resources
Glossary of Programming Terms
Never Programmed Before? Start Here

 

More from About.com

Plan a Unique Vegas Wedding
The minister, music and champagne are just the beginning -- why not get married aboard a helicopter or have a pirate swing in to deliver your rings? Arrrr! More>



Join About.com's User Panel!
Share your opinions and help us make About.com more relevant, informative and enjoyable to use. More>




This newsletter is written by:
David Bolton
C / C++ / C# Guide
Email Me | My Blog | My Forum
 
Sign up for more free newsletters on your favorite topics
You are receiving this newsletter because you subscribed to the About C / C++ / C# newsletter. If you wish to change your email address or unsubscribe, please click here.

About respects your privacy: Our Privacy Policy

Contact Information:
249 West 17th Street
New York, NY, 10011

© 2010 About.com
 


Must Reads
Programming Challenges
About C, C++ and C#
C++ for Beginners
C++ Programming
Intro to OOP

Advertisement

Tuesday, June 15, 2010

About C / C++ / C#: Three New Programming Contests

If you can't see this email, click here

About.com

C / C++ / C#

Fundamentals

Tips & Tools

Going Pro



From David Bolton, your Guide to C / C++ / C#
Google's Chrome Operating System offers a future where the only Apps you run are web apps, throwing away 50 years of creating programs at a stroke. I think I'd prefer to revert to a Dos command line world than give up the ability to program that way. I can't see the likes of Linux, OS X or Windows vanishing though. Have a great week!

Three New Programming Contests
Clearly the corporates see this as a time to harness the availability of student and school age programmers in the USA and afar.
  • Activision is looking for individual developers or teams located in the USA and includes not only completed or in game development but also concepts and proposals. With a cash prize of $175,000 and second getting $75,000 to assist with game development!
  • Samsung are offering $2,700,000 in total with a grand prize of $300,000 for developers to enter their Global Developer Challenge or local if you live in Russia, China, Hungary, Poland, Philippines and Vietnam. This is to develop applications for their Bada phone (it's programmed. in C++). More details about Bada on Wikipedia.
  • You've just got time to enter the Intel Visual Adrenaline Game Demo Challenge which is open to professionals, hobbyists and students alike.
Good luck with those and if they aren't enough for you, how about the usual programming contests.

Atari Pitfall in C# and ASCII
Pitfall Atari Game ScreenshotGames in ASCII look less than brilliant but that's not the issue. This is a pretty neat rendering of the old Atari Pitfall game from the early 1980s, almost 30 years ago. It's written in C# and uses a library by Jim Mischel to output flicker free ASCII graphics to the screen. This gives slightly crude looking graphics but it's very fast.and flicker free. The original Atari 2600 was quite limited in its display and available RAM/ROM and uses an 8 bit random number generator that emits all 256 values before repeating. the details are on the web page. According to Wikipedia, the whole game took ten minutes to design but 1,000 hours to program.

A worthwhile Open Source Project
I'm surprised no one has done this before, basically an open source project that is like DropBox, the file synchronization service. I use DropBox now and then; it's one of the fastest and easiest ways to get txt or PDF files onto my iPhone/iPad. That plus GoodReader or Stanza make for an excellent ebook reader for PDFs. So SparkleShare is doing an open source version of the Dropbox software, not just the client but to setup your own servers. The initial version is for Linux and there is some source code there (in C#/Mono). Windows and Mac versions will follow, sooner if the project gets more helpers. Any kind of contribution would be great. translations, bug reports, code, docs, it doesn't matter. Remember, if you've a project that would benefit from help, email me and I'll mention it.


Never Programmed Before? Start Here
Learn how to program computers as a living or just for recreational fun. Find out how to make a computer do what you want.

 


C / C++ / C# Ads
Featured Articles
Other Blogs You might find Interesting
Welcome to the C Area with Articles about C Programming
Welcome to the C++ Area with Articles about C++ Development
Welcome to the C Sharp Area with Articles about C Sharp Development
Learn about Commercial Software Development
All about Games Programming

 

More from About.com

Plan a Unique Vegas Wedding
The minister, music and champagne are just the beginning -- why not get married aboard a helicopter or have a pirate swing in to deliver your rings? Arrrr! More>



Join About.com's User Panel!
Share your opinions and help us make About.com more relevant, informative and enjoyable to use. More>




This newsletter is written by:
David Bolton
C / C++ / C# Guide
Email Me | My Blog | My Forum
 
Sign up for more free newsletters on your favorite topics
You are receiving this newsletter because you subscribed to the About C / C++ / C# newsletter. If you wish to change your email address or unsubscribe, please click here.

About respects your privacy: Our Privacy Policy

Contact Information:
249 West 17th Street
New York, NY, 10011

© 2010 About.com
 


Must Reads
Programming Challenges
About C, C++ and C#
C++ for Beginners
C++ Programming
Intro to OOP

Advertisement