« first day (2251 days earlier)      last day (2063 days later) » 

00:00
RELOAD! There are 6192 unanswered questions (89.7759% answered)
 
1 hour later…
01:05
0
Q: Using youtube_dl to download Youtube audio but it is not always of type mp3 even when specified

AhmedSalehfrom __future__ import unicode_literals import youtube_dl ydl_opts = { 'format': 'bestaudio/best', 'postprocessors': [{ 'key': 'FFmpegExtractAudio', 'preferredcodec': 'mp3', 'preferredquality': '320', # selected mp3 and 320 }], } with y...

 
1 hour later…
02:21
You might get better traffic on this question on the codereview.stackexchange.com, (I threw an answer up anyways) — Jay Dorsey 49 secs ago
 
2 hours later…
04:08
1
Q: Need a better way to handle multiple alerts that are stored as an array in TempData

craigI have a form that is comprised of a table of visual and hidden input elements: When the form is posted, each input is converted to a string[]: public IActionResult Assign(int?[] UpdateKey, string[] DriverNumber, string[] NewDriverNumber) { ... If there is a change in any of the rows' value...

04:28
0
Q: How can I make my Pygame Tic Tac Toe game better?

Rahul NiranjanI have this code ready and it works just fine. But what are the ways by which I can improve this code? I have no CS background and this is my first coding project. I could not paste my entire code so I'm posting my github project link. Any recommendations on that would also be appreciated. impor...

Monking
04:45
possible answer invalidation by Arief Anbiya on question by Arief Anbiya: codereview.stackexchange.com/posts/223346/revisions
 
1 hour later…
06:03
@SᴀᴍOnᴇᴌᴀ Official opinion is fluid with the community, so that's working as intended. The lack of consensus however, is not.
Monking all.
@Duga Well, considering the only answer posted is OP's own, not really.
0
Q: String Rotation

its_vinayaki have solved a previous year question of 2018 codevita link in python Problem Description: Rotate a given String in the specified direction by specified magnitude. After each rotation make a note of the first character of the rotated String, After all rotation are performed the accumulat...

06:28
0
Q: A game that deals a high card to one of two players

SIth_Lord_85So for my class, I have to design a game that will deal out one card to for each player. I also need to use functions to accomplish this one for the high card game, and another for the face value of the card. import random def high_card(): print("\n High Card") print("-----------") ...

 
1 hour later…
07:30
Monking
07:48
0
Q: Is writing functions without return values good style in C/C++?

gebbissimoI quite often see functions in C/C++ without a return statement, where I believe there should be one. For example the add function below (obviously too simple for a real scenario, but I hope you get the idea): #include <iostream> #include <string> void add(const int* const a, const in...

08:28
0
Q: Find minimal number of days to meet all your friends

David RefaeliI was asked this in an interview yesterday: You get an array of segments (segment contains 2 numbers, representing days count (say in a month, but could be in a year, etc.): start, end). You need to find the minimum number of days where you can meet as many of your friends. For example, if you ...

0
Q: Find max number you can create from an array of numbers

David RefaeliWas asked this in an interview yesterday: You are given an array of numbers (not digits, but numbers: e.g. 9, 23, 184, 102, etc.) - you need to construct the largest number from it. This is my solution, I wonder if you can improve this? def maximum_number(a): work_dict = { 0: 0, ...

08:40
possible answer invalidation by CorellianAle on question by CorellianAle: codereview.stackexchange.com/posts/223365/revisions
09:08
0
Q: Optimizing calls for reauthentication when working with a REST API

AlexeiI am currently developing a REST service in ASP.NET Core 2.2 that acts as a wrapper upon a REST API provided by a reporting solution. The reporting systems REST API authenticates the user based on a username and a password and subsequent requests must contain both a token and the cookies receive...

09:27
Hi Hilgie, what do you mean by "Clean the code up"? I think this would be more on topic in the code review site: codereview.stackexchange.comI.T Delinquent 30 secs ago
My Excel is starting to look like a database. Oh carp.
I've rolled back the revision, again. If you disagree, please take it to the comments, meta or chat. Don't rollback a rollback simply because you disagree with site policy. — Mast 16 secs ago
If that happens again, I'm not rolling it back again. Either the community takes it or I'll put a flag on it.
09:48
0
Q: timer struct for fixed timestep iterations in C (gcc)

David C. RankinI was toying with a way force fixed timestep loop iterations in C and came up with a fairly simple timer struct (quite different from Pausable Timer Implementation for SDL in C and decided to put it out for review. The timerstruct itself is: typedef struct ktimer_t { struct timespec next; ...

 
1 hour later…
10:49
-1
Q: how can I fetch two api with javascript?

jennyI'm doing my new project and I really have big trouble , I need to fetch two api , one has all username and country and another api has user info. so I fetch the first api enter code hereasync function getData() {let response =awaitfetch(regionUrl);let data = await response.json()return data}va...

possible answer invalidation by oss on question by oss: codereview.stackexchange.com/posts/223143/revisions
codereview.stackexchange.com may be a better place to post this since you're looking to improve the structure of working code. — frobinsonj just now
11:06
@Duga Usually, yes. But since the answer points out the code is not working, it's the answer that's at fault now.
11:46
I'm voting to close this question as off-topic because it belongs on codereview.stackexchange.com — Eyeslandic 3 mins ago
0
Q: Simle todo list VanillaJS - repository pattern

Adam BorowskiIm new in JavaScript, so I was looking for some reviews and advice for better code quality. import Todo from './Todo.js'; export default class Repository { constructor(todos = []) { this.todos = todos; this.storage = localStorage; } addTodo(todo, save=true) { this.todos = [.....

possible answer invalidation by Joelius on question by Joelius: codereview.stackexchange.com/posts/223375/revisions
@Duga Is it international answer-invalidation week or something?
6
It's fine though, this one.
12:09
0
Q: Better code for error handling in NodeJs and Express

user3742929I have this code for a post request, when the user wants to change his password. Because of all the cases and the following page renders the code came out really ugly. Is there a better way to structure this? (It works fine and does what I want.) // Check if old password is correct SQL.getUs...

3
Q: Recursive conversion from ExpandoObject to Dictionary<string, object> #2

JoeliusBecause my original question was lacking many details, I have been advised to ask a new question. I will repeat the important parts of the original question and add examples etc to hopefully make it clear. For my blazor library which is a modification of this awesome library I have to convert ...

You would have better luck on codereview for optimization questions. However, If you get rid of the copy and paste and just dump the values directly it will significantly reduce the runtime. — Warcupine 50 secs ago
12:29
1
Q: Simple Python OOP currency converter

NguyenThis is a follow up question on this post This is what I changed on my previous code: I use Exchanger and PairCurrency class instead of Bank I change addRate and addCommission to setRate and setCommission respectively Exchanger object contains multiple PairCurrency object which can be added to...

0
Q: Class for comparing objects - how to write better this code?

Adam BorowskiIm curious how to write better this code. I don't like creating objects of four different types of reporters, this could provide some problems with testing. How about rest of this code, for example this if statement below? """Module containing classes for comparing objects""" import senders impo...

13:09
0
Q: Lightweight, modular Discord bot - tips and feedback on the code?

trvlrThe full project is up on GitHub. The codebase is super small as it stands. I'm brand new to reactive programming and Spring, and would mostly like insight on those two things. Asynchronous programming is also one of my weak points, because I'm really used to synchronous program structure - henc...

Having said that: you might want to turn to codereview.stackexchange.com. Carefully read their help center content, to learn how/what to post there. Then see if you can create a meaningful review request that clearly states in which ways you want that community to help you. — GhostCat just now
13:29
As your code works, you should ask this on codereview.stackexchange.comMatSnow 13 secs ago
0
Q: Loop to copy values from one sheet and paste the values 68 times in another, time efficiency

MULakerI have created a large VBA program to automate creation of a data table that is needed to run slicers in an Excel file. While the loop works well in creating what I need, the main loop take an hour to create the list of company names that I need. I was wondering if there is a way to improve the t...

0
Q: JQuery Selector in Vanilla JS

DinoI've decided to reproduce the JQuery selector - specifically for finding elements by class name, ID, and tag So for example the tests could be written like $('.box') === domSelector('.box') // Class $('#box') === domSelector('#box') // ID $('input') === domSelector('input') // Tag Here is my ...

0
Q: char[] and int[] ambigutity in c++

Amruth Achar str1[] = "amruth"; cout<<str1<<endl; //output -> amruth cout<<&str1<<endl; //output -> address int arr[] = {1,2,3}; cout<<arr<<endl; //output -> Address cout<<&arr; //output -> Same address as above one Why is this behavior different for char[] and int[] ?

13:49
0
Q: Convert integer to full text string duration

BishNaboBI have a function I have written in VB for use in SSRS 2012. It takes an integer and converts it to full text duration - for example 900 becomes "15 minutes", 9000 becomes "2 hours 30 minutes", and 7201 is "2 hours 1 second". The code works, and is: Public Function SecondsFullText(ByVal TotalSe...

14:17
Hello, welcome to StackOverflow. Since you're asking about general advice on how to improve your code, and not to solve a specific problem, codereview.stackexchange might be a more appropriate place. — Vincent Saulue-Laborde 26 mins ago
@Mast I can change the wording or remove the comment. Based on OP's reply to you I think it is still broken code.
Or at least it's not handling dead locks correctly.
14:48
@Mast I have removed my comment and flagged the OP's response to my comment as no longer necessary.
0
Q: Stored procs fine tuning for processing bulk data - 5 million records

JayI have the below procedure which is used for bulk upload data from a temporary table (temp_rules_master) into two other related tables. It has 5 million records. The actual 5 million records to temp table upload take less than 10 mins. But later the below procs takes around 10 hrs for running t...

Well. Correct exception handling is a different story. What is showing up in your code ... is simply something that I would reject in a code review. — GhostCat just now
@SᴀᴍOnᴇᴌᴀ Wat
0
Q: Allows the use of Redux to manage the state of a grid with the Kendo React Library

YanayayaI wanted to use Redux to manage the state of my KendoUI components such as the grid. The online examples from Telerik do not seem to contain clear information on how to do this, so, I started to create a solution of my own. Whilst all my code works with no errors, I'd still like it to be sanity...

15:15
IMO there isn't really a right or wrong answer in this case, and questions asking for "best practices" are usually off-topic here. If your code snippets are working, this may be a better question for Code Review. — GrumpyCrouton 30 secs ago
15:26
15:50
@Thirumagal If there wasn't specific feedback, this might be better at Code Review (since Stack Overflow tends to be focused on specific problems rather than general feedback on how to improve the code). — EJoshuaS 2 mins ago
Monking
16:09
0
Q: git Create Tree from Arbitrary Directory (works in bare repository)

James TalbertI made a script for a project I'm working on to create a tree object from a filesystem directory, without any working tree operations (can be run in a bare repository). The tree can be inserted into (a) commit(s) by using an index filter that invokes git read-tree --prefix=</...>. #!/bin/bash # ...

@Duga hmm - such dedication
> PS: I am new to the forum so if something needs to be updated in question, please suggest instead of downvoting. I'll update it immediately.
@SᴀᴍOnᴇᴌᴀ that reminds me of this joke
-1
Q: I made a Validation with React.The code works, but is this okay or it can be much simple?

Stefan[![enter image description here][1]][1] [![enter image description here][2]][2] [![enter image description here][3]][3] this is image [1]: https://i.sstatic.net/s5ONO.jpg this is image [2]: https://i.sstatic.net/6fwTO.jpg this is image [3]: https://i.sstatic.net/u8gb1.jpg

@CaptainObvious <weapons-grade-facepalm.gif>
17:09
1
Q: UnionTypes: PartialRequired and PickRequired

ShinigamiToday I created two new UnionTypes in my project. PartialRequired will create a definition of T with all attributes optional + some specific picked attributes that should be forced not to be optional. export type PartialRequired<T, K extends keyof T> = Partial<T> & Pick<Required<T>, K>; PickR...

18:02
This kind of questions is better asked at Code ReviewJens 30 secs ago
18:25
possible answer invalidation by John on question by John: codereview.stackexchange.com/posts/223302/revisions
@Duga That's okay - OP added sample data in JSON format
18:36
Having thought about zombie CR posts periodically has led me to listen to the song Zombie by the Cranberries more frequently... and there is a cover it by Bad Wolves that I like as well
the acoustic version is good too
0
Q: Notifier/dialog Plugin

darcherI started working on a notification system that is pluggable into any project. I have not made any "plugin" type javascript libraries, usually just functions very specific to the project at hand. That said I wanted to reach out for pointers to avoid conflicts in both javascript (and css). I'm awa...

0
Q: Object-oriented cat-and-mouse in Pygame

MaxDI'm rather new to programming. So far I've only done some small coding tasks once every now and then, and this the first "bigger" project for me. I love the idea of object-oriented programming and I've heard a lot of good things about Python and Pygame, so I decided to give it a shot and get codi...

0
Q: Check whether a string has all unique characters (time efficiency)

demasI don't find this algorithm in Go language here, so I just want to check that it is really most efficient algorithm in Go: func checkUnique(s *string) bool { var a [256]bool for _, ascii := range *s { if a[ascii] { return false } a[ascii] = true ...

19:28
0
Q: Finding paths between triangles efficiently in 3D geometry

Tyler ShellbergI've been writing some functions used to find paths between two types of triangles - alphas and betas. Alphas are triangles that have been in a zone we consider important, have an "interesting" value above a given threshold, and are "active". Betas are essentially anything that isn't an Alpha. ...

19:54
... but this site is not to be used for general debugging. You come here after you debug and find the error. Since this isn't what you were initially asking for, code review might be a better location for such questions, but you'd best read their help site first. — Hovercraft Full Of Eels 23 secs ago
20:19
Welcome to stackoverflow! Since your code runs but you want to optimize it, this might also be a good question for the Code Review stack exchange site — G. Anderson 36 secs ago
20:30
0
Q: My Sal's Shipping challenge on Codecademy attempt

Ahmad Izzudin AlifyandraThis is my attempt on the Python 3 Sal's Shipping challenge on Codecademy (Challenge Link(instructions in the link)). Can anyone please review my code?I'm very fresh newbie and I really wanna improve my coding, thanks. def groundCost(weight): if weight > 10: cost = weight * 4.75 elif wei...

20:57
OP: This looks very much like a Code Review post, down to even the title describing the purpose of the code (kudos!) -- here on Stack Overflow, it's arguably opinion-based; enhancements of working code are best made on CR, where reviewers will provide feedback on every aspect of the code, so you'll want to present that code in its surrounding context "natural habitat" for best results. — Mathieu Guindon 12 secs ago
21:50
0
Q: Run length encoding C#

Giladthis is the original question https://www.geeksforgeeks.org/run-length-encoding/ Given an input string, write a function that returns the Run Length Encoded string for the input string. For example, if the input string is “wwwwaaadexxxxxx”, then the function should return “w4a3d1e1x6”. ...

0
Q: Union and Intersection and Diff of two sorted arrays c#

Giladthis is the original question https://www.geeksforgeeks.org/union-and-intersection-of-two-sorted-arrays-2/ Given two sorted arrays, find their union and intersection. Example: Input : arr1[] = {1, 3, 4, 5, 7} arr2[] = {2, 3, 5, 6} Output : Union : {1, 2, 3, 4, 5, 6, 7} I...

22:25
Then I think this question belongs to CodeReview, not StackOverflow. — Fureeish 20 secs ago
22:36
Is this answer just an alternate solution without justification, or is pointer casting obviously an improvement?
23:10
0
Q: Tiny URL creater

EMLCoding challenge: Convert a given long URL into a Tiny URL. The length of this Tiny URL should be fixed and the same for all URLs. You should return the full URL if given a shortened URL. I am aware this code is technically flawed as there will be clashes owing to the limitations of the...

0
Q: Filter b y Date, summarise and paste data between spreadsheets

rewoundI have written the below working Code to speed up the summarisation of transaction data into a reduced format whilst also checking and providing feedback where there is no data to transfer. Overview: I manage the bookkeeping for 40+ companies in an excel workbook. All transactions are added to a...

23:30
0
Q: Why is the Nginx PHP Unit ignoring the root parameter in this configuration file?

rraallvvI'm trying to move mywebsite.com from a multisite WordPress installation into its separate WordPress installation folder. I've already setup a separate database and created a new file wp-config.php for the new WordPress installation with the information needed for the new installation. The proble...


« first day (2251 days earlier)      last day (2063 days later) »