« first day (2210 days earlier)      last day (1812 days later) » 

12:00 AM
RELOAD! There are 6053 unanswered questions (89.8652% answered)
 
 
2 hours later…
2:17 AM
0
Q: PowerShell - Loop Through Nested Objects

Kyle HaleI'm writing a PowerShell script to loop through an organization's PowerBI workspaces and spit out the report IDs, names, and URLs for each workspace - so, a nested loop. Here's my working script thus far: Install-Module -Name MicrosoftPowerBIMgmt $myArray = @() Login-PowerBIServiceAccount Get...

 
2:37 AM
0
Q: Increase Efficiency of TickeTron

YouraverageprogrammerI have written a program that simulates a TickeTron and allows the user to book seating in a virtual audience. The virtual audience is read in from a text file which will be included below. The program does work when run but I feel there are ways to greatly increase the efficiency of the program....

0
Q: Core Data Wrapper

IsaacI built a wrapper in Swift to practice CoreData. My question is more general, I hope this is acceptable. I wanted to know whether my implementation of this wrapper is correct or poorly implemented for practical use. Any feedback like design-patterns, conventions, etc are welcome as well. Curren...

 
3:00 AM
possible answer invalidation by Unic0 on question by Unic0: codereview.stackexchange.com/posts/220774/revisions
 
 
1 hour later…
4:19 AM
Monking
@Duga rolled back
 
4:41 AM
0
Q: redirect automatically using javascript php

Gold JimmyHow can I redirect automatically? When a visitor comes to the site, I want to check for a mousemove, keypress, mouseclick, or scroll event, and if one is detected, redirect the user to $activitly. If no event is detected, I would like to automatically redirect the user to $inactivitly. The event...

 
5:01 AM
0
Q: Array based Binary Search Tree out of bounds

Redsam121The problem is I have an array based Binary search tree that needs to take in nearly 2000 lines of information from a text file read from a file IO. However, I continuously get array index out of bounds 3012. I've attempted to make the array as large as I could without exceeding the limit in Ja...

 
6:01 AM
0
Q: Python program to find the median of two sorted arrays

JustinAn assignment required me to write a Python program to find the median of two sorted arrays. Here is the description of the task: There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should...

 
 
1 hour later…
7:06 AM
Monking
@Duga Not that the answer is of particularly high quality, but ok.
It's still invalidation.
@CaptainObvious That's a request for rewrite.
 
This should be on code review. What is your problem here? — window.document 1 min ago
@Someprogrammerdude I am providing a product to a customer. The customer insists on compiling the code by himself. I want to make it hard for the customer to make a code review and comments about the code. — user3551678 35 secs ago
@window.document ??? On codereview I was told the opposite — Shidomaru NeveRage 50 secs ago
By judging from your profile, It looks like you've never signed up for code review. — window.document 56 secs ago
@window.document It got closed on CR here. Please take a look at Code Review's help center before making recommendations. — Mast 37 secs ago
 
7:24 AM
monking
 
@Mast thanks for linking the question. Although, I've been on code review and this question is indeed relevant for code review but the OP failed to provide more context on his code. — window.document 18 secs ago
@cxw Thanks, didn't know that existed. Yeah, it works, so it sounds like Code Review is the place to ask. — Alex 11 secs ago
I don't see the problem you are trying to solve. As I see it this question is off topic on SO. It could probably be posted on code review though — Andreas 20 secs ago
 
7:40 AM
0
Q: Python program to find the substring with concatenation of all words

JustinThis is a Leetcode problem: You are given a string, S, and a list of words, L that are all of the same lengths. Find all starting indices of substring(s) in S that is a concatenation of each word in L exactly once and without any intervening characters. Here is my solution to the problem: ...

 
8:00 AM
0
Q: VBA: Errorhandling with GoTo and labels

AlexStackoverflow suggested I post my question here: The code below works, but I want to ask if my solution is adequate or if there's something I should structure differently. If it's alright, I'll apply the same code in other subs. My code copies stuff from Excel to PowerPoint and inserts it as...

 
8:39 AM
0
Q: Should I use dependency injection instead of class funcs?

