« first day (2230 days earlier)      last day (1803 days later) » 

12:00 AM
RELOAD! There are 6090 unanswered questions (89.8719% answered)
 
0
Q: I was wondering if I can some perspective on optimizing a function that has nested for-loops for feature selection?

Mel ManiwanI looked up a tutorial and created a function based upon its script. It's essentially used so I can select dependent variables that's a subset of a data frame. It runs but it is very very slow. How would I flatten a nested for-loop such as this? I tried implementing an enumerate version but it ...

 
I don't see a question here. There's a vague if I'm missing something, tell me, but that's not a question. If you have working code that you're looking for ways to improve or optimize, Code Review was established just for that purpose. This site is for specific questions related to programming (code) or use of a programmers tool. You've not asked a specific question of any sort in anything you've posted above. — Ken White 50 secs ago
 
 
2 hours later…
1:48 AM
0
Q: Best way to store salt in database using java

Lebron11This is my account table: CREATE TABLE mwUser ( username varchar2(20) primary key not null, salt varchar2(64) unique not null, hashedpw varchar2(64) not null, email varchar2(320) unique not null ); When I register a new user with my java webservice I automatically generate a random ...

 
2:11 AM
I'm voting to close this question as off-topic because it is asking for peer review for optimization. Code Review was created for that purpose. Please be sure and review their guidelines before posting there to ensure you've followed their requirements. — Ken White 37 secs ago
 
2:39 AM
Not a problem. That's why I left the comment to introduce you to the other site. It was created specifically for the purpose of peer review of code that is already working. This site is for what you've said you used it before - to solve problems when writing the code. Once it's written, it's no longer problem code, but working code, and that's Code Review territory. — Ken White 44 secs ago
 
3:32 AM
You should accept the answer if this worked. The question you pose here in the comments should either be another question or even better a question for codereview.stackexchange.comPerplexabot 37 secs ago
 
4:13 AM
 
 
1 hour later…
5:21 AM
Your question might be more suitable for Code Review but they too will want to see some research effort as well as a basic grasp of English punctuation. — tripleee 37 secs ago
 
5:39 AM
Monking
 
5:55 AM
0
Q: Best most efficient way to loop through files using VBA Excel

StephanI have a procedure for looping through all files in folders and subfolders starting at a folder which the user can select. The user can select both the source and target folder. I'm using Excel VBA for this. The worksheets contain all the files names or part of it, to search for. It works like ...

 
6:42 AM
Not sure how timestamps work. Also, it is hard to guess the difference with the information you provided. Even if you provide the information here in question, I am afraid, the question will become Too Broad or Off Topic. I guess codereview is better place to try. — Amit Joshi 50 secs ago
 
7:15 AM
0
Q: Non-testable class wrapping Java Properties with basic logic

franiisI written simple java.util.Properties wrapping class. Unfortunatelly in my opinion it isn't testable at the moment and I don't have any great idea, how to improve it. I could use PowerMockito to change properties after loading or add setter for them or inject some class that provides properties, ...

 
7:49 AM
You should be able to save a lot of time using dynamic programming. Check the answer of the euler project problem 31 and problem 76obchardon 57 secs ago
 
8:14 AM
Your question might be better recieved at codereview.stackexchange.comJaxi 8 secs ago
This might be more suitable for codereview.stackexchange.com since your code is actually working — DTul 17 secs ago
 
8:42 AM
Consider using codereview.stackexchange.com next time you have code that works but are looking for ways of making it better. — Mark Cilia Vincenti 25 secs ago
 
9:15 AM
But may as well just put slope inside a Map class, right? makes everything easier to manage. BTW, yikes! I just realised I should have put this question on Codereview.StackExchange! — aName 38 secs ago
 
9:34 AM
0
Q: UVa Problem 10300(Getting Runtime Error SIGKILL)

Jayed YeameenI am solving UVa problem no 10300. But I am getting runtime error SIGKILL for the follwing code. /*Rough solution of uHunt 10300*/ #include <iostream> #include <vector> #include <numeric> using namespace std; int main(){ int n, f, farm_size, no_of_animals, efness, budget; int farm...

 
9:54 AM
0
Q: Find the longest word in a string

MannuI have written code in the language Go. I wonder if anyone can do it in a very simple and effective way, because every language has its own way to solve this problem. My experience is in JavaScript. Please guide me how I can improve this solution. Thank you in advance. What I'm doing here: ...

 
10:14 AM
1
Q: Parallelize for loop in bash

