« first day (2868 days earlier)      last day (1447 days later) » 

00:00
RELOAD! There are 7391 unanswered questions (89.5662% answered)
00:25
Seems like an opinion-based question about what other people might find "better". If you have working code and you would like insights on how you might refine your working code, then please post your question on Code Reviewmickmackusa 18 secs ago
0
Q: Python unit testing

ApplePieI have started a hobby project and would like to integrate better and more thorough testing practices. Since I am not too used to it, I'd love to have some feedback on the sample code below. In particular, I'd be interested in the best practices surrounding setting up data necessary to feed a par...

00:51
0
Q: Clean way for sending Google Analytics events

Hooman BahreiniI am working on an e-commerce website. I want to track 2 events in Google Analytics (I would need to send these events to Analytics): when a buyers contacts a sellers (an email will be sent through the website) when a job seeker applies for a job (job seeker would be redirected to the employer's...

01:08
 
3 hours later…
03:51
0
Q: A Tester of Paragraph Merger for Removing Overlapped Duplicated Lines in C#

JimmyHuThis is a follow-up question for A Paragraph Merger with Removing Overlapped Duplicated Lines in C#. I am trying to implement a tester for testing the implemented paragraph merger for removing overlapped duplicated lines. The operations of this tester are: Generate Expected Output Paragraph Cont...

0
Q: Multi-threaded application performance in C

xuanduc611I'm programming a multithreaded application (server-client UNIX socket) implemented for the server-side. I have two thread check_cmd_thr and server_thr. I use check_cmd_thr to check data input from keyboard, if the input is start then the server is allowed to receive messages, if the input is sto...

04:16
0
Q: Code to clear a Socket queue, is this reasonable approach?

Phil FreihofnerI have a Java Socket that is opened once (includes establishment of input reading and output writing lines). Then, it is used, on demand, to run a single message cycles in the background. During the time the socket is 'dormant' it is possible that the SocketServer might have sent it an extraneous...

04:31
That's not what this site is for. There are other sites that are for code review. — jmcilhinney 10 secs ago
04:43
Monking
05:33
0
Q: Cleaner way to write the condition

Avinash ReddyUserRoles Will have multiple roles from L0 to L9 and T0 to T9 the condition is if UserRoles is Only L0 and T0 then I need to go inside. the below written works. but as you can see its a mess any better way? if (Program.UserRoles.DtoList.Any(x => !(x.RoleName.Contains(ConstantReference.UserAccess...

 
2 hours later…
07:16
0
Q: Generating basic Fractals

Ch3steRTrying to generate fractals image with given IFS equations. I have two classes: Shape - Gives co-ordinate to form a shape. Ifs - Takes the given IFS equations and generates a fractal image. Code: ifs.py class Shape: @staticmethod def square(): x1 = np.concatenate( ( ...

0
Q: Diluting JavaScript events

John MartiIt is the first time I have developed a public code. The purpose of this code is that the classic debounce and throttle features are coded in pure javascript with advanced options. "jQuery and so on, it has no dependencies." I tried to keep the script as short as possible. Please analyze and rate...

If this is your real code, you should take this question over to codereview.stackexchange.com — Heslacher 7 secs ago
07:28
@Heslacher But I'm not looking for a code review just an answer to a very specific question, does yield return provide any benefit here? Yes / No ? — Ash 7 secs ago
07:38
Is anybody able to help [Алексей Неудачин ](codereview.stackexchange.com/q/256981/75307) with an English description of the code? I can't make sense of it!
I don't speak pascal, sorry
@Heslacher I think it's probably more useful to be able to speak Russian...
Oh, thats no problem....just kidding. Thats a bigger problem ;-)
08:07
0
Q: OpenGL Shader Loader in C++

Desmond RhodesI made my own custom OpenGL shader loader for C++. Please tell me is I'm doing anything incorrectly or anything to improve on. I've tested this and it works perfectly fine. main.cc std::vector<ShaderInfo> shader_info { {GL_VERTEX_SHADER, "shader.vert"}, {GL_FRAGMENT_SHADER, "shader.frag"}...

 
1 hour later…
09:19
This is a better fit for codereview.stackexchange.com. — timgeb 29 secs ago
09:50
0
Q: A wrapper for user authentication using cURL in PHP

Anurat ChapanondSo I created a wrapper class to authenticate user via POST HTTP request. class Nucleolus { public const AUTHEN_USER_URL = "localhost:8000/authen/user"; protected $ch; public function __construct(string $token) { $this->ch = curl_init()...

Unless you have a problem getting it to work, it should go on Code Review. — 500 - Internal Server Error just now
10:41
0
Q: speed up python code, vectorize

nicolaI m struggling with my python code due to its very slow execution time. After trying different option I was suggested to use Vectorization... however I'm a bit confused about how it works (I'm quite new to coding). Could you give me some suggestion about how to use vectorization? Thank you in adv...

11:07
0
Q: Maintaining state while walking a tree structure

JacksonThe following code creates a simple tree structure and then walks through the tree looking for node with the value 9 that appears after we have seen a node with the value 1 and a node with the value 4 (order of the 1 and 4 don't matter). type N = Value of int | Children of N list type S = {oneFo...

11:32
0
Q: C++ generic, multi-dimensional linear interpolation template

StefanUse-case in a nutshell: Interpolate fixed-sized data (a lookup table) that provides output values for combinations of a (fixed) number of inputs. The appropriate scaling is done externally, each axis starts at 0 and increments by 1. The output is a floating point value regardless of the table dat...

0
Q: Should @media queries be handled from smaller to larger sizes or vice-versa?

cbdeveloperYou can find the term "mobile-first design" all over the web. But should that design principle apply to the way media queries (for screen sizes) are used? For example: Let's say we need to implement a break point to toggle the display: flex; property on some div If you'd apply the "mobile-first"...

11:42
In general, these kind of questions should go on codereview.stackexchange.com if you get them working, but want the code to be improved. The hangman rules I know use a guessed letter as often as it occurs in the word. You could change that by removing letters from the letter list when "used" in a word. In this case, you should also allow user input with more than one letter. — Dschoni 38 secs ago
11:58
0
Q: Folders and subfolders Drive Management

PROGETTAZIONE STUDIO GBHy, I'm working for a drive's file and folder (including subfolders) management system to render in a google sheets. The project is very userful for next and future improvements and works very well. Here is the link to the project (to copy in your drive if you want to see the code in action): h...

12:24
0
Q: Password Logging using C#

LV98Summary I have finished creating a secure login functionality. I have used 1 resource to help me with the security. Most of it was just copy and paste. https://medium.com/@mehanix/lets-talk-security-salted-password-hashing-in-c-5460be5c3aae Would appreciate any helpful review to my current code I...

Also , I couldn't get it to work ecuses, will fail senior dev code reviews on commits every time — TheGeneral 6 secs ago
 
1 hour later…
13:41
Also, consider posting this on Code Review if you don't really have a specific problem. — VLAZ 49 secs ago
Yes, you are right I will move it to Code Review — PierBJX 27 secs ago
Wouldn't this question be better suited for the code review SE? — Alex Metsai 56 secs ago
14:05
Is there a more suitable site for this best-practice question?
0
Q: Group inner properties from an array of objects to a map

PierBJXI have an array of object and I want to group/order some inner properties in a map according to a key. I did this code but I would like to know if there was a way to optimize the code ? const myArray = [{ getValue: () => { return { country: 'France', city: 'Toulouse'...

@CaptainObvious Please can we not use MRC (LCC) as NDoC (UWYA)
14:19
@TobySpeight IIRC Programmers might. But I don't know the new name of the site, never mind any rules
Greetings, Programs.
Dan
Dan
hello
I thought I would share with y'all the day I got defeated by Git
dpant1ml1:keyconjurer dpantry$ git rebase pr_head
fatal: It seems that there is already a rebase-apply directory, and
I wonder if you are in the middle of another rebase.  If that is the
case, please try
        git rebase (--continue | --abort | --skip)
If that is not the case, please
        rm -fr ".git/rebase-apply"
and run me again.  I am stopping in case you still have something
valuable there.
dpant1ml1:keyconjurer dpantry$ git rebase --abort
error: could not read '.git/rebase-apply/head-name': No such file or directory
15:20
Computers are evil and can only be defeated by pouring holy water on them.
6
0
Q: Invert n bits beginning at position p of an unsigned integer

j3141592653589793238In an attempt to create a function that returns x with the n bits that begin at position p inverted, leaving the others unchanged - following the exercise in K&R - I've come up with the following piece of code. Still, I find it unclear where to start counting, i.e. the result would be different i...

15:35
possible answer invalidation by Peilonrayz on question by nicola: codereview.stackexchange.com/posts/257016/revisions
possible answer invalidation by Peilonrayz on question by nicola: codereview.stackexchange.com/posts/257016/revisions
Dan
Dan
@Peilonrayz water u doin ^
@Dan I moved the 'answer' into the question cause the OP should have edited not answered
Long time no see. How's Ireland?
Dan
Dan
wet
windy
thanks for asking, though :P
Sounds about right. Whenever I'd visit family we'd barely ever venture outside...
Dan
Dan
yeah it was hammering down earlier, that wasn't fun
but that's my pay back for hammering last night at 9pm when having a disagreement with a desk I was trying to disassemble with some force
15:47
lol, yeah that's one way to see things XD
0
Q: Performance investigations for a virtual array

huseyin tugrul buyukisikI implemented virtual array using OpenCL and graphics cards as backing store, with caching some of data on RAM using a LRU algorithm and accessing data through some simple setters/getters. Accession of an array element goes through a page lock (using array of mutexes for all independent pages), t...

0
Q: Text replacement with Räubersprache ("Røversprog")

ljrkI've been toying with Haskell again and implementing a simple text replacement program that replaces all consonants c in a text by coc, i.e., inserting an 'o' in between: > robber_simple "abcdef" "abobcocdodefof" This is rather simple to implement: robber_simple :: [Char] -> [Char] robber_simple...

@Dan @Peilonrayz We had hail in Los Angeles yesterday, not exactly a common occurrence.
@pacmaninbw Wow, been a little chilly in LA lately or just random weather?
16:14
0
Q: PHP nested if statements coding pattern

Taylor EvansonSometimes I end up reading or writing deeply nested if statements in PHP. Here is an example of the original pattern: $keepGoing = FALSE; $valid = TRUE; if($valid) { $otherstuff = TRUE; if($valid) { $goodstuff(); echo 'working'; $valid = FALSE; $keepGoing =...

0
Q: Is it ok to use whitle True in main function for service?

Roy KingThe goal is to build a service that will watch for the most popular communities in some social network. There's no API, so I should make requests and parse html. How it works now? Firstly, I get all topics (or themes) and then I parse the most popular communities of each topic. I have three metho...

@Dan I'm not used to seeing it as rm -fr - typically rm -rf - like the node utilitiy rimraf
@CaptainObvious MRC - I like the $goodstuff() ;)
need more $goodstuff()
16:29
Hehe @Joseph Merdrignac ... Funny thing is... being a writer among other things, I also find "the word is" (indeed) "fairly pleasant". Gonna name my next kid Rimraf :D. "Hey Rimraf, please remove all your toys from the floor. Recursively!" --- It's going to be a great success :D. — Axonn Sep 30 '20 at 7:45
17:04
Monking
0
Q: While statement does nothing on third loop

Ricky BascomWhen i enter a D as my 3rd salesperson initial, it does not regsiter the while statement. Theres no error message. It just doesnt do anything. It will work if i enter it 1st or 2nd but not 3rd. It doesnt matter if it is captial or not capital. using System; using static System.Console; using Sys...

0
Q: Speed up Python code

nicolaI would like to speed up my code. image3 is a tuple of tuples that contain 0s or 1s. I think the bottleneck is in the function make_step. Do you know how could I speed it up? for w in range(len(image3[1])-1): if image1[0,w]==0: start = 0, w end = len(image2)-1, 0 ##### empt...

17:24
@Peilonrayz It's now called Software Engineering. Like you, I'm unsure whether it would be welcome there.
0
Q: I made an infinite error generator

Parkerdaboss216when true do false when false do true help I've never coded before and I know almost nothing about it and I made this abomination and I am proud of myself. The best part is, it actually works.

@Peilonrayz I think it was random weather. I didn't hail where I live, but it did hail 17 miles away in West La and West Hollywood.
It did rain throughout Los Angeles.
17:40
I’m voting to close this question because it belongs on CodeReview — Scott Hunter 26 secs ago
Agreed, if your code is working, and you don't have a specific problem, then you should typically use codereview.stackexchange.com instead. Just make sure to make a post that fits that site's rules. — Random Davis 16 secs ago
@TobySpeight Personally I never recommend other sites to users; I don't want to tell a user to post an off-topic question. Seems like a bad situation :/
17:55
possible answer invalidation by Desmond Rhodes on question by Desmond Rhodes: codereview.stackexchange.com/posts/257012/revisions
0
Q: Faster Tridiagonal Matrix Multiplication

vloveroI have a function that I've been trying to make faster that computes \$XA + B\$, where \$A \in \mathbb{R}^{n \times n}\$ is a tridiagonal matrix, and \$X, B \in \mathbb{R}^{m \times n}\$. In the code, the lower, main, and upper diagonals are represented by dl, dm, du. The naive implementation of ...

@Duga rolled back like a Walmart price
@SᴀᴍOnᴇᴌᴀ RBA
true
perhaps I should have mentioned that recently
shrug
There's no policy.
18:03
@CaptainObvious I see some serious problems with this question.
@pacmaninbw FWIW I do too. I can't tell if the user is trolling or not. However the account doesn't look like any other troll accounts I've seen. Probably best to just VTC and otherwise leave the question alone.
Probably a troll.
It"s closed now.
Don't engage.
idk what language it is, i forgot — Parkerdaboss216 29 mins ago
I mean...
Might be best to close this mess too.
1 more VTC.
18:21
what would closing it do? do you want the OP to update the code and/or description?
0
Q: Hackerrank: Absolute Permutation - How do I make this code more efficient

MNIShauryaThe problem is basically this: Return the permutation of the set of the first n natural numbers which satisfies the following property: |pos(i) - i| = k for all i in (1,n) where pos(i) is the ith number in the permutation If no such permutation exists, return -1 note: the input is the integer n t...

@SᴀᴍOnᴇᴌᴀ It's either MRC, UWYA or both. Even what exactly is wrong with it isn't clear because the question is a hot mess.
It seems it is a hot mess given the revision history; if it is closed, do you want the OP to change something? OP might just ignore such requests and use the accepted answer...
meh
I want both OP and answerer to have a little more respect for site policy.
@Mast I 100% am not going to VTC because if I can't say what the problem is then how can I know the question is off-topic? Additionally the question seems to be perfectly well answered so MRC is completely irrelevant
18:34
@Peilonrayz And UWYA?
From title and introduction of this question, I have no idea what the code is to accomplish. The code does not seem to contain embedded documentation. — greybeard yesterday
And the latest rollback didn't rollback the title apparently.
Must've been a manual one.
@Mast I cba to decipher the English and I don't vote on what I don't understand.
@SᴀᴍOnᴇᴌᴀ Wow. How'd you link to a rev?!
I always click the "link" button, but I land somewhere else.
@Peilonrayz I use this Web developer toolbar which can reveal (Display) Anchors
2
it isn't perfect- you may have observed the anchor is below the grey bar showing the revision number
@SᴀᴍOnᴇᴌᴀ I just downloaded the addon. Open the options and go "how am I going to find the option?!" Look back here and you've already answered my question 😂 Thanks!
18:48
0
Q: Competitive programming, the code is too slow

John DoeI am trying to solve this DIEHARD problem (https://www.spoj.com/problems/DIEHARD/). This is a problem from competitive programming. I've tried to test my program: diff <(python main.py < sample_input.txt) sample_output.txt with their sample input / output and it hasn't shown any difference. But m...

@Peilonrayz "We do what we must because we can"
@SᴀᴍOnᴇᴌᴀ Note to self: finally play Portal...
I never really played it... just sang the song on Rock Band 2
@Peilonrayz If you go that route, might as well reserve some time for playing 2 as well :-)
I'd have thought that'd be a given ;) Can't play 1 without playing 2 right?!
18:58
Only if you don't want to know how it ends.
19:14
0
Q: Quest system - best OOP design and design pattern to use

aderwcan someone suggest the best design pattern or oop design for a quest system More details here Quest spans for x days each quest can have multiple tasks each task has some data like description , amount to complete etc. also each task has a reward and completing all task in a quest has anoth...

20:05
0
Q: Simple Snake Game With OOP in Mind

zellezI am a beginner in C# and trying to learn how to program with OOP in mind. I am 100% that the code is not OOP-friendly at all, but the game is running and working, so if anyone could look throw the code and give me feedback on how to improve it, that would be helpful. The game is a simple snake g...

 
3 hours later…
23:05
0
Q: Secure c++ Password Wallet

Anass YounessI am so new to c++ I made this Basic password wallet using c++. #include <iostream> #include <fstream> #include <string> using namespace std; int main(){ char pass[30]; string site; getline(cin, site); cin >> pass; system("cd /opt/PW/ && openssl enc -aes-256...


« first day (2868 days earlier)      last day (1447 days later) »