Tuesday, August 31, 2010

About C / C++ / C#: Free Programming E-Books!

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#
As Contest 38 is due tomorrow, I'm extending the deadline until next Sunday so still time to enter. Contest 39 is now published and starts tomorrow. It's an interesting one, working out differences between two strings. Silverlight is still not entirely off the coverage radar as the tools to develop it are available free (see below). There are a few rumors circulating about Silverlight's future. Can anyone cast any light? Have a great week! (Mine will be it's only four days long this week!)

Free Programming E-Books!
Maybe it's laziness or bad navigation titles on my part but I've put up a lot of links to free E-Books and yet at least 2-3 times a week get requests to send E-books on programming. So if anyone wants to try and make money sending free e-books by email, you'll get plenty of requests! I've just updated Links to C programming E-books by adding C Programming in Linux an 84 page PDF by British author David Haskins. You'll need to register for that but it's free. There are nearly 50 links to the free E-Books, Just click Tools and Resources on the left menu.(or the link) and you'll see links to Free E-Books for C, C++ and C# and other programming related aspects. The two folders with 0 count are wrong- there are e-books there, It's a bug and it will be fixed!

Programming Contest 39 Published
The Levenshtein Distance between two strings a, b is the number of changes to transform one string into another. For example to transform mouse into house would take 1 (change the m to an h). If the strings are different length then either characters need to be added or removed. The total number of operations needed (inserts, deletes or changes) is the Levenshtein distance. In this challenge you are given a txt file of 100 word pairs, each pair is on a separate line and separated by a comma. You must write a function int getLevenshteinDistance(string a,string b) (char * for C) That calculates the distance between the two strings and returns it, The challenge is to do it 100 times, as quickly as possible. This is a speed challenge. Note to keep it simple the lengths of the two words will only differ by at most 2 characters. So you may get a 6 letter word and have to transform into a 4-8 letter word but not 9 or more, or 3 or less.

Contest 38

I'm extending the deadline for this until next Sunday. So still time to get your entries in!

Eclipse Tools for Silverlight
>I haven't been covering Silverlight development because you need the paid for Visual Studio 2010 so it's not free to develop. I still think Microsoft should make this free, as it already has with WPF. In Visual C# 2010 Express you can create WPF Applications as well as WPF browser applications. I've nothing against Silverlight, in fact I was quite keen on it. C# plus fast graphics that runs in your browser or standalone! What is there not to like about that? But developing for Silverlight is not easy without the editor, However there is an alternative project that may help. ESL - Eclipse Tools for Silverlight. It's been out for over a year, so I wondered if anyone had tried it and had comments. I've added it to my growing list of things to investigate and if it proves workable then Silverlight development will come back here. it's still a couple of versions behind and is moving to a project within Eclipse (ESL).

Development Projects from Initial Design to Completed Code
Each project is a complete application with notes on the requirements, the design, the architecture, code and final project review. With full source code in C, C++ or C#.

 


C / C++ / C# Ads
Featured Articles
Reviews of Software - Tools, Compilers, Editors etc
Book Reviews
Top Tools, Utilities and Resources
Glossary of Programming Terms
Welcome to the C++ Area with Articles about C++ Development
Other Blogs You might find Interesting

 

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, August 24, 2010

About C / C++ / C#: A Week of Games Posts

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#
Not by design but last week's blog entries seems a little top heavy with several games related posts on Game Maker, Frotz and Arimaa, but only two are included here. Some weeks are like that but it really does happen by chance. Next week might be about C# etc. I'm still feeling good because I found a bug at work last week that had been crashing a logging service for a very long time! If only every week were like that... Until next week, have fun!

Game Maker - Create/Prototype Windows/Mac Games
Game Maker Screen ShotGame Maker is actually a game creation system that lets you create a wide variety of game types from 2D board games, card games, adventure, arcade, puzzle, strategy through to 3D shootemups (though possibly not quite Call of Duty Standard!).It's now at version 8 and the basic system is free but the advanced Pro version costs just $25 and generates standalone exes that can be distributed free of charge. Given that it includes 3D (using Direct3D API), and networking, I think it's a really powerful package.It's got a very good "get you started" tutorial as well. Other official tutorials cover Creating a Scrolling Shooter, Maze Games, 3-Dimensional Games and a First Person Shooter. I wouldn't normally cover such systems but this one works well for C developers and so intrigued me and I took a closer look. There is a C like scripting programming language GML (Game Maker Language) with C like code blocks, function calls, variable assignments, and operator syntax. It has an extensive number of numeric and string functions. In additions sprite are mapped as objects with an event/action system but objects can be invisible and used to control game logic. They aren't created in code though, GML is not an OOP language. You can extend Game Maker with your own dlls, so for example AI could be controlled from a DLL but only doubles and strings can be passed in and out of DLLs. There is also a newer alternative way of packaging using the Extension Maker, a free download which bundles up dlls and scripts. For $25 you get a very usable game prototyping tool that also lets you create very playable games, ideal for the Indie game developer. It certainly has a lot of developed games and a large community behind it. What many programmers don't appreciate is the effort needed to create animations, sound effects, collision detection, game state, networking etc and lots more code that goes into every game. This provides all of that. Game making isn't easy, in fact it's a lot of hard work but this gets you into coding the game without worrying about learning to code all of the other stuff that's needed.