user213544I am using a Bash script to execute a Python script multiple times. In order to speed up the execution, I would like to execute these (independent) processes in parallel. The code below does so: #!/usr/bin/env bash script="path_to_python_script" N=16 # number of processors mkdir -p data/ for ...

 
10:34 AM
1
Q: Class for managing a list of scores (game development)

VengeancosFor my game that I'm writing, I need, among other things, a data structure for storing best values. For this purpose, I tried to write a class that meets the most general needs, and yet does not seem overloaded. Can the class be further improved in terms of code quality or performance? Is the in...

0
Q: Custom WordPress SQL query to get posts and users using term_id

Antti KoskinenI have a WordPress site with multiple custom post types, that all share a common custom taxonomy. Users can also be tagged with terms from this taxonomy. After giving up on JOINS, I managed to conjure the following query to get all of the posts and users based on a term_ID. global $wpdb; $sql =...

 
11:14 AM
0
Q: changing file name in a prefer sequence format, Python

Ali TajikI have a list of file which I have gathered them in time order, I should change the file name (just name) in order of the time. The name changing process will contain; Removing the name from ‘#’ sign until the end. Save the name before ‘#’ and add the 1.1 for the first file and the numbering wil...

 
12:02 PM
I'm using some linters on some of my code and just came across this. No wonder people hate linters.
4
> pep257: D212 / Multi-line docstring summary should start at the first line
> pep257: D213 / Multi-line docstring summary should start at the second line
 
12:15 PM
@Peilonrayz: Looks like you are supposed to choose an interpretation for "The summary line may be on the same line as the opening quotes or on the next line." from PEP257 yourself. But it's funny that they are both enabled by default ;-)
 
@AlexV True true, it's a simple solution anyway, :)
 
12:46 PM
If you have a working solution and are looking for improvements then you should post this at Code Review instead — Joakim Danielson 29 secs ago
 
@Peilonrayz Yea, that's why I rolled my own.
Which is basically a selective wrapper over existing solutions, but hey. It's Python. That's how it's supposed to be done.
 
0
Q: C# Object Oriented Implementation on Expense Tracking App

doctorWeirdI am creating a Expense Tracking Application in C# and right now I am trying to build its building blocks in a console app. would like to know your feedback if it is in a Object Oriented Design/Structure namespace ExpenseTrackerOOP { class ExpenseTracker { static void Main(string...

 
1:02 PM
@Mast Same, I put a PR to add support for another tool to Prospector, but they've ignored me for 3 months... :/ Might as well just write my own linter wrapper at that point.
 
1:14 PM
-1
Q: How can the length of a string be O(log(n))?