SoniusI was reading a blog article by https://www.raywenderlich.com/ about the integration of health kit. For the communication with HealthKitStore, they used a class with a class func in it like this f.e. class HealthKitSetupAssistant { class func authorizeHealthKit(completion: @escaping (Bool, E...

 
8:59 AM
0
Q: Is the "thunk" really necessary in this case?

HMPARTICLEI have started reading a blog on lazy evaluation. Here is a link to the blog https://bartoszmilewski.com/2014/04/21/getting-lazy-with-c/ I do not understand why the intermediate "thunk" methods are necessary in this code: template<class T> class Susp { // thunk static T const & thunkFor...

0
Q: Correct semantic html5

t BookI would be thankful for feedback for following html5 markup. The outer div (class articles) has no more meaning as setting flex for it's child elements. Is a div the semantically correct choice in this case? .articles { display: flex; } .articles__article { flex: 1; } <main class="main">...

0
Q: Vanilla Javascript code to sort nested tables

LaxmanI have written a code to sort a main table containing tables in each of its rows. The actual table is very big. So I did not paste the HTML. Here I am trying to sort the tale by first sorting the rows in each of the main rows and then sorting the table from the sorted main rows. Whenever I click ...

0
Q: Pandas styling: Conditionally change background color of column by absolute value

ahad pashayevI had posted question in stackoverflow.com about how I can apply conditionally change background color of column by absolute value. https://stackoverflow.com/questions/56202218/pandas-styling-conditionally-change-background-color-of-column-by-absolute-valu. But, I have not received respond yet. ...

 
Wondering if this should be closed as UWYA perhaps?
0
Q: Using most constraining variable and least constraining value for N-queens challenge

Borna GhahnooshI was trying to solve the N-Queens(Only 1 solution) problem and I succeeded but my program could only calculate up to N = 47 in a good amount of time so I tried to implement least constraining value and most constraining variable and even though it got faster, it was still slow. What can I do to ...

It doesn't seem answerable
Maybe even "lacks context"
 
9:28 AM
@SimonForsberg Probably better, I agree with Heslacher's comment on it.
 
9:39 AM
0
Q: 128-bit unsigned integer

Paweł BylicaThis implements 128-bit unsigned integer using C++14. It works on MSVC and 32-bit architectures being complementary to the unsigned __int128 type provided by GCC and clang on 64-bit architectures. // intx: extended precision integer library. // Copyright 2019 Pawel Bylica. // Licensed under the ...

 
@M.Deinum I have created a question on Code Review about this code. It can be found at codereview.stackexchange.com/questions/220810/… and you'll probably be better able to give in-depth feedback and comments on the structure and working there. — Nzall 46 secs ago
What is the actual problem with your code as is? (If you merely want a code review: There is a dedicated Stack Exchange site for Code Review...) — mkl 41 secs ago
 
9:59 AM
0
Q: Given a resource ID, instantiate, retrieve and localize a Linked Resource for a REST API call

NzallDuring a question on Stack Overflow, another user had some comments about the way this code works. He had a few choice words for it, including "magic", "ugly contraption", "you're doing things you shouldn't be doing". I wanted to ask some feedback on this sytem. Note: there might be some minor th...

 
10:19 AM
0
Q: Properly disposing of a WCF connection

Yonatan NirThis is a follow up question to this question: https://stackoverflow.com/questions/4573526/what-could-be-causing-a-cannot-access-a-disposed-object-error-in-wcf I have created a WCF service and using it in the client side. When closing the connection to the service and trying to use the client f...

 
10:38 AM
0
Q: How to write the Bookmark section with Polymorphism in Laravel?

Emad MotameniI should now work on the bookmarks(favourites) section with Polymorphism in Laravel. i write the following code: routes\api.php: //favorite routes Route::prefix('favourites')->group(function(){ Route::get('','API\FavouriteController@getFavourites'); Route::post('','API\F...

 
@Mast Feel free to VTC
 
11:38 AM
1
Q: Force-unwrapped property as a contract

