« first day (2142 days earlier)      last day (2171 days later) » 

00:00
RELOAD! There are 5893 unanswered questions (89.9124% answered)
Stack Roboflow now includes an archive of all the questions it has generated so far: https://stackroboflow.com/browse/index.html
They made a NN that comes up with SO questions, LOL.
00:17
0
Q: Pausable timer implementation for SDL in C

Mark BenningfieldI've written a timer module in C for an SDL game that I'm working on that I'd like to get some eyeballs on. I wrote this for 2 requirements: I needed a timer that would signal on an elapsed interval, AND that was pausable and restartable. The timers in SDL signal a callback on a set interval, but...

00:37
0
Q: ROT 13 for IntelliJ/ Java

user195319Need to be able to encode a file, decode a file, and give the word count using ROT 13. enter code hereSystem.out.println("Please enter a file name"); enter code hereScanner keyboard = new Scanner(System.in); enter code hereString fileName = keyboard.nextLine();

01:15
0
Q: make XML, send it, receive response

NekoNekothis code works as intended, copypasta and it works. as long as the proper configurations are made on your test server. <?php $servicio="https://www.dataaccess.com/webservicesserver/numberconversion.wso?WSDL"; //service URL $parametros=array(); //call parameters $parametros['ubiNum']=23;//ac...

0
Q: Am I looking at tightly coupled code here, entity framework 6?

CMRHonestly, I have been really trying to read up and learn the best techniques for uncoupling different portions of my applications. I have such a long way to go in regards to this and entity framework 6. I was hoping to post this small sample and get some feedback as far as tightly coupling was c...

01:54
0
Q: Reading from JSON files, basic calculations and writing over another JSON file

EmmaReview Class SectorController calculates coefficients for sectors of equity exchange markets using minute data from an API. Would you be so kind and review this class, which is also connected to some other classes, some of them I will post after this review? I have simplified and added some du...

0
Q: Adventure Game (Text Based) c++

JustinSo I'm working on a simple text based adventure game. I've just finished working on the character creation portion. The code works perfectly fine when run, but I would just like to get some feedback to ensure that it checks off from a professional and efficient standpoint. Thanks! Code: #include <

 
1 hour later…
03:03
Put this question in codereview; you'll get some good answers. Personally, I'd say the 2nd approach is favorable since the function is private and is not accessible from outside the class, you don't need the ability to pass anything to it. As for testing, you're still going to have to create a MyClass object which requires a username in its constructor so your test will look like $obj = new MyClass('user_name_already_exists'); $this->assertEquals(false, $obj->register());. — waterloomatt 50 secs ago
@waterloomatt ah that's a very compelling reason never thought about that before. Will try to post in codereview too. Thanks! — hrsetyono 31 secs ago
0
Q: Best Practice for Class Variable within Private Function?

