« first day (1717 days earlier)      last day (2317 days later) » 

12:00 AM
RELOAD! There are 4899 unanswered questions (90.2633% answered)
 
That’s actually a thing that bugs me about code golf. Where is the forum to do cool stuff elegantly? All code golf seems to care about is tiny. Shouldn’t there be cause for people who just want to play with cool toys? — Dúthomhas 6 mins ago
Well, there's Code Review...
 
0
Q: Sierpinski Carpet using Seesaw (Swing)

CarcigenicateI decided to write a Sierpinski Carpet generator. This has been something I wanted to try since watching the Coding Train this summer. A screenshot of it in action with some experimental coloring: This is my second version, since I decided to try rewriting it from scratch to see if I could com...

0
Q: Ability System Implmentation

zwallerI'm making an RPG in Unity with an ability-based combat system, think Guild Wars 2 or World of Warcraft. I'm implementing abilities in an inheritance tree structure which makes creating multiple similar abilities very easy and quick, but the whole system feels like it could be structured better. ...

0
Q: Adding arguments to my main method

Joe.pI am writing a program to recored and maintain student data. I have written most of the code but am a running into problems, calling methods. I would like to call the following methods. printAll(); 
printInvalidEmails(); 
printAverageGrade(); remove("3"); remove("3"); I have written the fo...

 
12:31 AM
I'm voting to close this question as off-topic because you're asking for a code review, basically. — melpomene 6 secs ago
 
 
2 hours later…
2:28 AM
0
Q: Accio file! File finding utility

