News for hackers. Stuff that matters.
Re:Howdoi – Instant Coding Answers via the Command Line by davej on Tuesday January 08, 2013 @12:33PM (#5027238)
Super useful, love it.

Some queries I tried (results were not perfect but pretty decent):

    howdoi split string javascript
        var split = 'john smith~123 Street~Apt 4~New York~NY~12345'.split('~');

        var name = split[0];
        var street = split[1];

        etc...

    howdoi get day from date javascript
        var date = new Date();
        var day = date.getDay();

    howdoi iterate coffeescript
        ages = []
        ages["jim"] = 12
        ages["john"] = 7

        for k,v of ages
          console.log k + " is " + v
  
    howdoi get referrer url php
        <?php

        session_start();

        if (!isset($_SESSION["origURL"]))
          $_SESSION["origURL"] = $_SERVER["HTTP_REFERER"];

        ?>
Re:Howdoi – Instant Coding Answers via the Command Line by gleitz on Tuesday January 08, 2013 @12:36PM (#5027251)
An enhancement I've been considering is noticing when users ask for a second or third answer with "-p2" or "-p3". If it happens often and the user never queries again after reading the second answer you can assume it is probably correct and display it to all users as the default response.
Re:Howdoi – Instant Coding Answers via the Command Line by nicpottier on Tuesday January 08, 2013 @12:42PM (#5027288)
Also.. don't you think the more common case is not that the top answer is incorrect but rather you picked the wrong question from the search results? Seems to me that would be more common.
Re:Howdoi – Instant Coding Answers via the Command Line by gleitz on Tuesday January 08, 2013 @12:48PM (#5027310)
Ah yes I should clarify. -p2 picks the second search result from Google, not the second answer to the question.

$ howdoi format dates django templates -l

http://stackoverflow.com/questions/7737146/django-template-d...

$ howdoi format dates django templates -p2 -l

http://stackoverflow.com/questions/1180372/how-to-format-dat...

$ howdoi format dates django templates -p3 -l

http://stackoverflow.com/questions/4087717/django-template-d...

Another improvement might be to list the second and third answers to the currently selected question.

Re:Howdoi – Instant Coding Answers via the Command Line by voltagex_ on Tuesday January 08, 2013 @05:30PM (#5028956)
maybe howdoi --reroll? (Repeat same question for a second opinion)
Re:Howdoi – Instant Coding Answers via the Command Line by davej on Tuesday January 08, 2013 @12:41PM (#5027283)
That sounds smart but it also means that you'd need to keep track of and store user actions centrally. I don't know if I'd like that. You could always make it an opt-in feature I suppose.
Re:Howdoi – Instant Coding Answers via the Command Line by nicpottier on Tuesday January 08, 2013 @12:39PM (#5027273)
That's not a bad idea, kind of meta level answer tracking.

What about making it even easier by just prompting as to whether it answered their question? (perhaps defaulting to 'y' so you can just hit enter if so)

Re:Howdoi – Instant Coding Answers via the Command Line by catshirt on Wednesday January 09, 2013 @12:45AM (#5030374)
not necessarily. usually if i am on stack overflow i am looking for an easy-type answer. usually if that is not one of the first two, i move on.