« first day (2209 days earlier)      last day (1810 days later) » 

12:00 AM
RELOAD! There are 6050 unanswered questions (89.8653% answered)
I think this question is more suitable for codereview.stackexchange.comHooman Bahreini 50 secs ago
This isn’t Code Review, but why should each Deck make its own RNG rather than requiring one as an argument to shuffleDeck (instead of the mysterious re-shuffling…)? — Davis Herring 21 secs ago
 
12:34 AM
0
Q: Householder method not returning desired values

Robert AriasI'm taking the numerical methods curse. As part of a homework, I was asked to implement the Householder Method. In order to do it, I was supposed to look into Numerical Analysis by Burden and Faires. I already coded the method according with the steps explained in such book; however, I am not get...

 
12:54 AM
0
Q: Small project users privileges

Mourad KaroudiI have small web application that need a users permissions system to access some content or add/edit it. I'm using roles given to a user to manage priviliges, and also a user custom meta to set a custom priviliges to a specific user. I want to know if this method is good ? if not why ? Is there...

 
1:33 AM
0
Q: Random String Chooser

David WhiteI was tasked with creating the class RandomStirngChooser that prints the strings in the passed array in a random order, based on the for loop in the tester. If the number of iterations in the for loop is larger than the size of the array passed, then "NONE" should be returned. Look at the tester ...

0
Q: Simple ring/circular buffer c++ class V2

Hex CrownThe Original Post (v1) I'm looking for feedback on the updated version of the code posted at the link above. #pragma once #include <memory> #include <cassert> #include <type_traits> namespace datastructures { template<class _Ty, size_t _Size> class CircularBufferv2 { // uses...

 
 
2 hours later…
3:53 AM
@Suman Code optimisation Q's are not off-topic here at SO (provided they meet all other criteria), advide to move your Q to CodeReview is inappropriate. However, if you do move it, be sure to follow their guidlines. — chris neilsen 22 secs ago
 
4:18 AM
Monking
 
4:37 AM
@NexusGames No, that's not how this community works! Do not add the answer as edit to your question but instead mark the answer that helped to solve your specific problem as accepted. If you have another question open a new one. Question about improving working code are offtopic on StackOverflow and should rather be posted to Code Review. — derHugo 51 secs ago
 
4:47 AM
"Looking for good practices" is not what this site is meant for: Try codereview.stackexchange.comKaushik Nayak 44 secs ago
 
0
Q: Visibility SQL aliases

M.DoeI'm generating a lot of to-be reused SQL. A question on the visibility of aliases in SQL. If I create a query as followed: SELECT name, age FROM tablea a JOIN (SELECT pid, age FROM tablea a JOIN tableb b ON a.pid = b.pid) tage ON a.pid = tage.pid Would this generate any issues?...

 
5:33 AM
0
Q: Singly-linked queue in PHP 7 - follow-up

coderoddeI have improved this post. Now I have this: <?php class QueueNode { function __construct($item) { $this->item = $item; $this->next = null; } function __destruct() { $this->item = null; } function getItem() { return $this->item; } } ...

 
5:47 AM
why would it be 2000 times? I already told you why it doesn't have to be. for further improvement, this is better suited on a code review page — Stultuske 31 secs ago
 
 
2 hours later…
7:52 AM
If your code is working, I'd suggest you post it on code review, that's the place for it. — m.raynal 37 secs ago
 
8:04 AM
@Damien thanks for the hint, I checked Data Science, Code Review and Signal Processing, but the tags fit here the best. — Anne Bierhoff 30 secs ago
 
8:45 AM
@EthanCode26 you want to use (or reimplement getline if not available on your libs), take a look to codereview.stackexchange.com/questions/119219/…Keine Lust 32 secs ago
 
9:09 AM
0
Q: $scope variable are not printing on html

user201261I am developing an application in which we are taking the response from the web-service as an array and i am looping that array on html page but the value more than 1000 are not printing on page others are printing.. Attached picture is the output i am getting. Please help thanks in advance. Htm...

 
9:29 AM
@Axya If the code works, but you want a more efficient way. You should post it to codereview. — Jeroen van Langen 21 secs ago
 
10:46 AM
You should ask this on codereview.stackexchange.com. It is too broad for this site. — Stephen C 9 secs ago
 
11:04 AM
This is assuming that meshPart is a custom class where you can create other variables inside of it. But looking back at it, I'm not sure if it really helps in performance regardless. Maybe since this question does not specify a problem, then this question can also (if not better) be asked on Code Review: codereview.stackexchange.comSteven 42 secs ago
 
