Dr. Dobb's Blogs http://www.drdobbs.com//author/6832 Dr. Dobb's Copyright 2013, United Business Media. en-us My Big Company Code Interview http://www.drdobbs.com/tools/my-big-company-code-interview/240166992 It's been years since I gave up on chat interviews. It just seems like these don't work so well &mdash; we all feel like we are insightful judges of candidate quality, but somehow the people we hire just don't always turn out as well as we hope. Wed, 09 Apr 2014 03:36:00 -0400 C++11: unique_ptr http://www.drdobbs.com/cpp/c11-uniqueptr/240002708 There are a lot of great features in C++11, but <code>unique_ptr</code> stands out in the area of code hygiene. Simply put, this is a magic bullet for dynamically created objects. Tue, 26 Jun 2012 06:37:00 -0400 C++11's async Template http://www.drdobbs.com/cpp/c11s-async-template/240001196 Spinning off worker threads for fun and profit. Wed, 30 May 2012 10:33:00 -0400 Auto Types and Range-Based For Statements in C++11 http://www.drdobbs.com/cpp/auto-types-and-range-based-for-statement/232900460 Two really handy features in C++11 are the <i>range-based for statement</i> and the <i>auto type specifier</i>. Tue, 17 Apr 2012 10:41:00 -0400 Visual Studio 11: The Early Release http://www.drdobbs.com/architecture-and-design/visual-studio-11-the-early-release/232602709 In this article, I'll show you how a little thing like a lambda can make a big difference in your coding style. Thu, 15 Mar 2012 14:23:00 -0400 Iterators and iostreams http://www.drdobbs.com/cpp/iterators-and-iostreams/232600539 In a previous post, I bemoaned the fact that the C++ iterators that perform stream I/O use the insertion and extraction operators, making them unsuitable for binary data compression. It looks like I spoke too soon. Thu, 09 Feb 2012 10:00:00 -0500 What's the Best Paradigm for Data Compression Routines? http://www.drdobbs.com/cpp/whats-the-best-paradigm-for-data-compres/232301211 General purpose data compression routines tend to be used on binary streams of data, either from files or in-memory objects. So what is the best general paradigm for input and output when compressing data: iostreams or iterator? Tue, 03 Jan 2012 09:20:00 -0500 C++11 Hash Containers and Debug Mode http://www.drdobbs.com/cpp/c11-hash-containers-and-debug-mode/232200410 I have to give Microsoft a demerit in one area: Its C++11 hash containers have some serious performance problems &mdash; so much that the debug versions of the containers may well be unusable in your application. Tue, 29 Nov 2011 16:00:00 -0500 Network Discovery Tools: Putting DNS Service Discovery To Work http://www.drdobbs.com/parallel/network-discovery-tools-putting-dns-serv/231602470 I will show you a little bit about how we use DNS-SD, and how you can put it to work effectively in your networks. Fri, 30 Sep 2011 06:35:00 -0400 Type Safety and GCC http://www.drdobbs.com/cpp/type-safety-and-gcc/231300291 One of the great things about C, and even more so for C++, is its strong type-checking mechanisms. Fri, 05 Aug 2011 06:18:00 -0400 SMTP Configuration http://www.drdobbs.com/cpp/smtp-configuration/231002487 I'm going to share a few tips to help in the process of setting up an SMTP server so postfix can send mail from your Linux system. Fri, 22 Jul 2011 15:55:00 -0400 Free SMTP http://www.drdobbs.com/web-development/free-smtp/231000912 Integral email is still a great feature, almost 40 years after it first showed up in UNIX. Fri, 01 Jul 2011 14:45:00 -0400 C Skills in the Land of PHP: No Easy Ride http://www.drdobbs.com/cpp/c-skills-in-the-land-of-php-no-easy-ride/230500251 For the last three months or so I've been working full time on a fast-paced project that is using PHP as a general-purpose scripting language. So I've been working in this unfamiliar language at a fairly frantic pace, and I have to say that PHP, like Perl, is a strange place for a C programmer. Fri, 10 Jun 2011 11:48:00 -0400 Linus and C++ http://www.drdobbs.com/cpp/linus-and-c/229700143 Does C++ lead to really bad design choices? Fri, 27 May 2011 13:32:00 -0400 C/C++ Programming in a UNIX Environment http://www.drdobbs.com/cpp/cc-programming-in-a-unix-environment/229402491 How long did it take you to learn C++? Do you think you could squeeze that into a single undergraduate semester, giving it only the 20% of your attention span that is due? Fri, 29 Apr 2011 06:01:00 -0400 Project Euler: Problem 328 http://www.drdobbs.com/cpp/project-euler-problem-328/229401218 If I had been paid for every hour I spent working on Project Euler's problem 328, I think my summer vacation would already be paid for. Fri, 08 Apr 2011 06:02:00 -0400 A Big Problem That Doesn't Need a Bignum http://www.drdobbs.com/cpp/a-big-problem-that-doesnt-need-a-bignum/229300292 When I finally wrapped up the mathematical modeling of the <a href="http://www.drdobbs.com/blog/archives/2011/01/20_heads_in_a_r.html">k-consecutive heads coin toss problem</a> I had a concise formula... Tue, 15 Feb 2011 13:47:53 -0500 Ken Olsen, RIP http://www.drdobbs.com/architecture-and-design/ken-olsen-rip/229300291 Looking back on the amazing arc of Ken Olsen's life brings home an important point about the pace of change in the technology business Tue, 08 Feb 2011 04:21:50 -0500 Gawker Considered Stupid - Criminally Stupid http://www.drdobbs.com/architecture-and-design/gawker-considered-stupid-criminally-st/229300225 <table border="0" align="left" cellpadding="5"> <tr><td><img src="http://marknelson.us/attachments/2011/gawker/passwords.jpg"/></td><tr> <tr><td><a href="http://www.flickr.com/photos/beleaveme/3988066... Mon, 07 Feb 2011 03:59:15 -0500 20 Heads In a Row - What Are the Odds? http://www.drdobbs.com/architecture-and-design/20-heads-in-a-row-what-are-the-odds/229300217 A couple of weeks back I <a href="http://marknelson.us/2010/09/12/innumeracy-revisited/">took</a> <a href="http://www.nytimes.com/2010/09/26/magazine/26letters-t-ENGINEERINGT_LETTERS.html">issue</a> w... Wed, 19 Jan 2011 08:12:13 -0500 Combinatorial Data Compression http://www.drdobbs.com/architecture-and-design/combinatorial-data-compression/229300227 Newcomers to the world of data compression often stumble on this old idea in hopes of creating a novel and powerful algorithm. In a nutshell, the idea is to create an enumerative coding system that us... Sun, 09 Jan 2011 13:15:18 -0500 Google Is a Scary Lifeline http://www.drdobbs.com/architecture-and-design/google-is-a-scary-lifeline/229300287 These days I've turned over a lot of my life to Google - they have my email, a lot of my documents, and my primary phone number. This is all great while it works, because in general it's free, and th... Thu, 16 Dec 2010 09:45:45 -0500 Ripoff Artists http://www.drdobbs.com/architecture-and-design/ripoff-artists/229300253 Nobody likes getting ripped off, and I'm no exception. I search the web from time to time to see who's copying my stuff, and it's always a little disheartening. Sun, 14 Nov 2010 10:13:53 -0500 Any Serial Port http://www.drdobbs.com/tools/any-serial-port/228700072 I spent a pretty big chunk of the 80's and 90's toiling away on <a href="http://www.greenleafsoft.com/CommLib/CommLibSummary.asp">Greenl af Commlib</a>, a C/C++ library that provided support for RS-232 communications on MS-DOS and Windows machines... Sun, 07 Nov 2010 12:45:10 -0500 The Never-ending Awesomeness of Bash http://www.drdobbs.com/architecture-and-design/the-never-ending-awesomeness-of-bash/228700380 This semester I'm teaching a class on Linux/UNIX, and am enjoying it immensely. With every lecture I'm reminded that you simply never stop finding new tools and tricks to use in an O/S that is now well into middle age. One of my midterm questions from last week was a basic query regarding filename expansion under bash:<blockquote><div> Write a command to copy files chapt00.txt, chapt01.txt, through chapt15.txt from the current directory to your home directory. Make the command as short as possible.</div></blockquote> The answer I was expecting was<br/> <tt>cp chapt0[0-9].txt chapt1[0-5].txt ~</tt><br/> and that is indeed what I got from the majority of the students. Of course a few were confused about the use of character classes and tried to get something like <tt>chapt[00-15].txt</tt> to work. But one student turned in something a bit more novel:<br/> <tt>cp chapt{0[0-9],1[0-5]}.txt ~</tt><br/> My initial reaction was that this was simply a misguided attempt at filename expansion using broken syntax. But I was assured that this worked properly, and a quick look at the bash reference manual showed me the error of my ways. It turns out I was completely overlooking a nice feature of the shell: <i>brace expansion</i>. When the shell encounters a sequence of the format <i>preamble{comma-separated-list}postamble</i>, it iterates through the comma list of tokens inside the brackets and generates a new string for each one. The GNU manual example is for the sequence <i>a{d,c,b}e</i>, which generates a space separated list: <i>ade ace abe</i>. What this means is what I took to be an incorrect file specification actually generated the sequence <i>chapt0[0-9].txt chapt1[0-5].txt</i>. Since brace expansion occurs before filename expansion, this results in the desired output. So this answer, being more terse than my expected response, is actually <i>more right</i>. Our machines at school are using bash 3.2. If we upgraded to bash 4, we could use a numerical sequence with brace expansion to get even a better answer. The expression <tt>chapt{00..15}.txt</tt> should expand to the list of all 16 file names. But bash 4.1 is still only slowly working its way into new distributions, so it may be a while before we can count on that syntax to work everywhere. The moral of the story, of course, is that no matter how much time you spend working with the UNIX/Linux command line, there is always plenty more to learn. I should be paying <a href="http://utdallas.edu">UTD</a> to teach this course, not the other way around. Sun, 17 Oct 2010 13:08:06 -0400