« first day (1549 days earlier)      last day (2764 days later) » 

00:00
RELOAD! There are 4212 unanswered questions (90.8622% answered)
00:10
0
Q: RESTFulness of /actions endpoints

samfrancesI have been looking at examples of good REST APIs, and I read that Rackspace's cloud servers API is often cited in comparison with AWS's RPC-like EC2 API. However, I also saw that their API reboots a server like so: POST /servers/{server_id}/action { "reboot" : { "type" : "HARD...

00:38
You made a copy of this question at codereview.stackexchange.com/questions/171614 . Please delete this one at stackoverflow. — Peter Rader 8 secs ago
0
Q: New to programming

CoderKliptoI am new to the coding world as well as this site. I have been learning Java by myself for a few days now and wanted to make a gambling program just for fun and practice. I am going to ask two questions, one short, and one long. I'll ask the long one first! How does my code look for a beginner? ...

00:57
1
Q: PEG.js grammar for a simple programming language

OlgierdI'm trying my hand at developing a compiler and have written a PEG.js grammar for a simple programming language. A sneak peak at the grammar: /* calculates fibonacci sequence */ fn fibonacci(n int32) int32 { /* termination */ if n == 0 or n == 1 { return 1; } else { r...

01:08
1) You're getting downvoted because you're posting working code here instead of on Code Review 2) That's pretty much as good as you're going to get unless dir /s is somehow faster and I don't know about it. — SomethingDark 40 secs ago
01:27
Heyo, if I've got a program I wrote real quick and didn't comment, would you guys prefer me to add bare-bones comments, or leave it uncommented?
0
Q: Package structure for my 2D Bin-packing Algorithm

Solomon BothwellI've put together a 2 dimensional bin-packing greedy algorithm. I plan to use it in a flask web application for Carpenters to find optimal yields from sheets of plywood. The algorithm is working fine, but this is the biggest project I have ever implemented (I'm a beginner..) and I'm not really ...

What's wrong with using brute force? There are only 1440 minutes in 24 hours. (BTW, if your code works, this question should maybe be posted at codereview.stackexchange.com) — squeamish ossifrage 22 secs ago
kk.. I am practicing for interview. They are always looking for a optimal solution. I think my current algorithm is OK. Let me try it on the codereview site — wrek 48 secs ago
 
3 hours later…
05:07
Monking
This question seems more suited for codereview.stackexchange.comOfer Sadan 57 secs ago
0
Q: how to speed up python function - sklearn custom transformer (label encoder & imputer)

Georg HeilerI have a pandas.Dataframe with a single (new) record and the following function: self.encoders # is a dict and stores a sklearn LabelEncoder() for each column self.fillNewLabels # is a pd.Series and has an entry for each column with the most frequent element def transform(self, data): for c...

05:26
I fell that this question belongs on Code Review, which is a Stack Exchange community focused on the writing of clean, efficient code. — George 50 secs ago
This will happen - instead of having to check 10 collisions per frame the game now has to check 30, so the physics of the game runs thrice as slow. If the framerate is synchronised to the physics update, your game will run thrice as slow overall. Make the collision code faster, or deal with a lower number of circles. This is more of a Code Review question anyway. — Tamoghna Chowdhury 54 secs ago
0
Q: Shorten codeSize of Lisp Interpreter written in JavaScript

Akshay IyerI had a task to reduce my lisp Interpreter from 400 lines to 120 lines. I was able to bring it down to 255 lines without including newline after every function. I'm not able to figure out where I can reduce the lines of code. I wanted a different perspective to my code probably a repeating patte...

 
1 hour later…
06:48
Your question is best suited for codereview.stackexchange.com — Pradeep Simha 11 secs ago
0
Q: C++: Implementation of Stack using Linked List

coderPlease review my code and help me to improve it. I have written this code using template. Can I use more C++11? Is using top in this code is necessary? #include <iostream> template<class T> class Stack{ struct Node{ T data; Node *next; Node(T val):data(val),next(nullptr) {} }; Node *head...

07:03
1
Q: Java 8 and Optional use