11:19 AM
Greetings, Programs.
 
0
Q: Two many arguments

DominikI've written an full adder in haskell. xor :: Bool -> Bool -> Bool xor a b = (not (a && b)) || not (not a && not b) fulladder :: Bool -> Bool -> Bool -> (Bool -> Bool) fulladder a b c = (xor (xor a b) c) ((a && b) || (c && (xor a b))) but ghci tells me that I would try to apply xor to to thre...

 
11:37 AM
codereview.stackexchange.com is better place for this question — Pavel Anikhouski 12 secs ago
 
@pacmaninbw I vaguely recall having left a comment on it, but it appears to have disappeared.
 
@Mast there's no deleted comments on that question
OBTW, re your last flag: I vacuumed all comments there, you could've flagged all of them for some more :)
 
11:59 AM
@Vogel612 I thought I had flagged them all, I had 3 flags on 3 different answers for the same question.
 
I was talking to Mast :D
though that was very much a flagfest :D
 
@Vogel612 There's no need to increase my flag count even further, but thank you.
 
that's not the point I'm trying to make 😀 It's just very much easier to go through a thread where every comment is flagged as obsolete instead of needing to do more than a cursory glance before deleting everything
2
or in other words: If you take the sorting off of our hands, we're grateful :)
 
0
Q: Is this a correct way to create single Rx Event in Typescript?

Anirudha MahaleI have created an observable to emit single item or emit an error and stop. Is this a correct way to create single Rx Event in Typescript ? import { Observable, Observer, of } from 'rxjs' import mongoose from 'mongoose' import { map, first } from 'rxjs/operators' export default class BaseModel ...

0
Q: Remove duplicate case labels within a switch statement

salim saidThis simple piece of software is generating a vehicle object by using the get_vehicle() function, Whenever i need to generate a specific vehicle I pass in the vehicle ID to this method and it returns the appropriate vehicle. Within the get_vehicle() function, each vehicle is generated within ...

0
Q: Proper way to map Client Application's DTO to Service-Proxy's DataContract

Anil KumarMy idea is to not not expose/use service's Proxy everywhere throughout the application, rather exercising all service communications(using client Proxy) from a single class. To achieve this I have created below class: - namespace MyOrganization.EventSender { using MyOrganization.EventSender...

 
@Vogel612 Sure, here to help.
By the way, put that question out of it's misery with a final VTC. UWYA fits even better than Broken if there's no spec, IMO.
@SᴀᴍOnᴇᴌᴀ Some users use their profile as a clipboard.
Completely unrelated:
Aug 13 '15 at 15:59, by Mast
I have more answers on meta than on CR self ^^
Funny how some things never change.
 
12:19 PM
@Mast that C one? meh.
I wouldn't VTC as normal user...
it's not quite beyond my line, though I can see if others consider it off-topic
 
It's not beyond hope, but it needs to be improved by OP before it's on-topic IMO. Now it's just a clutter of code doing who-knows-what for some unspecified reason.
 
0
Q: Python program to find the factorial of a number using recursion

