Yeah, I have been a "winning" victim of that problem a few times...... and, no, I can't figure out how to link a particular badge to a particular question/answer.....
This answer of mine keeps sitting at the top of the list even though it won populist a while ago.
Problem is with 1-vote-short query.... it identifies the conditions for what can earn a badge, but not whether that badge is already earned for that situation.
@rolfl I can understand that restriction. However, is there a way to set a value for when a post reaches a certain score, or would that get complicated?
That would be complicated, mostly for 2 reasons: 1. the score is summarized on the post, and to get the score at a particular date would require a query on the votes table 2. the votest table does not record the vote time, just the date.
So, it would be "really hard" for most cases, and "impossible" for other cases.
A better solution would be to link each badge to the post that earned it, if the badge is post-related, but SEDE does not record that link.
Below the //message for the driver comment; $search_loc['location'] is not getting the location in mysql db. I want to be able to retrieve location and email it to driver.
<?php
$host="localhost"; // Host name
$username="hidden"; // Mysql username
$password="hidden"; // Mysql passw...
@mjolka I have a class which uses another class (we'll call this second class Keyword), does it make sense to do the processing for each Keyword in the first class, or pass the relevant data to the Keyword itself and do the processing in it?
Right now I do all the processing to check if a string of text matches a Keyword within the first class, when the actual parameters are within the second class.
I think I'm doing it all wrong, and the first class should send the text to the second class (Keyword) which would check if it matches.
It's for a commercial product, so I can't really divulge too many details.
Which of these reads clearer: if (x <= 0 || x >= 1) or if (!(x > 0 && x < 1))?
@EBrown my gut instinct is to agree with that. so you have a method bool Matches(string) on Keyword, and then in the other class you have bool Matches(string foo) => _keywords.Any(keyword => keyword.Matches(foo));
This question is an improvement I did based on recommendations from these other questions:
Simple object-oriented calculator
Simple object-oriented calculator - follow-up
To those looking this question first I'm trying to find a correct OOP model I can use in JS. I initially found a very diff...
I liked this problem because there are so many sub-problems that are interview problems in their own right-- (reverse linked list, find midpoint)
var Node = function(val) {
this.val = val;
this.next = null;
}
var a = new Node('r');
var b = a.next = new Node('a');
var c = b.next = new Node('...
If you just want people to review your working code, then you should post to Code Review, not Stack Overflow. If you are having a specific problem, you should be able to describe the output you expect. Describe where you are having trouble. Just asking someone to solve a Project Euler problem for you isn't really a good fit for this site. — MrFlick50 secs ago
Problems was to calculate Maximum Product of Word Lengths:
Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters. You may assume that each word will contain only lower case letters. If no such two words exist, r...
To try and track down a troublesome AS400 bug, my company wants me to keep track of the order in which files are put into a folder. I spent an hour whipping something up in Go, but I'm still pretty new to Go so I'd like an opinion on a couple points:
Idiomatic Go: how do I make it more "Go"-lik...
I should clarify, not on Stack Exchange. There is actually a code review site on the stack exchange network: codereview.stackexchange.com But what you really needed was a tool that lets you compare code. @Radio was correct in his solution, but that's not what you asked for, you asked for us to compare your code. — Jacques56 secs ago
@200_success I completely agree with you there, though to play devil's advocate a little: I think the OP was indicating that (s)he could not make the changes to optimize the code on their own. Either way, it's a very low-quality question.
That said, it's still not a good question for CR. It doesn't contain any indication on what the code is supposed to do, it's basically just a code dump.
I recently got to a certain exercise in a book I am reading, and am looking for feedback. It is a program in which the user picks a number and the computer uses algorithms to guess it. If there is any way that I can improve my code, feedback is really appreciated!
#include <iostream>
#include <s...
You do realize that stack overflow is here to help the general community, questions as specific as this are not helpful to the community. That being said, the OP needed to post this on the code review site. I've updated my answer to say that as well. He didn't ask a question pertaining to programming, he asked a question that was about a typo in his code. — Jacques58 secs ago
I likes my use of functions so I'm mostly looking for little things but if you see something tell me :)
#include <iostream>
using namespace std;
void addQuarter(double &num); void addDime(double &num); void
addNikle(double &num); void addPennie(double &num);
bool quarterValid(double num, co...
@mancini13: the only way to tackle this is to print out the generated SQL statement before executing it. Then try that statement manually in your SQL client. And do read up on prepared statements. No offence, but your current code is a mess and wouldn't pass any code review in my company. — a_horse_with_no_name29 secs ago
the only way to tackle this is to print out the generated SQL statement before executing it. Then try that statement manually in your SQL client. Edit your question and add the actual statement that is executed and the error messages (or results) you get. And do read up on prepared statements. No offence, but your current code is a mess and wouldn't pass any code review in my company. — a_horse_with_no_name32 secs ago
@syb0rg You seem to double up your path... Do you have a typo somewhere?
You have: /Users/syb0rg/Dropbox/Development/Khronos/Khronos/build/library-build/src/pocketsphinx-build//Users/syb0rg/Dropbox/Development/Khronos/Khronos/lib/pocketsphinx/../sphinxbase... no