Gabriele B-DavidI decided to spend the last few days writing a file-finding utility in C (written for GNU/Linux) and would love to be told if this code makes my ass look fat. I want to learn the right way to write C code so that I can contribute to the opensource community (not that all opensource code is writte...

 
 
2 hours later…
4:31 AM
I still don't feel certainty about gradle's (and maven's) core concepts (yes, I've read the book, but i haven't got all pieces of a puzzle laid in my head completely) what I do, I think I was hoping to get some kind of code review. I got involved in many projects, but my build scripts were more like batch scenarios to this moment. — Minor Threat 42 secs ago
 
4:52 AM
1
Q: Dice roller in Ruby (Mainly for d&d)

Caleb RickettsI have been working with Ruby for about a week or two now, and I wanted to create a dice-rolling application that intakes any string (eg 1d4 + 1 or 3d20 + 4) and outputs the correct dice rolling. My current question is how to treat the 'modifier', or the + 3, or -1 etc at the end of the roll. I c...

 
5:16 AM
Monking
 
 
2 hours later…
7:12 AM
Monking
 
 
1 hour later…
8:15 AM
possible answer invalidation by EBH on question by EBH: codereview.stackexchange.com/posts/183704/revisions
I'm voting to close this question as off-topic because it should be posted on codereview.stackexchange.comdalle 9 secs ago
 
8:36 AM
More efficient than what? Difficult to tell, without seeing your code. Having said hat - this sounds rather like an example for Code Review. — Piinthesky 1 min ago
 
9:24 AM
No @dalle, it's not yet ready for Code Review, as it contains known bugs. — Toby Speight 45 secs ago
 
9:37 AM
0
Q: node.js knex queries - running update after select

renathyI am working on node.js project for two days. This is my first node.js code. All the time I am confused with knex and Promises. First I didn't add "returns" after knex queries. But then my code never executed knex query. SO, I added "returns', but this is confusing for me, to have multiple retu...

 
9:56 AM
0
Q: Preorder, Postorder, inorder Traversal in an Binary Search Tree

Sarabjot Singh Suggest some ways to improve it(since I have made root public and want to make it Private).This is code for Inorder, Preorder, Postorder Traversal of a Tree. #include<iostream.h> #include<conio.h> struct Node { int data; Node *left; Node *right; }; class Tree { private: Node *...

 
10:43 AM
0
Q: How to optimizing the code on generators and itertools functions?

Tomasz PrzemskiA third approach to clarifying the problem. I hope that now it will be easier to understand the idea of the algorithm :) I have an algorithm that creates a graph that has all representations of 4-bit binary strings encoded in the form of the shortest graph paths, where an even number in the path...

0
Q: Drawing with acm.graphics. Any even shorter solution than mine?

Κωνσταντίνος ΚορναράκηςThe following code is my solution of exercise 10 of chapter 5 of THE ART AND SCIENCE OF JAVA. So here, using acm program and graphics, i need to draw a castle with two side towers and other three consecutive towers some distance away from the main building(castle and its two side towers). Is ther...

 
11:02 AM
Maybe Code Review would be a better place to as this question. — dandan78 44 secs ago
 
11:12 AM
@dandan78 I'm not so sure, this looks like an exercise in hypothetical scenario's, something Code Review doesn't handle well. This is definitely not code used in production, it isn't doing anything useful at all. — Mast 33 secs ago
 
Monking
 
11:44 AM
See the File Browser GUI for some ideas. — Andrew Thompson 39 secs ago
 
12:17 PM
I think site codereview.stackexchange.com is more proper for this question. — BWA 47 secs ago
 
12:53 PM
I think I now understand what your program does. I have no clue why you want this (and this might help because this sounds like an xy-problem). But since you've got a working code which does what you want and just want to discuss improvements, this sounds to fit better into a code-review forum. — Alfe 59 secs ago
 
1:40 PM
If your question is actually about code optimization then it may be a candidate for code reviewQHarr 56 secs ago
 
2:17 PM
Seems like codereview.stackexchange.com is more appropriate for this type of question. Anyway, here's two I think most critical aspects: 1. DO NOT store your data in HTML and DO NOT use HTML as your primary data source when you need to find something 2. Separate different logical blocks (Save, Edit, Delete, Find-Contact-By-Name) and move them to separate function. Try to not rely on any global variables, only on arguments. — flapenguin 50 secs ago
 
2:36 PM
0
Q: Rules and targets in a makefile for data science in R

LlopisI am analysing some data (from bioinformatics) with R scripts. I created my first makefile to be able to redo them easily. There is a Figures folder in the root folder and for each analysis a folder with its own Figures folder where the output images go. Other files end up in the same working dir...

 
codereview.stackexchange.com — Jay Blanchard 11 secs ago
@JayBlanchard Not in it's current form. Please take a look at the help center. — Mast 43 secs ago
:) its funny so first of all I have posted my question @ codereview.stackexchange.com as Jay has suggested, I did not know about that so thanks. About duplication of 'key', if you observe closely, $input is a 2D array, and the inner level array has only one key named as 'key'. Thank you for your attention guys — Learner 17 secs ago
Hey @bivouac0, thank you for the answer. I've also asked on CodeReview, here's the full codew00zie 34 secs ago
 
2:52 PM
-1
Q: Reform PHP associative array

