« first day (1588 days earlier)      last day (649 days later) » 

12:00 AM
RELOAD! There are 4323 unanswered questions (90.8353% answered)
12:39 AM
If the code is working, the the Code Review Stack Exchange is the place to ask this question. — AJNeufeld 48 secs ago
1:35 AM
Q: Implementation of an intrusive SmartPointer

czxylHere is my implementation of SmartPointer. It is intrusive and tiny. How can I improve it? For example, constexpr, nonexcept, try-catch-throw, and etc. /* * file name : smartpointer.h */ #ifndef __SMARTPOINTER_H__ #define __SMARTPOINTER_H__ #define COMPARE(_op_) ...

1 hour later…
2:40 AM
Q: Autocomplete and CancellationToken

erdingerIn the mobile application I have a search page. As user types search keywords I display autocomplete entries. On each keystroke I initiate autocomplete lookup, and I am using CancellationToken to cancel lookups if user keeps typing. I am new to using CancellationTokens, so please review my code ...

2:54 AM
Q: Passing a form reference for accessing control in other class

Ran_THI have a form and one other class that basically maintains initialization state of the form (in this case, loading data from Json file to controls in form). My form code: Public Class PublishDigital Dim init = New InitForm Dim jsonPath As String Dim jsonTxt As String Private Sub Pu...

3:52 AM
This question may be better suited for codereview.stackexchange.com. — chepner 7 secs ago
4:23 AM
4:48 AM
Q: How to handle "Others" option in dropdown in ASP.Net MVC 5

UnbreakableBusiness Logic I have a company referral form, and in that form I have dropdown to select from Company List. But when a company is not found in the dropdown, User can select Option as "Others". Upon which a Textbox will appear. Now User will add the company in the TextBox and will fill rest of t...

5:02 AM
Q: Adjacency list Graph representation

Pranit KothariFollowing is the graph I used to create adj list. The code should follow all the best practices of C++ 14 and stl. map is used instead of vector to keep label. Any suggestions for better implementation are welcome. .h #pragma once #include <iostream> #include <vector> #include <list> #in...

5:32 AM
Q: Return a minimum number of ranges from a collection of ranges

Andrew ParmarI'm new to Python and SWE in general so excuse the simple questions. I was given the following coding challenge by an interviewer. And I came up with the following solution. But I was passed over becuase it didnt meet their performance criteria. I was wondering if anyone could give me pointers on...

5:44 AM
Q: Can I ask a Code Review question about a Linux kernel patch made by someone else?

Marc.2377I've been following another developer who fixed a bug in the Linux kernel. The developer has posted a patch series hoping it would get reviewed/merged, but he got no response so far. The patches have been out for a while. I'm no expert kernel developer, but I have a feeling that his patch could ...

6:24 AM
If your code is already working, consider posting on Code Review.SEjtbandes 15 secs ago
6:40 AM
I'm voting to close this question as off-topic because it belongs on codereview instead. — Mark Rotteveel 26 secs ago
7:30 AM
Q: How can I shorten my code

RedbeardGood day folks. I am trying to code a little program which mimics the code wheel which was included in the computer game The Secret Of Monkey Island. It consists of two cardboard wheels with pirate faces on it. Combining the upper half of the face with another lower half shows different year dat...

7:52 AM
"It works as expected" - then this question is not for SO. Have you tried asking on codereview? — Fildor 18 secs ago
if it is working code, it should go to codereview SO. classes like SqlConnection and SqlCommand deal with unmanaged resources, implement IDisposing and should therefore be wrapped in using. The else branch would not compile due to unterminated string literal. For variable declaration we nowadays use the var keyword instead of repeating the class name. — dlatikay 53 secs ago
I'm voting to close this question as off-topic because It belongs on Code Review. — VDWWD 22 secs ago
Just to answer to your edit : CodeReview is for very basic reviews tooPac0 26 secs ago
WTF, I voted to move to Codereview site. Why it is put onhold!!! — Pரதீப் just now
Q: Variadic function to find the first matching (string) argument in a larger array

StefanPlaying around with parsing a data buffer I wrote a small search function to find the first complete match out of a set of (string) arguments. The (simplified) buffer class with the find function: // buffer_simple.hpp #pragma once #include <cstddef> #include <utility> template <typename T, si...

@VDWWD - This isn't offtopic, you should have voted to move to Codereview site!! — Pரதீப் 40 secs ago
8:15 AM
Q: Multithreaded matrix multiplication on Unix in C

