1. Home
  2. Computing & Technology
  3. C / C++ / C#

Latest Programming Tutorials

About C, C++ and C# brings you the latest programming tutorials, a part work built up week by week. Choose C, C++ or C# or all three.

Latest Programming Tutorials

C / C++ / C# Spotlight10

David's C / C++ / C# Blog

Challenge 29 Revisited

Sunday November 8, 2009

Thanks to John Downey, Pedro Graca, Stuart Highman and Kenneth D Weinert for early entries (I've marked the first two and will carry on marking as entries are received). Also, thanks to the commenters regarding the asymmetric distance calculation (not the same distance in each direction!). I found this page on distance calculations

a = pi/2 - lat1
b = pi/2 - lat2
c = sqrt(a^2 + b^2 - 2 * a * b * cos(lon2 - lon1)
d = R * c

Use R= 3956(miles). I know the Earth isn't a sphere- it's an oblate spheroid because the rotation of the Earth makes it bulge slightly at the equator but it's ok for this challenge.

The first times are

  1. Pedro Graca 1.567 seconds
  2. John Downey 1.658 seconds
Both entries are written in C#.

Covering Open Source

Friday November 6, 2009
As you've probably guessed, I'm a keen advocate of open source, albeit an equally keen user of closed source software, especially development tools. Having worked in a software house that sold software to banks, Closed software development is focused on providing something that the customer will buy. If they aren't focused then they're out of business sooner or later, whereas open source has the luxury of not needing to be commercial to survive. My point is that the world is big enough for both.

But it's also obvious that with 70 million + websites/blogs out there, there is almost certainly a lot of useful open source that is never heard about. So if you are working on an open source project (C, C++ and C# only) and would like a mention write to me at cplus.guide@about.com and tell me about your project, team etc.

Challenge 28 Marked

Thursday November 5, 2009

Congrats to Pedro Graca who once again wins though the competition was out of sight this time. His C entry calculated the puzzle answer in about 3 seconds and though it didn't create a valid CSV file, it would be churlish not to cite him as the winner.

I've had the first entry for Challenge 29 from John Downey of Purdue University. Starting from this weekend, I'll try and mark these as they come in but no source code will be published until the challenge ends.

Computer Vision and Face Recognition in C and C++

Tuesday November 3, 2009

Living in the UK which I believe is home to the most CCTV cameras per head of population (about 1 for every 16 people in the UK) means I'm not terribly keen on advancing this type of technology but you can't really halt progress, just try to control it so it doesn't get abused. We must be close the point of having software that can track a person in a crowd moving across a city, if it hasn't already been done.

Face recognition is a hard problem to solve from scratch but it's now a mature enough technology that even cheap compact digital cameras can identify faces. Open Source is making inroads into this as well with two libraries. The LibFace open source library uses the OpenCV library for face recognition and has got a complete collection of functions that are essential for building a face recognition system.

Intel originally produced the OpenCV (Open Source Computer Vision) library, written mostly in C which is about computer vision and has over 400 different functions covering 28 areas of computer vision research, of which one aspect is face recognition. There's even an O'Reilly book about using OpenCV and writing applications in C, C++ and Python. There's also a good guide to getting started with OpenCV from Leeds University. Intel sells a library IPP which is integrated with OpenCV so that if you have IPP, some functions are much faster.

Discuss
Community Forum
Explore C / C++ / C#
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. C / C++ / C#

©2009 About.com, a part of The New York Times Company.

All rights reserved.