« first day (2267 days earlier)      last day (30 days later) » 

12:00 AM
RELOAD! There are 6258 unanswered questions (89.7263% answered)
 
12:21 AM
0
Q: Derivative Approximation

N. BarI'm pretty new to programming, but I have a pretty extensive background in math. Because of this, I decided one of my first programs (in C#) would estimate derivatives. This program does just that, and it only does so for the function $x^2$. Here's the main part of the code: Console.WriteLine("...

 
@200_success Not sure NAA really applies, since it's an attempt to answer. Whilst I think it's "very low quality", I've made a small edit that should make it less gray in that regard. As I can see it not being descriptive enough for most.
 
 
2 hours later…
2:01 AM
0
Q: Letter Case Permutation

Mitchel PaulinThe question can be found here https://leetcode.com/problems/letter-case-permutation Given a string S, we can transform every letter individually to be lowercase or uppercase to create another string. Return a list of all possible strings we could create. My question pertains mostly to...

 
2:12 AM
If you already have a working code and is looking for a review, take a look at codereview.stackexchange.com and check their guidelines — Andreas 11 secs ago
 
2:41 AM
If you have a question about your source code, you'll need to post it here. If you want someone to review your code & give suggestions, please post it over here. — Sebastian Waldbauer 29 secs ago
 
 
1 hour later…
3:41 AM
0
Q: Project Euler # 19 counting Sundays Python

emadboctorYou are given the following information, but you may prefer to do some research for yourself. 1 Jan 1900 was a Monday. Thirty days has September, April, June and November. All the rest have thirty-one, Saving February alone, Which has twenty-eight, rain or shine. And on leap years, twenty-nine. ...

0
Q: Project Euler # 20 factorial digit sum in Python

emadboctor n! means n × (n − 1) × ... × 3 × 2 × 1 For example, 10! = 10 × 9 × ... × 3 × 2 × 1 = 3628800, and the sum of the digits in the number 10! is 3 + 6 + 2 + 8 + 8 + 0 + 0 = 27. Find the sum of the digits in the number 100! def fact(n): """returns factorial of n.""" if n <= 1: ...

 
4:21 AM
 
 
1 hour later…
5:24 AM
0
Q: Run functions in pandas dataframe

elisaI have a dataframe like this: Date Query 29-03-2019 SELECT * FROM tableN WHERE .. 30-03-2019 SELECT * FROM ... JOIN ... ON ...WHERE .. .... .... 20-05-2019 SELECT ... And I want to apply two functions (say that my functions are getTable and getCol) to that dataframe to ge...

 
5:58 AM
Monking
 
-1
Q: How to create an autocomplete method that search an existing trie in pythonn

adham mustafaI am new to python, I found different codes that implements trie, like this one for example: from collections import defaultdict class TrieNode: def __init__(self): self.children = defaultdict(TrieNode) self.isEnd = False def insert(self, word): node = self ...

 
 
2 hours later…
7:43 AM
So, today I found out WinPython works wonders right through our firewall, virus scanner and other enterprisey obstacles. Even supports Python 3.7.
 
0
Q: Unit testing - is this to many test cases?

WebbarrI'm currently working on a unit testing course (NUnit 3.x). I've been tasked with a simple class to test all edge cases. using System; namespace TestNinja.Fundamentals { public class DemeritPointsCalculator { private const int SpeedLimit = 65; private const int MaxSpeed ...

0
Q: Project Euler # 21 amicable numbers Python

emadboctorLet d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n). If d(a) = b and d(b) = a, where a ≠ b, then a and b are an amicable pair and each of a and b are called amicable numbers. For example, the proper divisors of 220 are 1, 2, 4, 5, 10, 11, 20, 2...

 
8:32 AM
Your code works fine. Only thing I'd change is the assignment inside the conditional (which is often confusing and forbidden by linters), but that's not that bad - it's opinion-based. I'd ask the code reviewer what he would've done differently, I don't see anything at all significant to change. — CertainPerformance 46 secs ago
I think this should belong to the codereviewJeroen van Langen 37 secs ago
you could also ask here for a codereview codereview.stackexchange.com (i think it's actually the place to ask for that instead of stackoverflow, since your code is working and all that) — rebecca 47 secs ago
You're actually asking for code review which is off-topic here. But you may ask it at related site. — hindmost 22 secs ago
 
1
Q: Detecting if a struct has a member

PangiI wanted to detect if I have a member in a simple POD struct and after some searching and merging some methods found on web I've come up with this solution: #include <iostream> template<class...Fs> struct funcs_t{}; template<class F0, class...Fs> struct funcs_t<F0, Fs...>: F0, funcs_t<Fs...> {...

0
Q: Python Turtle implementation of the 15 Puzzle

RobinPlease can I have some feedback on my Python Turtle implementation of the 15 Puzzle? I have deliberately avoided using OOP as my aim is to develop a clear and clean coding style suitable for teaching programming at school (at a level before OOP is relevant). I also tried to avoid using globals b...

 
BTW: The answer almost certainly will be found via the (icon of the) TreeCellRenderer used for the tree nodes. See the File Browser GUI for tips. It shows how to set the icons in the FileTreeCellRenderer. Admittedly the point here is almost exactly opposite what it was there, but it still comes down to the same thing - the icons. — Andrew Thompson 10 secs ago
 
9:04 AM
0
Q: Function invocation every secoтd time?

ogbofjnrRecently I got test task at the project, it is fairly simple: const _ = require('underscore'); // Challenge: // // Write a function that accepts as argument a "function of one variable", and returns a new // function. The returned function should invoke the original parameter function on every...

 
9:24 AM
0
Q: Object-Oriented Calculator

Grace MathewI have solved an assignment (Exercise 3) from MOOC Course Object-Oriented Programming with Java, part II, but I'm not enrolled in said course. Question: How do you refactor this code so that it follows OOP, reads better, is manageable? How can I write method names and classes better? How do you ...

 
10:04 AM
0
Q: Reading a remote TEXT file using ftplib class

LinuI need to read a remote file using FTP and process it and insert the processed data to a PostgreSQL database in another server. The below code is working fine, but i want some advice to modify few things. In this line i don't want to write the actual details,i want that to be hidden from my sc...

 
10:44 AM
0
Q: Double pendulum real time plot

Bruno VermeulenDouble Pendulum I made a little application that embeds a matplotlib dynamic plot into tkinter that enables control through the tkinter GUI. Code is in Github. It also uses numpy and scipy to solve the ordinary differential equations for a double pendulum. To change the initial theta's just dra...

 
11:04 AM
0
Q: Porting stemming algorithm from Java to Python

dzieciouI have ported Stempel stemmer in Java (Apache Lucene) to Python. I also come from Java world so my translation might not be "pythonic" enough. I would like to hear your feedback on quite representative part of the code, translation of Diff class that applies stemming command (diff) to a string ...

 
I believe this is a question for Code Review rather than StackOverflow — Joffrey 36 secs ago
 
 
1 hour later…
12:25 PM
possible answer invalidation by Mitchel Paulin on question by Mitchel Paulin: codereview.stackexchange.com/posts/224450/revisions
 
@bclarkreston I think you’re going to struggle to find anyone who’s actually dropped fossilised sharks teeth out a Cessna 172 in cremation bags. — Tim 13 hours ago
@Duga Not explicitly mentioned, it seems.
 
12:45 PM
possible answer invalidation by 200_success, 200_success on question by ogbofjnr: codereview.stackexchange.com/posts/224466/revisions
 
1:45 PM
posted on July 19, 2019 by plhn

My python code looks like this, arr = glob.glob('*.txt') # many files if some: arr = list(filter( lambda x : not x.endswith('3.txt'), arr )) else: arr = list(filter( lambda x : x.endswith('3.txt'), arr )) the only difference between if part and else part, former contains not. Any id

0
Q: Replacing self-reference with ellipsis in Python

int6hI'm trying to make a pattern matching system in Python (trying to make sense of how they work, and maybe out of curiosity) and I represent different kinds of patterns (like 'match an exact string', 'match a digit', 'match either pattern' etc.) with different classes. For instance, I might define ...

 
2:05 PM
0
Q: Coding Challenge: Kattis - Antiarithmetic?

RoyMShort problem description: A sequence of numbers are antiarithemtic if there exists no three numbers a_i, a_j, a_k – where a_i preceeds a_j which then again preceeds a_k in the sequence – such that a_i - a_j = a_j - a_k. Example: (5, 0, -1, 3, 1) is not antiarithemtic, because 5-3 = 3-1, wheras t...

0
Q: Boolean expression order

Kevin PastorI have a simple question about how I should be ordering the elements in a boolean expression. Imagine I have an equality operation, should the expected value be in front or the actual value? if (expectedValue == actualValue) { /* ... */ } // or if (actualValue == expectedValue) { /* ... */ }

 
@Duga Well, that's new.
 
2:25 PM
-1
Q: Check list of password requirements using Regular Expressions

Sandeep MahatoPython program to check the validity of password input by users using re module. Following are the criteria for checking the password: At least 1 letter between [a-z] At least 1 number between [0-9] At least 1 letter between [A-Z] At least 1 character from [$#@] Minimum length of transaction pa...

 
2:46 PM
If we were petty we'd move this to Code Review. — Simon Richter 36 secs ago
 
3:15 PM
@Mast perhaps 200_success has been cloned...
 
3:31 PM
This is probably better suited to the Code Review SO, but one problem I see is the lack of a print specifier on your printf(). — Reticulated Spline 15 secs ago
 
Monking
 
@Duga The edit in the second revision does look uncharacteristic of something 200 would do... maybe it was the clone...
 
@ReticulatedSpline no, this is not suited to code review as code review requires that the program works and this one doesn't. — Antti Haapala 1 min ago
possible answer invalidation by Deja Bond on question by Deja Bond: codereview.stackexchange.com/posts/220847/revisions
 
-1
Q: Code knowledge against simplicity when looping on a list, what is the best practice?

Dorian TurbaContext On StackOverflow, a user ask: How to make last element of list finish with a dot and the others with a comma? # list that may vary errors_list = ['It has no letters', 'It has symbols', 'The last letter is a space'] for i in errors_list: print(" " + str(errors_list.index(i) ...

 
4:00 PM
@SᴀᴍOnᴇᴌᴀ Usually this reeks of an edit war, but in this case we'll just keep an eye on it.
 
@Mast yeah I am also baffled by the title edits by Konjin... maybe couldn't make up mind about correcting it vs preserving it
 
@Duga Rolled back.
@SᴀᴍOnᴇᴌᴀ The both of them have been around since who knows when, so I'm sure they'll figure it out. If not, we'll cross that bridge when we come to it.
 
@Mast yep
@RMunroe silly competitive Americans
 
-1
Q: Is this a good use case for closure? (New to closures and trying to find out how to use them correctly)

AnthonyThis question is more to see if I can get some input on the "design pattern" I tried to implement here. I'm just learning about closure in JavaScript and I think I'm starting to get it. I'm wondering if the way I wrote this code is of a good quality - something you'd expect to see in production c...

 
Posting a complete example of your class on codereview.stackexchange.com may be better. — Michael Berry 36 secs ago
I'm voting to close this question as off-topic because it should be asked on Code Review instead. — EJoshuaS 45 secs ago
If you ask on CR, please read How do I ask a good question?, since the current title and lack of context would most likely make the post considered off-topic... — Sᴀᴍ Onᴇᴌᴀ 18 secs ago
 
4:40 PM
possible answer invalidation by 200_success on question by Linu: codereview.stackexchange.com/posts/224470/revisions
This should still be asked on Code Review rather than here, even after the edits. — EJoshuaS 21 secs ago
 
@Duga its good - code line was moved into pre-formatted quote block instead of non-formatted inline with text
 
@Bergi - I read some of the threads linked - it seems that because of how JS handles variables at runtime ("hoisting") it's appropriate to declare variables near where they are used in the code for readability. However what I was wondering more directly is: if I had a frontend script that contained this code (using a function to "generate" functions) would it make more sense to grab the HTML elements outside of said function, or is it appropriate/readable/otherwise-production-worthy to do so within said function? I did post this on code review as that's more the spirit of my question. — Anthony 8 secs ago
 
4:58 PM
I'm voting to close this question as off-topic because this question belongs on CodeReviewRiggsFolly 15 secs ago
 
5:08 PM
@Renat Oliver must clarify question first... and show why existing answers/articles did not help - bing.com/search?q=c%23%20autocomplete%20command%20line brings plenty of SE results including CR autocomplete in C# with code and analysis. This may indicate that OP did not do any research prior posting (just remote possibility). — Alexei Levenkov 51 secs ago
 
@Duga nice word: remote :)
 
5:26 PM
0
Q: Generic Factory in Typescript

Mykhailo KuchmaI am new to typescript, I have a class that works some services with rest API and caches the result, so in case of multiple functions calls there will be only 1 network operation and multiple lookups in the cache. I've created a demo prototype, and I need feedback. Are there any issues with the ...

 
 
1 hour later…
6:30 PM
It might be beneficial to ask this question in the Code Review Stack Exchange. But either way, in my eyes the cleaner solution is to FIRST check if something contains in the key, and NOT checking if something is missing first, because thatqs not intuitive to read. — mnestorov 52 secs ago
 
7:00 PM
possible answer invalidation by Pangi on question by Pangi: codereview.stackexchange.com/posts/224463/revisions
 
@Duga Rolled back. HNQ, so keep an eye out.
 
7:21 PM
@Mast Keyboard keys?
 
7:40 PM
possible answer invalidation by Sᴀᴍ Onᴇᴌᴀ on question by thadeuszlay: codereview.stackexchange.com/posts/220396/revisions
 
3
Q: Project Euler # 22 names scores Python

emadboctorUsing names.txt (right click and 'Save Link/Target As...'), a 46K text file containing over five-thousand first names, begin by sorting it into alphabetical order. Then working out the alphabetical value for each name, multiply this value by its alphabetical position in the list to obtain a n...

 
8:07 PM
0
Q: check condition with userdefaults value exist or not

KkMIWI am check first time userDefaults will not save value return 0 else get value from userdefaults func scaleMeter() { let numberPicker = NumberPicker(delegate: self, maxNumber: 100) numberPicker.tintColor = .white numberPicker.heading = “Select Scale” let ageCou...

0
Q: What is the best way to set a a specific bit to a specific value?

Mark CeitlinThis is the code I came up with: void set_bit_at_pos(int* num, int pos, bool val) { if (val) { int mask = 1 << pos; *num |= mask; } else { int mask = ~(1 << pos); *num &= mask; } } I'm new to bitwise operations, so this approach may not be the b...

 
8:27 PM
0
Q: Finding unpaired number in an odd Array of integers

Anirudh A non-empty array A consisting of N integers is given. The array contains an odd number of elements, and each element of the array can be paired with another element that has the same value, except for one element that is left unpaired. For example, in array A such that: A[0] = 9 A[...

 
8:47 PM
0
Q: CodingBat: without_end

LinnyLink To Question Given a string, return a version without the first and last char, so "Hello" yields "ell". The string length will be at least 2. without_end('Hello') → 'ell' without_end('java') → 'av' without_end('coding') → 'odin' This is the code I wrote as a solution to...

 
9:27 PM
0
Q: Update join table using list of checkboxes in Rails

thumbtackthiefI have Gig and Singer models with a many-to-many relationship. My form sends a given gig id and all the singers who will be attending, denoted with check boxes. I need to have the ability to check or uncheck singers. The following code works, but it does so by removing all the singers from a g...

 
9:47 PM
0
Q: Sim game and it's my first program

Joshua TorresThis is my first program and I had fun making it and learning new things! Please let me know what I can do to improve this code! import random; import time; import threading; import sys; import psutil; from colorama import init; from termcolor import colored while True: # Contains all variable...

 
10:07 PM
0
Q: make a high order component that uses similar sign in/ sign up logic

BARNOWLHow would i use a high order component to prevent the same or similar logic, im looking for a more complex way of using a high order component. I read some of the basic examples. This is some existing logic that do multiple functions. This app is like an instagram. For example i have a Sign up...

 
10:47 PM
0
Q: Simple react app to fetch and display data

tramadaThis is my first react app and it was for a job interview challenge. The app is really simple and it works, but although I don't think I'm gonna get it, could I have some feedback about what is wrong and how could I improve it? ***I already submitted this, so is not cheating, I just need to know...

 
11:28 PM
0
Q: Optimizing throughput when writing millions of rows to columnar storage

dcrdevI'm building a basic data pipeline in .NET to extract data from tables in our RDBMS systems, that exports into columnar storage using Parquet. I'm using Parquet's row group to batch up the writes into manageable segments as switching from rows to columns means holding a chunk of data in memory. ...

 
11:48 PM
0
Q: Error handling in express without middlewares and using class structure

E.ssThis is a simple implementation of Django's sample project "Poll" using and express. The controller code: export default class AuthController { private db: AuthDb; constructor(db: AuthDb) { this.db = db; } login = async (user: User) => { try { userV...

 

« first day (2267 days earlier)      last day (30 days later) »