I have a CLS_Comparison_Predicate which will take an input value, perform a logical comparison and return a Boolean.
CLS_Compound_Predicate instead takes lists of predicates and an inputValue, and performs MatchAny() or MatchAll() operations on the predicate list.
E.G.
predicate_1 has >= 3
...
and I tell you again: such titles are overly generic and result in less eyes on your question. Aside from that: the dot-product is exactly the problem you wanted solved. The "problem" of the question may be a differently framed one, but the underlying problem is exactly that. Every question here wants to refactor code to be more succinct (under constraints) and as such your question title is nonsensical. Usually questions with generic titles are edited (unless it's not worth the effort). If you want to discuss this further, feel free to visit me in Code Review Chat or ask on Code Review Meta. Thanks. — Vogel6121 min ago
It seems like the norm at most gaming companies is to have an - how should I call it politely - unoptimized codebase and way too many unnecessary bugs from an outstander perspective
Speaking about games.. looking through my Steam friend list and someone is playing Job Simulatorstore.steampowered.com/app/448280 in Virtual Reality mode
I need to check animal type without using operator "instanceOf". I decided to use variable animalType, and compare it with different values. But when I'm trying to run my application, I receive Uncaught TypeError: Cannot read property 'call' of undefined. I cann't understand, why object isn't tra...
@DanPantry Many games with their own engine are written in C++. It's fast. The amount of odd bugs companies like Riot have is also the reason why people tend to avoid C++. It's hard to maintain when you got 400 files over 2k LoC long.
Currently our application have many immutable entities which are used for holding information on database level. For example,
public class Status implements Serializable {
private static final long serialVersionUID = -6253387194209148223L;
@Id
@GeneratedValue(strategy = GenerationT...
I have this (short) HTML page that allows the user to input his/her LaTeX code, after which it will compile the code and display the result using MathJax.
index.html:
<!DOCTYPE html>
<html>
<head>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({tex2jax: {inline...
I'm new to Gradle, so I expect many things I did wrong in my build script, which is pasted below.
What is special about that build script is, that it runs the EclipseLink metadata processor and copies the generated Entity_.java file to a folder in the sources directory.
Are there ways to make m...
Mogli jungle C is A blood rock perl ruby.Mogli jungle C is A blood rock perl ruby.Mogli jungle C is A blood rock perl ruby.Mogli jungle C is A blood rock perl ruby.Mogli jungle C is A blood rock perl ruby.Mogli jungle C is A blood rock perl ruby.Mogli jungle C is A blood rock perl ruby.Mogli jung...
This is my first post so if I am doing something wrong in the post please let me know. I have implemented a dynamic array based stack. Can someone point out any pitfalls or things that can be done better?
MyStack.h
#ifndef MYSTACK_H
#define MYSTACK_H
#include <iostream>
#include <stdexcept>
...
@syb0rg how the word "forum" applies to SE is instructive, but too restrictive an interpretation might discourage people or mislead them. True, CR, like all SE communities is not a "discussion forum" (see codereview.stackexchange.com/tour), but they are forums in an abstract sense, and as such invite people to post questions and solicit answers. this question raises the question, but those that say it isn't a forum are using a specific definition, and those that say it is are using it in the abstract sense. — Hank D51 secs ago
@HankD "post questions and solicit answers" - so it's a Q&A site, as identified by the Code Review tour you linked, not a forum. There are similarities between the two, but also quite a few distinctions that if not recognized would make your contributions off-topic. — syb0rg50 secs ago
I Am trying to hide a table data using the following
<td *ngFor="let tableHeaderItem of gridHeaderData"
[ngStyle]="{'hidden' : tableHeaderItem.hidden ? 'none' : 'table-cell'}">
But it isn't working, I tried removing the quotes 'hidden' to hidden, but it just doesn't work
@AnsgarWiechers but it spits out a total that I do not know if it is really correct or not Since Code Review deals in working code only and OP is not sure whether it's working, I'd strongly advice against posting this on Code Review. — Mast19 secs ago
@AnsgarWiechers This question would be closed on Code Review, as it seems to be asking if the code is working correctly and not for a review of the code. — syb0rg50 secs ago
I have this function neighbor() that works on this matrix:
matrix = np.array([[3,3,3,3,3,3,3,3,3,3,3,3],
[3,2,2,2,2,2,0,0,0,0,0,3],
[3,2,2,2,2,0,0,0,0,0,0,3],
[3,2,2,2,0,0,0,0,0,0,0,3],
[3,2,2,0,0,0,0,0,0,0,0,3],
[3,2,0,0,0,0,...
I'm learning RxJava and this is what I attempted to find the mean of 'n' transactions.
List<Transaction> transactions = TransactionsStore.getTransactions();
BigDecimal nTransactions = new BigDecimal(transactions.size());
Observable.from(transactions)
.map(transaction -> transaction.amoun...
I'm facing the problem with the following code:
class Cart(models.Model):
user = models.ForeignKey(settings.AUTH_USER_MODEL, null=True, blank=True)
items = models.ManyToManyField(CC, blank=True)
total = models.DecimalField(max_digits=10, decimal_places=2, default=0.00)
def __str...
"You lift something when you have to. Piano falls on granny? You lift the piano. Because granny has mixed feelings about the whole situation. Sunday lunch continues. He didn't do anything like that! He went over and lifted the heavy thing. And then put it back down without moving it. And the people said 'youre the person we want to deal with taxes'". - Dylan Moran on Arnold Schwarznegger
If your code is working and you are looking to simply discuss improvements etc, you might want to consider the following SE instead of this one: codereview.stackexchange.com — Dave21 secs ago
I have a long form which includes many nested form, I have tried to use partial but I believe partial not working fine and object is not transferred there. Any help will be appreciated.
<%= link_to "Back to Search the listing", root_url, "data-no-turbolink"=>"true" %>
<...
Well... Colleague is back at it again. Instructed another colleague how to add translations to the DB, said that "it'll take time for them to propogate".
I just got rejected at the tech interview of a job application. They gave me the following exercise for me to complete:
They gave me a bin file with 10 million pairs of 16 bit signed integers. From those 10 milion, I had to find the 10 closest points to (-200,300) and the 20 furthest points to (...
I need some help with this control. I've created this but I don't like how I have done it. Could somebody review my xaml code and give me some advise how can I improve it?
The control I have to create is below.
My code for this control:
<UserControl x:Class="LockerWpf.Views.Controls.BoxTypeI...
I'm trying to cross-compile something and it compiles without error, but when transfer the binary file onto the machine it's trying to use pthreads.so despite me turning off all threading support when compiling
I've been given this little test exercise for an interview as php developer, and I'd like to hear from you if my solution is good (enough) or if the problem could have been solved in a better way. Please keep in mind that I've no academic formation in CS or equivalent (rather the opposite) and my...
Congratulations! As you can see, the new site design just went live. Thanks to everyone for your patience.
Also updated are the newsletter template and chat room based off of the new design.
If you see any CSS/styling bugs, please start a new post and tag it with design and bug.
Congrats again...
I have this Java class for building bit strings. The set of methods it provides resembles that of java.lang.StringBuilder.
See what I have:
BitStringBuilder.java:
package net.coderodde.util;
import java.util.BitSet;
/**
* This class implements a simple bit string builder.
*
* @author Rod...
I often find myself implementing IComparable{T} in different classes for sorting in a very similar fashion:
Values meeting criteria X and Y should be sorted to the front
Values meeting criteria Z and W should be sorted to the back
Values not meeting any special criteria can stay where they are...
so... what's the question? Is this working code? More of a review? Are you looking for another way to write it? Might be better suited for code review stack exchange — Kritner35 secs ago
this is to be used like an Enum (as parameter mostly), but for string
using .net 3.5
'testing the StringEnum
Module Module1
Sub Main()
Dim v1 As StringEnum = StringEnum.Value1
Dim v2 As StringEnum = StringEnum.Value2
Dim v3 As StringEnum = StringEnum.Value3
D...
Sub Main()
Dim v1 As StringEnum = StringEnum.Value1
Dim v2 As StringEnum = StringEnum.Value2
Dim v3 As StringEnum = StringEnum.Value3
Dim v4 As StringEnum = StringEnum.Value4
Dim vS1 As String = v1
Dim vS2 As String = v2
Dim vS3 As String = v3
Dim vS4 As String = v4
Dim vc1 As StringEnum = StringEnum.GetEnum(vS1)
Dim vc2 As StringEnum = StringEnum.GetEnum(vS2)
Dim vc3 As StringEnum = StringEnum.GetEnum(vS3)
"can you spot anything wrong"
why do I mentally translate VB to C# whenever I read VB.NET code?
I wrote a script for reading a csv, parsing it and saving data to mongodb. I would love some input on how I'm handling errors and dealing with callbacks. I wrote it with nested without using async and the nesting wasn't too bad, but I tried this way thinking it might be better practice. It's a on...
I'm voting to close this question as off-topic because it belongs on a code review site. — chux12 secs ago
@chux Wrong. OP isn't sure whether it works and is looking for verification. That makes it off-topic at both Stack Overflow and Code Review. — Mast35 secs ago
@Mas My first comment was if the code was working it belonged on codereview. My 2nd comment was that it did not belong here, but elsewhere. The 2nd comment did not recommend codereview.stackexchange.com - sorry if that was not clear. — chux8 secs ago
@WeatherVane I'm not saying it's a good post. I'm saying mentioning Code Review here is not helpful. It's crap. Close it. That's the beginning and end of it. — Mast45 secs ago
Point 1: What is your question/problem actually? If you only want extra improvement, this question should go to codereview.stackexchange.com instead. - Point 2: Did you test what happens when you plug in a USB stick while the task runs...? :D — CherryDT12 secs ago
this is to be used like an Enum (as parameter mostly), but for string
using .net 3.5
Actual Implementation
Public MustInherit Class StringEnum(Of T As {New, StringEnum(Of T)})
Private Shared ReadOnly _lock As New Object
Private Shared ReadOnly _cache As New Dictionary(Of String, T)
...
I have a company code review tomorrow of my code... but I haven't been able to test it cause some other bloke failed to cross-compile this library for me
This is an update to my previous post about my Active Directory Query Application. I have made multiple modifications, and I request some feedback.
Summary: This program queries an active directory and writes either a list of the users or a list of the users with a list of the groups each user b...
So what I need to make happen is using erb and Sinatra I need to make an array of each variable that can be added in, [noun], [verb] and [adjective]. So then I can return the number of each there are and create the appropriate amount of form boxes for each to take in the user input. Then it would...
I've been reading up on algorithms lately and now I smell them halfway the description.
> Imagine Alice, Bob, and two piles of ten rocks. Alice and Bob are bored one Saturday afternoon so they play the following game. In each turn a player may either take one rock froma single pile, or one rock fromboth piles. Once the rocks are taken, they are removed fromplay; the player that takes the last rock wins the game. Alice moves first.