LearnerI have an associative array: $input = [ ['key'=>'x', 'value'=>'a'], ['key'=>'x', 'value'=>'b'], ['key'=>'x', 'value'=>'c'], ['key'=>'y', 'value'=>'d'], ['key'=>'y', 'value'=>'e'], ['key'=>'z', 'value'=>'f'], ['key'=>'m', 'value'=>'n'], ...

 
3:34 PM
The other slightly nasty bit is that Bar knows that it's in an ordered list of some type ... which can become a headache when maintaining code; but that's in the realms of code review — UKMonkey 50 secs ago
 
1
Q: Setter error checking - is there a better way?

Brett WarrenI have a class called Duration which has the attributes hours, mins, and secs. These attributes have to stay within acceptable ranges, so I implemented the following in their setters: private void setHours(int newHours){ if (newHours >= 0){ hours = newHours; } else{ ...

 
argh openGL wtf...
 
3:58 PM
0
Q: JAVA: Remove the occurences of an element from array if it occurs more than n times

THE GEEQI wanted to remove the occurrence of an element from array if it occurs more than n times... For example- { 20, 37, 20, 21 } (n->1) -----> { 20, 37, 21} { 1, 1, 1, 1, 1 } (n->5) -----> { 1, 1, 1, 1, 1 } { 1, 2, 3, 1, 1, 2, 1, 2, 3, 3, 2, 4, 5, 3, 1 } (n->3 ) --------> { 1, 2, 3, 1, 1, 2, 2, 3, ...

-1
Q: Reminder of a number in assembly 8086

parvinHow can I get and save reminder of a number when doing a division in assembly 8086? I need to write code for prime number viewing and I guess I am going to need that.

0
Q: Platformer without canvas

semih ezenWell i had a stupid idea about making a platformer without using canvas.It uses some other codes from github for collision detection. Result is "https://jsfiddle.net/5dL266kL/2/" <!-- CSS --> #character { position: absolute; background: blue; top: 0px; left: 0px; width: 50px; height...

 
4:09 PM
This is Code Review. We review code. Where's your code? — Mast 9 secs ago
 
Maybe you should better migrate this question to https://codereview.stackexchange.com/tgogos 33 secs ago
 
4:40 PM
possible answer invalidation by Trevi Awater on question by Trevi Awater: codereview.stackexchange.com/posts/154201/revisions
 
5:03 PM
Monking
 
Better suited for SO.
 
As far as I know, this might be better suited for Code ReviewDavid Stockinger just now
@tgogos I would recommend you stop recommending posts be sent to Code Review until you've read their help page. — Hosch250 8 secs ago
 
@Hosch250 Too late to migrate now, but you can VTC if it's unsuitable here.
 
@Mast I did.
 
@Hosch250 Is it broken though? Looks like he fixed it himself.
 
5:09 PM
@Duga You got it nicer because you did more of a hint.
@Mast It's broken (he was asking how to fix a specific issue) and it is stub code.
 
@DavidStockinger No, Code Review reviews written and working code that is included in the question. Broken code, pseudocode, and diagrams are all off topic. — Hosch250 49 secs ago
 
@Hosch250 I read it like he fixed it and wants to know whether his fix is any good. Fix review.
 
Nope.
First, Give the user balance... doesn't run in C#.
Second:
> I recently ran into an issue in which if 2 requests with the same coupon code were fired at almost the exact same time my web service call would accept both (probably because of the time it takes to write to the database).
> So my question: Is this a legitimate way to fix this? I am afraid it will become an issue if a lot of people are claiming coupons at the same time. Is there a better way of solving this problem?
And the answer tells him the correct way to handle this: codereview.stackexchange.com/a/154205/34073
It's a great SO question (or would be if it wasn't a dupe).
Also, I have a theory.
When people try to generate random passwords on their own, their passwords will be skewed based on how they sit at their keyboard.
So, I sit at a slight angle, and I just noticed I mostly use keys within a certain line from one corner to the other..
If I sat the opposite way, I might use the opposite line, or if I sat straight, I might use a horizontal line.
 
possible answer invalidation by Diego Pino on question by Diego Pino: codereview.stackexchange.com/posts/185106/revisions
 
@Duga OK.
 
5:18 PM
@Hosch250 Huh, I simply let my mind generate the password and type it in afterwards. Make them long enough, screw up enough letters and add special characters to mess with dictionary attacks and all is well.
But nobody can ever find my passwords based on how I hold my fingers.
 
@Mast I try, but it doesn't work.
Because I know exactly where each key is on the keyboard.
 
So do I, but that part of my mind is excluded from the password negotiations.
 
Please show us your code, if there isn't an inherent issue try the code review stackoverflow... — Mike Tung 25 secs ago
 
@Mast I had a plan to type in the wrong keyboard layout... The problem was I couldn't be arsed to change keyboard layout... ofc Mslvglu > Monking...
 
6:01 PM
@Peilonrayz lol
 
0
Q: Improved RandomGenerator with nextPrime() method

Κωνσταντίνος ΚορναράκηςI am trying to implement a method that generates random prime number between a given range. I have tried using simple method to find wheter a number is prime or not, advanced simple method, wilson's method and i ended up with sieve of Eratosthenes as soon as my code based on this algorithm is f...

 
6:26 PM
I'm voting to close this question as off-topic because it is working code that badly needs a review. We have a site for that: codereview.se — rene 8 secs ago
If there is no inherent problem with your code you may wanna take it over to code review stack exchange. — Mike Tung 8 secs ago
If your code is working as intended, then this question is more appropriate for codereview.stackexchange.com. — Mike M. 7 secs ago
 
-1
Q: Pointer dillema in a heap-tree

AliRaI'm writing a program to count the letters which are all in capital written down in a text file, and then for each character it makes a node consisting of the weight which stands for how many times it was seen in the file, the element which is the character itself and isleaf which shows if this n...

0
Q: Requires Code Optimization in MVP

xTIGRxGreetings to all participants SO =). was not here for several months. Recently started to study MVP + Moxy. It took me to make an MVP-based application. I did. This code is working. But I do not like the addMarkersOnMap line in the MainActivity class. Because, every time we turn the screen, we...

 
7:10 PM
0
Q: A static Java method for multi-indexing a collection

coderoddeI have this small utility for selecting from a collection via multiple indices at one method invocation: MultiIndexUtils.java package net.coderodde.util; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; public final class MultiIndexUtils...

 
Does anyone know a way to copy 1500 tabs to a new PC?
 
Which browser? FF?
MozBackup might help you, but I'm not sure whether it stores currently opened tabs.
 
Hmm wait Firefox has Sync..
Though maybe I should leave the old tabs behind on the old PC
 
I vote to let them behind
 
Never give up. Never surrender close those tabs.
 
7:19 PM
Every line of code in this question, except close braces and most of the body of main, has problems that would make me reject it in a code review. That is impressive. — Yakk 11 secs ago
 
@skiwi: do you ned to keep them working on the old pc?
(ok, now that i think about it, you actually dont need to change the old pcs settings if you copy them beforehand)
 
7:56 PM
@skiwi Take a day to sort them out. Save whatever you need as a bunch of links in a notebook somewhere.
But if you start your new PC with 1500 tabs on day one, things can only get worse.
 
8:28 PM
@hoffmale No, don't need them double :)
@Mast Yeah, if I manage to close 100 a day it will only take two weeks!
 
@skiwi: You can get a pipe separated list of open URLs (in the current window) by going to ff settings and set the starting pages to the currently open ones
 
@hoffmale I'm afraid it'll crash when doing that
 
@skiwi Just don't open them all at once afterwards. Only generate the list.
 
you'd only have to do that once per open window (I don't know how many tabs you've got opened per window)
 
Generate the list, copy it, nuke the original.
 
8:30 PM
Start count on this window: 1412... let's see what I can do today
 
@skiwi Should be more than half.
 
No way :D
Also gotta be careful that Firefox doesn't crash and my tab restorer restores them all again
 
Wat
Don't forget to keep count, I'm interested in the total.
Might want to hack together a script checking for duplicates as well, to check your tab efficiency.
 
I also gotta see what the tab is about.. though SO links I can check by just checking the title in the address bar before it's loaded
I was afk for an hour or a bit more just before now and put on some downloads on new PC and noticed it was sleeping... because Windows by default makes it sleep after 30 minutes
 
@skiwi One of the first things you turn off, right after superfetch.
 
8:34 PM
@Mast superfetch?
 
@skiwi You don't know Superfetch?
 
@Mast No?
 
Oh.
Superfetch is worse for your RAM than Firefox, Chrome and Edge together.
And, of-course, it's enabled by default in Win10.
 
Explain..
 
8:36 PM
Huh I found an article dated from 7 December 2016 in one of my tabs from the left side
Tabs from the left side are ones that I open via pinned tabs, tabs from the right side are brand new tabs
That one I click now is a tab from the left side :)
@Mast Hmm, doesn't seem like I need to worry about it with 32GB RAM
I do notice that on this PC 7.2 GB out of 15.9 GB is in use essentially by just running Firefox
 
@skiwi Depends whether you have applications that really like to use a major portion of that, like CAD tools.
If you do, Superfetch may simply decide to load a whole crapload of heavy programs in RAM by default.
 
(and Discord, Open Hardware Monitor, Skype, Spotify, Battle.net, Dropbox, Google Drive, OneDrive, a MySQL server, Origin, Overwolf, 7 PostgreSQL servers, Pushbullet, Steam, Telegram and Teamviewer)
Hmm, I'm going to forget about those SQL servers, ain't I?
 
Last time I crashed my laptop it was because I started Altium and forgot I had Solidworks still open.
Technically the casing for the PCB crashed the PCB software because they starved each other for RAM.
Big fun.
 
Wow
"Why procrastinators procrastinate"
Soooo many SE tabs
This is like taking a history class
Also, I learned today at work that you can have NullReferenceExceptions inside user-defined equality operators... Fun times
 
9:01 PM
@skiwi That's one thing I've known for a couple years at least.
Also, it's really fun when you accidentally define a recursive == operator.
I'm just looking forward to when I define a tail-recursive == operator. It won't crash, but will just run forever.
I should totally write that for the PPCG challenge about writing a challenge that will run infinitely.
 
@Hosch250 I'm very happy the stack-trace showed it clearly, otherwise it would've been a PITA to debug
What I was practically seeing when stepping through was that I did a null-check, verified it was not null (even though it was null) and then started using it and it crashed with an NRE
 
LOL.
 
Huh, I glance over to my PC and see it's restarting... Great
Windows...
 
MUAHAHAHAHA!
 
The joke going around at work is asking whether Visual Studio or the person himself is the boss when developing something... Apparently Visual Studio is often the boss
 
9:11 PM
@skiwi LOL.
Sometimes, yes.
I'm wondering why it takes a minute between the build and the test run in our gated checkin.
 
It's like I only have SE tabs open..
 
TIL about DB statistics.
Turns out you can't drop a column if it is referenced by a stat.
We'd added a stat manually on a column, which caused problems when we couldn't drop the column.
We'd originally designed our DB one way, and now we are restricting it some, and trying to clean up some poor architecture created by some non-DB/non-.NET devs.
 
Huh, interesting
I wrote a database that's backed by SQLite for work over the last weeks
 
Been working at it for about 3 hours. Eventually someone else solved the problem for me.
 
@Mast I like to turn Superfetch on Max and push every PC ever to the limit.
 
9:19 PM
Well, writing was maybe a 1-2 weeks, and then 2-3 weeks of writing tests I guess
 
Then I finally found another issue about the same time...
 
Not everything is under test yet, I assume about 70-80%, so only the fun bugs are left now, and the NRE in the operators is one of those ;)
I'm considering converting all those types to value types anyway
 
