« first day (2180 days earlier)      last day (1827 days later) » 

12:00 AM
RELOAD! There are 6008 unanswered questions (89.8350% answered)
 
 
1 hour later…
1:24 AM
This site is for questions related to problems that you're having with programming (code) or use of a programmers tool. You've not explained a problem or asked a question (as I mentioned before). If you're simply looking for peer review of your working code, Code Review was created for that specific purpose. Otherwise, you're going to need to be specific about a problem and ask a more specific question. — Ken White 30 secs ago
 
0
Q: This program works 100% properly, but still getting an error?

dahvheedThis program draws a Koch Curve using turtle graphics. Everthing works 100%, but for some reason I am getting a concurrent modification error. Any way to revise this to eliminate errors? import TurtleGraphics.; import java.util.; public class KochCurve { public static void main(String[] ...

 
2:06 AM
0
Q: How to make loops in scrapy?

Bilal KhanI'm scraping a webpage of Dmoz site. I want to make a loop in functions because the for loop which I am using in every function, I will have to put again and again in every function. Although their functionality is same. The second thing I want to resolve is to make a loop in yield response.follo...

 
2:52 AM
If you are simply looking for general feedback regarding your code, you might want to check out the Code Review Stack Exchange site. — Alexander Nied 14 secs ago
I'm too tired to look at that mess of code. But if this is from your textbook, please don't take it as an example of good coding. It's absolutely not, and I wouldn't let it through a code review. This code is, at best, trying to show off how clever the author is. The reason you find it hard to understand is that it's hard to understand. So basically, I'm sorry for you that you need to read this, but please don't learn from it. :-) — yshavit 53 secs ago
 
 
2 hours later…
4:43 AM
-1
Q: Python find largest file in a directory and print it

Bobilly89I need help on how to use python os.walk to find the biggest file in a directory and then print that files name and size. This is what I have so far: import os for root, directories, filenames in os.walk("c:"): print(directories) print(filenames) I just have no clue how to do this and...

0
Q: Wrapper for LeagueAPI in Node.js

dustytrashFull code is here: https://github.com/LionelBergen/LeagueReddit I'm creating a wrapper for the LeagueAPI in Node.js. This includes methods to call various endpoints and classes to map the outputs & inputs. 'Champion' class is Integer mapped to a name. (output from endpoints) Champion.js cons...

 
 
1 hour later…
6:19 AM
0
Q: Django authentication against Exchange server

Greg SchmitSo this is my first question on Code Review. I wrote an authentication app for Django and my worry is primarily about the security of my app. I wasn't sure if I should post here or security.stackexchange.com but I saw here that "Potential security issues" are on-topic. My Django authentication a...

-1
Q: It manipulate the DOM

Alpit AnandRecently had given an online interview, in which interviewer asked this snippet and , told to find the error. The program compiles successfully however there was no error, not that i know of. Here the code. const jsdom = require("jsdom"); const { JSDOM } = jsdom; const dom = new JSDOM(`<body><

 
This question is better suited for codereview.stackexchange.comMarkus Deibel 31 secs ago
I'm voting to close this question as off-topic because except it is primarily opinion based, it looks like it is a Code Review question. Your code works and you want to improve it. Stack Overflow is for issues you have with your code only. — double-beep 38 secs ago
 
6:47 AM
Monking
 
That's weird on both cases then. That isServicable() impl is fine, it doesn't do loops, so it should be fast. And if there is indeed one shift instance, that cross product shouldn't cause a perf impact. At this point, only a deep code review and some extensive benchmarking could help (which me and my collegue's only do through Red Hat services), but all in all, 3k per second isn't bad. — Geoffrey De Smet 6 secs ago
 
7:17 AM
0
Q: React To-Do App

merkur0Github This is my first "real" React project, it's a simple to-do app with features like creating a new note with a timestamp, marking a note as done (this will add a timestamp to show when the note was marked done) and deleting notes. I'd like to get feedback mainly regarding the best practic...

 
7:36 AM
0
Q: performing SQL SELECT query inside the loop

RopAli MunshiI have a table leave_muster inside which I have to update all the records of the previous month on every start of the new month. My Code public function sync() { $pre_month = (int)date('m') - 1; $data = $this->Leave_muster_model->get_by_month($pre_month); $updated...

 
7:55 AM
-2
Q: Angular 7 CRUD operations in bootstrap modal

JustLearningI am trying to figure out the correct approach of loading crud components in bootstrap modal. I have a table with buttons in a UserListComponent. Each button click opens a modal with a CRUD component e.g. UserCreateComponent. so in the UserListComponent i have a <router-outlet></router-outlet> ...

 
8:10 AM
Monking
 
8:22 AM
Monking
 
8:34 AM
0
Q: Python breakpoints in Vim (Vimscript)

JebbyI recently decided that putting strategically placed print statements scattered about my python programs to debug was getting to be a little messy. I had thought to try out other debugging plugins I found online, but thought I would give writing my own simple breakpoint plugin a shot. I know of...

0
Q: Generically call static methods

WynDieselI currently have two (core) classes : public abstract class BO<TConfig> where TConfig : BOConfigBase { protected TConfig Config { get; set; } internal List<BC> _BCs { get; set; } public abstract void Init(); public void Process() => _BCs.ForEach(bc => bc.Process()); } public c...

 
8:53 AM
Optimization should be posted on code review. You should start by profiling the code to identify which steps are costly. I recommend cProfile. I believe the slow part is probably in the readerXYZ function... — Mathieu 30 secs ago
 
9:12 AM
0
Q: Array Dynamic resize in heap

f1r361rdI have answered a Question in Stackoverflow link. a) Create a function called resize that can be used to increase the size of integer arrays dynamically. The function takes three parameters. The first parameter is the original array, the second parameter is the size of this array, and t...

0
Q: Code vulnerability - Source control

overexchangeBelow is the GO code used from client library to connect to Cloud foundry. c := &cfclient.Config{ ApiAddress: "https://x.y.z.cloud", Username: "admin", Password: "admin", } client, _ := cfclient.NewClient(c) This source code becomes vulnerable due to readable password, g...

 
9:53 AM
I'm voting to close this question as off-topic because requests for code review belong on codereview.stackexchange.comhardillb 5 secs ago
If your code is working as intended then better as such questions at SE Code Review. — πάντα ῥεῖ 10 secs ago
 
10:10 AM
0
Q: httprequest to php login system benefits and disadvantages

AmanI'm trying to make a login system for my website which I'll be releasing in public later on. I have inserted some main samples of my code in here and I would like some useful advise or suggestions. Also if I'm doing anything unsafe or anything which may cause problems in future please let me know...

 
10:29 AM
0
Q: Compute all the permutations for a given vector of integers

Nicola BerniniThe task is to compute all the permutations for a given vector of integers (but of course the specific integer type is not relevant for the solution) The strategy is based on recursion + iterations At each recursion, the state consists of the root sequence a which is the set of elements al...

 
Welcome to stackoverflow. Your question seems more suitable for another network, which is code review: codereview.stackexchange.com . As long as some code is working as expected but needs to be optizimed, codereview is the correct network to post into. — briosheje 43 secs ago
 
@CaptainObvious Look who's back. Unfortunately, that's a Programmers question, not a CR one.
 
11:05 AM
0
Q: Warn if question is tagged with [python-3.x] but not [python]

PeilonrayzGiven that 16/50 of the latest [python-3.x] questions aren't posted with the [python] tag,[1] and site policy is to tag with both.[2] Can we move the burden onto the poster to tag properly, rather than have other users clean this up. I think this number has increased lately, this may be because ...

 
0
Q: Sort Array By Parity

thadeuszlayThe task is taken from leetcode Given an array A of non-negative integers, return an array consisting of all the even elements of A, followed by all the odd elements of A. You may return any answer array that satisfies this condition. Example 1: Input: [3,1,2,4] Output...

-1
Q: Get a map containing differences between two unordered maps

IrbisI would like to create a function which returns a map containing differences between two unordered maps. Here is the code: std::map<std::string, int> getDiff(const std::unordered_map<std::string, int>& unordered_map1, const std::unordered_map<std::string, int>&...

 
11:32 AM
Thank you for your replies. It actually works, I was just worried that this code is unnecessary complicated for computing and there might be better (to significantly improve performance) solution. @briosheje I thought, this community would help me with optimization too, I will use codereview next time, as you recommend. — Martin Simecek 32 secs ago
 
11:42 AM
This sounds more like a code review then and actual issue with your code. If so, try posting this in code review site — Zac 35 secs ago
 
12:07 PM
a) You don't test that. Code review is enough for 2 lines of code. b) you create an abstraction of Process.Start() that is mockable and then call that — Thomas Weller 9 secs ago
 
12:25 PM
0
Q: Insert into SQLite3 database

PloppI have a tsv file containing the mapping for two kinds of identifiers. accession accession.version taxid gi V00184 V00184.1 44689 7184 V00185 V00185.1 44689 7186 V00187 V00187.1 44689 7190 X07806 X07806.1 7227 8179 ...

0
Q: Export OLEObject to a folder

DirectionskyI got this code from "https://www.pcreview.co.uk/threads/how-can-i-output-the-file.2824299/" The code launches each and every OLEObject in the sheet in new image viewer window, i tried to loop through to avoid some 100s of windows, i failed to do so. I want to extract the images so as of now i w...

 
Hi there. A better place for this is Code Review. They help you optimise your code. — Bram Vanroy 31 secs ago
 
1:03 PM
0
Q: Lazy Loading a Bioinformatic SAM record

SamI'm currently writing an API to work with Bioinformatic SAM records. Here's an example of one: SBL_XSBF463_ID:3230017:BCR1:GCATAA:BCR2:CATATA/1:vpe 97 hs07 38253395 3 30M = 38330420 77055 TTGTTCCACTGCCAAAGAGTTTCTTATAAT EEEEEEEEEEEEAEEEEEEEEEEEEEEEEE PG:Z:novoalign AS:i:0 ...

 
1:23 PM
0
Q: Minimum values in numpy arrays

ibra meta(s,c,l,e,r): are arrays for i in range(q): for j in range(25): if s[i,0:1] == C[j,0:1]: f = f+1 l=np.array([]) l[f,0]=min[e[s[i,0]],r[s[i,1]]]; l[f,1]=C[j,2]

 
1:42 PM
1
Q: Beginning C character array explanation

RobotManI have been following along the book 'The C Programming Language' 2nd edition by Kernighan and Ritchie. The below code is an exercise from the book. What I am confused about in this code is the Character array 'line'. It is a local variable so I don't understand how the value is changing when it ...

 
If you're worried about correctness, I'm not sure there's anything we can do. If however you're looking for improvements regarding style and efficiency, you should go to codereview and ask for advice there (copy-pasting this exact question should do) — Right leg 33 secs ago
I'm voting to close this question as off-topic because it belongs to codereview.stackexchange.comRight leg 5 secs ago
If your only question is "how can I improve this?", you're probably better off posting your full code over at codereview.stackexchange.comBroots Waymb 48 secs ago
 
2:40 PM
0
Q: How to make another function in a loop?

Bilal KhanIs there any way for for loop not to be repeated in every function which I make for seperate pages? Because I don't want for loop to be repeated in every function although the things which I have written are same in for loop in every page. Is there any other function require for separating the lo...

0
Q: Similar to boggle game

Urfa JamilNeed help to edit this code to allow user to find words in the grid that are touching horizontally, vertically, and diagonally adjacent. For example, the board: Q W E R T A S D F G Z X C V B Y U A O P G H J K L contains the magic words WAS, WAXY, JOB. # include <stdio.h> # include <math.h> # inc...

 
2:50 PM
Greetings, Programs.
 
Can I ask a 10k user to tell me whether they can see this page?
I know that anon users can not
But I wonder what that's for logged in users
Monking btw :)
 
Monking
@CaptainObvious Broken code.
@CaptainObvious Off topic, not owner and a "How to" question.
 
3:07 PM
Monking
 
Monking
 
@Vogel612 Yes I can see the list of underrated feedback when I click that link
 
Only 8:10am and already 7 VTC. :(
 
@SᴀᴍOnᴇᴌᴀ thanks for confirming :)
 
@pacmaninbw I got one in the LQP Queue :) on 241 more posts until I get my steward badge there
 
3:13 PM
It's really cool what tools SE has given us, but weirdly hidden away...
3
 
@Vogel612 yeah I still have to learn about all these tools and how I can use them
sure I read the first page of instructions
but it doesn't mention things like underrated feedback
 
I only learned about that thing today :)
 
@SᴀᴍOnᴇᴌᴀ I have 6 Custodian badges for review types.
 
0
Q: Parse through an xdocument efficiently and match values to matching object

yhyrcanusWorking Code: foreach (XElement xElement in xDoc.Root.Elements()) { filteredParamList = paramList.Where(param => param.xmlName == xElement.Name.LocalName); if (filteredParamList != null && filteredParamList.Any()) { filteredParamList.Single().Value = double.Parse(xElement.Value) ...

1
Q: Simulate round-robin tournament draw

EldarI decided to implement the round robin algorithm in Python. My code takes a list of teams as input and prints the schedule. This is my first try to write something by my own after taking some online courses, so I am absolutely sure that this code must be significantly improved. Here it is: i...

 
3:18 PM
And I can't even see the page due to lack of points.
 
3:33 PM
@SᴀᴍOnᴇᴌᴀ What is the LQP queue?
 
does anybody have familiarity with batch in -? I'm wondering if the author of this answer should provide more detail to back up the claim about obstruction
 
Maybe Code Review Community is a more suitable place for this kind of topic. — Biagio Festa 39 secs ago
 
@SᴀᴍOnᴇᴌᴀ thanks @pacmaninbw for commenting - apparently you think what I surmised is true
 
Welcome to Stack Overflow! If you want help improving work code you should post this on CodeReview.SE. If you do decide to do so please delete the question here. — NathanOliver 25 secs ago
 
Monking
 
3:47 PM
@SᴀᴍOnᴇᴌᴀ I don't know java-spring, but it seemed really terse.
@SᴀᴍOnᴇᴌᴀ it was in the first posts queue.
 
@pacmaninbw well imagine that - such coverage!
 
:)
TTYL
 
You are "yatta-yatta"ing with perform some checks. This very relevant information for us to know. If the checks can be articulated within SQL, then it would be possible (best practice) to perform the whole process with a single, non-iterated query. Additionally, this is a cronjob, right. Are you executing INSERT or UPDATE queries with the qualifying data? Is $key relevant in your code, I am guessing not. — mickmackusa 7 hours ago
makes me think of a certain Seinfeld episode
 
0
Q: feedback needed on c# data access library for mongodb

Ryan Gunneri just pushed out v3.1 of MongoDAL which is a simplified data access layer wrapped around the mongodb c# driver. the api is quite easy to use compared to the official driver. an example query would look as simple as follows: var author = (from a in DB.Collection<Author>() where a....

 
4:12 PM
Thanks for the advice! I didn't know about Code Review Community. Will check it out now, thanks again for your answers. I'll have a second look having in mind integer arithmetics and arrays. :) — Daniel 16 secs ago
possible answer invalidation by Deduplicator on question by Nicola Bernini: codereview.stackexchange.com/posts/217939/revisions
 
4:28 PM
@Duga that's okay - an extra line was removed after the code block, along with TIA
 
Please check "Which site?" for general issues and "Code Review or not?". — Prune 19 secs ago
 
4:52 PM
This is a question better suited for https://codereview.stackexchange.com/ than here — C.Nivs 17 secs ago
 
5:08 PM
@Duga @SᴀᴍOnᴇᴌᴀ Yea, that's fine.
 
0
Q: Different payment details in a common list, to be casted

JimboFlexI need to be able to access a number of different payment methods in a common list. They can be different methods - credit card, cheque, direct debit etc. The only common attributes are the payment method id and PaymentMethodEnum. I would then be casting the payment method to it's appropriate typ...

 
5:34 PM
-2
Q: First time fumbling around with a vector of vectors, and producing weird results

aNameSorry for asking for help, but I don't know where else to go for this. I've tried using a debugger (and don't really understand what I'm seeing either). I'm teaching myself to code and attempting exercises in order to get some practice. I have to write a function that returns a vector of vectors...

0
Q: Optimizing graph partitioning by connected components of generated subgraph

Zachary HunterI'm trying to optimize a function in a process which is gonna be run millions of times. The function is supposed to partition the vertices of graph, which will be used to make a quotient graph, theoretically, the process is: Input a graph, G For each vertex, v in G, we choose a random edge of v...

 
@JesperJuhl That question won't fly well at SE Code Review. Only working code is accepted there. Proper compilation doesn't mean the code works as intended. — πάντα ῥεῖ 45 secs ago
 
6:13 PM
0
Q: Primitive Full-Text-Search on some Properties of an Object

VSDekarI am not a JS/TS Guru, so i wanted to ask if one could write this better. I needed a very primitive Full-Text-Search of some properties of an Object. What do you think? export const search = <T, K extends keyof T>(term: string, objects: T[], keys: K[]): T[] => { const foundObjects = objects.f...

 
This may be a good question for codereview.stackexchange.com since your code works but you're trying to improve efficiency — G. Anderson 47 secs ago
 
6:26 PM
One of the modules has decided to randomly fail one test, just for the heck of it.
 
6:38 PM
Apr 10 '18 at 19:01, by Sam Onela
rogue unicorns? cosmic rays?
 
@SᴀᴍOnᴇᴌᴀ Considering where I work, saying "cosmic rays" would just cause professional, science based argument. Saying "unicorn" would get me labelled as mentally unstable.
 
@Donald.McLean oh right...
 
I think I can safely say that we either have a cosmic ray expert here, of somebody has one on speed dial.
 
I was in a consult call with a vendor this morning called Unicon - didn't realize until after the call started that it wasn't Unicorn (。◕‿◕。)
 
0
Q: DRY principle applicable here?

Joey CoderI have two cases here 1) the person who ordered a ticket clicks on "Permission" and the OrderConsentUpdate View updates the database. The option 2) is the attendee him- or herself gives consent for one specific ticket. In that case, AttendeeConsentUpdate is called. You can see both classes are ve...

 
6:58 PM
@SᴀᴍOnᴇᴌᴀ One letter differences can cause great confusion. Consider the differences between the words "macaroon" and "macaron".
 
@Donald.McLean yeah - we had a developer at our company give a presentation and she forgot the l in the word Public for a slide heading (-‸ლ)
 
@SᴀᴍOnᴇᴌᴀ Big difference. At least macarons and macaroons are both types of cookies.
 
@Donald.McLean you helped me realize I was actually confusing the two last week - thanks!
 
Remember folks: The Planned Maintenance has been moved to 23:30 UTC today!
 
(╯°□°)╯︵ ┻━┻
thanks for the reminder
 
7:48 PM
This would probably be a good place to start Iterate over chunks of date range. Instead of using span_days find your time delta between the dates and divide by the number of ranges you want. — Error - Syntactical Remorse 57 secs ago
 
0
Q: What is the classes in MapReduce check for stragglers and speculate tasks?

Hunter TFrom my limited knowledge of Hadoop, I understand that the TaskTracker is in charge of Map and Reduce tasks. I am attempting to modify the decision to speculate slow reduce tasks by (1) checking for stragglers, (2) identifying the reason tasks are straggling, and then (3) deciding whether to spec...

0
Q: Modal pops up after ajax call completes instead of before

J. DuBoisI have a modal that I am using to tell the viewer "Please wait" while an AJAX call is made. It may be something as simple as how I am making the call. When I click my web link, it appears to be running the code I need, and making the needed call. However, my modal pops up AFTER the ajax call i...

0
Q: Confusion about matrix shapes while using scipy.optimize

Shirish KulhariHere's my code for a machine learning problem I'm attempting. Note that the .txt file being read has three columns. Mostly I'm trying to keep the array shapes in the form of (m,n) rather than (m,), whether it's a square matrix or a vector. As for vectors, I'm keeping their shapes as (m,1) (column...

 
@CaptainObvious I believe this is broken code.
@CaptainObvious pseudo code, hypothetical
 
8:17 PM
This sounds like a question better suited for CodeReview than StackOverflow. — TheMadTechnician 38 secs ago
 
8:34 PM
@CaptainObvious RBA'd
@CaptainObvious and OP apparently doesn't know that java !== javascript :/
 
8:47 PM
0
Q: Putting a Queue Between HTTP Request/Response

Phil SandlerWe currently have two legacy systems: the Consumer and the Worker. These systems are massively complex in ways that are not important to this review, but it is enough to say that a large-scale re-development of these systems is not currently possible. The Consumer communicates with the Worker v...

 
9:06 PM
1
Q: Extract the IP address from the output of ipconfig when connected to multiple wireless networks

Albert RothmanI am trying to extract the ip address of my machine when connected to multiple wireless networks. The motivation here is then I can make a socket connection on that ip when I have two networks that have the same default gateway. I am hoping that there is either a way to greatly improve the code o...

 
9:25 PM
You may want to check out Code Review for questions about improving working code. — glibdud 26 secs ago
 
9:51 PM
I think this question is better suited on CodeReview. — Lasse Vågsæther Karlsen 56 secs ago
I'm voting to close this question as off-topic because the question belongs on CodeReview. — Lasse Vågsæther Karlsen 21 secs ago
 
10:29 PM
This should be un the code review stack exchange — BlueSheepToken 35 secs ago
 
@Duga hypothetical code might be incoming - the post on SO appears to be RBA'd by owner
 
10:43 PM
0
Q: LeetCode 773. Sliding Puzzle - DFS Logic

Sanat VijI tried to solve the LeetCode Sliding Logic Puzzle using BFS and DFS. My BFS solution worked, but my DFS solution did not ... and I cannot figure out why. Here is the original question: https://leetcode.com/problems/sliding-puzzle/ This is the basic logic of my implementation: generate ...

 
11:28 PM
@zero_coding I think you need to create a Merge Request there in order to be able to add code review comments — Denis Makarenko 40 secs ago
 
11:40 PM
0
Q: Simple Javascript card game

FlamoondoonI'm currently learning JavaScript and I'm working on a small project but I need your help. I've been working on this card puller website were you can pull a card and it then adds the value of the pulled card together. I would like to know how I can make it so that the value addsup eachtime you ...

0
Q: Compare two version numbers in the form Major.Minor.Patch.Build to see if one is less than or greater than the other

the_endianPython 3.7.0 from sys import argv class Version: def __init__(self, ver_str): if type(ver_str) != 'string': ver_list = ver_str.split('.') self.Major = int(ver_list[0]) self.Minor = int(ver_list[1]) self.Patch = int(ver_list[2]) ...

0
Q: Running AWS commands works ok, but the code seems messy and I don't like the time.sleep bit

star_tracThis is what I've come up with for a class that handles parsing AWS Textract output. So far it only gets the AWS Textract output into a .txt file. import json import logging as log import os import sys import subprocess import time log.basicConfig( format='%(asctime)s [%(levelname)s]: %(messa...

0
Q: Finding median from unsorted array with duplicate elements without sorting it

LigerI am implementing a method to find the median of an unsorted array using a counting sort. I would happily go for a median of medians or selection algorithm for better performance but they are essentially sorting the array(or partially sorting the array if I choose to go for minHeap) which I am no...

 
@CaptainObvious #GimmeTehCodez
 

« first day (2180 days earlier)      last day (1827 days later) »