« first day (2211 days earlier)      last day (1823 days later) » 

12:00 AM
RELOAD! There are 6063 unanswered questions (89.8542% answered)
 
12:16 AM
0
Q: Cconvert a float to a 24bit audio

Andrea VerdiI have a float number that can be from -1 to +1. I has been converted from 3 bytes (from a wav file) So 0x7fffff -1 and 0x800000 +1 this is the function that converts the 3 bytes to a float number function ToFloat (b1:byte;b2:byte;b3:byte):extended; var i1:int64; var retval,Q:extended; var ar : ...

 
 
4 hours later…
4:17 AM
0
Q: What is the trick behind the code?

Bubblethandef inc_subseqs(s): """Assuming that S is a list, return a nested list of all subsequences of S (a list of lists) for which the elements of the subsequence are strictly nondecreasing. The subsequences can appear in any order. >>> seqs = inc_subseqs([1, 3, 2]) >>> sorted(seqs) [[], [1], [1, 2], [...

 
4:56 AM
Monking
 
 
1 hour later…
6:16 AM
0
Q: RecyclerView with different ViewHolder using generic

thegarlynchI have different ViewHolder for different Feed Implementation. But i can't use the best practice of having each ViewHolder corresponds to different layout id because i am reusing layout for 2 different ViewHolder (aka. FeedWithImageHolder and FeedWithoutImageHolder) class FeedAdapter extends Rec...

 
7:15 AM
0
Q: Database design for a project management system for freelancers

Prahlad YeriI'm working on a web-based project mgmt app (similar to asana, trello, etc.) with special focus on freelancers, clients and agencies. I'm thinking what tables and relations should I have to manage this data on the backend. So far, I've come up with following tables: - users (id, type, email, pas...

 
7:51 AM
I'm voting to close this question as off-topic because this question is about codereview and should asked at Code ReviewJens 4 mins ago
 
 
1 hour later…
8:56 AM
0
Q: How to remove duplicated code when performing action to a Python list filtered by an if statement

PittoI have written the following function for a CLI tool, it works as expected but it also contains duplicated code. What would be an elegant solution to get rid of the duplicated part? def populate_teams_tab(self): teams = self.get_data(self.TEAMS_URL) for team in teams: if self.IS...

 
9:23 AM
Please share a code (not pseudo-code) piece as far as you can implement. Then if you want to improve/review it, share it on codereview.stackexchange.com unless you face an error and stuck with it (if so, you should ask a new question describing that error clearly). — vahdet 33 secs ago
This is a part of the bigger code. I have pasted the whole code on codereview. Can I paste the link to that question here? Or should I change this question itself? — Laxman just now
if your code is working - head to codereview.stackexchange.comvasily.sib 39 secs ago
 
9:57 AM
I'm voting to close this question as off-topic because open-ended questions about refactoring code belong on Code Review. — Michael 1 min ago
 
10:23 AM
If you don't mind I will add your code (the one in this answer, the one with strpbrk from glibc is probably overkill) to the timings in my answer to the question on Code Review. Unless you want to add it as a separate answer there? — Graipher 52 secs ago
 
10:35 AM
0
Q: Finding lowest number between a list of numbers

MathematicsI have a sql table like this, SomeDouble SomeInt 1.00 121 1.50 124 2.00 200 2.50 321 ......... 11.00 2727 12.00 2324 13.00 3433 13.50 2324 14.00 2324 14.50 2324 so on...

 
possible answer invalidation by Kris on question by Kris: codereview.stackexchange.com/posts/220865/revisions
 
10:52 AM
@Duga rolled back
 
-1
Q: Improved OCR result using pytesseract

A14I am trying to extract text from image, but it is not able to extract all the text Please find code: import pandas as pd from pytesseract import image_to_string import re from PIL import Image import cv2 import numpy as np img = Image.open("test.png") width, height = img.size new_size = widt...

 
11:15 AM
0
Q: Interpreter raises an error that has already been corrected

Nikolay CherednychenkoGuy, I'd really appreciate your help, I am a complete newbie to Python and to programming in general. This error is raised when I am trying to execute the code below from command prompt: (base) C:\Users\KOLYA>maindataversion2.py Traceback (most recent call last): File "C:\Users\KOLYA\maindatav...

0
Q: Bindling User details from AD using LDAP (in c#) takes time

TheSacredKillerI have got a request from a client to fetch all client user details from AD and finally dump to a db so that they can use it for reporting. I have used DirectoryEntry and PrincipalContext class to retrieve all the information.The user volume is approx 7500 and and for each user i am binding 35 AD...

 
11:34 AM
0
Q: Refactoring the code to have better efficiency and better code clarity

Prerna SharmaI am working on a yatzy game development for 2 players that consists of all the categories Fullhouse,Yatzy,ones,twos,threes,etc I have implemented the interface that works for 2 players and displays the winner at the end of the game , but I don't think it is efficient need feedback and suggestio...

1
Q: Python3 - Determing if a PDF is scanned or "searchable"

oliverbjI am in a situation where I need to determine if a PDF file is either: Scanned Searchable (contain text) To do this, I am simply running the command pdffonts on the PDF file: # Check if the resource definition indicates this is a scanned PDF cmd = ['pdffonts', pdf_file] proc = subprocess.Pop...

 
Hi. A better place to post such questions is code reviewDivyanshu Srivastava 29 secs ago
 
11:59 AM
You're probably better off posting this to the code review StackExchange site. This kind of question would fit right in. — Das_Geek 57 secs ago
possible answer invalidation by Prerna Sharma on question by Prerna Sharma: codereview.stackexchange.com/posts/220901/revisions
 
12:14 PM
0
Q: How to Reduce the Version Number of AS in Self-Added Version

jianhua yin def currentVersionCode = "" def version = "" def tempCode = (apk_version_code + "").length() if (tempCode == 1) { currentVersionCode = apk_version_one + "" + apk_version_two + "" + apk_version_three + "000" + apk_version_code version = apk_version_one + "." + apk_version_two + "." + apk_...

0
Q: Dynamic operators within DAGs (Airflow)

Mar-kI would like to know if what I did to achieve to goal of dynamic operators within an Airflow DAG is a good or a bad practice. The goal I had to achieve was to create a 'x' amount of operators within a DAG based on the result of an API call. This DAG will run every for example every week. ...

 
.. but that would be in the realm of codereview.stackexchange.comRuss Hyde 45 secs ago
 
12:34 PM
0
Q: Using System.Security.Cryptography.Aes to generate encryption key

CryptoQIs the below method a safe way of generating a random encryption key to be used with AES (SymmetricAlgorithm) in .NET? It essentially piggybacks off of the Aes alg to create a random key, trimmed to the correct bit size. /// <summary> /// Defines AES key sizes. /// </summary> pu...

 
12:55 PM
possible answer invalidation by Pitto on question by Pitto: codereview.stackexchange.com/posts/220889/revisions
I'm voting to close this question as off-topic because it belongs on codereview.stackexchange.comNikos C. 16 secs ago
 
1:28 PM
I'm voting to close this question as off-topic because it's more suitable for codereview.stackexchange.com and I can't seem to pick it as a "Migrate..." reason — Shark 14 secs ago
 
0
Q: Find largest binary gap of a number N improved

Krisas a follow-up question based on the original one. Could you please see the updated and refactored version and point at things to be improved in term of logic or efficiency? I have now know as I have been made aware about the Greedy Algorithm; Math.Max and binary shifting which deal more gracefu...

 
@Feeds wrong site
 
1:53 PM
0
Q: Find largest binary gap of a number N improved

Krisas a follow-up question based on the original one. Could you please see the updated and refactored version and point at things to be improved in term of logic or efficiency? I have now know as I have been made aware about the Greedy Algorithm; Math.Max and binary shifting which deal more gracefu...

 
2:12 PM
1
Q: Refactoring a LINQ lambda expression to eliminate duplicate object creation code

w4nthe following code fetches data from a MySql database to generate a simple report on accrued work time on projects. I've been away from Entity Framework for a while and looking at this code you can see that the creation of ListProject is basically repeated 3 times. Is there any way to refactor ...

1
Q: Chess Piece Movement

Alec AI'm developing chess in python, and I've decided to make everything text-based before creating a GUI because it'd be my first time doing the latter. I haven't got around to the actual gameplay, but I've modeled the possible movement of any piece. Note that I cannot implement En Passant and cast...

0
Q: std::shared_ptr<T> with implicit cast

InlineAt the work there was task to implicitly convert std::shared_ptr<Derived> to std::shared_ptr<Base> for better ergonomics around type hierarchy. To if I have function void foo(std::shared_ptr<Base> base) and I try to call it with std::shared_ptr<Derived> it should create no problems for caller. ...

 
2:55 PM
possible answer invalidation by Stephen Rauch, Robert Todar on question by Zack E: codereview.stackexchange.com/posts/219533/revisions
You should post on codereview.stackexchange.com once you have your new solution. What exactly are you trying to model here? What do the "Rn" numbers model? — Alexander 32 secs ago
 
@Duga That's a novel approach of rejecting a code edit while leaving the rest intact.
 
hmm and how can I solve problem, where I pushed task 1 for code review, then start task 2 which is not a part of task 1, from master (task 1 not included), made some changes, then realized that I need solution from task 1. What Im trying to say is, one of my task was about translations, I pushed them, then started working on another task, different task, but I later realized, that I need translations from task 1, is there a way to solve this? Can rebase help me? — LadIQe just now
 
3:10 PM
possible answer invalidation by w4n on question by w4n: codereview.stackexchange.com/posts/220914/revisions
 
0
Q: How to check if the value passed onto an array is from among a range of values for example check diceArray to have values in the range 1-6

Prerna SharmaAsks for user inputs in a comma separated manner This code basically asks the user for a comma separated manner to have the dies to be re rolled for (int i = 0; i < 2; i++) { System.out.println("Select the dice you wish to re-roll"); System.out.println("Enter the...

 
3:30 PM
possible answer invalidation by w4n on question by w4n: codereview.stackexchange.com/posts/220914/revisions
 
0
Q: jQuery element reloader

K.DI have looked around for an already existing script for this, but couldn't find one, so i decided to make my own. The point of this is to make it easy to reload an element, whether its a form or a link. To use the script, you add a class to the link/form called "js_container-reloader". What the...

 
@Duga Rolled back.
 
Monking
 
3:50 PM
Monking
 
0
Q: Daily Temperatures

thadeuszlayThe task is taken from leetcode Given a list of daily temperatures T, return a list such that, for each day in the input, tells you how many days you would have to wait until a warmer temperature. If there is no future day for which this is possible, put 0 instead. For example, gi...

 
hey @rolfl !
You know yesterday I was thinking that I hadn't seen you around for a while
 
@CaptainObvious hmm... one down-vote with no comment... I wonder why the DV?
 
I have been lurking, @skiwi - just "busy".
 
@rolfl Ah
 
3:59 PM
Hmm... that sounded defensive.... a better way of putting it is.... life is crazy busy, lots of things happening, and I have been keeping myself a bit behind-the-scenes on Code Review.
 
How's life?
 
"crazy busy"? ;)
 
Life's good. Kids have been travelling (my daughter recently came back from a history trip to belgium/france, she has a job as a "tech expert" at staples (an office supply store), and she turns 16 in a few weeks, so she's about to start driving. My son is just back from a few days in Ottawa, also a history trip.
Wife's got some small medical issues, surgery on monday, nothing serious, but lots of planning.....
We bought a boat recently too, so getting it all cleaned up and prepped for the summer.
 
Sounds pretty busy :)
 
Yeah, I'm running a team of a dozen people at work too, over 3 continents, so that's fun.
Scrolling back in the transcripts here, it's been busy too. How's the 2nd been?
 
4:04 PM
@rolfl it can get busy at times but other times it can get quiet
Did you see there was a close vote room created last fall? it has gone quiet as interest has waned but some are attempting to keep it going
 
0
Q: Python program to find the most frequent letter in a text

enoyGiven a text like "Hello World!" the program outputs the most frequent letter, in this case the "l". If there are two letters with the same frequency, it outputs the first in alphabetical order, for example in the text "One" it outputs "e". In addition upper and lower letters are counted as th...

 
I was aware that the close-vote room existed, but have not been following it.
 
4:20 PM
I wish the Atlassian markdown link format was the same as the regular markdown link format...
I usually remember which one I have to use but sometime I get tripped up- like just now :/
 
4:31 PM
-2
Q: Coverting Python to C++

B3anssI'm working on translating this code from Python to C++. I've gotten stuck and have no idea what is going wrong. My Z value is not changing, but there are not any syntax errors Any help is appreciated. Thanks! import math import matplotlib.pyplot as plt #initial condition mass = 5.125 #Oz circ...

0
Q: Want to refactor working methods that return id of inserted row of query for country, city, and address tables

Ashton MorganThese are the 3 methods and I am just wondering what would be the right way to remove all the duplication? I want to use this example to learn how to do it to clean up the rest of my code. Thank you. private void handleSaveButton() throws SQLException { countryId = getCountryId(); cityId...

 
@Vogel612 Always thought the other way around was preferred. I'll flag that way now too
 
possible answer invalidation by Justin on question by Justin: codereview.stackexchange.com/posts/220835/revisions
possible answer invalidation by Justin on question by Justin: codereview.stackexchange.com/posts/220835/revisions
 
@Duga OP added comment
@Duga OP removed example input/output
 
possible answer invalidation by TheSacredKiller on question by TheSacredKiller: codereview.stackexchange.com/posts/220900/revisions
 
@Duga Handled already
 
4:37 PM
@perennial_noob - I understand. I will remove the third output from my answer so that it doesn't cause any confusions. And I will go into this very soon. But for now, I would like this question to have a positive vote. Thank you :) — Justin 24 mins ago
 
This is the link where I have pasted the whole code. codereview.stackexchange.com/questions/220806/…Laxman 12 secs ago
 
@Peilonrayz FWIW, the mod UI makes it somewhat annoying to sort out which comments need to be dealt with from the flag queue, so I usually go to the post anyways, but we've been getting some quality of life fixes that make the "flag everything that needs to go" much clearer on the post side
 
@Vogel612 Ah ok, that's good to know :)
 
@Peilonrayz - the mod UI makes it hard to see the comment flags in-context ... there's a short-cut way of handling flags, and that short-cut allows you to delete the comments without going to the post.... and just navigating from one flag to the next, to the next, etc.
If all the obsolete comments are flagged, it makes it easier to see, and in turn, it helps us. It also gets you multiple helpful flags ;-)
 
4:48 PM
@rolfl I only know a little about that place, but it was suggested to flag the post at that time. (if there were a lot of flags)
 
@Peilonrayz - Matt describes it pretty well here: codereview.meta.stackexchange.com/a/7069/31503
 
@rolfl Spooky, we linked to the same post
 
@RMunroe lol dat alt text
 
Can you efficiently sum c & 1 in Python to count odd numbers without any kind of pattern-match? (The even count is len - odd). I added an answer on the cr.SE question about the low-level perspective of how you'd do it in C, or given a string how you'd do it with SIMD. — Peter Cordes 55 secs ago
 
@RMunroe lol
 
5:50 PM
0
Q: Python program to know who wins a tic-tac-toe game

enoyGiven an input where we have two players: "X" and "O", and empty cells marked with a "." like: check_winner([ "X.O", "XX.", "XOO"]) the program outputs if there are three "X" or "O" in horizontal, vertical or diagonal. If there is a draw it outputs "D". def check_winn...

 
6:10 PM
0
Q: Toggle any application feature ON or OFF

t3chb0tWhen testing or debugging applications it'd be often useful to be able to run it without certain features like committing things to the database, saving files, sending emails, reading files, executing queries and and and... Currently I use various configurations and boolean flags to achieve this ...

 
6:39 PM
If it works post it on codereview — Alec A 14 secs ago
Post it on codereview, SO isn't for code optimization — Alec A 53 secs ago
The most likely reason is that Excel is busy running your code, and since VBA runs on the main/UI thread, Excel isn't able to process its own window messages. Does the code eventually complete? It's possible that it's simply inefficient - see if putting it up for peer review on Code Review helps (posting rules are different there: you'll need a question title that summarizes what the purpose of the code is, and then a description of what it does in the post body). — Mathieu Guindon 47 secs ago
 
0
Q: Python program to get all non unique elements in an array

enoyGiven an array of ints as input: non_unique([1, 2, 3, 1, 3]) returns [1, 3, 1, 3] non_unique([1, 2, 3, 4, 5]) returns [] non_unique([5, 5, 5, 5, 5]) returns [5,5,5,5,5] non_unique([10, 9, 10, 10, 9, 8]) returns [10, 9, 10, 10, 9] The code itself: def checkio(originalList: list) -> list: ...

0
Q: Count the number of words & lines that has multiple vowels in python

NaphstorI am working on this coding problem "Count the number of words & lines that have more than X vowels for every Y words in every Z line" Basically the input string has multiple lines and I need to count words that has X or more vowels in them. But the constraint is I need to consider only alternat...

 
I'm voting to close this question as off-topic because the code works and the Asker just wants to optimise the code. It probably should go to codereview.SE — Ralf 43 secs ago
Thanks Ralf, I posted the code in codereview. — Naphstor 23 secs ago
 
7:11 PM
You might want to use clustering, so that when they overlap, they’re clustered. E.g. codereview.stackexchange.com/a/214565/54422 or stackoverflow.com/a/18779861/1271826 or ... — Rob 17 secs ago
I believe codereview.stackexchange.com is more suited to things like this — Kevin Wang 14 secs ago
I'm voting to close this question as off-topic because this would be better suited on: codereview.stackexchange.comruohola 19 secs ago
@ruohola Feel free to recommend the OP post on CR but in the future, please don't use the existence of the Code Review site as a reason to close a question. Evaluate the request and use a reason like too broad, primarily opinion-based, etc. Then you can mention to the OP that it can be posted on Code Review if it is on-topic. Please see the section What you should not do in this answer to A guide to Code Review for Stack Overflow usersSᴀᴍ Onᴇᴌᴀ 22 secs ago
This question belongs on Code Review, which was designed specifically for the purpose of asking for peer review to improve working code. — Ken White 41 secs ago
 
7:30 PM
0
Q: Performance of my Java lexical analyser

MinkizzI created a lexical analyser in Java recently, but I don't think the performance is very good. The code works, but when I debugged the program, it take around ~100 milliseconds for only two tokens... Can you read my code and give me tips about performance? Thank you. Lexer.java: package me.mi...

1
Q: Creating keys/names from interfaces to avoid strings

t3chb0tThere are many APIs that require some kind of a string key/name. I usually try to avoid using raw strings and prefer to use helpers that can create them for me. One such a tool is intended to be used with my FeatureService that requries feature names as strings. Usage examples In order to use ...

 
7:55 PM
possible answer invalidation by DavidPH on question by DavidPH: codereview.stackexchange.com/posts/196862/revisions
 
8:10 PM
0
Q: How can i make the code of my Stacker game shorter?

DomeGamer 14I am pretty new to C# and so i would like to ask you, how i could improve my code. I am currently coding a Visual Studio C# Console Game where you have to stack blocks. Currently you can only Stack 3 blocks because my code is getting really long and i am really losing my orientation. The voids "...

 
If you are already getting the correct output then this question might be more suitable in codereview.stackexchange.comkarthick 36 secs ago
 
8:30 PM
0
Q: Python program to translate sentences

enoyGiven a sentencen in 'bird language', where there are two rules: After each consonant there is a random vowel added, for example if the consonant is "l" it willm end as "la" or "le"... After each vowel there are two extra vowels which are the same as the first, for example if there is an "u" it...

 
^ Darn. Meant to approve this pending edit; accidentally rejected it instead.
@Duga Self-vandalism. Rolled back.
 
10:05 PM
possible answer invalidation by enoy on question by enoy: codereview.stackexchange.com/posts/220946/revisions
 
10:30 PM
0
Q: Python program to calculate what pawns are save

enoyIn chess there are eight rows numbered from 1 to 8 and 8 columns a-h. Pawns which are on the lowest row are always in danger to be captured. The objective of the program is to calculate which pawns are saved. Given the coordinates of seven pawns return the number of pawns which are safe. For ex...

 
 
1 hour later…
11:50 PM
0
Q: jQuery popup menu function

K.DI looked around for a script for popup menus in jQuery, but all i found were complex and largely-coded plugins. I decided to write a small script myself: $(document).on("click",".js_popup-trigger", function(e){ e.preventDefault(); //Set variables var element = $(e.currentTarget...

 

« first day (2211 days earlier)      last day (1823 days later) »