coderoddeI have this program for comparing serial and parallel matrix multiplication algorithms: matrix.h #ifndef NET_CODERODDE_LINEAR_ALGEBRA_MATRIX_H #define NET_CODERODDE_LINEAR_ALGEBRA_MATRIX_H #include <stdlib.h> typedef struct matrix_t { size_t m_rows; size_t m_cols; double* m_data...

8:30 AM
Q: cannot figure out a runtime error solution?

Ankitvoid write_dlog(){ string temp_uid; cout << "\n Enter your UID again : "; fflush(stdin); getline(cin, temp_uid); char date[10],hrs[5]; string dlog_data; cout << " Enter Date [dd/mm/yyyy] : "; cin>>date; cout << " Enter Time [00:00] : " ; cin>>hrs; cout << "\n Whatsup for today (>) :"; cin.ig...

Wearing my Code Review shirt for the first time at work today.
Take a star @Morwenn
Thanks :3
It just isn't my color, otherwise I would wear it as well ;-)
It isn't my colour either. I don't remember having ever worn it nefore ^^'
But colleagues said that « tomorrow everyone wears a blue shirt » for fun, and it's the only blue shirt I have.
Well, I have a blue crop top too, but I wouldn't wear it at work xD
8:35 AM
@CaptainObvious broken code
9:02 AM
Q: Bob Marley is jamming on the wifi

LudisposedBob is jamming it's way through the city deauthenticating people from thier wifi for a few seconds. First scanning all possible wifi-AP and then pretty printing them, afterwards you can choose a wifi to jam and it will perform a deauth for a few seconds attack using the airmon-ng framework. This...

10:01 AM
as I said, you can post your question 1:1 on codereview.stackexchange.com . The way it is written you are asking for improvements of your working code. This is out of scope of stackoverflow, but totally in scope for the codereview subpage — oli_obk - ker 59 secs ago
10:22 AM
The nuances of off-topicness are discussed in codereview.meta.stackexchange.com/questions/5777/… . If you change your question to a concrete improvement (like "how can I rewrite this to get rid of fail!"), then it is back in scope of stackoverflow, but in that case you should still create an MCVE that preferably works on play.rust-lang.orgoli_obk - ker just now
10:44 AM
Make a small test environment for yourself: two folders, with few files in them that constitute a representative sample of the real set of files. Split up your problem into bits and begin writing the script. Use the environment you set up for testing. If you get stuck, research the problem for a bit, and if you can't figure it out, then post it here and we will help you debug. Once the script works properly, you can post it on Code Review S.E. if you want to, and they will help you optimize and make it adhere to best practices. — stybl 33 secs ago
Q: How do I avoid multiple chain calls?

MichaelImagine code that reads from a file, cleans the data and finally writes the cleaned data to a new file. Let's briefly define these methods as Ruby stubs: def write ... end def read ... end def clean ... end We can also have an orchestrator method that triggers the whole logic: def...

@CaptainObvious stub code
11:03 AM
Q: Ruby: Which century programming exercise

NathanI recently wrote this up and am wondering if there is a better way to achieve the results I want. Essentially, we're taking a given year and adding 'th, nd, rd, st' depending on the digit. Any suggestions on how to shorten this code and make it better? Keep in mind that this is taking centurie...

Greetings, Programs.
11:25 AM
It looks like that is something you could implement but you just think your solution is not particularly elegant, right? That'd be kind of a broad question for this site. If I were you I would implement a working solution and validate it over at code review. Take a look here codereview.meta.stackexchange.com/questions/2436/…DPM 55 secs ago
11:45 AM
@Donald.McLean Greetings, User
12:18 PM
Q: Portable multithreaded matrix multiplication in C

coderoddeI essentially took this progam, and made it compile and run on Windows too. Also, I incorporated some nice points made by Toby Speight. matrix.h #ifndef NET_CODERODDE_LINEAR_ALGEBRA_MATRIX_H #define NET_CODERODDE_LINEAR_ALGEBRA_MATRIX_H #include <stdlib.h> typedef struct matrix_t { size_t...

Q: ASP.NET Users and SignIn managers

TheQultThe is any difference between those implementations? Some are less secure than others ? Default implementation: private ApplicationUserManager _userManager; public ApplicationSignInManager SignInManager { get => _signInManager ?? HttpContext.GetOwinContext().Get<ApplicationSignInManager

All I'm saying is that your application has security holes. I could list the problems that I can see in the code you posted, but that won't do you much good, because i have to I can't say exactly which ones without a complete code review, but alone the code quality you show here demonstrates that you (or your company) lack basic security knowledge, so it's almost guaranteed that there are security holes. — RoToRa 7 secs ago
12:39 PM
Q: I think my code might have a bug, but I am not sure if it actually does, Is it broken code?

TheyouthisSo I have some c++ code that I am executing from c# dotnet core 2. In my c++, I am using a third party library. My code builds and runs, but after being executed a few million times(2.5mil last time) I see the following message. terminate called after throwing an instance of 'std::length_error'...

1:16 PM
Does it work? if it does and you only want to shorten it, then move this to codereview.stackexchange.com If it does not work then explain more what it is supposed to do and what it is doing that is in error. — Scott Craner 52 secs ago
Probably the fact that the schema is undocumented and that 90% of the Code Review is not stored in the TFS Warehouse at all. — jessehouwing 18 secs ago
Then move to [CodeReview]. But as I said look into a For Loop: For i = 7 to 9726 Step 120 before posting there and if you cannot make it work come back here for specific help on that. — Scott Craner 33 secs ago
Give your post a title that describes the purpose of the code, describe what "this" does, present your code, the problem it's solving, and describe what you deem the problematic areas are in a Code Review question, and you'll have a great post. On this site (SO) however, this is too broad a question. — Mat's Mug 52 secs ago
1:37 PM
Q: Modelling passenger flow in space transport game

JoeClarkI've had ( what I think is ) an interesting idea for game about passenger transport in space. However, I'm trying to come up with a model for passenger traffic, meaning, how to generate passengers in the different locations in a way that each passenger wants to go somewhere. The old TTD just ass...

1:51 PM
Q: Given two arrays of integers output the smallest number in the first array not present in the second one

Tyndale PraveenInput Specification: The first line contains the size N1 of the first array. Next line give the contents of the first array. Next line contains the size N2 of the second array. Next line give the contents of the second array. Output Format: Output must be a single number which is the smallest n...

@CaptainObvious no code no glory
2:28 PM
Cramming UML for my "Modeling" exam is horrifically annoying
Has someone got motivation spare?
If you fail that exam, you have to repeat it.
Nah, sorry, I have no constructive motivation points for UML at the moment :/
well... it's only 300-something slides remaining...
2:56 PM
Q: Safely and elegently handling UNIX signals in Qt applications

FritzWhen you search the web on how to gracefully shut down your Qt application when receiving SIGTERM, you are invariably directed towards this informative, yet needlessly complicated, page full of code snippets: Calling Qt Functions From Unix Signal Handlers. So I gave it a shot and wrote a class wh...

Q: using map() over labels and keys with Conditional (ternary) Operator

Isak La FleurHow can I make this code block shorter? I'm repeating myself, because of this prop cellRenderer. {headers.map((header, i) => { return header.index ? ( <Column label={header.label} dataKey={header.id} disableSort width={100} ...

This should probably be on Code Review - not Stack Overflow. — G5W 44 secs ago
probably should be posted on codereview if it's working code i would think — Kritner 42 secs ago
possible answer invalidation by ema-pe on question by ema-pe: codereview.stackexchange.com/posts/175037/revisions
@Duga No, that's ok.
@Vogel612 300 slides? For UML?
3:29 PM
BPMN, Metamodeling and a Lecture Conclusion
but I have ~180 for UML finished, which are not included here
3:44 PM
@Zeta UML isn't solely class diagrams...
Q: Building objects in javascript, without "if(!a[k]) a[k] = []"

user1272When building objects using reduce, I often have crappy code like this: //k, j, and v are all variable if(!collector[k]) collector[k] = [] collector[k][j] = v; return collector; I would love to one line this, but I can't figure out a way to do it. If only assigning a property to undefined cre...

Q: Text height animation strange behavior with position absolute and bottom 0

GordonFreemanI'm working on some text fill animation using :after element position on top of the text and animate the height of it to make the fill animation. It's working well with position absolute and top 0 on my after element. Now if I want to make the same animation of the height but in the oposite dire...

4:06 PM
@Vogel612 I just realized that I didn't create any UML class diagram so far. Thanks, doxygen.
I mostly need sequence, activity and state diagrams at work. And sometimes, sometimes use case.
I'm honestly surprised that people seem to use these
I haven't been working on extraordinarily complex programs though.
They make management happy, because management can follow nicely drawn arrows.
why would management want to know how the innards of an application work?
@Zeta My management doesn't usually care how things work, except the VPBIS, who just wants to know what can fail. Lol
or: why would they want to see anything other than a summary of testcases and testcoverage?
4:11 PM
@Vogel612 Use case diagram, not necessarily class or component diagram.
Do you count software product assurance management to management, or product assurance? And yes, the acronym is hilarious.
Is there a separate section for code review or a different site altogether @tambre — 3L3C7R0 42 secs ago
@3L3C7R0 Yes, it's called Code Review. Make sure to check their on-topic criteria, though. — Zeta 9 secs ago
@Zeta As soon as that is a separate department it's not really management anymore
and if they're not a separate department, then it's a middle management concern
My bad, wasn't talking about high-level management. Or whatever I should call it.
usually people say C-Level or something.. not sure how large your employer is
Heh. No comment about that.
@EBrown VPBIS? Vize-president of Business .... Actually, my acronym finder fails here.
4:17 PM
@Zeta Vice President of Business Information Services.
We're BIS instead of IT.
Huh. Close.
Providing highly aggregated information on unpredictable quiries, according to my lecturer
(And I just notices I mixed English and German; again)
hmm ... I didn't even notice. Then again I guess I'm making similar mistakes regularly
I've migrated this to Code Review; general rewriting of your code is too broad a subject for Stack Overflow. — Martijn Pieters ♦ 10 secs ago
4:25 PM
@Zeta Yeah, basically our "CIO"
Q: Convert a "old" XMLHttpRequest to ES6 fetch() or using the lib axios

Isak La FleurI would like to know how I can convert this code to ES6 with fetch() or using axios. componentDidMount() { const xhr = new XMLHttpRequest(); xhr.open("get", "/admin/dashboard"); xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); // set the authorization ...

Q: How can I avoid using global variables in this code?

over soCan this code be optimized to not use global variables since they are considered bad practice? import random def checkForBum(tal, bummer): if(not tal%bummer) or str(bummer) in str(tal): return "BUM!"#returning a boolean value would probably be more convenient, but there are requirem...

4:48 PM
Q: Encrypt and decrypt a message using AES-256 with GCM mode using Bouncy Castle C# library

RaghuGoal: Given a plain text message and 256 bit key, encrypt (and subsequently decrypt) the message using a 12 byte IV (in this case null bytes for simplicity, should not do this, I know :-)) with MAC of 128-bit length using GCM mode of AES symmetric algorithm with/without Authenticated Encryption w...

Q: Abstract Base Classes for an easy challenge on HackerRank with Python 3

HarryI am practicing some exercises on HackerRank in order to improve my skills on Python 3. I am doing the 30 days challenge track. There is one challenge involving Abstract Base Classes and inheritance. I must admit that I am not really comfort with the OOP paradigm. I need to brush up my skills on ...

5:02 PM
Q: Simple Blackjack game in console (update)

RickA couple of days ago I posted the code for my Simple Blackjack console game. I have got some good reviews and since then I have been trying to improve the code. That previous question can be seen here: Simple Blackjack game in console I think I have treated every issue that was put up by the pre...

Q: How can I efficiently retrieve keys from a dictionary in Python and delete items based on that?

Sreedhar DanturthiI have two dictionaries boyNames_Rank_Dict, girlNames_Rank_Dict. These dictionaries have basically names of Girls and Boys that are named in that particular year. And they are ranked based on the frequency of their naming. To elaborate if John is named 101 times and Johan is named 130 times they ...

5:21 PM
Q: Python basic arithmetic compiler

MelkorI am attempting to follow the "Let's build a compiler" tutorials, in order to build a basic language compiler for a custom assembly language. Currently the specs of my compiler are: Accepts a single positive integer of any length as input Accepts two single digit numbers† with a "+" or ...

5:35 PM
This might be the type of question that you would ask on Code Review. They accept questions about how to improve working code. It doesn't appear to be suitable for Stack Overflow. — Cody Gray ♦ 53 secs ago
Q: Exchanging a For Loop for a While Loop

IDCODERI'm working on an exercise at Code Academy that utilizes a while loop instead of a for loop. However, even after correctly writing a while loop I'd like to also write a for loop just for the challenge. Can you show me where I'm wrong in my for loop code? Instructions given (via hint): If we crea...

5:52 PM
Q: Event handler re-use in Javascript

S MeredithI've been trying to deal with a lot of duplicate code in the first web pages I've been working on and have been playing around with the prototype model, which I think is the 'right' way to go about it. What I'm not sure about however is if this is the right way to re-use event handlers. For exam...

6:22 PM
Q: C++ Benefits or drawbacks of "#define PURE 0"

dgnuffI found this in some code I "inherited" from another programmer who wrote it quite some time ago, and has subsequently left the company. While I like the use of the word PURE since it's a bit more descriptive than an integer 0, it does use "an unholy macro" to get there. Is there a way of doing...

Q: Collating list of dicts to table format

MoxI've got a list of dicts like: data = [ {'date': '201410171311', 'test': 'Test b', 'value': 30, 'range': ('10', '30')}, {'date': '201610310152', 'test': 'Test A', 'value': 6, 'range': '<=10'}, {'date': '201410171311', 'test': 'Test A', 'value': 8, 'range': '<=10'}, {'date': '2017...

@CaptainObvious Primarily opinion-based?
@200_success Yes.
Wow, just read documentation requiring the use of a 202 HTTP Accepted response code.
@200_success I'm stealing your display name style.
6:45 PM
@202_accepted 418_im_a_teapot?
@Zeta Nah, too obvious.
402_payment_required <-- the answer to a surprising amount of SO questions
@Vogel612 Hah! That would be hilarious, lol
Q: Grouping work hours for consecutive days

alecxeProblem Description The problem was initially posted here: Parse and clean up text block of store hours in Python. Given the following multi-line string: """Hours Monday 9:30 AM - 9:00 PM Tuesday 9:30 AM - 9:00 PM Wednesday 9:30 AM - 9:00 PM Thursday 9:30 AM - 9:00 PM Friday 9:30 AM - 11:00 PM...

@Vogel612 And 400_bad_request would be the answer to many CR questions ^^
6:57 PM
harsh, but true...
@Zeta More like 406_not_acceptable am I right? Lol
Stack Overflow is not a site for reviewing code or writing it for you... here is a site for on-the-point question about programming in general. If you want your code reviewed you can try asking on Code ReviewGrayCygnus 49 secs ago
Q: Type to represent multiple possible values

ThisIsNoZakuI created this type for use in a "Wizard"-style user interaction. In each step, the user chooses an option called a Modifier and each of those options contains subselections that must be made. These Modifiers are stored with two parallel structures, one of the fixed values and a second of the se...

7:24 PM
Q: Kotlin idiomatic code

CodingMouseI am a Java developer, and I recently gave a try to Kotlin. To begin, I did a little exercice I often do when I start a new language, to verify I got the very basics : the more or less game. The code I submit there is working fine, but of course I suspect it may be too much like Java, and I would...

Q: The placement of database files in a shared folder

Ant_222Is it a normal practice with MS SQL Server to place databases in remote shared folders on a fast local network rather than on the physical HDD where the server software is installed? What problems shall one fear that local placement avoids? For example, can a network glitch cause .mdf and .ldf to...

7:39 PM
Q: Creating a Stripe Subscription

Jezen ThomasI have some working Haskell code in a Yesod application that is responsible for creating a new paid Stripe subscription for a user. Although it works, I'm not pleased with the walking indentation that appears as a result of nested Either case matches. module Handler.Purchase where import ...

Congratulations to @alecxe on passing 10k!
(a couple of days ago)
In VS 2017, I had to go into Tools -> Options -> Work Items and change "Open work items in" to Visual Studio instead of the default browser to see the link in Step 5. Otherwise, it opens the work item in my browser (where there is no such link to "Open Code Review in Team Explorer") — user735232 1 min ago
7:57 PM
Q: String manipulation library

Matt95I have to manipulate an input string that looks like this create /foo create /foo/bar write /foo/bar "text" create /foo/bar/baz And I've created this program (you don't need to look at all of it) and the problem I have is with the function printAllFolders() which is called in the last "else" o...

8:09 PM
This question is technically off-topic for stackoverflow and is perfect for sister site, codereview.stackexchange.comWill Barnwell 1 min ago
1 hour later…
9:10 PM
Q: This code animates a mobile menu

stack overflowI feel like there are a lot of anti-patterns. I want to refactor to make it cleaner. I am aware that in general you don't want use jQuery with React, but in this case it works fine. import React from 'react'; import $ from 'jquery'; class MobileMenu extends React.Component { constructor (pr...

9:45 PM
possible answer invalidation by jrtapsell on question by Tomasz Waszczyk: codereview.stackexchange.com/posts/175052/revisions
9:56 PM
If this code works fine, then this question is off topic on Stack Overflow, but may be good for our sister site Code Review. — Joe C 18 secs ago
10:20 PM
Q: JS - Splice from Array if index matches

user148450for (var i = $rootScope.watchlist.length - 1; i >= 0; i--) { if($rootScope.watchlist[i]['id'] == titleID) { $rootScope.watchlist.splice(i, 1); break; } } The code above loops through an array called $rootScope.watchlist (uses AngularJS). It gets the current iteration of ...


« first day (1588 days earlier)      last day (649 days later) »