hrsetyonoI know this is a subjective question, but it's been haunting me for years. Let's jump straight to a simple Example: class MyClass { private $username; function __constructor( $username ) { $this->username = $username; } function register() { if( $this->_has_duplicate( $this->u...

All code needs to be posted directly in the question. Also, if the code is complete and works, but just can be improved, it should be on Code Review, not here. Note though, they also require all code to be posted in the question. — Carcigenicate 50 secs ago
03:56
TTGTB... 5AM T.T
04:11
0
Q: Implement LinkedList class in python

A.LeeI am currently study the basic data structure and trying to implement everything as I go. can anyone give me some feedback about class LinkedList how to make the code more elegant. any review are appreciated. class Node(object): def __init__(self, data, n=None): self.val = data ...

05:09
0
Q: Mutable Linked List in Scala

Aashish DattaniScala newbie here. I'm trying to implement a mutable linked list in Scala. So far, I am only supporting the add() operation. Here's my stab at it: class MutableList[T] { class Node[T](val value: T) { var next: Node[T] = null def hasNext = (next != null) } var first, last: Node[T]...

05:28
0
Q: this.props.removeFromFavs is not a function

m4rsib4rIn the main component theres a function removeFromFavs = id => { console.log("removed", id); }; which is then passed down through props <CharacterList characters={this.state.characters} search={this.state.search} ...

0
Q: Generate a Style Tag and Append to a Document

EmmaCode Review I have two functions of styleAppend and getCss, which generate and append a style tag to a document. Would you be so kind and review them and help me to possibly make it faster, simpler or more efficient? I'm hoping it would work with earlier versions of IE and other browsers. st...

0
Q: In CodeIgniter, how To display a view page in a particular div element

GRVI am working on a project using codeIgniter. I got stuck in a UI part. I need to display a view page inside a div element, but instead of displaying in the div either it is getting displayed in the new tab or nothing is working. Can anyone provide me the solution for this ? <script type="text/...

0
Q: Python: Extract principal components

jss367First, I am aware that this can be done in sklearn - I'm intentionally trying to do it myself. I am trying to extract the eigenvectors from np.linalg.eig to form principal components. I am able to do it but I think there's a more elegant way. The part that is making it tricky is that, according ...

possible answer invalidation by Smith Dwayne on question by Smith Dwayne: codereview.stackexchange.com/posts/215253/revisions
Is this code working? If yes ask this in code review. — Rahul 40 secs ago
06:07
0
Q: Generate a Daily Sitemap and Update using a URL String Input

EmmaCode Review I wrote method generateSitemap, which is part of a large class, UpdateStocks. It generates a daily sitemap and can update it few times a day. generateSitemap has an input string and called inside a for loop, similar to: {pseudocode} for i=1 to 8000; get input[i]; // for examp...

1
Q: How can I fix this code to use try...catch?

user195336static double trycatch(double newint) { double input = 0; boolean thrown = true; while (thrown == true) { try { thrown = false; input = newint; } catch(InputMismatchException e) { System.out.pr...

Thank you DYZ, Rahul et al for the pointer. Posted on code review exchange. codereview.stackexchange.com/questions/215556/…RebornCodeLover 43 secs ago
06:26
0
Q: Is there a simpler way to write this python code?

RebornCodeLoverI have a list of strings. I need to list them in rows and columns. Each row should not have more than "cols" number of values. Each of the values in a given row should be "step" away from the previous value. The values should appear only once in the output. Here is what I have. Any better way to ...

If the code works, this probably belongs on codereview.stackexchange.comAlexander 40 secs ago
 
1 hour later…
07:36
This question might be a better fit for codereview.stackexchange.com. — Brian McCutchon 34 secs ago
07:48
@Vogel612 Shiny.
@Barmar As this question ask for a new feature (sort by id), it's off topic on Code Review. — Zeta 6 secs ago
Monking
 
2 hours later…
09:47
@yurmix I might be mistaken, but aren't you calling targetTime = targetTime.plus(period); in all branches? Then you can move this line before the several if statements (assuming there are no side effects in doing so). Please edit your question to include the full source code you have, maybe even a Minimal, Complete, and Verifiable example. Using codereview.stackexchange.com might also be a try since it is a question about refactoring your code. — Progman 41 secs ago
10:17
This question might do well on codereview.stackexchange.comtshimkus 17 secs ago
11:08
As this is example code (Foo, bar), it's off-topic on CR, @tshimkus. Please only recommend another site of the stack exchange network after checking their rules. See also codereview.meta.stackexchange.com/questions/5777. — Zeta 15 secs ago
12:21
Monking
12:50
If the code works and you just want someone to review it, you should post it in Code Review instead. — Magnus Eriksson 1 min ago
I'm voting to close this question as off-topic because the OP is simply asking us to review the code. It should be post it in Code Review instead. — Magnus Eriksson just now
-1
Q: Project Euler #10

tazajaPlease help with the code I've written – 1) it takes way too long, 2) it produces the wrong answer of 37550402023. the Problem is "The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two million." def is_prime(n): primes = [] for num in range(2...

I understand, but SO is for when you're having some specific issue with your code that you just can't solve yourself. What you are asking is for us to simply review your code and come with advice. That's off-topic here but on-topic over at Code Review. — Magnus Eriksson 48 secs ago
@Duga That would be a good fit, but there is no close vote on SO. @Yvette, your call.
13:12
0
Q: Load other files (from outside public_html) under index.php

J. DoeI wanted to load every page under index.php with a simple index.php?do=login For example when the link index.php?do=login or /login/ is opened, the file login.php is loaded (from outside public_html), and so everything is done under index.php instead of having a separate php file in public_html ...

13:41
@Barmar I added it to Code Review, and it's immediately being downvoted into oblivion. — Nicole Grimes 1 min ago
0
Q: Need to modify my current code. Any Simple solutions?

Nicole GrimesI'm just under 2 weeks into learning to code, and I built a working grade book program. Is there a SIMPLE way to modify this code from Just accepting and reproducing entered grades, to using a custom structure to allow for grades (0-100) and ID numbers for each student to be entered? When the gr...

@CaptainObvious @Duga there it is.
However, it is still salvagable.
Deleted
:(
13:57
@zeta I removed it from Code Review. I've done a decent bit of studying on Custom Structures, and how to implement them, I'm just too raw to comprehend how to plug it into an existing program. Like, I have these 20 Legos in my hand, and I know what they do and why, but I'm not good enough with them yet, to make anything other than clunky trash. :( — Nicole Grimes 13 secs ago
What VCS are you using where the code diff only shows the previous version? On the ones I’ve used, you can diff between any two versions. The VCS already keeps the relevant bits. Anyway, code review should have already been done before the new code makes it into master/trunk/whatever your VCS calls the main line; at that time, the old code can safely be discarded. So I’m just not seeing how this practice serves any purpose at all, beyond showing that you don’t trust your VCS. :) — Marnen Laibow-Koser 28 secs ago
It sounds like you need a mentor. Unfortunately neither Code Review nor Stack Overflow provide mentoring, they only provide reviews (CR) or answers (SO). I suggest you to split your new feature ("read all names, ids and grades, and sort them according to x,y,z") into several, e.g. "Write a program that reads student IDs, names and grades, and then prints them in the same order they were given". When you manage that task, you can post your result on Code Review to get some feedback. Alternatively, you can try to sort an array. Or: before you build a Lego Minas Tirith, build a small house :). — Zeta 39 secs ago
@zeta I built a tree fort. Now, I'm trying to hammer the "No girls allowed" sign to it, and my nails are weird and mysterious. :p — Nicole Grimes 24 secs ago
lol
14:29
-2
Q: Adding spaces to a string using backtracking

Omar ShallaI am trying to print all possible strings that can be made by placing spaces(zero or one) between the characters of the string. Example: For input 'ABC' we have: 'ABC' 'A BC' 'AB C' 'A B C' This is my initial attempt at solving the problem. The bug is that the space is ...

@CaptainObvious closed...
Monking folks
14:44
If you have something that works, but you’re looking for something better, I’d suggest you post the current solution on codereview.stackexchange.com and solicit feedback there. — Rob 10 secs ago
15:00
@stevedc this question might be better suited for Code Review if you want to ask over there. — Jack Moody 26 secs ago
15:30
@Zeta done
15:47
0
Q: Brainfreeze: A Brainfuck compiler in C

GnikBrainFreeze This is my implementation of a brainfuck compiler in C. The instruction to build/run the project (GitHub repo) can be found here. I am first converting the brainfuck source to x86 assembly and then using ld and as to generate the executable file (currently generates a 32 bit executa...

16:07
This seems like it's better suited for Code Reviewrickdenhaan 55 secs ago
16:18
wait for it
@rickdenhaan Code Review requires actual code to review. This sort of design review is off-topic there. — bruglesco 26 secs ago
16:31
@VibhorSagar I would write a loop to load all the "memberinformation" into a vector< memberinformation> then you can simply loop over vector to search for it. If you want a more sophisticated search you can use std::map<> rather than std::vector<> but that is a cuople of steps ahead of you. You can any working code reviewed at codereview.stackexchange.comMartin York 18 secs ago
17:23
0
Q: Fastest way to draw pixels with PyGame?

LuminousNutriaI am experimenting with Perlin Noise and random map generation. I have a 2D numpy ndarray full of 16-bit floats called map_list that I call from the singleton ST. It has 1600 * 900 elements in it. I am iterating through it to display different colored pixels to represent terrain at different poin...

Git flow and code review can do that well enough. Have each developer fork the main project and submit pull requests that should be reviewed by a senior before merging. See here... you want to control development through versioning? Well guess what... git has that already, and it's simultaneously more flexible and controlled. Merge, cherry-pick, do what you like. Any additional versioning must be meaningful for the whole project, or else you'll be better off simply using git or subversion's forking and merging to contain mistakes. Again, this is all just my own opinion :) — Jasmonate 42 secs ago
 
1 hour later…
18:41
1
Q: Asynchronous serial port communications class in C++

arcomberPlease review my serial port class written in C++. It is completely asynchronous, ie event driven. My idea for later is to inherit from this a sync_serial, where timeouts can be specified and it waits for responses. But that is not the purpose of this review. It is Windows only and I have tes...

19:38
0
Q: PHP: Faster Method to Write a ~100Kb HTML String Over an MD File (Number of Iterations ~10K)

EmmaCode Review I have tried to write a large string (~100-120 Kb of HTML) over a md file and pretty sure it's not the fastest method, even though the it only iterates ~8000-10,000 times and few times per hour. There is also a low (~1%-2%) probability that the target filename has an old name (prev...

Thanks for the answer. I am working with an org in our company that has a few decades worth of research data stored as some form of text format. I am currently trying to identify the structure of all these files. Which is step one to create a data model for these. So find out if the file had headers lines, columns names, column separators, data types, possible formats for dates. Properties that can help identify keys. Etc. I posted the code in the code review site under the title identify structure of a text file using python. After some manual modification of the format file we can forward e — Uttaran Banerjee 7 secs ago
That hasn’t been my experience at all. I frequently use a VCS to compare nonconsecutive versions—it happens all the time in code reviews and when tracking down bugs. — Marnen Laibow-Koser 30 secs ago
20:15
possible answer invalidation by Emma on question by Emma: codereview.stackexchange.com/posts/215578/revisions
This should be moved to code review as stated above, but perhaps something like asyncio would be helpful. — Ethan McCue 42 secs ago
possible answer invalidation by Emma on question by Emma: codereview.stackexchange.com/posts/215578/revisions
I wrote that ten years ago. In actuality, the reason is lack of code reviews. What would happen is the code would be commented out while doing an extensive patch and then get checked in to go to QA. But no one ever went back and removed the commented code after QA approved the patch. — jmucchiello 16 secs ago
20:50
@rici You may find these codereview answers to a similar problem interesting. They make use of the techniques I hinted at to solve for solutions to the equivalent of a 4SUM problem from an imaginary array containing all integers. — Dillon Davis 6 secs ago
21:34
0
Q: Reflect MRO at metaclass.__new__ in python

MikaelblomkvistssonPlease someone confirm that this is correct for getting an class attribute from the closest base class in an inheritance tree. It works for simple cases, but I'm not sure if it will do in complex multilevel structure and if it really reflects the MRO machinery applied by interpreter. The assumpt...

21:54
0
Q: How to exclude some combination of itertools.product?

Александр КоролёвI have such set of data: params = { 'child': ['sasha','masha','baby'], 'action': ['play','cry'], 'lesson': ['mathematica','lingvo'] } I use itertools.product such a way: keys, values = zip(*params.items()) for v in itertools.product(*values): event = dict(zip(keys, v)) pprint(event)...

22:32
0
Q: CoinFlip class that prints coins features

Kioken VoltnerI am trying to make a class that flips a coin and returns the year and type of coin and if its head or tails. I am sure that i made my class correctly but can someone show me how the tester class should look like. This is my class: public class Coin { //These are constants that are provided for...


« first day (2142 days earlier)      last day (2171 days later) »