@skiwi No kidding, I always forget to disable that POS setting on the ones I provision, so it goes to sleep and stops downloading.
I consider that a huge bug in the software.
 
@202_accepted I think IT does more downloads than most people.
 
Meh, Windows is only going downward in terms of quality control in my opinion
 
9:21 PM
@skiwi LOL, says all the devs ever.
 
I provision a PC about once a week and I always forget to disable that, start the download for an overnight, and it's only 10% done.
 
Over half of our serious software bugs are caused by Windows malfunctioning since some update..
 
@skiwi Write your software better.
 
@skiwi No kidding.
 
@Hosch250 It's mostly the 3rd party components that are failing because of the Windows updates, it is harder to control those
 
9:24 PM
In other words, all software ever is %^&*
 
I kid you guys not, major U.S. financial institution software wasn't working on my PC because my Date/Time formats were set to "dd-MMM-yyyy HH:mm" and not "M/d/yyyy h:mm tt", it's 2018 and I'm declaring that all software is shit.
 
@202_accepted LOL.
 
That was 3 days ago.
Oh and by the way, the error isn't "the date format on this system is not the correct format" or anything reasonable, it's an "Unknown error", and that's all the useful information you get.
 
@Mast End count: 1187 tabs
 
And I'm screwed.
 
9:26 PM
225 closed today, or 16%
 