The Dreams WindI have a class which looks similar to the following code: var actions: [(title: String, action: () -> Void)]! { didSet { // refresh UI } } init(actions: [(title: String, action: () -> Void)]? = nil) { super.init() if let actions = actions { self.actions = actions...

0
Q: Synchronising data between my remote and local databases

Tendai MareI have code in place that helps me to keep track of our SiteData and make sure its always up to date. Whatever new records are added in the Site must be added to the Online Database.Records that have been modified and updated must be overwritten and replaced with records from the online Database....

0
Q: Properly disposing of a WCF connection using IDisposable

Yonatan NirThis is a follow up question to this question: https://stackoverflow.com/questions/4573526/what-could-be-causing-a-cannot-access-a-disposed-object-error-in-wcf I have created a WCF service and it is up and running. When I used it, I was closing the connection after each time I got a response in...

0
Q: Creating a list of letters when a word is given

Lasan Manujitha Ukwaththa LiyaI was given two words and have to sort them according to the alphabetical order. To determine which of the two words comes first in alphabetical order, their first letters are compared. If they differ, then the word whose first letter comes earlier in the alphabet comes before the other word. If ...

 
 
@Mast Ping me when you just need one more and I can put mine in.
 
12:15 PM
done
 
-1
Q: I am trying to create an Datastore Entity through Google Cloud Dataflow

SylvesterTheKidBelow code is used to create entity with user define key. I want to know how to create an entity with default key provided by Google Datastore Key key = Key.newBuilder().addPath(PathElement.newBuilder().setKind("PoolMaster").setId(120098L)).build(); Entity.Builder entityBuilder = Entity.newBuil...

 
12:37 PM
1
Q: Count Even Digits In Number

David WhiteI was asked to complete this CodeStepByStep problem. Here's a quick summary: Write a function named count_even_digits that accepts two integers as parameters and returns the number of even-valued digits in the first number. An even-valued digit is either 0, 2, 4, 6, or 8. The second val...

0
Q: Pidfile single process instance mechanism

FyrnI'm writing a system deamon in rust that may be started by the user manually. Only one instance of the deamon should be running at a time so I have created a pidfile locking mechanism to prevent multiple instances. This is my first time doing any kind of unix style file locking and I would apprec...

 
12:52 PM
Yes, there are certainly, certainly neater ways to do this than using reflection to get methods on BitConverter and using Convert, but if you want advice on how to improve working code, and you can make your concerns specific (rather than "make it look better somehow"), Code Review is a better venue. (If it doesn't work right now, it's not clear in what way it doesn't work.) — Jeroen Mostert 11 secs ago
 
1:17 PM
0
Q: Java-Code to implement Soft-TF-IDF Similarity using Jaro-Winkler Distance

Daniel SanI want to compare the string similarity values from two nodes by using soft-tf-idf. The idea is to get two nodes by a nested for-loop and create a vector-space model by adding all existing token in the two nodes to spaceSet. The closeSet contains all tokens from the first node, that have a simila...

 
1:37 PM
0
Q: Javascript Rotate Element using array

samuelkorohLaying out nine(9) buttons to form a 3 x 3 grid inside a div and modifying their labels after each click event on one of the buttons. Important: The labels on the outer button must rotate in a clockwise direction each time we click the middle button. I tried this but nothing working const rota...

0
Q: Convert Byte array into collection of items of different types

sebpinskiI'm recieving UDP messages as byte arrays and depending on details in some of the first byte, I need to convert remaining bytes into a multitude of different possible arrangements of other data types. These data types are primarily 'uint', 'ushort' and just 'byte' but can be in any order, and th...

 
1:57 PM
0
Q: Python program to find the first missing positive integer in a list

JustinThis is a Leetcode problem: Given an unsorted integer array, find the smallest missing positive integer. Note: *Your algorithm should run in O(n) time and uses constant extra space.* Here is my first solution to this problem: class Solution: def __init__(self, A): ...

0
Q: Linting React+Typescript project with ESlint

Amir-MousaviI read in an article that the TypeScript core team explaining ESLint has a more performant architecture than TSLint. And on the other hand @typescript-eslint/parser makes a more convenient AST which works the best alongside @typescript-eslint/eslint-plugin. Now I have a feeling that my tslintrc ...

 
2:17 PM
0
Q: Python program for Jump game II

JustinThis is a Leetcode problem: Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that position. Your goal is to reach the last index in the minimum number of jumps. ...

 
I'm voting to close this question as off-topic because, this code is working as stated in the question it would be better suited for codereview.stackechange — johnny 5 53 secs ago
 
2:37 PM
0
Q: Simplify small pieces of code with Python/Django

EssexI'm trying to make a code review from an external developer on my project. His code could me improved and I need your advices in order to know if my overwritten parts are better or not. Part 1 # INITIAL if 'error_message' in result_import: result_import['error_message'] = "The file could n...

 
This is a better fit for codereview.stackexchange.com. We're about fixing broken code here. — The Head Rush 48 secs ago
As your code currently works I believe it belongs to CodeReview (The link points to their How to ask). — Frakcool 28 secs ago
possible answer invalidation by Justin on question by Justin: codereview.stackexchange.com/posts/220795/revisions
 
2:56 PM
-1
Q: A cursor that checks for database-users and their roles

wenzzzel I've made my first cursor which checks for database users and their roles and I would appreciate a second opinion on it. This is how it looks: /* * This is a script made to check the existens of database users * and their roles. * * It creates two temp tables, #logins and #roles to run th...

 
3:09 PM
Monkin'
 
3:25 PM
possible answer invalidation by sebpinski on question by sebpinski: codereview.stackexchange.com/posts/220831/revisions
 
@Duga rolled back by t3chb0t
Firstly, you must not change the code after answers have been posted so I reverted the edit... secondly, the edit still doesn't make sense and does not use ref. I don't think you know how ref works... — t3chb0t 3 mins ago
 
Rather than coming up with some complex/convoluted solution, this is something I have always solved through code reviews. It should be quite obvious if something is redefining a method inside the test. There's also this rubocop rule to help prevent such bad practice, though I'm not certain if there's an equivalent cop for minitest. — Tom Lord 13 secs ago
 
@SᴀᴍOnᴇᴌᴀ <obligatory-gif-from-Princess-bridge-about-I-don't-think-that-word-means-what-you-think-it-means.gif>
@Duga hmm... removed comments but I don't see that mentioned in the one existing answer - should we still roll it back?
 
3:51 PM
@SimonForsberg oops
 
possible answer invalidation by sebpinski on question by sebpinski: codereview.stackexchange.com/posts/220831/revisions
 
4:16 PM
0
Q: Tetris Game Javascript

All KnowerI am creating Tetris in javascript. I have finished the basic mechanics. I would appreciate some feedback on how I could improve it. Down, left, and right arrow keys move the piece while the up arrow key rotates it. "use strict"; const pieceData = [ { // O builds: [ [ [...

 
4:38 PM
@Duga rolled back again by t3chb0t
 
@SᴀᴍOnᴇᴌᴀ You had 2 reasons to reject it, why did you accept it anyway?
 
@Mast wat? do you think I am the OP that accepted that?
 
@SimonForsberg Closed 50 minutes ago FYI
 
@Mast stackzebra !== Sᴀᴍ Onᴇᴌᴀ
 
> Sᴀᴍ Onᴇᴌᴀ reviewed this 1 hour ago: Approve
 
4:43 PM
@Mast yes...
 
Ok, let me reword that, it was phrased poorly. You didn't accept, you approved.
 
the rejections came after my approval...
 
Yes, so ultimately it didn't matter. The question though, is why? Why didn't you reject it?
 
~rifles through meta
I don't see anything in meta about not modifying code in answers.... the code in that answer was originally invalid python code (at least according to my experiment on onlinegdb.com)
11
A: What are our answer editing guidelines?

rolflThe Edit Review queue is notorious for people making mistakes in the process. The problem is almost entirely related to the fact that answer edits are much rarer than question edits. Code Review has unfortunately got a lot of robo-reviewers in this queue, people who see a code edit - and auto-re...

> The solution is that code suggested edits, if they have an edit comment that makes logical/obvious sense, should just be approved. If there's a problem, well, the answerer whose code was edited will get a notification of the edit, and they can easily roll it back if it's wrong.
 
@SᴀᴍOnᴇᴌᴀ Is valid Python in answers a requirement on Python questions?
 
4:50 PM
is it not?
do I have to search meta for that?
 
The correct approach here would be for someone to leave a comment for the author of the answer, perhaps a downvote if you think it's a bad answer.
@SᴀᴍOnᴇᴌᴀ Answers without code are acceptable.
 
> Now, if the answerer was simply trying to demonstrate an algorithm, then it would be better off as pseudocode, which is okay as an answer as long as it relates to the original code.
 
Answers often miss implementation details, does that make them invalid?
 
10
A: Can answers to questions contain only code not the same language?

Elias Van OotegemOn the whole, I'd have to say: No. This site is supposed to be about reviewing the code, posting a working version of the code in another language doesn't always help the OP. If you are suggesting an alternative algorithm, or you want to illustrate a point, using a language you are more comfortab...

 
We accept pseudo-code in answers.
@SᴀᴍOnᴇᴌᴀ The response to that is a downvote and/or comment, not an edit.
 
4:53 PM
@Mast so then maybe that code should have been pseudo-code, not c-based code
 
That would've made for a better answer, perhaps.
But that doesn't mean the answer should be edited like this.
Should we take this to meta?
 
@Mast alright - noted
@Mast you could add/alter an answer or add a comment to one of the answers on that latter meta post
unless editing one of those answers is acceptable (oh the irony)
 
0
Q: If statement comparing first and last letter of string with exception

Alex HI am trying to remove a duplicate letter of first or last letter, with an exception of containing 'a' as first letter and 'l' and 'e' as last letter. However, this code does not look efficient to me because, what if I had 20 letters of exception? I would not want to compare each letter all in one...

 
Perhaps the community is more in favour of your approach, policy can be fluid like that and has changed in the past.
 
@Mast would you prefer I post a follow-up meta question linked to that question?
 
4:57 PM
I think that would be better. We agree the community should do something against such answers, but we need an answer to what is and isn't an acceptable approach for dealing with them.
That does about sum it up, right?
FYI I've left a downvote on the answer.
 
acknowledged
 
Also, I'll be back.
 
5:15 PM
0
Q: Poker Hand evaluation

fuboI want to evaluate Poker Hands an wrote the following Code: https://dotnetfiddle.net/A35CP2 Anything wrong / to imporve? public class Deck { private Random rnd; private List<Card> DeckCards { get; set; } private int PlayerCount { get; set; } public Deck(int playerCount) { ...

 
5:33 PM
1
Q: How should we handle edits to answers to make code congruent with the language of the question?

Sᴀᴍ OnᴇᴌᴀThis is related to What are our answer editing guidelines?, but about an edit with a brief comment: Switched to python. To me that makes sense, since the code looked like a mix of python and a c-based language. Others felt that edit shouldn't have been approved. Rolfl's answer to the afo...

 
5:43 PM
Here's an example that makes .forEach work by returning something from the expression. I would reject this in a code review, because .map is the most idiomatic way to do this, so just to illustrate the point: codesandbox.io/s/quizzical-haze-4mr8qpawel 42 secs ago
 
@MathieuGuindon The times when a former moderator is just as good as a current one :)
 
6:02 PM
"Do you guys have a better alternative to this code?" That sounds quite like a question that would be better at home at codereview.stackexchange.com. Although, the term "better" will mean different things for different people, and as such it is not a question that can be answered in a definitive, meaningful way... — elgonzo 1 min ago
 
@SᴀᴍOnᴇᴌᴀ @Mast
1
A: How should we handle edits to answers to make code congruent with the language of the question?

Simon ForsbergKnow what you are doing If you know the language in question just like you know your best friend, then I'd say feel free to edit and correct it. In this particular case the code was a mix of Python and some C-style language, so the edit makes perfect sense and I would have also voted to approve...

 
I already seen it
 
@SᴀᴍOnᴇᴌᴀ ... mumble mumble... notifications mumble mumble...
 
1
Q: Java objects for a network sniffer program

CrizlyI'm working on a network sniffer program, whose structure uses 3 main classes: Frame Class - One per monitored frame, holds reference to all the other sub frames Parse Class - Holds the hex value of the entire frame Protocol Classes - Individual classes for each network protocol When a new fr...

 
6:46 PM
I'm going to accept this since it's a working proof of concept that answers my question pretty exactly. However it comes with some caveats, a big one being that if you actually do something like this in your code, every code reviewer will just be like WTF. It's also important to note that once you start thinking about such shenanigans, it might be time to rethink your design. For that, see @sehe 's answer. — Victor Mataré 46 secs ago
 
7:07 PM
@SᴀᴍOnᴇᴌᴀ Just when you think you've seen it all:
@Mast Sorry, I don't know either. I'm just pretending. — stackzebra 1 hour ago
As a rsponse to:
Was your code supposed to be C or Python? At the moment, it's neither. — Mast 2 hours ago
 
-4
Q: A Javascript file I'm inspecting is ten lines long and has over 30,000 characters! How do I verticalize it

Peabody jr.I am trying to validate a Javascript file, but the file I am validating (I didn't make it) is all on a few lines with extremely long columns. Is there a delimiter function I can use or some tool that could make it far more vertical and easier to read. Maybe something that makes a new line each ti...

 
7:39 PM
@Mast oh are we not supposed to pretend?
darn I've been doing it all wrong
 
7:54 PM
Thank you again for the code review, I really appreciate the insight — Jose Fernando Lopez Fernandez 29 secs ago
 
0
Q: Visualization of a incremental rotary encoder

AlexVWhile reworking my teaching materials for an exercise of an introductory course on mobile robotics, I recently created a visualization/simulation of a incremental rotary encoder, e.g. often used for odometry purposes. I'm quite happy how it turned out and it was indeed helpful when talking about...

 
This question is better suited for codereview.stackexchange.comRawrplus 14 secs ago
Maybe you answer this question as well which is a follow up to this one and is based on your answer? codereview.stackexchange.com/questions/220818/…Yonatan Nir 22 secs ago
 
8:34 PM
0
Q: C# largest binary gap of a number

KrisI have picked up a problem from Codility website and tried to work it out. I would appreciate guidance of how to refactor it and what to look for in terms of efficiency? Optimisation I'd like to achieve would be, less type conversion, no zero items in the list, would there be a better way to fi...

 
8:59 PM
Monking, Good night
 
9:30 PM
@elgonzo Surely this can only be determined by the answer - if there is one. Perhaps this is not possible, and perhaps, if it is possible, it's not a clean solution. However, this is a programming Q&A site; I understand SE has different sites for code reviews. Wouldn't you be interested to see if this is possible (even if it's ugly)? — Paul Michaels just now
possible answer invalidation by AlexV on question by Paweł Bylica: codereview.stackexchange.com/posts/220809/revisions
 
@Duga its fine
 
 
1 hour later…
10:34 PM
1
Q: Encode and Decode TinyURL

thadeuszlayThe task is taken from leetcode TinyURL is a URL shortening service where you enter a URL such as https://leetcode.com/problems/design-tinyurl and it returns a short URL such as http://tinyurl.com/4e9iAk. Design the encode and decode methods for the TinyURL service. There is no re...

 
10:50 PM
possible answer invalidation by Unic0 on question by Unic0: codereview.stackexchange.com/posts/220774/revisions
 
@Duga post is on-hold as UWYA... edit comment is Corrections following the guide lines of the how to ask a good question improving readability... most of changes are descriptions of code; there is one code change to call a different function name but that doesn't appear to be mentioned in the one answer
 
11:17 PM
0
Q: Improving performance of moving arrays into an array

MatI am loading a bunch of arrays and putting them into a single array. The loading of the data is negligible, but putting it into combinedArray takes significant time (as in this code). import time import numpy as np start_time = time.time() st,en = 0,0 combinedArray = np.empty(shape = (3...

 
11:53 PM
This might be a better fit for codereview.stackexchange.comAlexander Nied 52 secs ago
I'm voting to close this question as off-topic because it's a better fit for Code Review. — Ken Y-N 57 secs ago
 
0
Q: Removing first or last character of a string for unit testing

Alex HI am trying to remove a duplicate letter of first or last letter, with an exception of containing 'a' as first letter and 'l' and 'e' as last letter. However, this code does not look efficient to me because, what if I had 20 letters of exception? Could I put this in a string or an array? I would ...

 

« first day (2210 days earlier)      last day (1812 days later) »