JustinA factorial of a number is the product of all the integers from 1 to that number. For example, the factorial of 5 (denoted as 5!) is 1*2*3*4*5 = 120.The factorial of 0 is 1. Here is my code: def recur_factorial(x): if x == 1: return 1 else: return (x * recur_factorial(x...

0
Q: There is a better way to handle multiple promise?

xShidomaruI'm trying to execute function after function but I want that p2() and p3() start even if p1() reject. How can I improve this ? this.p1().then((val) => { alert(val); this.p2().then((val2) => { alert(val2); this.p3().then((val3) => { alert(val3); ...

 
@Vogel612 For as much code as is there it has been reviewed in the comments. It would be very hard to write a full review based on only the code that is there. It's unclear if the memory is being allocated or not, it's clear that the memory is not being de-allocated within the code, and that is stated in one of the comments. As someone noted "2 memory issues in 20 lines of code".
I think that one of the commenters does have VTC privilege yet.
 
Turns out I thought this was about another close-worthy question. Now they're both closed.
 
@Mast You Rock!
 
12:34 PM
Even left a comment. On a roll today.
If I'd be as active with answering questions as I'm with keeping this site tidy, that zombie count wouldn't have stood a chance.
3
 
possible answer invalidation by Justin on question by Justin: codereview.stackexchange.com/posts/220720/revisions
 
@Duga Rolled back and commented.
 
Does the code as written work? That is, does running the loop indeed give you the output you want? If so, the folks at Code Review might have some insights. — cxw just now
 
1:05 PM
0
Q: What Python module will help me parse a MIDI file, and extract Note On events ...?

GoodinSoI'd like to parse a MIDI file and simply extract every Note On event and then write that information to a text file. (This is a MIDI file which I export from the piano-roll in my DAW by the way) So the text outputfile would output the following for example: D1, C2, D2, E4 ... etc These repres...

0
Q: Python program to take in two strings and print the larger string

JustinI have written a Python program to take in two strings and print the larger of the two strings. Here is my code: string1 = input("Enter first string: ") string2 = input("Enter second string: ") count1 = 0 count2 = 0 for i in string1: count1 = count1 + 1 for j in string2: count2 = c...

0
Q: PHP Login Class - Security and Efficiency Check

Thomas GregoryI'm hoping someone would be able to identify if my code is prone to SQL injections, and just overall see if there is anything that could be done better, faster or more efficiently Im very new to OOP and prepared statements so there might be some glaringly obvious problems but just let me know! ...

 
@CaptainObvious No.
 
@Mast it's just so much more effort to kill some zombies, right?
 
@Vogel612 Especially the fat ones.
@Vogel612 This one keeps taunting me. I'm this close to figuring out what he's talking about and learning enough Verilog to write something meaningful, just to get it over with.
 
1:23 PM
@Mast it has an upvote from me, but I never touched verilog and I wasn't a fan of vhdl when I learned it for university :/
 
0
Q: Optimize Entity Framework Core query

user201284I would like to optimize the below query using EF Core. Is it possible to make it more fast and also async the whole query? using Microsoft.EntityFrameworkCore; using MyCompany.MyProduct.Administration.Core.Application.Interfaces; using MyCompany.MyProduct.Administration.Core.Domain.Invoices; us...

 
@Vogel612 I've done enough VHDL to know I don't know enough Verilog to answer it.
 
2:04 PM
0
Q: Reviewing the Dockerfile and docker-compose.yml files for a basic nodejs mysql project

DeveloperI'm new to docker and after much research and stufy I've created a sample application and would like it to be reviewed in case if I'm missing any corner or if there's redundant information that can be simplified. Dockerfile FROM node WORKDIR /src COPY . . RUN npm install CMD ["npm", "start"] ...

 
2:24 PM
0
Q: Python program for a simple calculator

JustinI have written a program for a simple calculator that can add, subtract, multiply and divide using functions. Here is my code: # This function adds two numbers def add(x, y): return x + y # This function subtracts two numbers def subtract(x, y): return x - y # This function multiplies...

 
3:03 PM
Monking
 
3:23 PM
0
Q: Modify jObject elements that are decimal and have no '.' to int, recursively until jObject exist

miskegmI wrote code sample below that is finding decimal values in jObject without '.' char, and convert them to long type. The issue is, that it looks really ugly, and it works for max jObject that contains two child jObjects. Any ideas? public JObject ModifyDoubleIntegers(JObject objectToModify) ...

0
Q: Python program to find Armstrong numbers in a certain range

JustinI have written a program to check for Armstrong numbers in a certain range. An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is equal to the number itself. For example, 371 is an Armstrong number since 3**3 + 7**3 + 1**3 = 371. Here is my code: low...

 
@Vogel612 sometimes it is... I started looking at this veteran ... its going on 4 years old... Maybe its mostly because of Phrancis's comment about hoping great answers are received that I feel I want to try to answer it...
 
I've used tcsh a little, and while I don't know all the fine points, this looks like it works. If there is a problem you should describe it. Requests for code review are best on codereview.stackexchange.com . If you uncover a real problem, then post here with real code, exact output and error messages and your required output. Good luck. — shellter 27 secs ago
 
@SᴀᴍOnᴇᴌᴀ it is questionable how valuable feedback would be there, since AngularJS might not be dead but certainly feels more like a legacy framework...
Apparently the OP has been active on the site in the past couple months so that is somewhat promising that any input might be received in the near future... but even if not maybe it would be helpful to others too (site goal)
 
3:40 PM
@SᴀᴍOnᴇᴌᴀ Quite irrelevant. If you want COBOL reviewed, you can.
 
since the OP did ask about efficiency
 
@SᴀᴍOnᴇᴌᴀ Agreed, that was a sub-optimal suggestion. Rolled it back.
 
@Mast cool
I was about to reject it but then when I tried to, the system notified me it had already been approved by OP щ(゚Д゚щ)
 
OP didn't know any better, we do.
I don't mind double-checking you, but you do realize you got more privileges on this site than me, right?
Feel free to use them.
 
3:57 PM
Monking
 
@Mast yeah... I'm still getting used to the 10k mod tools... the inline tag editing is nice
@Mast So on one of the stats pages, I see that OP had approved another edit to remove the tag...
with a comment from that user:
You should not use perfomance tag for code that can't be represented as "high-load" or "heavily computational". If your program uses CPU for couple of milliseconds, you have no reason to care about perfomance. — vurmux 2 hours ago
@MathieuGuindon (or other proponents) does this edit make sense?
 
@SᴀᴍOnᴇᴌᴀ OP approved it, how come it just didn't go through?
and yes, it's legit
could have been a comment though
 
@MathieuGuindon it went through... thanks
 
4:17 PM
@vurmux You've been around for a whole 2 days, please read up on our Meta before trying to lecture other new users. — Mast 19 secs ago
 
@MathieuGuindon Should've, IMO. But as soon as OP accepts it, it's a really odd situation.
Should that situation explode, I'll be available later today. Not now.
 
4:34 PM
Thanks for your efforts
 
4:54 PM
For the record, I would likely have stripped out the tag in one of my routine edits.
 
5:22 PM
0
Q: didBegin function doesn't run and won't execute

FranciscoThis entire code is written in Swift v5. I'm trying to make a cowboy/gunslinger game. I need a collision between the projectile (coming from the first cowboy) to hit the second cowboy. However, the didBegin function isn't being run/called. I've tried messing with the physics bodies, by using cod...

 
I'm voting to close this question as off-topic because it should be asked on Code Review, since your code works and you just need to improve it. — double-beep 21 secs ago
 
6:00 PM
 
I'm voting to close this question as off-topic because it belongs to Code Review, since it is about Code Review and improvement. Your code works well and you try to just find a faster way. — double-beep 36 secs ago
 
6:22 PM
0
Q: Simple Sorted Linked List Implementation in PowerShell

KGlasierI wanted to create a simple LinkedList implementation in PowerShell in preparation of a SkipList implementation. This LinkedList currently starts and ends with a Null node, and when items are inserted, they are inserted in increasing order. For example, adding 217, 436, and then 178 into the lis...

0
Q: Duelling Idiots

ReignProblem: A and B decide to duel but, being poor, they have just one gun (a six-shot revolver) and only one bullet. Being dumb, as well, this does not deter them and they agree to "duel" as follows: They will insert the lone bullet into the gun's cylinder, A will then spin the cylinder and shoot ...

 
<havent-heard-that-name-in-a-long-time.gif>
 
It's not that I (don't) like the answer. You didn't explain what the code is supposed to do. Are you aware of that fact? The question doesn't seem to be valid. Maybe a more suitable place to ask it would be: codereview.stackexchange.com. — CristiFati 38 secs ago
 
@Duga "peace of code" is quite the nugget there
2
 
@CristiFati note that CR requires the OP to explain what their code does. Code Review is indeed a good place to ask for help with performance and readablity enhancements, but reviewers usually don't like having to first guess what the purpose of the code is. — Mathieu Guindon 34 secs ago
 
6:41 PM
posted on May 22, 2019 by goldi

My code is printing different outputs when i print something additionally . If i print the line 17 (mentioned in my code) I get a different output , whereas if I do not print that line I get a different final output . Can you please help me know why ? Here is the question link . question My code is below . Any help will be really appreciated . /*this is the code *

 
7:01 PM
0
Q: Find words with this prefix

AyxanThis function is supposed to find words starting with a given prefix in a container. The container is sorted. This function is a fairly performance-critical part of the code, so I am open for any optimization suggestions. template <typename It_beg, typename It_end, typename Prefix> auto find_pr...

0
Q: Handling Result and error Enum in Swift

Nicolas CharvozI'm working on a new API written in Swift 5 and I wanted to play with the new Result. I wanted to know what you guys think about this syntax: enum NetworkRequestError: Error { case hostNotAvailable case accountNotAvailable func finish<T>() -> Result<T, NetworkRequestError> { ...

 
7:28 PM
@M.Deinum Yeah, it's not really that pretty. I'm probably going to ask a question about it on Code Review tomorrow when I get back to work. — Nzall 53 secs ago
 
7:41 PM
1
Q: Increasing probability of finding a hash collision

Astral ZhangI'm trying to find a hash collision of my modified hash function. Assuming my modified hash only outputs the first 36 bits of SHA-1. As we know, SHA-1 is a 160-bit hash value, hence, we only need to output 9 characters out of 40 characters for comparison. How i begin my program is by hashing a ...

 
The code reviewers weren't able to point you to the culprit? — Broots Waymb 49 secs ago
I think this would be a better fit for Code Review SE. — Draco18s 38 secs ago
 
@MathieuGuindon oh the irony...
 
7:59 PM
If it doesn't do what you want, you need to explain what it is that isn't what you want. You've explained your approach and supplied code, but I can't figure out what your problem is, beyond "how can I do this better?" which is what Code Review does. — Draco18s 9 secs ago
 
8:40 PM
0
Q: How efficient is this?(Gauss trick to add numbers in an efficient way)

StarkFunction that print sum of numbers between 2 given numbers: def sum_of_numbers(start_number, end_number): # n self explanatory n = abs(end_number - start_number) + 1 # n / 2 represents the number of pairs, # end_number+start_number represents the total for each pair. return (...

 
9:00 PM
0
Q: Python program that gets my hackerrank code and scores using requests

jbbouzI'm trying to extend my coding skills to other languages by doing projects. (learned Java in school) and since python is very popular right now thats what I ended up choosing for this project, though I'm fairly new to it. Does this code follow common best practices? Is there anything I can do to ...

 
9:20 PM
-1
Q: Rewrite a Haskell function to be total

Curran McConnellI've written this function to give the neighbours of a vertex in a graph: import Data.Matrix (Matrix, getRow, ncols) import Data.Vector ((!)) type AdjacencyMatrix = Matrix Bool -- Input: the graph's adjacency matrix and a vertex. -- Output: the list of neighbours of that vertex. neighbours ::...

0
Q: LeetCode: minimum cost to hire k workers C#

Giladhttps://leetcode.com/problems/minimum-cost-to-hire-k-workers/ here are N workers. The i-th worker has a quality[i] and a minimum wage expectation wage[i]. Now we want to hire exactly K workers to form a paid group. When hiring a group of K workers, we must pay them according to the...

 
9:40 PM
2
Q: "Alien" challenge

user201325I have quickly written some code for a task in which takes a name of an 'earthling', their age and then applies a random operator with a random value in between 0 and 100. If their new age is below 0 or above 120, they die. The operator, name, previous and new age must be printed to the screen. ...

0
Q: Rotate Matrix 90 degrees C#

GiladPlease review the code readability, I would like to have an easier to follow code. Thanks using Microsoft.VisualStudio.TestTools.UnitTesting; namespace ArrayQuestions { /// <summary> /// https://www.geeksforgeeks.org/inplace-rotate-square-matrix-by-90-degrees/ /// </summary> [Te...

 
 
1 hour later…
10:59 PM
0
Q: Reverse Vowels of a String

thadeuszlayThe task is taken from leetcode Write a function that takes a string as input and reverse only the vowels of a string. Example 1: Input: "hello" Output: "holle" Example 2: Input: "leetcode" Output: "leotcede" Note: The vowels does not include the letter "...

 
11:19 PM
0
Q: Creating multiple numpy arrays (too many ?) Python 3.x

Unic0I am new to programming and I tried to wrap up a few functions that are helpful for my code. But It really looks bad ! I read heard that one of the best practice is to avoid repetition in the code. For my piece I have to create multiple arrays which will all have different usage, but generating a...

0
Q: Simple ring/circular buffer c++ class V3

Hex CrownThe Original Post (v2) As stated in the previous post, i'm looking for feedback on the updated version of the code posted. A few things specifically I'm looking for feedback on, are: I switched to using the std::aligned_storage as suggested in the previous post, but on the cppreference.com - ...

 
11:39 PM
0
Q: Find out whether number is of Power of Two

thadeuszlayThe task is taken from leetcode Given an integer, write a function to determine if it is a power of two. Example 1: Input: 1 Output: true Explanation: 20 = 1 Example 2: Input: 16 Output: true Explanation: 24 = 16 Example 3: Input: 218 ...

 

« first day (2209 days earlier)      last day (1810 days later) »