« first day (2000 days earlier)      last day (2003 days later) » 

12:00 AM
RELOAD! There are 5758 unanswered questions (89.7309% answered)
 
1
Q: SEDE query to calculate net migrations quarterly from ELU to ELL

Dan BronOver on EL&U Meta, someone raised the question of how many net migrations there are to/from our sister site, ELL. The following SEDE query calculates the net migrations by quarter (elu2ell - ell2elu). You can play with the query in SEDE here. -- migration prefix length DECLARE @mhpl INT, @mapl ...

 
12:41 AM
0
Q: Implementing a Trie in Python

user22261Question: Implement a trie with insert, search, and startsWith methods. Source: https://leetcode.com/problems/implement-trie-prefix-tree/description/ The Trie object will be instantiated and called as such: obj = Trie() obj.insert(word) param_2 = obj.search(word) param_3 = obj.starts...

 
If your code works and you're simply looking for suggestions to improve it, your post belongs on Code Review instead. — Ken White 32 secs ago
 
1:06 AM
Use to think like "possible overflow will show it as being negative" - yet found that not robust. — chux 23 secs ago
 
1:27 AM
0
Q: Automate the Boring Stuff with Python : Comma Code Project

AlexHello StackExchange Community, I am working on a challenge from Automate the Boring Stuff with Python. Below is the prompt... " spam = ['apples', 'bananas', 'tofu', 'cats'] Write a function that takes a list value as an argument and returns a string with all the items separated by a comma and ...

 
 
1 hour later…
2:30 AM
0
Q: Rust: Convert a type u16 number to a matrix (Vec<Vec<u8>> or array) of 4 x 4

matharumanpreet00I am a rust newbie and i am not familiar with all the iterator options. This is what i have so far. How can I make this better or atleast avoid collecting twice into a Vec? Thanks for your help. let num: u16 = 0b0010001000100010; // input number let bin = format!("{:016b}", num); let parsed = b...

 
3:19 AM
0
Q: Adobe Illustrator renaming artboards using an Excel file

MereMortalIs it possible to rename dartboards in Illustrator using data from an Excel file? Might this require an Illustrator script as well as a JS to reach put to the Excel file?

 
 
2 hours later…
5:12 AM
I'm voting to close this question as off-topic because it belongs to codereview.stackexchange.comZohar Peled 56 secs ago
 
5:42 AM
0
Q: SQL table questions - please look at queries

Logan SmithHello I have 6 SQL query questions using the example tables below: Here are the exercise questions: Please write an SQL query for each of the following: Create a table to display total workout hours & number of athletes by day Create a table to display the top ranked athlete on each day A...

 
5:57 AM
0
Q: SDL2/C++ Pong Game

NickI just completed my pong game. I'm trying follow the CS50 Introduction to Game Design course. The course uses LUA and LÖVE, but I'm trying to just transfer the concepts to C++ and SDL2. The game is pretty straight forward. There are 2 paddles on each side, one controlled by the player, the other ...

 
6:13 AM
0
Q: php foreach for making records in range wise of zipcode data

