« first day (1902 days earlier)      last day (2107 days later) » 

12:00 AM
RELOAD! There are 5451 unanswered questions (89.9422% answered)
 
 
1 hour later…
1:13 AM
This might be a better fit at Code ReviewJohn Coleman 30 secs ago
Your question is both too broad and opinion-based for Stack Overflow. Since you have a perfectly working code and seek for a review, I suggest you post your question at Code Review, with the d3.js tag. — Gerardo Furtado 39 secs ago
 
1:29 AM
0
Q: Counting sort in C

Dmitry KudriavtsevI have implemented counting sort in C. This program takes its input as integers from command line arguments, sorts the integers with counting sort, then outputs the sorted array. This is my first attempt at implementing this and I would really like to see what I could do better in this code. #...

0
Q: IsMovePossible and colors in 2048 game

J. DoeHere I have the code for a 2048 game besides 1 main thing. import random import termios import tty, sys nlist = [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,2,2,0] score = 0 def spawnnum(): x = [] for i in range(0, 16): if nlist[i] == 0: x.append(nlist[i]) y = random.randint(1...

 
1:51 AM
I'm voting to close this question as off-topic because this question belongs on another site in the Stack Exchange network (possibly code review) — collapsar just now
 
2:23 AM
@GerardoFurtado I didn't know about Code Review. I'll post it there, thanks! — Jeff Appareti 48 secs ago
Although this question might technically be on-topic here, I think that you may find codereview.stackexchange.com to be more suited to your needs. — Jerrybibo 38 secs ago
 
2:38 AM
0
Q: Update pattern for subplots d3 v4

Jeff ApparetiI'm working on a d3 project that has multiple sub-plots with updating data. I have a working example below, but I think I might be overcomplicating the update() pattern. I didn't include an exit() because the data is consistent (there's always the same amount of divisions, teams and values). d3 ...

 
possible answer invalidation by Snorrlaxxx on question by Snorrlaxxx: codereview.stackexchange.com/posts/198113/revisions
 
3:19 AM
I think you may find codereview.stackexchange.com to be more suited to your needs. — Kohki Mametani 8 secs ago
 
3:46 AM
0
Q: Is there an issue with my bisectional search?

dljkasfThe given problem: use bisectional search to find the minimum monthly payment to pay off debt after 12 payments (slight. Assume that the interest is compounded monthly according to the balance at the end of the month (after the payment for that month is made). annualInterestRate=.2 balance=32000...

 
4:22 AM
0
Q: Update google chart with dynamic data

user3012974<!DOCTYPE html> <html> <head> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <script> google.charts.load('current', { packages: ['corechart', 'line'] }); function drawBasic() { var xValue = Number(document.getElementById...

 
4:41 AM
0
Q: Implement thread safe arraylist, get, put, add, remove functions

user2038560I am preparing for multi thread interview questions. I don't have much experience on multi thread. I referred some online article to come up with solution. Is this solution appropriated? Any suggestion is welcome. public class ThreadSafeArrayList<E> { private final ReadWriteLock readWriteLoc...

 
5:14 AM
This might be better suited to ask on codereview.stackexchange.comLex 34 secs ago
 
5:38 AM
Monking
@Duga Yes, rolled back. Thank you, Duga.
@202_accepted Usually when you go down to 5V, it's 5V DC. That means you need more than just a transformer. Do you want a DIY solution or a pre-build block?
 
Monking
 
6:18 AM
This looks suspicious. You probably should create a package. Your run function should get the file name passed as a parameter. Also, your question is a better fit for codereview.stackexchange.com. — Roland 8 secs ago
@diagold Hey, I never said that—a code review will always find stuff, that the point :) I'm not very familiar with learning resources but I think PHP Delusions has some nice articles and PHP The right Way is often recommended here. However, none of these are specific to OOP. I think the important thing is that you actually understand the code you write and not just blindly copy and paste code you find in Stack Overflow (clean_str() is probably the case). — Álvaro González 37 secs ago
 
6:52 AM
Code Review would be better. But a first guess is the myriad of .Range/.Cells calls - resolving all these range objects is probably the culprit. — Vegard 41 secs ago
 
1
Q: Python: Dijkstra's Algorithm

jkdIn this code, I focused more on code readability rather than algorithmic complexity. I didn't really care about the code in the main function because it was just used to test the code. Some of the classes have a D prefix to differentiate them from the regular Nodes. A few problems in particular...

0
Q: Counting sort in C, revised

Dmitry KudriavtsevThis is a revised follow-up to this question. I have implemented most of the suggestions in the accepted answer. I am interested to see what I could improve in my code and what I could do to make it better. I have implemented counting sort in C. This program takes its input as integers from ...

 
7:47 AM
Monking
 
@DmitriyPolyanskiy codereview.stackexchange.com — Mafii 29 secs ago
 
8:16 AM
@talonmies (by definition)[en.wikipedia.org/wiki/… a plain observation of something being wrong is plain criticism , not constructive criticism. I am in the right place and I ask Why is wrong and How to fix it. You just have "observed" that it is wrong. I know it is. That is why I am asking. Otherwise the question would not be fit for SO, maybe codereview. I do not see how its wrong. in the loop I 1) grab the host pointer to the positions 2)malloc the device pointer 3)copy the host to device) 4)copy the device pointer to struct. — Ander Biguri 52 secs ago
 