Mateusz SobczakI start to learn Java 8 and I wondering is that kind of using Optional class is correct? @Override public Response confirmRegister(Request request) { return mailTokenRepository.findByToken(request.getToken()).map(mailToken -> { if (mailToken.getTypeToken().equals(TypeToken.REGISTER) ...

07:45
possible answer invalidation by G. Foster on question by G. Foster: codereview.stackexchange.com/posts/171351/revisions
07:55
possible answer invalidation by SleepingPanda on question by SleepingPanda: codereview.stackexchange.com/posts/171420/revisions
08:25
Well, there is always codereview.stackexchange.com - but you want to study their policies clearly, and probably come up with more precise questions there, too. — GhostCat 6 secs ago
08:36
0
Q: Discrete slide mechanism (with average rating display) for liking posts on a social network app

santafeboundI'm thinking about implementing a "liking" mechanism for a social network app (using Parse) whereby users select a value from a discrete slider beneath each post. The slide would range from 0-5 and reflect the post's value to users. An example of the slider is below: https://material.io/guidelin...

possible answer invalidation by SleepingPanda on question by SleepingPanda: codereview.stackexchange.com/posts/171420/revisions
0
Q: Instance registry for keeping track of class instances

SquidyIn my project, I need to be able to iterate through all living instances of a given class. I ran into a problem regarding static initialization/deinitization order where when an instance attempts to remove itself from the registry (in its destructor) when the program exists, there's a chance that...

08:51
@SimonForsberg SO doesn't learn. Yes, some of the older users have learned. Some of the moderators have learned. But we still get plenty of wrong comments. Duga's mission hasn't finished IMO, but it definitely helped.
6
09:05
0
Q: Rolling dice simulator with probability

raven rogueI'm a begginer at python, and to start off my learning progress I created a simple program which will roll a dice and decides the probability of it. Below is what I currently have: import random rolled = [] rolledtimes = 0; biggest = [] freq = int(input('How many times would you...

09:23
If you have working code, and want a review of that, then the place to post is codereview.stackexchange.comSome programmer dude 54 secs ago
09:38
@Duga rolled back
10:14
0
Q: How is it possible that my a std::list iterator randomly points to null?

mrclngI am iterating over a std::list of adresses. In the innermost loop I select elements from the list and delete them so in the next loop I do not check them again needlessly (tester.test() and the CV lambda are quite expensive). The code compiles and actually runs most of the time without issues! ...

@CaptainObvious Nope.
Monking
Monking @Vogel612
@StepHen whatever you'd do when the code's supposed to go into production
How is the temperature down in Stuttgart? After this weekend it's more bearable, right?
10:35
Right, but still 29.7 °C in my office
10:46
One of the advantages of this office: the airco is bloody awesome.
The heating part isn't half as good though, but nothing a good jacket can't fix in winter.
Would you like to ask this question on <a href='codereview.stackexchange.com/'>; Code Review</a> — ksai 22 secs ago
@ksai The code is not currently working so it is suitable for stackoverflow, and not suitable for codereview — Mel 20 secs ago
11:02
0
Q: Sprite animation with SDL2

saelekoFor the past few days I've been trying to learn how to animate 2D sprites using SDL2. For that purpose, I've taken a 6 frames animation from a Pokémon game and made a PNG image out of it : The way I figured out would work fine is is by creating an array leaf_frames (Leaf being the name of the ...

Post it on CodeReview then. — Rahul just now
@deceze This isnt codereview. — Kaspars 24 secs ago
11:27
@Rahul No. There's no code to review, so this is highly inappropriate for Code Review. — Mast 56 secs ago
@Duga @SimonForsberg Case in point.
Greetings, Programs.
11:52
0
Q: Background image checker for 404 error, typescript

 vadimka 404 code checker for background image, if 404 - replace with original and crop with nginx. I resize images and add new size to filename (original: 'funny_cat.jpg', resized: 'funny_cat_320_320.jpg'). If resize script haven't finished, checker replace 404 image with original and crop by nginx. Wh...

12:07
0
Q: Exception Handling Helper

PhoenixThis is some code that I found in a project I work on. Please tell me that I am crazy and that this code is good. Please do. public class ExceptionHandlingHelper { static IExeptionHandlerProvider _exeptionHandlerProvider = null; static IExeptionHandlerProvider ExeptionHandlerProvider ...

@Donald.McLean Greetings, User
12:25
0
Q: Correctness of PRNG / DRBG from Fortuna - C#

ligosI'm writing a C# implementation of Fortuna, and have implemented the core PRNG / DRBG which should produce a uniform distribution. I've run a variety of statistical random test suites over the output (Dieharder, TestU01, RaBiGeTe, PractRand) and there were enough border-line results that I'm sli...

12:58
If your code works, and you're looking for more efficient code, I would consider that more of a code review question. — Jason 10 secs ago
Kaz
Kaz
13:08
Monking @all
Monking!
Kaz
Kaz
A sign of how busy my morning's been, 2pm before I finally get in here ^^
@Mast Seems like that was well meant though, and correct, considering this comment:
No, the methods. that I know are slow. So I need fastest method — Nurislom Turaev 2 hours ago
Assuming the OP actually has existing, slow, code, CR would be a fine place.
@SimonForsberg Methods he knows, not methods he implements.
0
Q: An efficient Assert class/macro

MattMattHere's a simple Assert class I made recently. The requirements were the following: Using C++11 features (no C++14-17) A simple macro interface, that is hard to misuse. Being able to attach a Dialog to the assertion message at runtime. Here is what my code looks like. Any suggestions, idea...

13:18
@SimonForsberg Having said that, the overall comment still stands, in general.
possible answer invalidation by JMichael on question by JMichael: codereview.stackexchange.com/posts/171455/revisions
13:36
0
Q: HashMap Implementation

Jae BradleyPurpose I've never implemented a HashMap and thought it would be a good data structure exercise. I tried looking at the Java source code as little as possible. Discussion The HashMap was made up of an array of Entrys. Each Entry is points to another Entry (or null if it's the last Entry in the...

13:47
@Duga rolled back
1
Q: Refactor shopping cart jquery code

M-Misha-MI implemented shopping cart with asp.net and jquery on my website , and here is my js code which calculates amount and total sum on client side: $(document).ready(function () { update(); $(".quant").change(function() { update(); }); fun...

14:38
Code Review questions should be posted on the code review Stackexchange. Not here. — Murat K. 38 secs ago
You seem to have no error. Code Review Stack Exchange would be the right site for this — Anthony Pham 46 secs ago
I agree with the others on the code review section. However as a small hint to solve the probem yourself: You already identified nums[i] != nums[j] to be a problem depending on whether on not the same number is contained multiple times. You do know the position in the array This should be enough for you to tell the 4s of your example apart. — Akunosh 18 secs ago
14:58
This would probably be a better post for codereview.stackexchange.comJack 50 secs ago
possible answer invalidation by M-Misha-M, Sam Onela on question by M-Misha-M: codereview.stackexchange.com/posts/171651/revisions
:39Looks ok.
This question belongs to codereview.stackexchange.comFlown 50 secs ago
I'm voting to close this question as off-topic because it belongs to codereview.stackexchange.comFlown 1 min ago
15:14
0
Q: querySingle function for PDO

GrumpyCroutonI have been refactoring a lot of my old code lately, and with that I have been switching from sqlite3 to mysql using PDO - sqlite3 has something called "querysingle" that allows you to return single responses (as a row or a single value) from a database table. Anyways, I really liked the simplic...

0
Q: Graphics API Agnostic Rendering Library Design / Architecture

viktor zoutmanCode Review Hey, I'm looking for some feedback on my general library architecture of my graphics API agnostic rendering library. I'm not really looking for feedback yet on my vulkan implementation (Or what functions/handles I have) because it is still very work in progress. Here is the git repo...

15:29
1
Q: Is this implementation of CompareToBuilder considered inefficient?

MBAButADeveloperAnywaysDuring peer reviews, a developer seemed horrified at the thought of implementing the compareToBuilder solution I chose to sort by 3 attributes. He is under the impression that the compareTo method in my class would create an inordinate number of comparators, for each individual comparison, and th...

0
Q: Is there a better way to write this function?

Arslan.HI'm developing a MVC structured RESTful API project (thanks to the help of Mārtiņš Tereško for explaining it). Almost all of my functions look similar to this: /** * Insert Tag */ public function insertTag(Tag\Tag $tag) { try{ //Names $name = ...

15:40
I'm not sure if I can explain this correctly... These are some info related: 1) gerritcodereview.com/releases/… 2) en.wikipedia.org/wiki/Digest_access_authenticationMarcelo Ávila de Oliveira 47 secs ago
0
Q: Checking whether two input strings are isomorphic in Java

coderoddeGiven two strings \$a = a_1 a_2 \cdots a_n\$ and \$b = b_1 b_2 \cdots b_n\$ (of equal length \$n\$) over the alphabet \$\Sigma\$, the two strings are isomorphic if there exists a bijection \$f \colon \Sigma \to \Sigma\$ such that $$ a_1 a_2 \cdots a_n = f(b_1) f(b_2) \cdots f(b_n). $$ For example...

16:00
Monking
0
Q: Java. Check style found code duplication in factory

SergiiI've got some methods in my mapper: public EventDto mapToDto(Event googleEvent, EventDto baseEventDto) { EventDto eventDto = mapToDto(googleEvent, baseEventDto.getOriginalCalendarId()); eventDto.setCalendarId(baseEventDto.getCalendarId()); eventDto.setCollectiveId(baseEventDto.getCol...

16:20
0
Q: Good Object oriented Quarantine implementation

user1964141I am a newby in thinking object oriented solution for a problem.So i am trying to improve.I have tried to implement a quarantine assignment. Here is a requirement with unit test cases public class QuarantineTest { private Quarantine quarantine; @Before public void setUp() { ...

If this code is working then you will want to put it up on CodeReview: codereview.stackexchange.com. StackOverflow is intended for questions where the user is unable to make the code work properly. CodeReview is for working code that you hope to improve. Once you put it up on CodeReview let me know and I can see what I can do :). — Brandon Barney just now
Make sure you read Code Review's help centre before posting there, but yes, this question looks like it could work there. — Mast 17 secs ago
16:42
Turns out frameworks do tend to make sense when you take the time to read what they do
5
0
Q: Nested Loop Taking Too Long (VBA-EXCEL)

AngatvirI'm trying two loop through two separate sheets going row by row starting at row 2 comparing multiple columns (Product Number, Date, Quantity) in Excel using VBA but my nested loops are taking way too long. Is there another way to loop through cutting down on time but being able to compare multip...

17:28
0
Q: Injecting the Repository into the business layer

mirind4I am developing an application using Asp.NET core with MVC framework. I would like to ask your opinion about whether I inject my repository in a good way into my business layer. First of all, lets see my IRepository interface: public interface IRepository<T> { IEnumerable<T> GetAll(); T ...

17:41
I want to simplify the code below - how do you want to simplify it? A possible candidate for Code ReviewScott Holtzman just now
This question is better suited on Code Review. — Rodrigo Leite 39 secs ago
This should be posted over at Code Review. Stack overflow is for specific problems/questions you are having. — Adam LeBlanc 47 secs ago
I'm voting to close this question as off-topic because it belongs on codereview.stackexchange.comAndreas 34 secs ago
Any of you guys on Quora?
this room currently lacks the quorum required to effectively answer that ;)
18:01
0
Q: Optimized computation of pairwise correlations in Python

neither-norGiven a set of discrete locations (e.g. "sites") that are pairwise related in some categorical ways (e.g. general proximity) and contains local level data (e.g. population size), I wish to efficiently compute the mean correlation coefficients between local level data on pairwise locations that ar...

0
Q: Script that monitors a company's shareprice if it is mentioned by someone on Twitter

semaJOriginally started with a DonaldTrumpStockMonitor, which was a bot that checked Trump's tweets to see if he mentioned a company. If he did it would monitor the shareprice of said company for a week. I've rewritten, would love some critique :) https://github.com/semaaJ/TwitterStockMonitor

Please move this to codereview.stackexchange.com it is too broad for this forum. — Scott Craner 20 secs ago
@DanLyons lol
Technically, 'any' would require only one Yay vote.
@grek40 Still too broad. Questions asking for improvements to already-working code belong on Code Review, not Stack Overflow. — TylerH just now
@Legato Reading sometimes, but not answering anything.
@DanLyons I was hoping to trigger one. I'd say it's semi-successful.
18:20
There's always people lurking.
5
@Mast Of course
2
Just helping get your question to the correct people. This site is for problematic code not code that works. CodeReview is for code that works that needs to be tweaked to improve performance. Many who frequent this site frequent that one. It belongs there and not here. — Scott Craner 39 secs ago
@Mast Boo
@syb0rg Robots don't say boo...?
@SimonForsberg 0xB00
7
18:29
Much better
@Mast Robots too!
2
0
Q: I'm exporting an object to a file, how do I import it?

MMAdamsI have my own type of object, which implements Serializable. Here I have one called "extendedFormat" (not a terribly helpful name, yes, I know). I'm writing it out to a file like so: try { // is this the best way to do this???????? // this seems like too many streams perhaps. // like...

@syb0rg That deserves 11 stars.
lol
@Legato or 2816, depending on which endian you use
18:58
I think that is a question for codereview.stackexchange.comJanDotNet 24 secs ago
1
Q: vba - FOR LOOP macro needing optimization

Mike MirabelliI have the following VB macro, which works fine, but the problem is one section of the macro which is this for loop (in bold), which is reading the cell value in the selection, and then looking in all sheets in the WB to find the match, and then insert that row into that sheet and then exiting an...

19:14
22
Q: Is there a NOTAM code for solar eclipse?

Giacomo CatenazziSun eclipses have some noticeable effect (e.g. drop in air temperature). Inspired from Eclipse Flights (xkcd) I'm curious if eclipses are notified as NOTAM or as weather notice. How? Never seen such notification (but there are also few sun eclipses).

Did anyone here have experience with DigitalOcean?
0
Q: Memoization in the balanced partition problem (DP)

jschermanI'm trying to implement the Balanced Partition problem, where given a sequence A of $n$ elements you have to determine if it's possible to partitionate those elements in two sets $A, B$ such that the summation of each elements in both sets are the same. So, to solve this, i considered that on e...

0
Q: Address Duplicate Medical Claims (with SQL Injection GUI)

puzzlepiece87These are some pieces of a program I wrote to help my team automatically analyze and fix medical claims that have been rejected. I have two objectives in getting this reviewed: I thought some people might be interested to see what I have done to allow my team to modify a base query through what...

19:31
@skiwi Ctrl+F
@Mast Not too much then, though it seems Dan has some experience
I finally managed to connect to my PostgreSQL database via SSH tunnelling
19:50
1
Q: Efficient way of reading in list of string csvs' into lists

kPow989I have a list of strings. Each string is a comma separated list of numbers. I want to quickly convert each of these strings into a list. So far I have done the following: My Solution So Far def convertCommaSeperatedStringToList(data): s_lists = [] for s in data: s_list = [int...

0
Q: Java find minimum range

Angela PanQuestion Description: Given a list of companies, eg {ABC, BBC} and a large list of data looks like below: Timestamp Security 10000000 IBM 10000001 Apple 10000005 PEAR 10000008 ABC 10000012 BBC Find minimum time range where you can find all companies from list above. My solution works ...

@Mast That's what I always use when I'm looking for something :)
I've searched chat for Factorio, AWS, OSGi, lots of stuff.
@SimonForsberg Factorio... I'm sorry
@enderland Sorry for what?
Factorio is a trap
You don't say?
I've published three mods for it though: mods.factorio.com/mods/zomis
19:55
I've not yet played with mods
But there are enough useful ones I'm thinking about it
@enderland At least you know where to complain if you're using Simon's mods :)
the main ones I want are the tiered solar and the "on/off" red/green lights on assemblers
I'd love to get feedback on my mods.
I'd love to get pull requests even more.
I'm about to the point where I'm building a megabase, and nuclear power is annoyingly UPS heavy
19:57
@enderland I think you mean the "Bottleneck" mod for the red/green lights on assemblers
@enderland You might like my "What is missing" mod, but it might also be UPS heavy. I'd love to hear about what the performance of it is on your base
The best thing about Factorio mods is that it is so well supported. Not like Minecraft where you have to modify thousands of files (or use thousands of launchers to do it for you)
@SimonForsberg it's not clear to me what that does from it's description... :P
@enderland Could you say "What is missing" from the description to help Simon ? (sorry I had to make a joke)
20:01
@enderland That means that maybe I should improve the description... but you can see the screenshots. In the first screenshot, the mod detects that labs are missing red and green packs, green packs are missing transport belts, which is missing iron plates, which is missing raw iron.
I'm not sure what it's doing or what problem it's solving Iguess
oh, gotcha
So if you get more raw iron, perhaps that will solve everything
So... it solves all your problems ;)
20:13
This should be on code reviewrickdenhaan 33 secs ago
20:38
0
Q: Checking balance of a travel card with Selenium

Lukasz SalitraA Leap Card is essentially a travel card for Dublin, Ireland that can be used to pay for a bus or tram fare. It has to be topped up and I often forget how much I have left on it. To get familiar with Selenium, I wrote some code that gets the balance for me. I haven't worked with this framework b...

20:52
0
Q: Angular 1 CSS Encapsulation

Michael WarnerI am trying to get a good clean way to do CSS Encapsulation in Angular JS. The main goal of this is to use isolated components. This is what I have come up with so far. The method I am using is something I have seen used with React Native. You define a JavaScript object and place all your sty...

21:11
@SimonForsberg is modding factorio hard? enderland hasn't looked
your mods all have a ton of files though :(
@Kaz Made tons yet?
21:38
0
Q: Instantiating a Database connection class in PHP

user3628807I am building my own MVC and I have a couple questions about making a database connection and what is the best practice. I have a model User which interacts with the database and I wonder what is the best practice to instantiate the database connection class. Currently I made it so my User class ...

21:52
0
Q: Simple Queue Implementation

Jae BradleyPurpose As I've never implemented a queue, I decided to create a very simple implementation using a linked list approach. Discussion I create a singly linked list, using a private Node class that references some data and a previous Node, that will be used in my SimpleQueue class. When enqueui...

22:25
FYI: It sounds like you have functional code, that is just not up to the performance level you desire. Review of functional code (and explicitly for performance) is on-topic for Code Review. However, you have to actually put your code in the question (which is generally a requirement here too). — Makyen 5 secs ago
22:40
0
Q: Applying Scikit-Learn Linear Kernel with a generator for low memory pressure

James Allen-Robertsonmatrix = # a sparse matrix of TFIDF vectors - 28458x3218988 My aim was to create a similarity matrix comparing all documents to all documents using sklearn.metrics.pairwise.cosine_similarity but the doc notes indicated that with normalized values, such as TFIDF vectors, that `linear_kernel' was...

@Kaz: As a code reviewer, I would bristle at a direct comparison between an unsigned variable and -1. The code would have one of two unambiguous meanings depending upon whether the unsigned value is large enough to avoid promotion, but I would consider the code clearer if it made clear what it's actually asking for, e.g. comparing to (uint32_t)-1 if that's what's desired. — supercat just now
23:31
I am going to add a few more classes from my networking layer to give you a better idea of how it comes together. Since I am self- taught, and have never truly gotten any of my code reviewed, I'd really appreciate if you could point out any gaping flaws. your willingness to help this far has lead me to assume you don't mind doing so. Sorry for making that assumption. You've been a great help. — AnonProgrammer 52 secs ago
23:44
what did the class say to the object?

« first day (1549 days earlier)      last day (2764 days later) »