HimanshuI am trying to create array with zip-range like if my csv file contain postcode in range like 50001,50002,50003,50004,50007,50008,50009 then it will output 50001-50004,50007-50009. CSV file contain data like this below is my code function makeCSV() { $file = getPostcodeFile(); $han...

 
6:29 AM
0
Q: Wrap method definition in if statement, or instantly return if condition isn't met?

smeI'm just curious, with the following code, which way is better (if any)? And why? I would think it is only a matter of preference, but I'm still curious to how others think. Personally I prefer Method2(), simply because you don't need to indent the code within an if statement. var canExecuteMeth...

 
Monking
 
6:44 AM
0
Q: Using ReadWriteLock to implement a cache access guard

GenzerIn my project, there is an internal cache api to use. I have noticed an emerging pattern such that: class SomeService { private final CacheApi cache = CacheApi.newCache(); private final Object cacheAccessLock = new Object(); public List<Something> getSomethings() { synchronized ...

 
7:08 AM
I suspect the "time limit" is the response he gets from a challenge coding site like HackerRank or Codechef or the like. If this code is working but runs out of time, it should be posted on Code Review Stack Exchange. — David C. Rankin 7 secs ago
I'm voting to close this question as off-topic because review of working code belongs on Code Review Stack ExchangeDavid C. Rankin 56 secs ago
 
7:21 AM
So, your code works and you ask for improvement. This is off-topic here, I suggest posting at Code Review. — Wiktor Stribiżew 13 secs ago
@WiktorStribiżew, thanks for the suggestion, I'll post the following on Code Review — Peter Wilson 18 secs ago
 
1
Q: Elastic Beanstalk configuration using ebextensions container_commands combining leader_only and test

DennisFor our Django app running on AWS Elastic Beanstalk, we use a web-server/worker setup. The same code is deployed to the web-server and worker environments, and environment-specific configuration is achieved with .ebextensions config files, using the test option for container_commands, among other...

0
Q: Replace characters using multiple dependent regular expression substitutions

Peter WilsonI've written the following Python module to iterate over field values in the following two fields: "NAME_LABEL", "CATEGORY". I'm using regular expressions to substitute characters over three expressions that are dependent on each other. The first expression replaces the following characters "/-sp...

 
7:40 AM
possible answer invalidation by maxb on question by maxb: codereview.stackexchange.com/posts/205592/revisions
 
8:03 AM
0
Q: The calculation of the function value works too long

LeelooI've developed a function on Julia language, using the SymEngine library, which builds an equation. This function works quite quickly, returning a lambdified equation. The problem is, calculation of the value of this equation in the point takes too long time! And as the equation becomes longer, ...

 
8:30 AM
possible answer invalidation by maxb on question by maxb: codereview.stackexchange.com/posts/205592/revisions
 
-1
Q: Read excel cell, search in txt file, write in excel cell

DariusSo, for the beginning, I have an excel file with 1 row and multiple columns. I need to read one column where is a text. Then I have to search for that text in a .txt file. On the line where I found the text I need to keep searching for "MIN/MAX:". The line looks like these: "UInt32 StEaAktivK...

 
possible answer invalidation by Marko Petričević on question by Marko Petričević: codereview.stackexchange.com/posts/206190/revisions
 
8:50 AM
0
Q: submenu of the submenu is not working

pink widow babySubmenu of a submenu is not showing on mobile. I am using wordpress theme twenty fifteen. I am thinking this is because of the theme? I'm not sure. Here's my site http://dev.skylink.org/davewells/ - the sexology menu. Here's the video https://drive.google.com/file/d/1SthW8v8f6_0mZag4iQdc06ROW1xOP...

 
9:00 AM
possible answer invalidation by Marko Petričević on question by Marko Petričević: codereview.stackexchange.com/posts/206190/revisions
 
 
1 hour later…
10:08 AM
0
Q: Handling the attention states correct way in Tensorflow

AruespkuI am implementing encoder- decoder model. This part is the encoder: def encoder_birnn(x): x = tf.unstack(x, num_input, 1) # Forward direction cell cell_fw = tf.nn.rnn_cell.BasicLSTMCell(num_hidden, forget_bias=1.0) # Backward direction cell cell_bw = tf.nn.rnn_cell.BasicLSTMC...

 
10:37 AM
This question is probably better suited for codereview.stackexchange.comMarkus Deibel 25 secs ago
This question may be better suited for the code review stackexchange (codereview.stackexchange.com) - your solution is working and you're not having any problems persay, but the efficiency can be improved. — Alex Stiff 54 secs ago
I'm voting to close this question as off-topic because this question belongs on another site in the Stack Exchange network: Code Review (not provided as a listed option). — JohnLBevan 53 secs ago
 
11:42 AM
3
Q: C# legacy project to be refactored, but stuck at a basic if stacking

Attila GyurinSo I got a project to refactor and I can't figure out what the best solution for this specific problem would be. I'm trying to reach some kind of elegant few-line-solution, but every idea I have seems to be a dead end. My brain does not work anymore... The original state: public SearchParameterS...

 
11:55 AM
possible answer invalidation by shaike on question by shaike: codereview.stackexchange.com/posts/206208/revisions
 
12:13 PM
0
Q: Use of a single member struct as an attribute with boost::spirit::karma generators

SuperlokkusThis is kind of the reversed case (parsing-generating) of https://stackoverflow.com/q/19823413/3537677 (meta: I'am not sure since I got a working "workaround" if this is right here): I have a one member struct that I am using with boost::spirit::karma, but, as far as I could get it to work, I h...

 
If you need input to your code you might consider codereview.stackexchange.commaytham-ɯɐɥʇʎɐɯ 53 secs ago
 
12:29 PM
0
Q: Database design model for courier company

stakowerflolWhat do you think about my database domain? General description This database domain will be used in REST app where the main functionalities are: client make and order with parcel (weight, size, type, description) and route (start Area, end Area) the system calculats prices of the order, man...

0
Q: I can not insert data into the database using OOP

Prayas BhariI want to insert data into the database using OOP concept but i am getting an error that the undefined variable and on the top of that the query is not working too.the image of the error is attached Registration.php <?php include('header.php'); if(!isset($_SESSION)) { ses...

 
Your question might potentially be better suited to codereview.stackexchange.com - we don't normally deal with already-working code. Here, we deal with bugs primarily. — ADyson 56 secs ago
 
12:48 PM
Does it produce the desired result as far as you can tell? Then it's "correct". If you want a code review for your working code, see codereview.stackexchange.com. — deceze ♦ just now
well, it's not. But that's unrelated to whether you're asking for a code review as opposed to a bug fix. — ADyson 14 secs ago
 
1:29 PM
If your program is working and you just want comments on how to make it better I also suggest you head over to codereview.stackexchange.comRichard 7 secs ago
 
1:48 PM
0
Q: Not able to access Python class module in Yarn Cluster Mode

vikrantBelow is my main Pyspark application code PysparkMainModulenew.py: import os import pyspark.sql.functions as F from os import listdir, path from pyspark.sql.functions import broadcast from pyspark import SparkConf, SparkContext from pyspark import SparkConf import argparse from pyspark import Sp...

 
I think you should ask this question on: codereview.stackexchange.com — Kamil W. 14 secs ago
 
2:03 PM
0
Q: How to reuse a select object in LinQ

Arasu RRKI'm having two methods to get the user object GetUserByUsername(string username) { return DataTable.Select(a => new User{ Name = a.Name, Email = a.Email, Contact = a.Phone }).FirstOrDefault(); } GetUserByEmail(string email) { return DataTable.Select(a =>...

 
2:49 PM
Well, this should be fun to debug.
 
extra whitespace?
 
0
Q: Quicksort implementation with pivotal calculated as middle element

gstackoverflowI read quick sort algorhitm and implemented in like this: public List<Integer> sort(List<Integer> list) { if (list.size() <= 1) { return list; } int pivotalValue = list.get(list.size() / 2); List<Integer> left = new ArrayList<>(); List<Integer> pivotalValues = new A...

 
@hoffmale No, already ruled that one out.
Correct type too.
 
Well, can't help more without more context
 
@Mast missing newline
?
 
2:55 PM
@MathiasEttinger Not usually for such things. Tried adding one extra, no effect.
It's a bloody simple challenge really. Make an XOR. How can that possibly fail...
 
can you give a link to the challenge?
 
Pretty ugly, ok, but it works fine.
def strings_xor(s, t):
    res = ''
    for idx, char in enumerate(s):
        if char == t[idx]:
            res += '0';
        else:
            res += '1';
    return res

s = raw_input()
t = raw_input()
They want a string, they get a string.
Fails for Python 3 too.
def strings_xor(s, t):
    res = ''
    for idx, char in enumerate(s):
        if char == t[idx]:
            res += '0';
        else:
            res += '1';
    return res

s = input()
t = input()
print(strings_xor(s, t))
I think they don't like my solution while the answer is correct.
> Its not the case that u only have to get the output correct....you can only modify maximum of three lines...if u modified more than that it would be wrong answer even if output is correct.
sigh
I remember why I stopped doing those challenges.
Nothing to see here.
 
oh
so it's more a spot-the-bug challenge
 
@Mast So we are not allowed to criticize their poor coding habits by rewriting the whole thing?
 
Meh, it's more of a "we've set something up for you, finish it, don't mess around too much because we don't want your code to be good code"
@MathiasEttinger Yup. Turns out it's in the challenge. But who reads those...
> Note: You can modify at most three lines in the given code and you cannot add or remove lines to the code.
 
3:04 PM
well... it's a debugging problem
 
Welp.
I need more coffee.
 
so the focus isn't on writing the cleanest code possible, but to see what's wrong (logically, not stylistically) with the presented code
 
@hoffmale You're absolutely right.
 
0
Q: Program for a speed camera

Anthony K.I am doing some online exercises, and I came across this: "Your job is to write a program for a speed camera. For simplicity, ignore the details such as camera, sensors, etc and focus purely on the logic. Write a program that asks the user to enter the speed limit. Once set, the program asks for ...

 
@Mast There, fixed
import itertools


def strings_xor(s, t):
    reversed_xor = ''.join(
        '1' if s != t else '0'
        for s, t in itertools.zip_longest(reversed(s), reversed(t), fillvalue='0')
    )
    return reversed_xor[::-1]


if __name__ == '__main__':
    s = input()
    t = input()
    print(strings_xor(s, t))
 
3:18 PM
lol
 
3:28 PM
Monking
 
Monking
 
Maybe this question might be better suited for CodeReview? — Arnav Borborah 30 secs ago
You might be right, I didn't know this feature existed. Is there a way to move this question, or should I just re-create it in the CodeReview section? — Jack T. 21 secs ago
 
@CaptainObvious @Mast is there a reason that should still be closed? I was thinking originally that the "generic best practices are outside the scope of this site" applied but then I found a meta post that supports it being on topic
9
Q: Are database design reviews in scope?

BenVSee this question: Can you peer review my database design for a school system?

 
3:53 PM
@SᴀᴍOnᴇᴌᴀ IMO it's a bad fit. It's a "here's my DB, what do you think" question. There's a mention of some REST app, but nothing on how it will be used.
The problem with DB questions, is they're quite hard to review effectively. So IMO they need more context than the bare minimum we tolerate for other questions.
 
@Mast yeah... if the OP mentioned then I would request the indexes and output of EXPLAIN SELECT per the tag wiki, but alas that was not the case
 
Hey, I can't see you asking a question here. If you're looking for a code review, you could post this on codereview.stackexchange.com. Stack Overflow prefers questions that can be answered! — nevada_scout 41 secs ago
 
@Duga interesting construction: "I can't see you asking a question here" :)
 
4:24 PM
0
Q: Show text only when check box is ticked

JSPI have got a problem with the code in a website I am making. It should ask the user to select a few options then confirm the choices. <html> <head> </head> <body onload="loaded()"> Please select the subjects you would like to revise. <form id="SubjectsList"> English Language: <input type="checkb...

0
Q: Refactoring: Merging two dictionaries, but ignoring None values

Jack T.I need a bit of Python refactoring advice. I have a list of dict objects (new_monitors), which can be empty. When there are new monitors, however, I want to add a bunch of fields to those monitors. For each monitor, I would like to append all not None fields from the DogDump.HIDE_FIELDS dict: ...

0
Q: Dynamically tooltip into dropdown(select – Option)

user10540420 i trying to add a tooltip on select option when it is selected from drop down Can any one help below is code test $(function () { $("#sel option").each(function(i){ if(i>0){ var title="The select val=" +$(this).val(); $(this).attr("title",title); } }); } ); One ...

 
4:36 PM
@CaptainObvious Broken.
@CaptainObvious Broken.
@CaptainObvious No context.
sigh
 
Can you show us an example of some of that code? Also, if the code works as expected, this question may do better on SoftwareEngineering.SE or CodeReview.SE. — scohe001 1 min ago
 
-1
Q: BUILDING A QUESTIONNAIRE APP USING ANGULAR JS

YATHNIDevelop a simple polling application using the angularJS framework The application must have two logins viz Faculty login and Student login. Through faculty login, faculty should be able to post polling questions upto 10 number Through students login, students must be able to answer the ques...

 
@CaptainObvious somebody help - OP's "brain does not work anymore"!!!
 
@CaptainObvious HAMMERTIME!
Such questions are more offensive than most of the comments that are flagged as such.
 
@CaptainObvious Why are you yelling? ¿ⓧ_ⓧﮌ
 
4:48 PM
@SᴀᴍOnᴇᴌᴀ Well done on this edit by the way. I never noticed there was a typo in one of the links and that text has been around for ages.
That bad link was introduced here.
Welcome to The 2nd Monitor @BanghuaZhao
 
@Mast hehe yeah - I was clicking the link and kept seeing the panda riding the plastic animal, thinking that was just an effect of Programmers SE moving to Software Eng. SE...
 
If there's no problem with code I think it's OT for this site. Maybe codereview.stackexchange.com is a better fit — 4386427 52 secs ago
 
5:20 PM
I'd build a lookup table. Take a look at this question over on CR for the basic gist. — Comintern 1 min ago
 
6:15 PM
0
Q: Is it always faster to rewrite a workbook function and store it in the module as a UDF

BrotatoI was looking at this answer in SO and I was wondering if it would be faster to write the code for the CountIF function. I imagine it would look something like this: Option Explicit Function CountIF(UserRange As Range) Dim TempArray As Variant Dim item As Variant Dim count As Long ...

 
6:31 PM
0
Q: can someone help me with flashcard creating using html and css and javascript

Amin Ahmedcreating flash card using html and css and javascript

 
@CaptainObvious maybe but not here... :/
 
7:00 PM
possible answer invalidation by Adam on question by Adam: codereview.stackexchange.com/posts/206226/revisions
 
0
Q: What is an optimal way of not repeating myself in the following code?

shaytacFollowing code works and i am simply looking for ways to not repeat myself as well keep to code clean and readable. Would love to see what methods that can be utilized to make it prettier. const util = require("util"); const fs = require("fs"); const reader = util.promisify(fs.readFile); const s...

0
Q: back_inserter for several container arguments

SourceChrisRecently I wrote a back_inserter with the same interface as the std::back_inserter just for supporting several containers in the constructor and doing push_back for each. The solution needs C++17. Please give me some feedback! Thanks. #include <iterator> #include <tuple> namespace stx { template

 
@Duga looks okay - just one code change (i.e. db_cursor = db_connection.db_cursor() -> db_cursor = db_connection.cursor())_ but not mentioned in the answer
 
7:34 PM
-1
Q: Python3 - 1) Is this the appropriate use of the 'continue' statement, 2) is this how file commands should be incorporated in a 'while' loop?

PythonNewbieThis attempts to prompt the names of guests, while logging them into a guestbook on separate lines, and also shows the guest a response. It seems to work, but is this efficient? file_name = 'guest_book.txt' guest_name = "What is your name? " guest_name += " Or, enter 'quit' to exit. " prompt = ...

 
7:49 PM
0
Q: Am I re-creating a dictionary? Adding values from DictReader to empty dictionary

Erich PurpurI made a rock climbing simulator game for fun. Below is a function from the program, which works. But I can't help but think it could be refactored or more pythonic. Namely, I open the data with csv.DictReader and read through the data, which add to a blank dictionary called route_info. Is th...

 
8:36 PM
0
Q: jQuery AJAX submit form

bartBelow jQuery code submits a form using AJAX. The server response should return JSON. addNewOutreach = function(node) { var form = node.find('form'); var data = form.serialize(); $.post('ajax.php', {action:'addNewOutreach',string:data}, function(response) { if(res...

 
 
1 hour later…
9:39 PM
0
Q: Solving exercises on time

Dexter ThornIn this program you have to solve 20 exercises. The time you need will be measured. If you break a record, you'll get an entry in the highscore list. The program can be downloaded here. You can only start it via command line, not by double-click. If I can improve my code to make it more readabl...

0
Q: N Queens on NxN board once more

pgsI am quite new for c++ programming, and would be appriated for any comments. How many combinations of N chess queens on a N×N board exist that there is no two queen attacking each other? Input 8 Output 92 I solved the task by iterative approach using three additional arrays which ar...

 
possible answer invalidation by janos on question by thumbtackthief: codereview.stackexchange.com/posts/206195/revisions
 
@Duga its fine - separating specification from the code
 
9:55 PM
-2
Q: What is wrong with the code? Not using Scanner, arrays, lists etc

nailed itHERE IS THE ASSIGNMENT: Write your code in the file TwoLargest.java, your file has to have this exact name with T and L capitalized. You must use the IO module to read inputs and output your answers. When prompting the user, use System.out.print() or System.out.println(). Write a program that t...

 
@CaptainObvious
 
10:10 PM
0
Q: C++ split function (equivalent to python string.split())

smoothwareI wrote the equivalent to the split() in python for C++. I would like to know how I can make it better (note: I haven't done the version for an unspecified separator): std::vector<std::string> split(std::string_view str, std::string_view sep, int maxsplit = -1) { Expects(maxsplit > -2); ...

 
10:26 PM
0
Q: How do I print a pyramid of palindromes?

Aimee L'HeureuxI have the basis of the palindrome, this is the code I used to achieve it: output = ""; for (let j = 0; j < 10 - i; j++){ output += ""; } for (let k = 0; k <= i; k++){ output += k; } And this is my output: 0 01 012 0123 01234 012345 0123456 01234567 012345678 0123456789 What I ...

 
@CaptainObvious sigh
 
10:57 PM
0
Q: Genetic Algorithm to Predict Sequences of Hex Digits

Xodarap777I have a set of sequences that I want a GA to predict sequentially, using the last 3 characters as a lookup. I would love to use the last 4 or even 5, but it looks like this code is already "sticking." I don't know if I screwed something up in the breeding, or if it's just too complex (using 219...

 
11:44 PM
0
Q: Matrix (first time using them) namespace functions, operators

ChemistppNot much formal education in programming. One year in school. We did C++ classes for most user defined objects. I've written a few different class variations for matrices but wonder about how useful that really is. Array pointers vs. stl containers, all this wrapper around an array or std::<v...

 

« first day (2000 days earlier)      last day (2003 days later) »