Free Network Programming Book
One area where I haven't done much is network programming, but if I'd had this free e-book I'm sure I would. You can download it as a 104 page PDF or view it online (it's big). Written by Brian Hall (aka Beej) it is a very good introduction to programming network code in C/C++. If you've ever wondered for instance how to write code that works with both ipV4 and iPv6 this will explain it. Programming with sockets can be a frustrating subject but this should give you a good basic grounding. There's a lot to get through but the author does it well with lots of humor.

Arimaa - like Chess But Harder for AI
As computers have become pretty good at brute forcing chess, a computer engineer Omar Syed devised Arimaa® to be a much more complex game that is easy for humans to learn but much much harder for computers to brute force. It is both trademarked and patented, and there's a $10,000 prize each year until 2020 for any program that can beat a top ranked human in 6 games. The game uses a chessboard and pieces (with different names. King is elephant, Queen is camel, rooks are horses, bishops are dogs, knights are cats, and pawns are rabbits. The rules are fairly easy and I'm not going to mention them all here but pieces can only be removed if trapped in one of four special squares. To win, just move a rabbit to the far side of the board. Needless to say it's a lot more complex than that as pieces can be pinned unable to move without help, (bit like Zone of Control in boardgames), and stronger pieces can push or pull weaker pieces. It's really quite intriguing. There's a fair bit of code with sample source code for bots in C, C++ and C# on the download . I've added a permanent link to the C# Chimaera Arimaa® engine.

Other Blogs You might find Interesting
This is a list of Blogs that you might find interesting.

 


C / C++ / C# Ads
Featured Articles
Never Programmed Before? Start Here
Welcome to the C Area with Articles about C Programming
Welcome to the C Sharp Area with Articles about C Sharp Development
Learn about Commercial Software Development
All about Games Programming
Code Library for C, Objective-C, C++ and C#

 

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, August 17, 2010

About C / C++ / C#: Hard Software To Write or Test or Do

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'm still constantly surprised by some of the open source software that I come across. Raw Therapee and dcraw are excellent, as is HoldingNuts. i suspect I'll still be turning up excellent stuff in five years time but keep sending in your recommendations. have a good week - They can't all be great!

Raw Therapee for Raw Images
Raw Therapee Screenshot

If you own a Digital SLR then it will probably allow you to capture photos in Raw mode rather than just jpg. I have a Canon EOS 450D (aka Digital Rebel XSi) that can do this and I think most modern DSLRs will. In this mode you get the raw image captured by the sensor instead of one processed by the camera. With additional information, a single image comes as 16.8 MB instead of the usual 3-5 MB jpg file. Note each camera manufacturer uses their own Raw format but there is software that can read them. The benefits of working with Raw (also called digital negatives) are that you can achieve higher quality than the jpg output by the camera. Jpg is a lossy compression and only capture 8 bits of intensity information not the 12-14 bits in the Raw. If you have the tools and time you can tweak a raw photo well beyond the normal characteristics that cameras provide. For example iPhoto on the Mac can edit Raw files as can PhotoShop since CS2. Open source software has not been slow either. The dcraw library can read many raw image formats from hundreds of cameras (there are many!) and is also used in Raw Therapee, a cross platform raw image editing application written in C. The image in the screen shot is one of my office bookcases.


HoldingNuts - Open Source Poker Table
HoldingNuts Poker Table

Working socket server software isn't that common on the web. HoldingNuts isn't just a server but a multi-player poker table with a cross-platform client as well (built on QT). Written in C++, it's actually quite easy to understand. Although it uses the STL, only Vector and Map template classes are used. The table software isn't bad at all, it includes chat with other players, sounds, six languages, very configurable and the server supports multiple games with private, password protected games. If you were developing poker bots for instance this would be an ideal way of testing your bot. I'm very impressed with this.


Best Way to Learn a Language
After four years of writing here and 29 years programming I remain convinced that the best way to learn a new language is by writing an application or converting an existing one, assuming it's not your first programming language. If it is your first language think of a simple task to program then try and implement it. Here are some ideas but your suggestions for first programming project are welcome. Please send me your ideas and I'll create a page for them. Specify which languages if they're specific.
  • Input 3 numbers and calculate the average and output it.
  • Create an array of random numbers. Save it to disk in a text file.
  • Create a class (C++/C#) to calculate stats (min, max, average) of an array passed to it.
Plus and this is a personal rule; if I write a line or a block of code, I want to see it execute in a debugger. At least once to give me the confidence that it works. It's less important if you're writing it at home than say at work but all the tutorial code is always extensively by me. I's hard enough learning and if the code has bugs, harder still! Apologies for anyone currently trying to follow tutorial listings. The download code is fine but many of the listings are messed up because the line breaks were removed. Once I republish them they will be ok. It's a few hundred pages so will take a few evenings to do. Ironically it was a programmer who either didn't test his conversion code 100% or didn't realize it had to keep line breaks in code listings. I hope he read yesterday's post and now you know why I care about line breaks!

Development Projects from Initial Design to Completed Code
Each project is a complete application with notes on the requirements, the design, the architecture, code and final project review. With full source code in C, C++ or C#.

 


C / C++ / C# Ads
Featured Articles
Reviews of Software - Tools, Compilers, Editors etc
Book Reviews
Top Tools, Utilities and Resources
Glossary of Programming Terms
Welcome to the C++ Area with Articles about C++ Development
Other Blogs You might find Interesting

 

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