So, we have have a .cshtml that takes a type A.
We are restructuring our system, and when I create a VM B in a different project, it can't see A.
This is a partial view that is used just everywhere...
So now I have two options.
 
You should still be able to deal with it (I did) by manually referencing the full ~/Views/... path.
 
I think I'll just bite the bullet and jump into restructuring that system too.
@202_accepted Sure. But model B can't see type A that I need to pass to that partial view as a model.
 
Ah, that's why I use simple types for cross-project partial views.
 
@202_accepted We try. Believe me.
We are going DBO/DTO/VM.
Each of those have their own project with mapping and business logic around it.
 
9:30 PM
If I know the partial is needed cross-project, I'll bite-the-bullet and use Tuple generously.
 
Then the UI has it's own project with the controllers and the UI
 
Also, if anyone has thoughts:
0
Q: Internationally friendly decimal quantities

202_acceptedI was recently in a discussion about decimal / comma ambiguity (it came about as a result of a vendor product not working for me due to regional settings, but that's neither here nor there), but we can to an interesting conclusion: how does one specify what decimal / separators / units to use whe...

@Mast ^^^
 
But whoever wrote this was neither a .NET person, nor an architect, or a DB person, nor a web dev.
I mean, they don't use forms. They used spans instead of buttons and listen to click events.
 
I mean that's the definition of Legacy project man.
Unfortunately, you have to support them sometimes.
 
@202_accepted I know. Except it's pretty new.
 
9:31 PM
(For me, it's all the time.)
 
We are desperately working on fixing it in our spare time.
 
@Hosch250 So? Legacy != old, Legacy = uses out-of-date principles / technology.
I have a 3-month-old project that I now consider Legacy.
 
Yep, I know.
@202_accepted I'm not sure these were ever in date, lol.
But seriously, a new project should at least try to not be legacy.
 
@Mast I once got static-zapped by a bolt of electricity from a plastic trash-can with a plastic bag full of sand (from a sandblaster) in it that literally messed my heartbeat up momentarily. (Zapped me of all air, sounded like lightning in the shop.)
@Hosch250 I built that legacy project, because I did not know then what I know now.
Sometimes it's not intent, sometimes it's just a lack of experience / knowledge.
Looking at it today: I would do the entire thing differently.
 
possible answer invalidation by Κωνσταντίνος Κορναράκης on question by Κωνσταντίνος Κορναράκης: codereview.stackexchange.com/posts/185153/revisions
 
9:46 PM
2
Q: Is this an acceptable method for creating branched narratives?

kingdom5500Okay, so recently I was asked to develop a way to easily create a branched narrative, where the user can select options to progress the story in their own path. After a couple hours of fiddling around with different options I managed to produce this simple code. ### STORY BRANCH MANAGEMENT clas...

 
10:01 PM
1
Q: Implementing a linked list in C++

ovichimI am an experienced C# developer and started with C++ a few days ago. I implemented a simple linked list to play around with templates, iterators, pointers, references and stuff. What would experienced C++ developers do differently? Thread-safety and performance were not a priority in this imple...

 
10:15 PM
This may be better asked on Code ReviewPeter Wood just now
 
10:31 PM
0
Q: Inline visitor implementation for C++11

the4thamigo_ukI've been looking at getting back into C++11 after a few years and came across the idea of implementing the 'inline' visitor pattern. The idea is that you can specify your visitor class locally in the code using lambdas, function pointers and/or std::function. I would be interested in the opinion...

 
Well done! One suggestion: You don't need to copy everything into m, you can just use mylist directly. If you want a full code review, take a look at codereview.stackexchange.com - read their help center before posting to make sure you get the format right though. — Blorgbeard 33 secs ago
 
1
Q: Completed class definition put on hold as broken code or code not yet written

Tom celicI asked a question yesterday here. It has been put on hold for the following reason: "Questions containing broken code or asking for advice about code not yet written are off-topic, as the code is not ready for review. After the question has been edited to contain working code, we will co...

 
 
1 hour later…
11:41 PM
0
Q: PHP Prepared Statement fail with period

JustAGrumpWhile running a test on my query I found an issue where the prepared statement gives a false, when it should populate true. Manually checking seems to validate that the statement is true. $sql= "select * from ( select Case when chld.parent_client_id = 0 then 'Nope' else (sele...

1
Q: Translate a problem to OO-Code in Java, especially an RPG Idea

Dexter ThornI think that I have big problems with object-oriented analysis of a problem and with writing really good, object-oriented code based on the analysis. When I was trying to write an RPG, it struck me that as a beginner, it is very difficult to plan everything in detail and translate it into good co...

 

« first day (1717 days earlier)      last day (2317 days later) »