0
Q: Converting Json Array to Java Object

rikithe java method below is responsible for making a JSON request to a Node.js server. When it makes the json request it returns an array of JSON with the values ​​I need! I state that the code below runs on android and as api json use these: http://www.java2s.com/Code/Jar/j/Downloadjavajsonjar.htm!...

 
8:35 AM
0
Q: Demonstration of the Area of the Largest Square Submatrix

austingae Problem : Using the C++ language, have the function MaximalSquare(container) take the container parameter being passed which will be a 2D matrix of 0 and 1's, and determine the area of the largest square submatrix that contains all 1's. A square submatrix is one of equal width and ...

 
possible answer invalidation by Mart on question by Mart: codereview.stackexchange.com/posts/199669/revisions
 
@Duga That looks very invalidating.
 
Monking
 
8:55 AM
possible answer invalidation by Mart on question by Mart: codereview.stackexchange.com/posts/199669/revisions
 
@Duga These additions + the discussion under the answer call for a followup question…
But I’m not sure where to rollback
Rev 4 sounds good
Not sure if rev 5 invalidates the answer
Mind taking the decision @Vogel612 ?
 
ack
 
0
Q: Android MVP+Dagger2+Room

Abhinav TyagiI recently developed an app as a part of the interview process. The result is still awaited. Since I work alone as an individual developer, my code never gets reviewed. I want to improve my coding style and learn better practices. Using this platform and some sharable code from this interview, I ...

0
Q: Select column from database and compare with the list

