As a belated follow up to my post on C# Anonymous Methods, let’s look at a closely related feature of the CLS: lambda expressions. Then let’s use a lambda expression to improve the code example from that earlier article. Continue reading “C#: Lambda Expressions”
C#: Anonymous Methods
To continue ChalamiuS’ theme of C# goodness, let’s explore a feature of C# introduced in version 2 of the CLS: the anonymous method. Along the way we’ll also encounter Generics and Object Initializers, but they are not the focus of this post.
Continue reading “C#: Anonymous Methods”
Mine Mania
A fanatic is one who can’t change his mind and won’t change the subject.
Sir Winston Leonard Spencer-Churchill, KG, OM, CH, TD, FRS
Not to let our rodent friends have all the fun mine-sweeping, I’ve created a basic C++ ncurses minesweeper game. This diverges some from the theme of Standard Template Library exploration, although it does make use of the std::max and std::min functions.
Exploding Rats and the C++ Standard Vector
Rats are small, cheap, easy to maintain and transport.
As many are aware, land mines present a significant danger in many war-ravaged countries around the world. Numerous innovative techniques have been developed to clear mine fields, rendering the land once again usable and preventing tragic injuries and deaths. A Belgian non-profit organization, APOPO, began a unique program to develop a new method — using Giant Pouched Rats (Nesomyidae Cricetomyinae) to detect mines — dubbed HeroRATS in 2004, and has now deployed the intrepid rodents in Mozambique.
The rats are too light to set off mines, so disappointingly they are not destroyed in the process (sorry, I lied). Instead, the rats are attached to guide lines and trained to scratch at the ground when they sniff out explosives. The mine is then flagged for removal using more appropriate tools.
A zebra is a horse designed by a committee.
I’ll be the first to admit that I am not an expert with the C++ language. In fact, I can use all the practice I can get. I’ve been using the Standard Template Library on and off for almost 3 years now, but know embarrassingly little about it’s full capabilities. In that vein, I will (hopefully) be posting a series of snippets and short programs about the STL. I plan to start simple, and work my way up. Without further ado, the very basics of the STL vector and it’s iterator.
#include |
$ g++ vector.cpp -o vector && ./vector foo bar baz $
Let me know if I’ve made obvious mistakes, which I tend to do frequently!