« first day (2623 days earlier)      last day (1691 days later) » 

00:00
RELOAD! There are 6809 unanswered questions (89.8682% answered)
00:26
1
Q: A Python Snake Game Using Pygame

RocknRollDeltaMy attempt at creating a snake game, in pygame. I tried to make it as simple as possible, but i feel it could be better in terms of best practice, and efficiency, along the idea of avoiding redundant code. It would be appreciated, if anyone can give me advice in that regard. import pygame import ...

00:51
1
Q: Is there a better way to parse this data file?

kwinkunksI have a text data file in SPWLA format; I cannot find a specification for it. It contains physical measurements and/or rock descriptions from wellbore core samples. It's fairly gross. The example here is substantially simplified: text = """\ 30 1 2001.10 0.00 2.11 40 1 2 ...

01:15
0
Q: Factorize All Numbers Up to a Given Number

Yonlifthis post is sort of a continuation of my answer on the following question: Fast Algorithm to Factorize All Numbers Up to a Given Number. As this post explains - We need to factorize all the numbers up to a large N. At first I gave a python solution which was pretty slow (since - you know, python...

 
2 hours later…
03:35
possible answer invalidation by Infinity on question by Infinity: codereview.stackexchange.com/posts/245050/revisions
 
2 hours later…
05:45
0
Q: Is it possible to update the database without referring to the ID number?

Phineas Facing ForwardI am using Javascript on Applab. I have the code: var player = {}; player.Username=" "; onEvent("confirmUsernameButton", "click", function() { updateRecord("AllUserData", player, function() { player.Username = getText("Username_input"); }); }); However, it is not updating the database at...

06:11
Monking
19
Q: The new moderator agreement is now live for moderators to accept across the network

CatijaToday, we’re announcing that the new moderator agreement is live and the existing moderators are being asked to accept it. This has been a great collaboration to get from a draft in November 2019 to the final agreement in July 2020. It’s gone through several phases of review internally, including...

Your question (about working code) belongs to CodeReview, not SO. — DYZ 50 secs ago
@Duga Unfortunate, rolled back.
@DYZ In its current state it would not be acceptable on Code Review, so closing the question because it would belong there doesn't fly. Please be careful when recommending questions towards other sites. — Mast 20 secs ago
For starters, the question is not a request for review but a specific request for simplification. On top of that, no context is provided as to the how and why of this code. On Stack Overflow, MCVEs are encouraged. On Code Review, they are outlawed. — Mast 51 secs ago
@Mast There is a checklist for Code Review that the question easily passes. — DYZ 32 secs ago
@DYZ No, OOP seeks a simplification, not open-ended feedback. The rest of the points still stand too. Please read A guide to Code Review for Stack Overflow users. — Mast 40 secs ago
06:57
Monking
 
2 hours later…
08:49
It sounds like your code works as expected and you are looking for a review: CodeReviewThomas Sablik 45 secs ago
08:59
0
Q: Decrease exectution time of my program

TanvirI have an array with 40000 number (float and /or int) where I need to perform some calculation. To do this I have used nested for loop. But the execution time is really high. Instead of nested for loop if I use list comprehension, the execution time reduce slightly. Here is one sample of my code,...

09:23
0
Q: IPC with over 100 different methods - viable way to maintain readability

KrowiI have a system with 2 different processes. Process 1 starts process 2 and sets up an AnonymousPipe between the 2. Process 1 needs to run some code and needs to interact with process 2 to get info and commit changes. Process 2 runs on Python with references to C# code (since I'm more familiar wit...

0
Q: Solving the game of 24 recursively in APL

RGSThe "game of 24" as I called it in the title is a maths game in which you are given four numbers and have to combine them in an expression using only the four basic arithmetic operations +, -, × and ÷ (and possibly using parenthesis) to achieve the final result of 24. You must use each digit exac...

09:41
Monking
0
Q: implementing listeners (java like) in c++

ClassYI'm coming from languages like java and python and i'm completely new to c++ therefor my knowledge is somehow limited. my goal is to implement a listener in c++ myself and I came with a solution using function pointers and lambdas. the design is different from other question that i have seen on t...

@Mast Looks like it's mostly an update with some damage control (over the late 2019 incident)
10:19
Considering, you didn't post your question to codereview and the answers in current thread seem to cover the scope of your question thoroughly (along with benchmarks and references). You may pick accepted solution to mark your question answered. — Yevgen Gorbunkov 39 secs ago
@Peilonrayz Probably. Some legalese added, but nothing shocking.
Yeah, nothing to get the pitchforks out over. Except possibly (v) in the agreement.
10:36
0
Q: Railway Reservation system in C

bugtrack001#include<stdio.h> int main(void) { struct passenger { char source_destn[30], target_destn[30], name[50], gender[1], address[50]; int age; }p[3]; int flush; for (int i = 0; i < 3; i++){ printf("enter the name :"); fgets(p[i].name, 51, stdin); // +1 for accomodating "\n" ...

@Peilonrayz shrug
They still pay for it, makes sense to have something like that in it.
Legally it's a bad situation if your volunteers can't be steered by company policy.
That's what the other bullet points are for. This just seems like a gateway to having a divide between what is said, and what is enforced. And can allow some staff member to just nuke a diamond because 'they said so'
Ordinarily I'd agree it's a bit beyond what's necessary, but given 2019 I can fully understand why it's there.
I strongly suspect it was added after strong encouragement from the lawyers.
11:28
Monking
12:14
0
Q: Construct a numpy array by repeating a 1 dimensional array sliced at different indices

J R ChapmanI have a pandas dataframe (called base_mortality) with 1 column and n rows, which is of the following form: age | death_prob --------------------------- 60 | 0.005925 61 | 0.006656 62 | 0.007474 63 | 0.008387 64 | 0.009405 65 | 0.01...

0
Q: Which of the following methods is declared incorrectly?

AlexWhich of the following methods is declared incorrectly? void printArray(int arr[]) void doSomething1(int... arr1, int... arr2) boolean isNegative(int n) String makeText(char... arr) int add(int... arr) I am struggling with this question. I think the incorect one is 3. Cause boolean takes 2 param...

 
1 hour later…
13:27
0
Q: Trie to index files and search for them

user227408Basic idea (foo and foa are filenames): using System; using System.Collections.Generic; using System.IO; namespace FileIndexer { class FileIndexTrie { private class CachablePath { public string filename; public int cachedPath; //stole...

14:15
0
Q: Speed Up Flow Field Algorithm?

inappropriateCodeI am slowly creating a flow field pathfinding solution for Unity3D. I'm trying to follow Elijah Emerson's description, which appears in the book 'Game AI Pro' (volume 1). In this question I ask about the Coordinates object which I use here. I have subsequently cached some variables. In my tests...

15:04
0
Q: Thread-safe event-queue code appears to work, any possible race conditions, deadlocks, or other design problems?

PMARINACross-Posted from Stack Overflow I am new to using condition_variables and unique_locks in C++. I am working on creating an event loop that polls two custom event-queues and a "boolean" (see integer acting as boolean), which can be acted upon by multiple sources. I have a demo (below) that appear...

0
Q: Very beginner DB playground

VoracThis is my very first interaction with databases. The goal is to setup a safe playground on an Arch box to create tables and make queries; learn the basics without risking sudo rm -rf /. #!/usr/bin/env bash # This script initializes a new MariaDB database, # without root privileges, # and conne...

15:30
@robin Judging from the column names, you should split the nhc table. You should consider posting a question on Code Review tagged database and whatever database you are using (MySql?). Try and post a schema and a detailed description of what each table does. — TinMan 48 secs ago
You need to add a description of what your code does to your question. Explain the inputs, the expected outputs, show an example of how it would be used, etc. Please edit your question. At that point, it can either be re-opened or migrated to a site like Code Review. — Cody Gray ♦ 10 secs ago
15:53
1
Q: Representing a graph with passable marks and actions in CSharp - Action reflection hell: good or bad?

BlenderI wanted to have a framework to build Petri Nets from C# code. Petri net is a digraph with functional transitions and mark types. In books they tend to look like this: Here is what I came up with - simple example: using ServicesPetriNet; using ServicesPetriNet.Core; using ServicesPetriNet.Core.A...

Monking
16:15
Monking
16:39
Monking
This was posted to codereview a while back, but since COM doesn't really change, it may be useful in your case. codereview.stackexchange.com/questions/135648/…Stephen 9 secs ago
possible answer invalidation by inappropriateCode on question by inappropriateCode: codereview.stackexchange.com/posts/245227/revisions
@Duga Thomas Ward rolled back, but OP attempting to reply to answer:
> It may even be possible to compute this with a simple arithmetic expression, although I cannot immediately see an expression that works. From the code supplied I am not clear how Flow.Value is used, it may be possible to choose a different encoding which is simpler and faster to calculate.
TW re-applied addition (without the value modifications) for clarity
^^ oh I forgot @ThomasWard is here...
good work!
16:56
@SᴀᴍOnᴇᴌᴀ ye i did the rollback as "fast" then salvaged
because the rollback gets the other code bits reset and the rest was just added at the end without adjusting the main code so
To compliment TinMan's suggestion - if you post on CR please read the sql wiki - especially the last section - i.e. Question GuidelinesSᴀᴍ Onᴇᴌᴀ 8 secs ago
patience is a virtue though esp. with cruddy interwebs
and other things Diamonds are busy doing
yes... it ain't no miniature dumpster fire
lol
Need help or got it under control?
think we're good with that one post
17:06
0
Q: LeetCode 924: Minimize Malware Spread

EmmaI'm posting my code for a LeetCode problem copied here. If you would like to review, please do so. Thank you for your time! Problem In a network of nodes, each node i is directly connected to another node j if and only if graph[i][j] = 1. Some nodes initial are initially infected by malware. Wh...

0
Q: C# Better logic for viewmodel

JeffersonAny advice on how to make this code; cleaner, more effective, just overall better! Program creates is filling a viewmodel object where the object only have certain properties base on type. The config type will only have the setting and value objects. class Program { static void Main(string[] ...

-1
Q: Is there any way I can better this code?

Emmanuel OkaforMade this Java program recently. it gets an input from the client. The first line specifies the the file name that you will use. The second line specifies what you want to put in the file. I have been trying to improve the documentation. Please only give me improvements using the packages I have ...

possible answer invalidation by inappropriateCode on question by inappropriateCode: codereview.stackexchange.com/posts/245227/revisions
@Duga flagged for mod. intervention
@Mast um... they claim it's not 'invalidation'
want to take a look in that post?
@ThomasWard On it.
sigh
The answer can't be invalidated if the answer itself is invalid.
Answerer jumped the gun, answered where he should've commented.
17:18
@Mast How's the Q off-topic?
@Peilonrayz The answerer implies there's not enough context.
> From the code supplied I am not clear how Flow.Value is used, it may be possible to choose a different encoding which is simpler and faster to calculate.
That's his own bloody problem.
If that really makes it unanswerable, don't answer it. If you point it out, expect invalidation.
The answer has still provided at least one insightful observation.
It's quite possible to polish a turd.
Even half a turd.
Not a fan of axing because of "if I had more code I could give more feedback", cause you can say that of every question where there is even one line missing.
If you ask for more code in an answer, I can't blame OP for providing more code.
It's on bloody request.
Either way of dealing with it is actually fine, I guess.
Mod flag has been raised already though, and I'm not going to enter an edit war over this.
Left a comment, probably the best I could do here.
17:23
I retracted my flag after seeing your comment @Mast
@Mast I'll leave it to the answerer to decide judgement
@Peilonrayz That's my idea as well. Should I make it more explicit with another comment?
The other one targets the OP, not the answerer specifically.
I didn't know there was a first comment, so I'll investigate that one before I answer about "another" comment :)
@inappropriateCode Ordinarily I'd agree with Thomas here, but it seems George simply was too fast with the answer and should've left a comment instead of an answer if the question was unclear. For now, we'll leave the edit as-is unless a moderator decides otherwise. Please keep in mind for next time we do take answer invalidation seriously, even if it only looks like one. — Mast 5 mins ago
Personally I'd flip it so the answerer is the subject, but I think either is fine.
No point deleting it now :)
@SᴀᴍOnᴇᴌᴀ How'd you do this? I've tried to retract before but couldn't find it
17:29
@Peilonrayz clicked the flag link again and it had an option in the lower left of the modal labeled Retract flag .... so I clicked it
124
A: Cancel misclicked flags

Michael StumThis is now completed and as of August 2016, live network-wide. Note that if you're a moderator (and thus your flags are authoritative), there's no retracting. Also, close flags get converted into close votes if you have enough rep, and can be retracted through the existing "retract close vote" ...

Hmm, not sure why I didn't see it before must have been a comment flag
@Peilonrayz Found it now or do you want a screenshot?
No, no I've found it now :)
apparently it used to be on the right side
@SᴀᴍOnᴇᴌᴀ Long time ago.
17:32
interesting... multiple bounties have been awarded to various answers on that Meta post...
For anyone reading back on this later I'll include a current picture anyway.
@SᴀᴍOnᴇᴌᴀ That reminded me of a certain Code Golf post with 6 answers with 1000 point bounties attached to each
wow - such rep!
Yeah, just a little... XD
Imagine getting 11k rep from one answer...
Wowzers, indeed.
That's quite a legendary thread.
17:45
@Peilonrayz who, what, huh?
@pacmaninbw Score of 1000+, with 1000 bounty as a bonus.
That's at least 11k.
Well 10k is subject to the daily rep limit, but meh.
No, that looks like 2000 to me, not 11000.
@pacmaninbw Ignoring the rep cap, an upvote is still worth 10 points.
1.000 votes = 10.000 points.
Have a coffee.
doh!
Can't my stomach is upset.
17:49
Tosti first, coffee later?
Just ate roasted chicken with brown rice for breakfast.
@Mast >:( Now I want a Tosti
IDK if it his max bug JS got 871 on SO March 9, 2012, 400 from a bounty
@pacmaninbw That should work too.
@Peilonrayz You're welcome :-)
17:52
lol
 
1 hour later…
19:04
Wut happened to the queues?
For me they are empty.
Looks fine to me, got 11 in the CV. I'll get around to them after dindins
19:44
There is a specific stack exchange for this very purpose.... Code reviewJacques 11 secs ago
@Jacques: The code review site is specifically for review of code that is known to work, not for asking people to test code for you. — user2357112 supports Monica 56 secs ago
0
Q: Interface implemenation with generic or without any type?

Pavel MironovI have two similar classes for two different keyboards: 1) public class InlineKeyboardMarkupBuilder { private Long chatId; private String text; ... private InlineKeyboardMarkupBuilder() {} public static InlineKeyboardMarkupBuilder create() { return new InlineKeyboa...

20:45
1
Q: Suggestion on Single Level Of Abstraction per Function - Java

Sakthi KarthiI followed the SLAP principle in the below code. But with "Mixing Level Of Abstraction" (refer below code) I can avoid the single line methods. My question is - is it good to avoid the single line method in this case? But I believe the code with "SLAP Principle" has better readability than the ot...

21:15
possible answer invalidation by Jefferson on question by Jefferson: codereview.stackexchange.com/posts/245236/revisions
@Duga the answer doesn't appear to call out the mistake (i.e. that mvm.Type was getting assigned to meeting.Name)
21:33
0
Q: LeetCode 37: Sudoku Solver

EmmaI'm posting my code for a LeetCode problem copied here. If you would like to review, please do so. Thank you for your time! Problem Write a program to solve a Sudoku puzzle by filling the empty cells. A sudoku solution must satisfy all of the following rules: Each of the digits 1-9 must occur e...

22:22
0
Q: Any better way to read Json array

inikiI have a json file - WorkflowNames.json with contents as - ["ImportOrder", "ValidateOrder", "ProcessOrder", "ArchiveOrder"] My C# code to read this json file is - private Dictionary<string, bool> GetWorkflowNames() { var appDataFolder = ConfigurationMgr.GetAppPath("App_Data"); var jsonFilePa...

The code is broken. As pointed out in the review on codereview. The objects in buffer and scratch do not have a defined lifetime (i.e. their constructors/destructors are not called. Anything more complex than a POD has undefined behavior). — Martin York 17 secs ago
22:40
possible answer invalidation by Jefferson on question by Jefferson: codereview.stackexchange.com/posts/245236/revisions
@Duga left a comment to the OP, who has done it in the past
This really should be on CodeReview. But given that, there is no need for size member variable in your class. Just use vector::size(). Tje same thing with a destructor -- no need for one. — PaulMcKenzie 41 secs ago
0
Q: How clean is my close_account code?

user13477176Hello i'm coding a social site and I need to know how clean this code is. I read other answers people told me from my previous questions like this and used it as guidelines. So now I wanna know if anything could be improved. Thank you. <?php mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STR...

23:42
@thore Now it works get a proper review here: codereview.stackexchange.comMartin York 33 secs ago
23:59
0
Q: Why does lodash.sampleSize randomize entire array?

laggingreflexHere's what lodash.sampleSize does: Gets n random elements at unique keys from collection up to the size of collection. function sampleSize(array, n) { n = n == null ? 1 : n const length = array == null ? 0 : array.length if (!length || n < 1) { return [] } n = n > length ? length...

0
Q: Python - Password Generator & Strength Checker

Brendan RodgersI am a beginner in Python and I have attempted to create a small script/program which allows the user to do the following: Generate a single random password Generate a number of passwords specified by the user of a certain length specified by the user to a text file in a location of their choic...


« first day (2623 days earlier)      last day (1691 days later) »