If the code works and you are simpy wondering whether it's good, can you make it better, or is your approach correct in general, StackOverflow is not the place you are looking for. You are looking for CodeReview — Fureeish52 secs ago
Thanks for pointing it out. I will try seeking help on CodeReview. — Mahmud Sakib36 secs ago
This question is a part of my research. I am trying to multiply two N X N matrices which are stored diagonally. I implemented the following algorithm for this purpose which is working correctly but the problem is it is taking way too much time. For example, To multiply 1000 x 1000 matrices, it is...
There are exactly n inputs and in which each entry is getting entered twice
except once but n value may go to 10 000 000 000 spoj ololo
Note-> The xor of two same value is always zero
1^8=9 -> 9^1=8
we can take xor of values while input is getting entered finally we will have a single v...
I'm facing a wrong answer problem on 5 test cases out of 10 on a Hackerrank question. I've tried every possible test case (generally small so I could later use the debugger to see the how the code is actually working) I could think of but I'm unable to find the bug that's causing the wrong answer...
I have to write windows service running 24/7. Service must process documents from various sources. I wrote some code but, I don't know how to apportion it on assemblies and folders consistent with clean architecture.
It is windows servide so I don't have presentation layer. Can I count on some ad...
I've been learning to code in my spare time for a couple of years. I have covered object oriented stuff before and can usually understand other people's object oriented code. This is the first time I've written an object oriented program from scratch.
It has all the functionality that I want and...
I saw a programming puzzle. Find a string containing letters from a to z such that its MD5-hash starts like 314159265359. I am a junior programmer so I would like to know if I can solve the problem faster that checking firs strings a-z, then aa-zz, then aaa-zzz and so on. As the computation takes...
The 2 ends coin game receive an array. The goal of the game is accumulate the number of points from the coins (values of the elements in the array) the most. you can take points only from the 2 corners of the array.
There are 2 conditions for the game:
1) The first player (Amir) would never los...
I am learning Python for a few weeks. Last time I started object-oriented programming and I feel like it is really hard for me to write relation between methods and attributes different objects.
I tried to write simpler version BlackJack card game only with Hit or Stand option.
Could you hav...
In the absence of feature-complete and easy-to-use one-hot encoders in the Python ecosystem I've made a set of my own. This is intended to be a small library, so I want to make sure it's as clear and well thought out as possible.
I've implemented things from a previous question concerning only t...
I am learning excel vba through an online course.
One of the exercises requires that you you find and replace text in a selected cell for all sheets. Here is my attempt at a solution using a For each loop.
Sub Find_Replace_Selected_Value()
' Initialize Variables
Dim inputRange As Range
Dim se...
Do you think the below code works in linear time? Below is my analysis :
[Full Question: https://www.geeksforgeeks.org/longest-consecutive-subsequence/ ]
Worst case time complexity analysis (when all the characters are consecutive) :
Total n iterations for the first value = O(n)
After this th...
my website is online now, i have been working on this for 10 months after i come back home from work and in the weekends and holidays. It was a great process in which i developed my skills especially in jquery and ajax and learned new things that can be done with php and mysql.
I would love to h...
I couldn't even register. You have plenty of errors across the site. Anyway this question is not suitable either here or on codereview. — Dharman56 secs ago
I've migrated this over to our sister site, Code Review, as this is your own working code for which you are looking for improvements. — Martijn Pieters ♦1 min ago
Okay so the problem is I have a file like this :
Case 1 ( 1st file ) :
abcd,1
abcd,21
abcd,122
abce,12
abcf,13
abcf,21
Case 2 ( and another file like this ) :
abcd,1
abcd,21
abcd,122
So, as you can see it's sorted and in increasing order.
What I want to do is convert it to like this :
...
I am currently developing a unity-based multiplatform game (PC, IOS, Android) in a small team. This is the code we have created for the Character Actions inside the game. I am looking for feedback on the code itself as well as tips on how some Unity features could be used better. This is my first...
I think this isn't the right forum to ask: if you think it is useful and should be added to the lodash library, talk to the owners of the repo instead (I can see that you've opened a PR, so just be patient and wait for community feedback). If you need review of your code you can ask on CodeReview. — Terryjust now
I am trying to solve some challenges and I noticed that my python code runs too slow.
When I wrote the same code in Java, I didn't have any problem.
Some could tell me how to improve my python code?
Java code:
import java.util.Scanner;
public class PrimeKattisChallenge2 {
public stat...
I'm trying to create an electronic order menu for a burger place. I'm stuck on trying to figure out how to add up the order up when each item is selected in the switch statement. I was thinking of placing each method that is selected from the switch, in an array and somehow add it up. For example...
solidstatejake, yes, this works, but only because it's been whupped with an ugly stick. Under no circumstances should you do this in real code. (I am sure Matthieu would agree.) I suggest you submit a question that presents your real problem (regarding the huge case statement) at Code Review. Its mandate is to suggest how working code can be improved. (SO, by contrast, deals with broken code and algorithmic issues.) You'll get some excellent answers at CR. — Cary Swovelandjust now
IMHO fixing the error you mentioned and then putting this code on code review could help you a lot — Treycos59 secs ago
I just recently began going over number systems again, granted I didn't pay very much attention to it the first time for lack of understanding its importance (I've only been coding for a year and some change). Below this paragraph of text I have a simple Binary to Decimal converter, and I was won...
I'm voting to close this question as off-topic because it should be asked on Code Review — G5W25 secs ago
@Ian Oh my. That's a long time ago. Good spot, and none of that code would pass my own code review today. I updated the answer to be a little bit better :) — sehe21 secs ago
You are asking partially for a code review, you know a better place for that. Further, your ClassNameHere type contains a bunch of public members. Lastly, you are asking multiple (related) questions here. The general rule of thumb is to only ask one. — Ulrich Eckhardt11 secs ago
This is an implementation of the Sieve of Eratosthenes :
It takes advantages of the fact that all primes from 5 and above can be written as 6X-1 or 6X+1,
For better space complexity, it uses a pretty accurate upperbound. Better estimations of the upper bound can be found here. I've observed a v...
If Joe and John are implementing a new feature and Joe commits the code. Does that mean Joe's commit is ready for a release? Because Joe want to commit to master branch, so that code reviewers can create their own branches(from master branch) for code review... — overexchange15 secs ago
Do you think SonarQube can help in such scenario to wait for CodeReview(static code analysis) done before tests are run? — overexchange22 secs ago
@UlrichEckhardt I don't want a code review at all. This is temporary code designed to compile and quickly illustrate an issue. I am not sure if being inside a struct/class means anything different than a variable in the global namespace, so I just wrapped it in a struct. All I want to know is if the C++ memory model confirms or denies that there are problems here. The code I wrote is a jumping off point and to help illustrate the issue at hand. I encourage anyone else reading this to not do a code review but to focus on the memory model. I will edit my post to make this clearer. — Water22 secs ago
I wrote code which calculate: 1.Decile threshold for every decile group,2.Total income in the decile group, 3. Number of persons , 4.Share of decile in total income (%), 5.Tax, 6.Share of tax(%). But unfortunately I didn't wrote with function like e.g apply,lapply,aggregate or similar function,so...
I'm converting the csv format to json format. Now I generated the json structure but I need to group the data by name.
CSV file:
name,email,date,phone
john,example.com,26/11/18,123
john,hello.com,12/08/18,123456
import csv
result = []
with open("student.csv", "r") as csv_ledger:
for row i...
Code review/feedback is requested and appreciated for the following open-source automatic differentiation C++ header-only library released under the Boost License:
https://github.com/pulver/autodiff
This library facilitates the calculation of nth-order single and multi-variable derivatives of f...
About second question: I think that SonarQube cannot be used as main code review instrument, only as addition to manual code review. To succeed Every commit is a potential release point you need to have auto-tests for all functionality (at least for all critical functionality). Then every non stable commit will fail the build. — biruk123059 secs ago
Also, to use continuous delivery in the proper way, instead of committing right to master, it's recommended to use GitFlow workflow, at least use feature branches for new changes and merging to master when feature branch is stable. So, you're not allowed to commit to master directly, only to merge a stable feature branches after manual code review. — biruk123042 secs ago