codelover string[] firstlistA = updatetime.ToArray(); string[] firstlistB = username.ToArray(); string[] firstlistC = lotname.ToArray(); string[] firstlistD = stageset.ToArray(); string[] firstlistE = Prname.ToArray(); { con.Open(); st...

 
9:42 AM
0
Q: Dijkstra's algorithm implemented in Excel VBA

neelsgI wanted to implement Dijkstra's Algorithm in an Excel VBA Add-In and built it to be used as follows: Define a list of paths with distances between points. This list needs to contain 3 headings that are used as flags to pick up where the list is. The 3 headings are !dijk:dat:from, !dijk:dat:to ...

 
"How can I write my Struct to Firebase?" i have answered your question. For any more questions provide the relevant code and post a new question. If you have found a solution and want some feedback you should post on code review. Iterate through infoProvided, use my answer and you are good to go. — Do2 56 secs ago
Well well well. This is a codereview, not a bug. — user202729 13 secs ago
 
10:00 AM
0
Q: Server app: pinging up to 500 clients asynchronyosly in a solid way

Dmitriy PolyanskiyTCP/IP server which controls up to 500 clients. Each client can send a lot of messages to the server. I face perfomance issues and trying to find bottlenecks. What do you think about that part which pinging remote clients? using System; using System.Collections.Generic; using System.Linq; using ...

0
Q: golang rabbimtq message consumer

vahid chakoshyi need to process rabbitmq messages with golang with worker style, is this correct way to process rabbitmq messages with golang? func main() { conn, err := amqp.Dial("amqp://guest:guest@localhost:5672/") if err != nil { panic(err) } defer conn.Close() for _, q := ran...

0
Q: Javascript Snake

MartenI have implemented a little snake game with Javascript and Html. This is my first game with Javascript. I use a Linkedlist to represent the snake. Both code snippets are in snake.js file. It would be really nice if someone could give me feedback. LinkedList: function Point(x, y) { this.x=x; ...

 
10:30 AM
@Iguananaut Question on Code Review is on hold. — Mast 16 secs ago
 
0
Q: Filtering a name Array in javascript

ealefI was wondering if there is a better, more elegant way to write the following javascript code block: var searchString = 'ma'; var names = ['Mark Kennel', 'Mary Smith', 'Jane Sue Annet', 'Peter']; var filteredNames = names.filter(name => { var words = name.toLowerCase().split(' '); for(var i...

 
11:05 AM
0
Q: Pythonic way to explicitely test for True and False

Richard NeumannI have a use case in which I need to check a given value whether it is explicitely True or False: def stringify(value): """Returns the string representation of the value.""" if value is None: return '-' if value is True: return '✓' if value is False: re...

0
Q: Python method or generator

Drudox lebowskyI'm writing a class to solve differential equation in python (I know that there is a lot of library but I want to learn .. and so I'm create something almost from scratch) I would use the generator in order to compute an Integral stepper this: @classmethod def step(cls, f...

 
@CaptainObvious No context.
 
This question belongs to Code Review site. — Nikhil Vartak 22 secs ago
 
11:28 AM
@Mast It's 24VDC to 5VDC. I have access to AC and DC sources. Don't care if it's DIY or OOTB.
 
@202_accepted Get a buck converter.
If you DIY one, make sure you got an elcap over the load.
 
That's what I was thinking.
 
Wide range input or exactly 24VDC?
As in, how sure are you the input is exactly 24 and at what values does it still have to work?
If it's something permanent you want something smaller, but if it's for a test set-up, consider something like this. Doesn't care that much about the input and has 3 outgoing rails.
Way overkill, but hey, for that price on a one-off...
 
11:51 AM
Specs are 24V+/-0.2, 1.5A+/-0.1
We measured 24V+/-0.1
 
1
Q: Calculate different speeds between min and max speed with a stepsize

kokos123public static void main(String[] args) { int minKmh = 10; int maxKmh = 20; int step = 5; String allSpeeds = ""; while (minKmh <= maxKmh) { allSpeeds += minKmh + ","; minKmh += step; } String[] allSpeedsAsArray = removeLastChar(allSpeeds).split(","); //...

 
@Mast Basically, we're hooking this into a 24V TTL/PLC driver.
 
 
1 hour later…
1:18 PM
@202_accepted No need for a wide range then. That's stabilized already.
 
@200_success Saw your answer on re.compile() option.... instead of doing re.search()
How re.compile().find_all() approach is efficient compared to re.search() for every line?
 
you only compile the regex once instead of every time you hit the re.search line
 
but find_all() runs for every file
hex_re = re.compile(r'(?<!\\\n)^0[xX][0-9a-fA-F]+', re.MULTILINE)
    for path in file_paths:
        with open(path) as f:
            for event_code in hex_re.findall(f.read()):
                yield int(event_code, 16)
My question is... how find_all() per file more efficient than re.search() for every line of the file?
 
0
Q: Use key as object in map C++: Check if the less operator is implemented correcty

Hani GotcHello I wrote the following code. It allows me to use objects as keys in a map. I have a constraint though: In addElement function both arguments must be pointers // Example program #include <iostream> #include <string.h> #include <map> typedef struct { char * name; } Test; class Tes...

 
re.search(...) is basically re.compile(...).find
 
1:25 PM
ok
I have heard of source code compilation to binary but what does regex compilation mean?
 
regex is basically a programming language
 
@Mast Yeah it's supposed to be pretty stable for some of the other things it's used for.
 
so whenever you use regex most implementations for regex engines will have to compile the regex to use it
 
compile you mean validate?
like regex engine parse the regex pattern itself for being valid? as part of usage..
 
and then get it into a form more suited for usage as well
 
1:30 PM
compile the regex to use it.. you mean validate the regex syntax? used in the first argument of search()
 
@overexchange He means they'll often compile it to some sort of code, rather than a regex string.
 
Ah got u
[0-9] mean '0' in str or 1 in str or 2 in str or...
 
Something like that, yeah. Different engines do different things, but it typically becomes some sort of code that is executed.
It also aids re-use substantially, if our regex is the same, then we can build a piece of "code" to execute new strings against.
(Regexes are a huge, complex subject.)
 
@overexchange: regexes "compile" to some form of DFA (deterministic finite automaton). Building this DFA can be expensive
(generally speaking at least. some implementations might use more complicated stuff internally, e.g. to support correct matching of parens)
 
Yes I did write C code in college to first convert regex to NFA and then to DFA - textbook from Ullman & some other author
DFA should reach final state to match regex for any input...
 
1:39 PM
0
Q: Haskell game server auth: cookie key generate&check

Евгений НовиковC++ code version (description copied from it) gameKeys id is authentication function of an MMO game server. When someone wants to play with friends, he sends request to server, server calls generateId, then gameKeys id and returns it as JSON using encodeJSON to player via API. When a friend esta...

0
Q: copy and pasting a scoreboard using vba

Mugabi Onesmushelo,i am a bit green in vba . I want to create a code that allows me to copy and paste my scoreboard plus resize the rows as many times as possible. but only pasting one copy for each run.

 
@hoffmale Thank you for reminding my basics that I already worked on.. but never realized that am amidst that...
 
Monking
 
let me check the dictionary.. for the meaning
life of monk?
 
You might want to post on codereview.stackexchange.com, SO is not really suited for codereview but rather for specific problems that have specific answers. — Freggar 48 secs ago
 
1:54 PM
Greetings, Programs.
 
31
A: What's a Zombie? And what are the many other memes of Code Review?

Vogel612Meme: Monking Originator: Morwenn Cultural Height: The 2nd Monitor Background: A morning greeting to the Monkey doing his monkey-business, in other words: monking Examples: A small chat search Variations: Monkernoon, Monkevening, Monknight, and the reversed gniknoM sometimes used when one le...

 
possible answer invalidation by Richard Neumann on question by Richard Neumann: codereview.stackexchange.com/posts/199819/revisions
 
@Duga Seems fine, adding context
 
2:48 PM
1
Q: Circles of numbers

kharandziukI have a function: def palindrome(n): res = [['0']] for x in range(1, n + 1): str_x = str(x) l = len(res) res.insert(0, [str_x] * l) res.append([str_x] * l) for line in res: line.insert(0, str_x) line.append(str_x) retur...

 
3:09 PM
0
Q: Wrapper for server component IPDaemon from nsoftware

Dmitriy PolyanskiyIPDaemon component from nsoftware. I haven't found good example of using this control. I'm developing socket server which can accept up to 500 clients connections each client can send a lot of messages each second. What's the best configs for IPDaemon should be to be good for these requirements? ...

0
Q: C - Random subject for every day of the week generator

Cvetelyn IvanovI've recently made a program which generates a (pseudo) random number which is tied to a specific subject to learn for every day of the week. The program generates the numbers the first time it's used and after that every Monday. Currently i'm using only 2 subjects and the program's got only one ...

 
3:20 PM
possible answer invalidation by kharandziuk, kharandziuk on question by kharandziuk: codereview.stackexchange.com/posts/199834/revisions
 
0
Q: How to handle a large amount of very specific use cases

emsimpson92So I'm writing a program that runs quite a few different tests. Which tests are ran varies based on which UI elements are selected by the user. For example, on one form I have 7 radio buttons and 6 check boxes. For each variation, anywhere from 2-5 different tests are ran. The user is able to sel...

 
3:41 PM
@Duga Doesn't invalidate the answer
 
0
Q: Prime number sieve in Standard ML

James JensenAs practice, I have written a prime number sieve in Standard ML. It works in a pretty straightforward way: The list of known primes starts with just 2. Starting with 3, check whether each odd integer is relatively prime to all numbers in the list of known primes (i.e. is not divisible by them)...

 
A question like this with code that works and you want to look for possible optimizations is better asked on codereview.stackexchange.comcharlietfl 13 secs ago
 
hex_re = re.compile(r'(?<!\\\n)^0[xX][0-9a-fA-F]+', re.MULTILINE) In this regex, what does ?< mean?
 
negative lookbehind
 
!\\\n says... no backslash followed by newline before hexcode..
 
3:51 PM
basically: "we haven't encountered "\\\n" before this position
to avoid matching line-continuations, I think
 
Basically this is covered in Code Review in this question Balanced parenthesesLiam 38 secs ago
I'm voting to close this question as off-topic because it's already been answered on code review. — Liam 24 secs ago
 
(?<!...)
 
? -> special capture group
< -> look before
! -> negative
 
4:07 PM
I'm voting to close this question as off-topic because it is asking for a review. Please send this over to Code Review and then close this question. — Codexer 20 secs ago
 
Huh... I didn't know posting an answer could require you to take an automated turing test (= captcha)
 
@hoffmale there's some timing checks on posting
 
That might explain it
 
if you take too long (or too short) they'll put in a captcha
 
4:09 PM
I did take my time with that one
 
4:27 PM
Monking
 
nibjubg
 
4:42 PM
An updated version of the new Code of Conduct is open for feedback until July 27th. Go read it and shape the replacement of "be nice"
4
 
They put both revisions on GitHub, shiny.
Now we could easily diff them if they hadn't made them into PDF.
4
 
lol
 
Uhu...
People, this is serious business. From now on, no more jokes. The network can't handle it.
6
 
0
Q: K&R E 5-15 solution

svsAs I'm on a pursuit learning to program in C I'm making my trough K&R. The goal of the exercise is to add a option to the program so that the sorting does not depend on upper or lower-case letters. What are your opinions on my use of function pointers in this exercise? Do you see any obviou...

 
@Mast go write an answer :)
 
4:49 PM
@Vogel612 I'm having plenty of trouble staying nice to colleagues this day already, let alone vs SE.
I'm not risking it.
But if anyone wants to nick that pic and write an answer, go ahead. I won't sue.
Honestly, I don't expect such rules to be enforced too strongly in most chats. Rules are there to fall back on in case you run into someone being an asshat.
Rules this strict simply can't be enforced strongly on a platform this big.
With users this nuts.
 
I want to wrap below lines into single line by removing trailing back slash and introducing single space..
0x0536ff01 E 50 R CA.EventCondition, \
        "regexp( {v 7},{S \"OCHSWAUTO\"})", "0x0536ff02 -:-", \
        "regexp( {v 7},{S \"TXSWFAB\"})", "0x0536ff02 -:-",  \
        "default", "0x0536ff03 -:-"
Is textwrap a right tool in python for this...
 
@Mast I'm totally gonna pin that.
 
Welcome to stack! In order to have a good chance at getting an answer, its important to ask a clear and specific question. This isn't a place for asking advice or getting someone else to debug your code (there is a code review section for that). Please try to reform your question to be specific about the issue you are experiencing, for example, what exactly do you mean it will continually redirect? — Jon Church 17 secs ago
Hi there! Welcome to stack overflow. Although I'm sure this is a frustrating bug, this is not the part of the site to ask people to debug your code or review it. You can ask this question on the Code Review section of the site perhaps, or if you have a specific question about animation with jQuery, that would be more appropriate codereview.stackexchange.com Have a nice day! — Jon Church 5 secs ago
 
5:25 PM
@JonChurch Hi Jon, this question would be most unwelcome on Code Review. Please read A guide to Code Review for Stack Overflow users and the Code Review help center. Code stripped from all context is one of the things we don't deal in. — Mast 17 secs ago
 
@Dragonrage I'm not sure the SE network gets any welcoming by punishing chatty chat puns with 30 minute chat bans. So I wasn't sure. — Mast 8 secs ago
 
5:41 PM
regex without paranthesis r'(?<!\\\n)^0[xX][0-9a-fA-F]+[^\n]*' gives output `0x0436ff02 E 50 R CA.EventCondition, " ` where as...
regex with paranthesis r'(?<!\\\n)(^0[xX][0-9a-fA-F]+)([^\n]*)'groups the output: ('0x0436ff02', ' E 50 R CA.EventCondition, " \\')
So... does compile_rule.findall() create groups based on paranthesis?
 
6:11 PM
0
Q: Read unstructured excel payslip and export to structured excel table

Toby BishopI've not used this site before, I would like to get opinions on the code I've completed for my first 'program' in python. I would like to understand how 'good' it is and where it can be improved, anything that says "you're clearly a beginner and haven't learned xxx" would be helpful. Background ...

 
6:28 PM
-1
Q: An Issue with my app

plutesciHello I have asked at another stack and had a poor response to my question. maybe this is more suited for this stack. I can not add the shebang #!/bin/bash to a option the app has when opening up a bash script from within the apps capability's and this is the line I need some help with, so if y...

 
7:17 PM
0
Q: To-do list with counting of checked items

Kate HerasimenakFor practice JavaScript I created simple To-do app. This app can add TODOs and track the number of total TODOs as well as the number of unchecked TODOs. For this I written 4 functions: for add newTodo - newTodo(), where I add new todo to todos array for render list of todo - drawTodoList(), ...

 
7:31 PM
the issue is not in routing. if the scripts is in xxx.js file, your razor code won't work. and Url.Action return action result, not a url, it should be Url.ActionLink. and never try to do your first code, it won't pass code review. — Dongdong 56 secs ago
 
0
Q: What is the simplest way to compare truthiness in this specific way?

CalamityAdamGiven the following instructions I have created a function that achieves the requirements. I feel my function is a bit too complex, though it does what it's supposed to. The difficult part for myself was avoiding the equality operators. The only way I could think to solve this is with a bit of ma...

 
@CaptainObvious Weird approach. Left a comment.
 
8:35 PM
If you have working code but are trying to improve it, maybe head over to Code Review - as your question is, it's hard to really nail down your issue. — BigBen 28 secs ago
 
8:57 PM
0
Q: Matching rows between two dataframes

Florian BernardI have managed to write this piece of code but as I am using it on big data sets it ends up being quite slow. I am pretty sure it would be possible to optimize it but I am very knew to coding and I don't really know where to start.. I think getting rid of the for loop would be one way but honestl...

 
True, I should have created it under codereview.stackexchange.com, Not sure, if questions are transferable after they are created? — Developer 18 secs ago
 
9:16 PM
i don't think you can move the question, but next time you can create similar questions in code review if your code is working but not sure if it's good code :) — Vinit 46 secs ago
 
9:34 PM
I have chatted with the owner above, and I approve those edits.
 
10:02 PM
0
Q: Bash creator app

plutesciHi I am a beginner and have created this bash script that helps that very same Creating bash scripts. It is no issues on shellcheck.net The code can be found here. https://github.com/plutesci/Iwanttobash/blob/master/Icode.bash I would like some feedback from more experienced users. Any sugge...

 
10:23 PM
@rolfl "I am Monkey and I approve of this message."
2
 
10:37 PM
Indeed ;-)
Monking
 
11:02 PM
I'm voting to close this question as off-topic because it belongs on Code ReviewJim Garrison 47 secs ago
 
11:42 PM
0
Q: This code transforms raw data in a table into nested objects

aloisdgI have a huge array that I want to group by by category and subcategory. A Book is contained in a shelve. A Shelve is contained in a Library. The output is a list of Library. I cannot change my Book class, but I am free to organize the Shelve and the Library class.How can I improve the grouping? ...

 
11:58 PM
0
Q: A Decorator for A Class Constructor

LemonColaI'm making a shooting game in Python3 with pygame for a practice. I implemented Shot class, and PlayerShot class and EnemyShot class as subclasses of Shot one. However, since I would like to make shot images rotated, the constructors of subclasses don't look clear though it works. Then, I would...

 

« first day (1902 days earlier)      last day (2107 days later) »