« first day (3744 days earlier)      last day (568 days later) » 

00:09
REFRESH! There are 7272 unanswered questions (90.5903 answered)
00:27
@rfl890 Code review's rules require that the code in question actually works: To the best of my knowledge, does the code work as intended?; this rule is one of many, but as demonstrated by the above "I tried but they don't seem to work as expected.", it obviously falls foul of that rule. This question does not belong on CodeReview. — Daedalus 19 secs ago
 
10 hours later…
10:16
0
Q: Model validation through the combination of PCA with classifiers

vdu16I use the code below for building machine learning algorithm. In the end, I need to validate model performance. However, I am confused if I do it correctly or not. names = ["PCA+LDA", "PCA+SVM", "PCA+NB", "PCA+LR", "PCA+RF"] random_state = 42 classifiers = [ LinearDiscriminantAnalysis(), ...

10:30
Monking
 
5 hours later…
15:34
... component fits together based on the generic type parameter declared at design time. Likewise, the compiler will ensure that the object passed to createBusinessObjectInfo is consistently typed to the entity type. (Obviously, one could abuse that and create one's own IBusinessObjectInfo, but this will very likely become apparent immediately as the wrong stuff is in the providers and it should be rejected during code review. — F-H 48 secs ago
15:57
0
Q: Code to convert a specific pixel color (RGB format) in an image to a text or letter value

NickEverything seems to be there, but the function doesn't properly convert the value to the right letter/number. The first part is using pillow to identify the specific pixel on the image, the second part of the code is using the function to convert the RGB value to letters/numbers. from PIL import ...

 
2 hours later…
18:05
This question is perhaps more relevant for Code Review: codereview.stackexchange.comAndreas 21 secs ago
 
1 hour later…
19:24
0
Q: Typescript consecutive days custom string

JeffersonI created this method for consecutive days to be listed with a dash, non-consecutive are separated by “and”. In my UI control I am only getting back a selectedDays: string[],. In this sample I am getting Mon,Tue,Wed,Fri. I am mapping then to the number 1 - 7 and then looping that list and removin...

@RMunroe So, what constitutes a flight data recorder? How cheap a system can we make and how many MP3 can we store on it?
19:50
0
Q: Replacement for EnsureSuccessStatusCode

VaccanoI like the simplicity of EnsureSuccessStatusCode for HttpResponseMessage after a call using HttpClient. But it does not really provide great information. This is my replacement for it. I am looking to see if I have missed useful information that is in the HttpResponseMessage, if there is a bett...

 
1 hour later…
21:08
0
Q: gdscript AStar path finding algorithm

user275384Is there anything I can do to this pathfinding algorithm to make it more efficient? An edge is a connection between two nodes, with a 'from node' and 'to node'. When I run it, it takes 17ms to visit 950 nodes and find a path that is 30 nodes long, which seems much too long. class AStarNode: var ...

21:59
0
Q: Wrapper for Go's Registry package

JordanI'm attempting to write a small wrapper over Go's standard registry package. I am experimenting with Go for interacting with Windows quickly, and fairly new to using Go, using this as a way to reinforce what I've learned. So, I'm dealing a lot with registry lately, and wanted to write a wrapper t...

22:30
Is this how you unit-test REST apps? Looks preposterous. Like I'm testing Mockito itself rather than the "unit", the UserServiceImpl class
@Service
@Transactional(readOnly = true)
public class UserServiceImpl implements UserService {
    private final UserDao userDao;

    public UserServiceImpl(UserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public List<User> getAllExceptLoggedUser(String username) {
        return userDao.findAllExceptLoggedUser(username);
    }

    @Override
    public User getLoggedUser(Authentication authentication) {
        UserDetails userDetails = (UserDetails) authentication.getPrincipal();
public class UserServiceImplTest {
    private final UserDao userDaoMock = Mockito.mock(UserDao.class);
    @Test
    public void testGetAllExceptLoggedUser() {
        User testUser1 = new User();
        testUser1.setUsername("testUser1");
        User testUser2 = new User();
        testUser1.setUsername("testUser2");
        Mockito.when(userDaoMock.findAllExceptLoggedUser("testUser1"))
                .thenReturn(List.of(testUser2));
        UserService userService = new UserServiceImpl(userDaoMock);
Besides, if I need to know which exact methods I need to mock, it seems my tests are strongly coupled with tested methods' implementations. For example, f I decide to retrieve information about a logged user's username some other way in the future, my test may fail because I only mock getPrincipal(). How is it actually supposed to be done?
22:55
@EricPostpischil I didn't mean mistake as in an error. It's obviously valid. But it's well known to be fragile and confusing - it would never pass a code review at anywhere I've ever worked. — pmacfarlane 30 secs ago

« first day (3744 days earlier)      last day (568 days later) »