Meme: Code Review
Originator: unclear / syb0rg?
Cultural Height: up to CR's graduation :(
Background: Ever since around March of 2014, Programming Puzzles & Code Golf and Code Review have had a friendly rivalry of who could graduate first (which has expanded to become a friendly rivalry in gen...
Meme: Code Review
Originator: unclear / syb0rg?
Cultural Height: up to CR's graduation :(
Background: Ever since around March of 2014, Programming Puzzles & Code Golf and Code Review have had a friendly rivalry of who could graduate first (which has expanded to become a friendly rivalry in gen...
dangit ninja'ed
@syb0rg @Mast, @Phrancis and @Quill are all somewhat active in our chat, The nineteenth byte.
I am working with a TreeView (default control from .Net Framework) that displays hierachical data. Data are bound to the view using MVVM pattern with the HierarchicalDataTemplate.
<HierarchicalDataTemplate DataType="{x:Type models:TreeItemViewModel}" ItemsSource="{Binding Children, Mode=OneWay}">...
Meme: Stealth Pinging
Origin: Unknown, various techniques have been developed
Cultural Height: June 2015 to November 2015
Background: In chat rooms, normal pinging involves writing a message containing @username123, which sends a notification to username123 that he has been mentioned in chat. ...
@Mast Well, with Jenkins you can control exactly what shell script you want to run, for example. So if you just know what shell script to run, then the rest is easy.
I'm voting to close this question as off-topic because it is a request for code review and so belongs on the Code Review site. — Toby Speight35 secs ago
so, if you put your working version up for review in a new post, with a nice title that roughly says what problem the code is solving (i.e. what it does), and a decent description of it in the post body, with the whole working code in its glorious context (we love context/surrounding code!), I'm sure you'll get valuable feedback and a massively positive experience on CR (as usually happens)
-- Could NOT find sphinxbase (missing: SPHINXBASE_LIBRARY SPHINXBASE_INCLUDE_DIR)
-- Could NOT find pocketsphinx (missing: POCKETSPHINX_LIBRARY POCKETSPHINX_INCLUDE_DIR)
-- Could NOT find LibSndFile (missing: LIBSNDFILE_LIBRARY LIBSNDFILE_INCLUDE_DIR)
-- Could NOT find tritium (missing: TRITIUM_LIBRARY TRITIUM_INCLUDE_DIR)
I've done a lot of reworking to this main file recently, in regards to using a new speech recognition engine and integrating the last reviews suggestions. My question before is going to be phrased very similarly to how it was previously.
How Khronos Works
The process starts off by recor...
@Mast I would be surprised if you had any of those installed actually. I should probably include a message with the build process tho that says they will be downloaded...
This algorithm sorts a list of Individuals, each with two fitness values, into what's called non-dominated fronts. A non-dominated front is a set of individuals where none of the individuals dominate each other. An individual is said to dominate another if is equal or lower (<=) for all fitness v...
Yes -- see the almost-a-duplicate question I linked. BTW, I strongly suggest showing your implementation for code review when you have one together -- it's very, very easy to get the details wrong in a security-impacting way. — Charles Duffy53 secs ago
I just came into the office and the new server case had been delivered. Unfortunately someone (me) didn't measure the door frame :-( but luckily it went through the door ;-) (had been a very tight fit)
You should ask a more specific question. Is there a problem with the code you've provided? If you want a more general review of your solution, perhaps try Code Review at codereview.stackexchange.com — Michael Blackburn38 secs ago
@Mast I'm confused... cmake flagged those dependencies for downloading and setup the makefile, you run make and everything should download, compile, and link
I am trying to solve [SPOJ] problem. I have used sieve of eratosthenes algorithm. But it is still slow when input is in range of 104
import math
no_of_cases = int(input())
for i in range(no_of_cases):
x = input().split(" ")
a = int(x[0])
b = int(x[1])
lis = set([p*i for p in ran...
Definition of util::any
[Taken from the standard's description of std::any]
A discriminated type that can contain values of different types but does not attempt conversion between them, i.e. 5 is held strictly as an int and is not implicitly convertible either to "5" or to 5.0. This indifferenc...
I'm voting to close this question as off-topic because it belongs on Code Review. Questions on optimizing already-working code are off-topic on Stack Overflow. — MattDMo14 secs ago
I am reading a signal off of a meter using a managed C# wrapper on a C++ object. In order to calculate the value of the meter, I need to determine the length of time from when the signal goes from 0 to 1 then back from 1 to 0. So, my code looks like the following:
var sw = new StopWatch();
var...
The code below is used to traverse up the content tree, and check if the document type exits, the Category doc type can never be on level 1 or 2 of the content tree, so I thought calling Model.Content.AncestorOrSelf(3) would be more efficient than just calling Model.Content.AncestorOrSelf() but ...
It's possible that Code Review would work. I'd be inclined to think Programmers would work. There are various ways to go about this. One such idea would be to use an interface to define common factors, convert values to match the interface declaration (but keep the unique originals at the model level), and then work off of both through the interface declarations. You could then build in comparisons since they'd have the same interface. — Chris Fannin5 secs ago
How can I make this little program works little faster?
import java.util.Arrays;
import java.util.Scanner;
public class Solution {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int[] a = new int[sc.nextInt()];
for (int i = 0; i < a.len...
Still way too many libraries/frameworks competing to do basic ecosystem things. Library variance is good when it comes to domain stuff but they shouldn't be so abundant when it comes to even trying to write code in the first place
@JeroenVannevel I think the main problem really stems from the fact that any js library has to be backwards compatible, so everything is opt-in (because any given js could use the npm ecosystem in the browser or in node)
For school, I am programming with Java. I am making a Guessing Game. I want to build it but It won't open. I think it is because there is no window. When you play it in eclipse, it is in the Console not in a separate window. If someone can please help me, It will be appreciated.
Here is what I g...
I have a question regarding the performance of my python program. The part which is written down is very essential and I already increased the performance with numpy. I would like to know if it is possible to make this part even faster? A 10x speed up would already be nice..
u = numpy.zeros((a*...
When users log in to our website, we store some information in a session to retrieve it across the site. We created a few wrappers to help with data retrieval/storage to lessen duplication of code.
I'm trying to redesign it as I don't like how the UserModel is written. I believe it's dangerous w...
Hey so I know this is really basic but I'm having trouble building an array with a loop, heres my code so far.
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
//
int main( )
{
int a[5][5];
int i,j;
for (i=0; i<5; i++)
{
printf("\nPlease input values for row %d", ...
Have you Googled for this question? There are any number of reasons, one of which being how long the formula is. This page goes over formula optimization, which also includes why they may be slow. Here's another good page as well. This is a pretty broad question for SO, which is generally for Code review. — BruceWaynejust now
I have written a python code which works absolutely fine but I am looking for other ways to do this:
my code:
import itertools
def permutation(word):
for i in range(len(word)+1):
perms=list(itertools.permutations(word))
for i in perms:
j=(''.join(i))
j=j.casefol...
@Fjotten with comments like that in the original code, it'd definitely fail code review, even though it does work, simply because, if you obfuscate the function name, it becomes nigh-impossible to figure out what the function actually does. — Compass24 secs ago
Sometimes I have an interface with default parameters and I want to call the implementing method from within the implementing class (in addition to from outside it). I also want to use its default parameters.
However, if I just call the method by name I cannot use the default parameters because...
The function itself:
import numpy as np
def is_numeric_array(array):
"""Checks if the dtype of the array is numeric.
Booleans, unsigned integer, signed integer, floats and complex are
considered numeric.
Parameters
----------
array : `numpy.ndarray`-like
The a...
I'd like to restrict user input in a form to a decimal with max two numbers before and 4 after decimal point. So valid values would be:
50
0.1
1.23
4.5678
12.943
I'm currently doing the following:
$(function() {
$('input').on('input', function() {
this.value = this.value
.repl...
I saw this code on Youtube from a Liskov Substitution Tutorial. I have found myself coding like this but I have always felt it was wrong.
My concern with this code is that InvoiceModifier class has control over my invoice instance though it manipulates its own instance variable, it is still po...
I've recently created my own chess game. It currently only supports a cooperative mode (player1 vs player2 on the same pc) because creating CPU to play against the player will be problem due to my lack of knowledge over the chess game and making it online will be way to difficult since I have abs...
I used that kinda thing for my tokenizer heavily, things like state == Enums.TypeDeclared ? variable.name = currentChars : variable.type = currentChars