<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Disqus - Latest Comments for noahrichards</title><link>http://disqus.com/people/noahrichards/</link><description></description><language>en</language><lastBuildDate>Mon, 14 Sep 2009 13:09:15 -0000</lastBuildDate><item><title>Re: MonoTouch 1.0 goes live. - Miguel de Icaza</title><link>http://migueldeicaza.disqus.com/monotouch_10_goes_live_miguel_de_icaza/#comment-16583852</link><description>2nd that - the left-most digit looks like the back of a curled index finger and not a thumb to me, so I absolutely saw the icon as flicking me off.  Thanks guys :)</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">noahrichards</dc:creator><pubDate>Mon, 14 Sep 2009 13:09:15 -0000</pubDate></item><item><title>Re: Demoware</title><link>http://noahsmark.disqus.com/demoware/#comment-7094449</link><description>Like I said, though, it depends on how you define "useful".  Adding those knobs and levers attracts the KDE types to compiz - the people who want their UI to be infinitely configurable, so that they can make it feel just right.  It also makes the extension author's life easier - instead of making decisions about what looks best, he or she just leaves it effectively unconfigured (hopefully to the trade off of making the extension even better).&lt;br&gt;&lt;br&gt;And besides that, my rant isn't meant to say that you *shouldn't* care about things looking pretty, but that you shouldn't sacrifice real usability for making things pretty (e.g. if compiz causes your computer to crawl when any of the effects turn on, to the point that normal UI actions take 4x as long, fewer people would use it).  If none of the software on my mac worked well, I'd probably care much less that they all look pretty to me.&lt;br&gt;&lt;br&gt;Remind me later to give you the real-life example I encountered that led me to write this blog; it would be funny if not for the fact that the person suggesting it was completely serious :)</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">noahrichards</dc:creator><pubDate>Wed, 11 Mar 2009 02:20:59 -0000</pubDate></item><item><title>Re: Firefox&amp;#8217;s SSL policy is not bad, you idiot</title><link>http://noahsmark.disqus.com/firefox8217s_ssl_policy_is_not_bad_you_idiot/#comment-1668040</link><description>Because they are different services - note the keyword _verification_ in that second part. The first part, the "I want a domain name here plzthx", isn't a complicated problem because there aren't many (enforced) trust/identity strings attached. Also, because there are an inordinate amount of domains being registered and a much smaller number of sites getting SSL certs, I can only imagine the cost for the first will be much cheaper than the second. Sounds pretty simple to me.&lt;br&gt;&lt;br&gt;Oh, and the real answer is, "because they charge that much and people will pay it." Enter capitalism.&lt;br&gt;&lt;br&gt;Your suggestion, in the first paragraph, is for how a "trusted" authority should establish trust with an untrusted endpoint - you do some activity to prove to that party that you "own" the domain, and that third party, which is a trusted authority by some other definition, is depended on for its verification of your site. Maybe that is enough to establish trust, but how does it relate to the post?&lt;br&gt;&lt;br&gt;If you want to complain about the methods CAs use to verify identity, then that is a different discussion. If you feel a CA charges too much for its services, find a different one. The digicert price I found was after clicking 2 links in a google search. I bet you can find better prices without looking too hard.&lt;br&gt;&lt;br&gt;Or you get behind someone like &lt;a href="http://CACert.org" rel="nofollow"&gt;CACert.org&lt;/a&gt;, who gives out free (as in beer) certs and (I believe) is still trying to be accepted by mozilla as a trusted root CA:&lt;br&gt;&lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=21" rel="nofollow"&gt;https://bugzilla.mozilla.org/show_bug.cgi?id=21&lt;/a&gt;...&lt;br&gt;&lt;br&gt;Mozilla has a nice, fair, and public policy for how to become a trusted CA:&lt;br&gt;&lt;a href="http://www.mozilla.org/projects/security/certs/" rel="nofollow"&gt;http://www.mozilla.org/projects/security/certs/&lt;/a&gt;...&lt;br&gt;&lt;br&gt;So I don't think there are major roadblocks preventing somebody from using your method to establish trust and charging less than $100 a year and getting accepted by mozilla as a root CA. Except, you know, capitalism.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">noahrichards</dc:creator><pubDate>Tue, 19 Aug 2008 23:50:44 -0000</pubDate></item><item><title>Re: Firefox&amp;#8217;s SSL policy is not bad, you idiot</title><link>http://noahsmark.disqus.com/firefox8217s_ssl_policy_is_not_bad_you_idiot/#comment-1667872</link><description>Because they are different services - note the keyword _verification_ in that second part.  The first part, the "I want a domain name here plzthx", isn't a complicated problem because there aren't many (enforced) trust/identity strings attached.  Also, because there are an inordinate amount of domains being registered and a much smaller number of sites getting SSL certs, I can only imagine the cost for the first will be much cheaper than the second.  Sounds pretty simple to me.&lt;br&gt;&lt;br&gt;Oh, and the real answer is, "because they charge that much and people will pay it."  Enter capitalism.&lt;br&gt;&lt;br&gt;Your suggestion, in the first paragraph, is for how a "trusted" authority should establish trust with an untrusted endpoint - you do some activity to prove to that party that you "own" the domain, and that third party, which is a trusted authority by some other definition, is depended on for its verification of your site. Maybe that is enough to establish trust, but how does it relate to the post?&lt;br&gt;&lt;br&gt;If you want to complain about the methods CAs use to verify identity, then that is a different discussion.  If you feel a CA charges too much for its services, find a different one.  The digicert price I found was after clicking 2 links in a google search.  I bet you can find better prices without looking too hard.&lt;br&gt;&lt;br&gt;Or you get behind someone like &lt;a href="http://CACert.org" rel="nofollow"&gt;CACert.org&lt;/a&gt;, who gives out free (as in beer) certs and (I believe) is still trying to be accepted by mozilla as a trusted root CA:&lt;br&gt;&lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=215243" rel="nofollow"&gt;https://bugzilla.mozilla.org/show_bug.cgi?id=21...&lt;/a&gt;&lt;br&gt;&lt;br&gt;Mozilla has a nice, fair, and public policy for how to become a trusted CA:&lt;br&gt;&lt;a href="http://www.mozilla.org/projects/security/certs/policy/" rel="nofollow"&gt;http://www.mozilla.org/projects/security/certs/...&lt;/a&gt;&lt;br&gt;&lt;br&gt;So I don't think there are major roadblocks preventing somebody from using your method to establish trust and charging less than $100 a year and getting accepted by mozilla as a root CA.  Except, you know, capitalism.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">noah</dc:creator><pubDate>Tue, 19 Aug 2008 17:23:01 -0000</pubDate></item><item><title>Re: the keyboard/mouse and &amp;#8220;bandwidth&amp;#8221;</title><link>http://noahsmark.disqus.com/the_keyboardmouse_and_8220bandwidth8221/#comment-1667866</link><description>So it sounds like you have to do the following:&lt;br&gt;1) You are typing along (hands on keyboard) and you want to replace something in a piece of text&lt;br&gt;2) You select the paragraph (hand on mouse) and move the mouse somewhere&lt;br&gt;3) You type in "edit s/foo/bar/g" (hands on keyboard)&lt;br&gt;4) You middle click it (hand on mouse)&lt;br&gt;&lt;br&gt;The slowest part of using an editor is the movement back and forth between keyboard and mouse, I think, so this still feels suboptimal.  In vim, for example, you could do the following:&lt;br&gt;&lt;br&gt;1) You are typing along and want to change text in the paragraph&lt;br&gt;2) You select the current paragraph with "vip" or "vap": visual mode ("select") inner/"a" paragraph (the current paragraph) (more below).&lt;br&gt;3) You type ":s/foo/bar/g" and press enter&lt;br&gt;&lt;br&gt;No movement of the hands, no movement off the keyboard.&lt;br&gt;&lt;br&gt;For #2, you can replace the "p" in that with any of the following:&lt;br&gt;"w" - word&lt;br&gt;"s" - sentence&lt;br&gt;"[" or "]" - a "[]" block&lt;br&gt;"(" or ")" or "b"- a "()" block&lt;br&gt;"{" or "}" or "B" - a "{}" block&lt;br&gt;"&amp;lt;" or "&amp;gt;" - a "" block&lt;br&gt;" or ' or ` - a quoted string&lt;br&gt;"t" - a tag block, a la html (e.g.: "&amp;lt;foo&amp;gt;sometext&amp;lt;/foo&amp;gt;")&lt;br&gt;&lt;br&gt;You can also replace "v" (for selecting) with other commands like "d" (to delete) or "c" (to replace) or "y" (to copy).  And the difference between the "a" and "i" version ("a" block vs. "inner" block) is that the "a" version includes the delimiters of the block.&lt;br&gt;&lt;br&gt;The command remains, in a sense, for further use: pressing "." immediately runs the last command (so if you move the cursor to another paragraph and press ".", it will do it again).  Pressing ":" and then the up arrow key will scroll through your history (if you've typed a part of something, like ":s/", it will only complete history items that match what you've typed so far).  If you want to save it around, type "qa" (record macro into register 'a'), do steps 1-3, then hit "q" again to stop recording.  "@a" runs the macro in register 'a'.&lt;br&gt;&lt;br&gt;The paper is an interesting read, and I do believe that using the mouse for selecting text is faster for most people than would be the vim keyboard equivalents (my coworker uses gvim for this very reason, but I stick to just vim).  However, I think that anything that &lt;i&gt;requires&lt;/i&gt; some use of the mouse is still suboptimal to a solution that provides an optional mouse interface.  Then again, to each their own :)&lt;br&gt;&lt;br&gt;Here's a paper from the author of vim (Bram Moolenaar) about effective editing in vim: &lt;a href="http://www.moolenaar.net/habits.html" rel="nofollow"&gt;http://www.moolenaar.net/habits.html&lt;/a&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">noah</dc:creator><pubDate>Mon, 04 Aug 2008 22:54:42 -0000</pubDate></item><item><title>Re: C#: -100, Java: +1 (?!)</title><link>http://noahsmark.disqus.com/c_100_java_1/#comment-1667859</link><description>Because an IList and an IList&amp;lt;T&amp;gt; are fundamentally different types: in other words, IList != IList&amp;lt;object&amp;gt;.  Even if they were, it still wouldn't be ideal, because I want the methods to return the thing passed in (as an IList&amp;lt;T&amp;gt;), instead of requiring casts everywhere.  Added to that, the methods/properties on IList/IList&amp;lt;T&amp;gt; are different.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">noah</dc:creator><pubDate>Sat, 09 Feb 2008 03:44:06 -0000</pubDate></item><item><title>Re: &amp;#8220;value&amp;#8221;</title><link>http://noahsmark.disqus.com/8220value8221/#comment-1667847</link><description>&lt;p&gt;But, you see, the real value of Time Machine isn't the fact that it backs up folders.  Lots of things have incremental backups over increasing increments of time, or even daily backups.&lt;/p&gt;&lt;br&gt;&lt;p&gt;What Time Machine brings is mainly two things.  First, the interface makes looking for changes easier, as you can jump back to change dates and even apply searches to jump back through changes, and you don't have to do things on a date basis (i.e. you don't have to remember the day it changed, if you are simply looking for changes).  Second, and more importantly, applications are plugged into it.  Even though at the lowest level it is (probably) just a regular ol' file backup, it gives the semantic of "looking for the picture I deleted", or the album you deleted, or the folder, or what have you.&lt;/p&gt;&lt;br&gt;&lt;p&gt;Incremental backup is nothing new, hence my lack of excitement about Time Machine originally, but intuitive and effective interfaces for presenting this information is new (to me).&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">noah</dc:creator><pubDate>Thu, 25 Oct 2007 21:19:11 -0000</pubDate></item><item><title>Re: it should be obvious how to use it</title><link>http://noahsmark.disqus.com/it_should_be_obvious_how_to_use_it/#comment-1667843</link><description>You are absolutely correct that occasionally we are forced, via deadlines, to act more quickly than we would like.  However, the problem is much more insidious than this, as it really does apply to more than just software.&lt;br&gt;&lt;br&gt;We (as humans? as Americans? who knows) are traditionally bad at making cost/benefit analyses that span more than 20 seconds.  Most managers get about a factor of 10 past that, not because they are stupid people, but just because they are bad managers (i.e. have not read Peopleware).&lt;br&gt;&lt;br&gt;The extra 20 minutes you would spend thinking through an interface the first time will save you plenty of time down the road, plenty of time that you can use to make other decisions correctly.  In the long-run, by which I mean a week or longer, you end up taking &lt;i&gt;less time&lt;/i&gt;, even on the same product in the same product cycle, because you decided at the outset not to make stupid decisions in the name of short-term gain.  We are a culture of immediate result, and it may be hard to escape that, but we, as good designers, must always take the time.  &lt;i&gt;Always.&lt;/i&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">noah</dc:creator><pubDate>Fri, 24 Aug 2007 11:36:07 -0000</pubDate></item><item><title>Re: free prescription drugs! so what?</title><link>http://noahsmark.disqus.com/free_prescription_drugs_so_what/#comment-1667838</link><description>Maybe you misunderstand - these drugs cost $.50 &lt;i&gt;before&lt;/i&gt; health insurance.  Their patents have all run out and they are cheap as hell to mass produce.&lt;br&gt;In other words, it would be much more beneficial if they would, say, give $2.00 off all prescriptions, rather than giving away the stuff that they already sell to you at effectively the cost of transportation.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">noah</dc:creator><pubDate>Wed, 08 Aug 2007 15:18:22 -0000</pubDate></item><item><title>Re: code complete redux + RAII</title><link>http://noahsmark.disqus.com/code_complete_redux_raii/#comment-1667835</link><description>&lt;p&gt;Corry:&lt;br&gt;&lt;br&gt;Looks like you are absolutely correct (my C# history is rather crappy, as you can imagine :) ).  Peter Hallam wrote an &lt;a href="http://blogs.msdn.com/peterhal/archive/2005/06/03/424923.aspx" rel="nofollow"&gt;article about it here&lt;/a&gt;, which seems to say that &lt;code&gt;using&lt;/code&gt; has always been in the language (the article describes how, for a short period of time, it would accept types that didn't implement &lt;code&gt;IDisposable&lt;/code&gt;, and only needed to have a &lt;code&gt;Dispose&lt;/code&gt; method).  Sorry about that :)&lt;/br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">noah</dc:creator><pubDate>Fri, 20 Jul 2007 11:27:47 -0000</pubDate></item><item><title>Re: Protected: selling culture vs. selling crap</title><link>http://noahsmark.disqus.com/protected_selling_culture_vs_selling_crap/#comment-1667833</link><description>I never meant to say that selling culture is a good thing, as I feel quite the opposite (I'm not sure culture should be a product to be bought and sold, created by companies and consumed by the public), but I do think that it does have some correlation with developing things of quality.  I certainly don't think that Apple's main purpose is to make things of quality, but it closely aligns with what they do want, which to to sell "cool".&lt;br&gt;&lt;br&gt;Microsoft, on the other hand, has no requirement of quality.  The only requirement they have is that they can continue to sell their products.  By this time, they've gotten so good at it that the product doesn't even matter anymore.&lt;br&gt;&lt;br&gt;And on somewhat related news, I'm going to buy a macbook soon :)  So there you go.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">noah</dc:creator><pubDate>Sat, 14 Jul 2007 19:57:34 -0000</pubDate></item><item><title>Re: stop crapping on C++</title><link>http://noahsmark.disqus.com/stop_crapping_on_c/#comment-1667831</link><description>&lt;p&gt;gcc tends to crap on that general type of thing ("did you mean '=='?"), but you can remove the warning by putting an extra set of parens around the expression.  So this:&lt;/p&gt;&lt;br&gt;&lt;p&gt;&lt;code&gt;if(Foo* foo = dynamic_cast&amp;lt;Foo*&amp;gt;(someobject))&lt;/code&gt;&lt;/p&gt;&lt;br&gt;&lt;p&gt;becomes:&lt;/p&gt;&lt;br&gt;&lt;p&gt;&lt;code&gt;if((Foo* foo = dynamic_cast&amp;lt;Foo*&amp;gt;(someobject)))&lt;/code&gt;&lt;/p&gt;&lt;br&gt;&lt;p&gt;It might look a little silly, but I think it is quite clever.  The warning itself even tells you, "warning: suggest parenthesis around assignment of a truth value", so that you know how to suppress the warning without using any special #pragma type labels.  Nifty, eh?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">noah</dc:creator><pubDate>Sun, 08 Jul 2007 12:22:05 -0000</pubDate></item><item><title>Re: noah = angry</title><link>http://noahsmark.disqus.com/noah_angry/#comment-1667826</link><description>warren:&lt;br&gt;I had always assumed Eckel's book would be good, probably just from name recognition.  Then again, I do strongly disagree with his outlook on checked exceptions as always being bad.  I suppose I should refrain from buying Eckel books, then?</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">noah</dc:creator><pubDate>Fri, 13 Apr 2007 16:10:25 -0000</pubDate></item><item><title>Re: 4am and stupid-angry</title><link>http://noahsmark.disqus.com/4am_and_stupid_angry/#comment-1667816</link><description>You're a dick any time of the day.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">noah</dc:creator><pubDate>Tue, 06 Mar 2007 04:25:46 -0000</pubDate></item><item><title>Re: &amp;#8230;and I&amp;#8217;m spent</title><link>http://noahsmark.disqus.com/8230and_i8217m_spent/#comment-1667814</link><description>Andy:&lt;br&gt;&lt;br&gt;Skype also does the best effort hole punching - it opens about 15 ports at a time and hopes that there is some overlap between the two machines contacting each other.  What we are doing is about the same, it is just that we have to recreate the algorithm, since Skype's NAT traversal algorithm or code isn't public.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">noah</dc:creator><pubDate>Fri, 02 Mar 2007 13:00:11 -0000</pubDate></item><item><title>Re: wordpress author comment highlight, part 1</title><link>http://noahsmark.disqus.com/wordpress_author_comment_highlight_part_1/#comment-1667812</link><description>Here is a comment, in blue!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">noah</dc:creator><pubDate>Sat, 24 Feb 2007 15:47:08 -0000</pubDate></item><item><title>Re: java: 0, noah: -1</title><link>http://noahsmark.disqus.com/java_0_noah_1/#comment-1667811</link><description>Paul:&lt;br&gt;&lt;br&gt;We didn't use C# because we don't want to tie ourselves to a less available framework.  As humorous as the "Write once, run anywhere" slogan is, it certainly is more available in general than C#. &lt;br&gt;&lt;br&gt;(Yes, for the pedants, users could install mono and run it lots of places as well, but .NET/mono hasn't reached the level of adoption of Java yet, not by a long shot).&lt;br&gt;&lt;br&gt;I'm a pretty big fan of Steve, although his newer stuff is somewhat crappy.  I figure that that is due to Google taking more of his brain power for work stuff than Amazon did.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">noah</dc:creator><pubDate>Sat, 24 Feb 2007 13:52:26 -0000</pubDate></item><item><title>Re: I have lost my faith in humanity.</title><link>http://noahsmark.disqus.com/i_have_lost_my_faith_in_humanity/#comment-1667801</link><description>Very much true, Paul.  When we asked Sidney to change it, we meant we wanted a different project, but not a vastly more difficult project.  Of course, "difficult" to Sidney and "difficult" to the rest of humanity are different beasts.&lt;br&gt;&lt;br&gt;I also agree on the two C++ courses.  Originally, they did have two - CS4 and SE.  The SE department changed this without informing the CS department, and the CS department was left up in the air about it.  I understand that learning a new language poses difficulties, and learning the new paradigms of C++ is equally difficult.&lt;br&gt;&lt;br&gt;I'm not entirely convinced that the problem is that of the courses or the content, though.  I've watched a steady decline in first project grades in the past 3 years, while at the same time watching Sean spend more and more class time explaining the project.  During this time, the project didn't get any harder.  I don't know that it is statistically meaningful, but it does scare me.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">noah</dc:creator><pubDate>Wed, 11 Oct 2006 01:04:35 -0000</pubDate></item><item><title>Re: nvidia test</title><link>http://noahsmark.disqus.com/nvidia_test/#comment-1667794</link><description>&lt;p&gt;mwoz:&lt;/p&gt;&lt;br&gt;&lt;p&gt;Quote the C++ or C standard if you want, but don't quote MSDN.  It isn't the standard and has never been.&lt;/p&gt;&lt;br&gt;&lt;p&gt;You are correct and my initial criticism was not: primitives are casted towards unsigned-ness, not away from.  In addition, according to the C standard (6.3.1.3.2):&lt;br&gt;&lt;br&gt;"Otherwise, if the new type is unsigned, the value is converted by repeatedly adding or subtracting one more than the maximum value".  This means that the cast would leave you with a number greater than 10, and therefore that part of your solution will work.&lt;/br&gt;&lt;/p&gt;&lt;br&gt;&lt;p&gt;Regardless, its rather unclear what you mean in the code - you are relying on an implicit (and probably unassumed, as in why it is one of the more prevalent warnings created with "g++ -Wall") cast to bring a number into a range that makes no sense conceptually, but happens to work technically.  I'm probably not the only person who at least had to think about where the implicit cast was, and what effect it would have on the resulting statement.&lt;/p&gt;&lt;br&gt;&lt;p&gt;This style is consistent with your use of "(i &amp;lt;&amp;lt; 3) + i + i", and using "0x0030" instead of (the character) '0'.  All of these work technically, but are semantically (in reference to the problem) meaningless.  In the same respect, I could have written (for the in-range check):&lt;/p&gt;&lt;br&gt;&lt;p&gt;while(*s / 0x10 &amp;gt; 2 &amp;&amp; *s / 0x10 &amp;lt; 5 &amp;&amp; *s % 0x10 &amp;lt; 0xa)&lt;/p&gt;&lt;br&gt;&lt;p&gt;Which will probably also work, but looks like it came out of my ass instead of my head.  The point is still that you should write what you mean, not what you think looks cool.  Remember that.&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">noah</dc:creator><pubDate>Wed, 11 Oct 2006 00:49:21 -0000</pubDate></item><item><title>Re: Firefox 2.0 RC2</title><link>http://noahsmark.disqus.com/firefox_20_rc2/#comment-1667803</link><description>I've noticed a few things, which may or may not just be perceived:&lt;br&gt;- Switching between tabs seems quicker (as when I have 25-30 open, it used to freeze for about a second).&lt;br&gt;- Tabs now display correctly when there are too many (it used to just cut them off after a point, now you get the arrow and a dropdown for all tabs).&lt;br&gt;- More options for feeds&lt;br&gt;&lt;br&gt;Although I should point out that a few of my (loved) extensions are broken, most notably flashblock.  Ah well.  I like the new bling, though.  The squishy icons are nice :)</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">noah</dc:creator><pubDate>Sun, 08 Oct 2006 23:28:34 -0000</pubDate></item><item><title>Re: nvidia test</title><link>http://noahsmark.disqus.com/nvidia_test/#comment-1667796</link><description>&lt;p&gt;For the memory part, are you talking about question #2?  If so, it is an extremely valid point that we shouldn't forget, _ever_.  If you create functions that are quasi-public, you should almost never be allocating memory for the caller (unless it is an explicit part of the API, e.g. malloc/calloc/realloc/etc.).  I don't think that is what nvidia wanted as part of the answer, but it definitely crossed my mind.  As to the Raymond Chen reference, I searched for a bit but couldn't find the article (it was recent, if I remember correctly) where he talked about how important it is to match up allocators/deallocators.&lt;/p&gt;&lt;br&gt;&lt;p&gt;Checking for a valid result from malloc is the last of the major problems, I believe.  I may have missed some, so please feel free to point out any others that you find.&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">noah</dc:creator><pubDate>Sun, 08 Oct 2006 22:17:00 -0000</pubDate></item><item><title>Re: nvidia test</title><link>http://noahsmark.disqus.com/nvidia_test/#comment-1667792</link><description>#1 - You have the right idea, now you just have to say what exactly the compiler could do about it, and what you have written isn't entirely correct.&lt;br&gt;&lt;br&gt;#2 - s++ modifies s, but s itself isn't const; it was declared "const char*", which is a (non-const) pointer to constant characters.  The second thing you mentioned (setting p back to the start of the string) is correct, as mwoz pointed out in his comment.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">noah</dc:creator><pubDate>Sat, 07 Oct 2006 03:04:49 -0000</pubDate></item><item><title>Re: nvidia test</title><link>http://noahsmark.disqus.com/nvidia_test/#comment-1667790</link><description>mwoz:&lt;br&gt;&lt;br&gt;First, returning -1 for a function that can only return integers &amp;gt;= 0 makes much more sense than returning the legal value, 0.  I'm not sure what you mean by inelegant, but I think following the paradigm of most other functions of the same type makes much more sense, as well as returning an illegal value.&lt;br&gt;&lt;br&gt;As to your answer for atoi, that is probably some of the most illegible C/C++ code I've seen in awhile.  First of all, use '0' to get the value of the character 0, not a literal hex value.  Second, your initial while will have major issues.  If you take any character less than '0' in the ascii range, that value - 0x0030 will be less than 10U.  So your function would include, for example, most punctuation as a number.  The same holds true for the other loop.&lt;br&gt;&lt;br&gt;The whole i = (i &amp;lt;&amp;lt; 3) + i + i is just plain silly.  Multiply by ten.  Multiplying by 8 and adding twice just looks ridiculuous.  Never mind the fact that you just killed the compiler's ability to produce code and the processor's ability to pipeline, the code is just plain inelegant.  You are closer to the right idea, but please, for the sake of humanity, never _ever_ write anything like that.&lt;br&gt;&lt;br&gt;For Question #2, that is one of the other errors.&lt;br&gt;&lt;br&gt;For Question #3, you are working in the wrong direction.  val is a copy of *p, and the compiler can't magically assign to *p what it was going to assign to val.  The compiler can cache reads of the thing, but it can't magically change it in one case but not the other.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">noah</dc:creator><pubDate>Fri, 06 Oct 2006 21:28:54 -0000</pubDate></item><item><title>Re: nvidia test</title><link>http://noahsmark.disqus.com/nvidia_test/#comment-1667787</link><description>&lt;p&gt;Your atoi looks like it will work in most cases (although it may do strange things in the case where s[0] = 0, since I'm not sure how isnum('\0') will work), although its a bit more complicated than it needs to be (hint: instead of multiplying the digit you are adding to the sum by the place of the digit, can you a similar operation to the sum instead, i.e. working left -&amp;gt; right?).  Also, I think you might leave off the largest digit by accident (with:&lt;br&gt;&amp;lt;pre&amp;gt;--s &amp;gt; left&amp;lt;/pre&amp;gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;and left being the first numeral, then you will skip over it on the way back).&lt;/p&gt;&lt;br&gt;&lt;p&gt;As for question#2, that is only one of the errors.  From my count, there are at least 3.&lt;/p&gt;&lt;br&gt;&lt;p&gt;For #1, you are on the right track, you just need to use your imagination at what the compiler can do with the code that is there.&lt;/p&gt;&lt;br&gt;&lt;p&gt;I would give you near full credit for atoi (near full credit for workingness, partial credit for being a bit over-complicated), 1/3 credit on #2, and a bit for #1.  And, of course, my love and affection for being the Warren.  Cheers!&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">noah</dc:creator><pubDate>Fri, 06 Oct 2006 12:32:11 -0000</pubDate></item></channel></rss>