J doeI have just started learning about time complexities and am currently reading Logarithmic Complexity. Here's an example of a piece of code which is O(log(n)). def intToStr(i): '''Assumes i is a nonnegative int Returns the string representation of i''' digits = '0123456789' if i == 0...

-1
Q: Better way to optimize code. reduce repetitive queries

Abdullah FarazI have a method in controller where i wrote queries in if else with a difference but how can i remove the parts of the query which is same for all than writing again nd again any better solution so solve this issue if (isset($slug_colum[1])) { $productsFeatured = Product::selec...

0
Q: RegEx version control

Hugo Coxthis is my first time on this stack exchange :) I created a little script to check for the latest version of specified API version available, but I am wondering if I am using the best way possible for checking regex and includes? The const arr will be filled dynamically with version folders usi...

 
1:31 PM
you're more likely to get a better response to this at codereview.stackexchange.com or reddit or somewhere else — Daniel Lizik just now
@DanielLizik Please don't recommend code that doesn't work the way the OP intends to go to Code Review. They are off-topic. — Peilonrayz 11 secs ago
 
0
Q: Optimize django export to xls format

EssexI'm working on a django project and I'm wondering if there is any way to improve the process time to export my data to xls format. Actually, it takes between 43 seconds and 49 seconds to create the file and download it. I would like to know if my code could be improved in order to earn time. Th...

1
Q: Register Script for a website

Phil StampI'm still new in web development and I am trying to develop a website with free access to doctors listing with option of booking. This is a personal project that my local community can benefit. I want to get an opinion or recommendation from you experts whether the logic for my register function...

0
Q: A small PHP library for styling terminal output

Trần Đình TrungI've attempted to make a small PHP library for styling terminal output using ANSI escape sequences. The repo is located here To be honest, I am not really satisfied with the current structure of my code. It seems to be "not good". But I don't know any better ways to structure it. Please feel fr...

 
2:05 PM
possible answer invalidation by Your Common Sense on question by Phil Stamp: codereview.stackexchange.com/posts/222156/revisions
I'm voting to close this question as off-topic since the code works and the OP just wants us to review it. IMHO, it would fit better over at Code Review. — Magnus Eriksson 9 secs ago
 
0
Q: Better Way to enabled/disable text boxes?

TravisIn my forms I have 4 radio buttons, to Add User/Add Group and to Remove User/Remove Group. The current code below works, I was just wondering if there was a better way to do it than have this gross very similar code. HTML forms: <div class="form-popup" id="addUser"> <form class="form-container"...

 
@Duga Not answer invalidation. Rolled back white space changes, wouldn't be surprised to see another message in chat.
 
@JimMoody You might also consider a followup post on codereview.stackexchange.com/help/on-topic to review your implementation once you have your solution ready. — Freiheit 24 secs ago
 
I don't know enough PHP to be able to give the guidance I'd like. However. 1. If the code in the question was broken, whether you knew it was, or to the point if you run it it will only error. You are allowed to edit the code in the question. If this is not the case, 2. You should improve this answer so it says how to improve the code. Code dumps aren't allowed here, and will be downvoted + voted to delete. 3. Delete this answer and post a new question in a couple of hours. — Peilonrayz 20 mins ago
@Peilonrayz ^^ The edit in this case would result in answer invalidation
 
@SimonForsberg If it's off-topic it's not AI as "the answer is already invalid"
I'll get you the meta
21
A: How should we deal with askers fixing off-topic questions when an answer has been posted?

EdwardAnswers to off-topic questions are already invalid One way to look at this is to say that if a question is invalid, it should be closed and not answered. Answering an invalid question sends exactly the wrong message and encourages unwanted behavior. Following that line of reasoning, fixing the...

 
The question has technically not been closed as off-topic though... yet.
I'm leaning towards considering the original post a human copy-paste mistake, and deem the question as on-topic, delete the OP's answer and unlock the question.
 
3:00 PM
As I said @SimonForsberg I don't know enough about PHP, the way Your Common Sense was saying it's off-topic made me think it was a "this can't even be interpreted by PHP" error.
 
@Peilonrayz No, it's not that bad of an error (at least not as far as I have seen)
The only issue I've seen is the usage of $stmt->bind_param (which one answer pointed out), this might trigger some error in runtime - I am not sure, but it's definitely not a "this can't even be interpreted by PHP" error.
My apologies. You are perfectly right. While editing the code, I missed updating the bind parameter. — Phil Stamp 1 hour ago
 
3:14 PM
@SimonForsberg Seems reasonable. Does the lock delete VTC? (Asking out of curiosity)
 
@Peilonrayz Nope, it doesn't.
 
3:27 PM
I think Codereview StackExchange site would be the right place for this kind of questions - provided that you are not posting duplicates of course. — FatihAkici 28 secs ago
 
@Duga Interesting, the anyone agree/disagree, it seems to work, but errors with an OverflowError for the, out of code, example 1/1527612795642093418846225
 
0
Q: Generating random sparse matrix

stats134711My goal is to generate a large sparse matrix with majority (~99%) zeros and ones. Ideally, I would be working with 10,000 rows and 10,000,000 columns. Additionally, each column is generated as a sequence of Bernoulli samples with a column-specific probability. So far, I've implemented 3 ways to g...

 
3:54 PM
0
Q: Slow runtime for program selecting optimal piecewise regression fit

sangstarI'm making a program which fits a piecewise linear regression with up to 4-5 breakpoints in the data, and then deciding how many breakpoints is best to prevent over and underfitting. However, my code is extremely slow to run, due to how ungraceful and brute force it is. However, I'm not sure how ...

 
Monking
 
4:28 PM
If you are 100% sure that your solution works but still looking for ways to improve it then consider moving your question to codereview.stackexchange.com. — Pshemo 24 secs ago
 
To improve complete working code, it should be posted on Code Review. — Carcigenicate 46 secs ago
Hi @matar770! Welcome to SO. This would be more on-topic over on the sibling site Code Review. Be sure to comment here if you open a question there so we can find it :) (I'll flag this one for moderator review.) — ShapeOfMatter 16 secs ago
I'm voting to close this question as off-topic because it belongs on another Stack Exchange site, the Code Review site. — Basil Bourque 28 secs ago
@BasilBourque 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ᴇᴌᴀ 54 secs ago
 
4:54 PM
-1
Q: Algorithm for Egyptian Fraction

swom bhaiAn Egyptian fraction was written as a sum of unit fractions, meaning the numerator is always 1; further, no two denominators can be the same. As easy way to create an Egyptian fraction is to repeatedly take the largest unit fraction that will fit, subtract to find what remains, and repeat until t...

 
5:14 PM
0
Q: Cast response depending on type

JamI use this method to get either Customer or Account. The server will determine which type it is. The response will have a property "Type": "Customer" or "Type": "Account". I first deserialize to Client (supertype) to check the Type property. Then deserialize to either Customer or Account. publ...

 
5:31 PM
@Duga I'm going to switch it up to just providing links in the future instead of adding advice
hopefully that will avoid excess comments
 
I'm voting to close this question as off-topic because it would be better asked in codereviewGreen Cloak Guy 8 secs ago
@cpit to the best of your knowledge is the code working? If not, please don't ask it in codereview until it is working (since that would be off-topic) — Sᴀᴍ Onᴇᴌᴀ 22 secs ago
looks fine. Post in codereview for coding style etc — Serge 41 secs ago
 
6:14 PM
0
Q: file encoder/decoder in nim-lang

EPoI wrote a simple program to encode a local text file with password and decode it back. There is one text file and it is either enocoded with password or is in plain text. I had a version in python for this, but nim compiles to an executable, so I gave it a try. I'm not prefectly happy with c...

 
No, it is not. The problem is with your code, maybe you are doing some preprocessing before showing the main UI window. I suggest you post your code in codereview.stackexchange.com. — M. R. 23 secs ago
 
Alright, here's what we do, the answer will be invalidated if we edit the question, so let's close this question off as broken, not working (it is broken, and not working), and, @PhilStamp - open up a new question with the working code (you can edit this question to get the raw content - and pasted it in to the new question, and then use the correct code for the new question). This will clear up any confustion and start the new question with a clear slate. — rolfl ♦ 3 mins ago
 
6:29 PM
@rolfl cool
 
7:09 PM
This is good, that you want to learn to do this. However, this might be a better fit for the Code Review StackExchange sitecale_b 6 secs ago
 
7:28 PM
posted on June 12, 2019 by CommitStrip

 
1
Q: List of previous and upcoming months to a given date (year and month)

SzekelygobeI need a menu with buttons of months previous and after a given month, something like this: | month | month | month | current month | month | month | month | Can this function further be improved? /** * Generates array of months previous and after given date * @param $p_base_data - arra...

 
7:53 PM
0
Q: Best way to implement Account verifiction

igodieSo I am having a discussion with a friend of mine whats the best way to verify an account. We have come up with two methods: Method 1 The first method there are three steps: register user and automatically create an row inside verification table send email to user with verification code aft...

 
8:21 PM
PPCG got its site design! Congratulations to them!
63
Q: Congratulations! Your site design is now live!

CatijaYou may have noticed that the site got a bit less blue today! Thank you so much for your input over the last few weeks. This has been a great process and I really hope you like your new theme. We took your very helpful feedback and made some adjustments Reworked the logo to look more like a ...

 
@200_success should this q be changed to ?
 
Yes, change it.
 
okay cool beans
 
 
2 hours later…
10:07 PM
Stack Overflow's scope is limited to specific, narrow questions where you can remove everything but a the shortest possible code that demonstrates a specific problem. Questions about improving working code are more likely to be on-topic at our sister site Code Review, whereas questions about general software design are more likely to be on topic at Software Engineering. That said, not every question is on-topic anywhere on the SE network; see meta.stackexchange.com/questions/129598/…Charles Duffy 11 secs ago
@CharlesDuffy Please don't link to Code Review on questions that don't contain working code. — Peilonrayz 20 secs ago
 
11:08 PM
You can ask this question on another community on stackexchange, see codereview.stackexchange.com — 0liveradam8 37 secs ago
If you post on CodeReview, please read How do I ask a good question? before posting, since the current form of this post would likely be closed as off-topic. — Sᴀᴍ Onᴇᴌᴀ 20 secs ago
@ 0liveradam8, Thank you for guiding me. I will ask this in codereview.stackexchange.comAayu 22 secs ago
 
0
Q: Tower of Hanoi - helper function

EMLHere is a fairly straightforward solution Python to the Tower of Hanoi problem def move_rings(number_rings, move_from, move_to, spare_tower): """Print all steps move_to move N rings move_fromom move_tower A move_to move_tower C""" dict_rings = {0: "A", 1: "B", 2: "C"} if number_ring...

 

« first day (2230 days earlier)      last day (1803 days later) »