How can the time complexity of the following code can be improved (assuming it's \$O(N^2)\$)? What about style and patterns?
/**
* Created by mona on 5/24/16.
*/
public class MinSubArray {
public static void minSubArray(int[] a, int k){
int start=-1;
int end=-1;
i...
I've been doing some reading and tutorials. As such I've contrived a node based project to apply what i've learned. I thought this was a good example as it had some conditional async calls and error handling.
Any and all criticism of not following current js best practices welcome.
/**
* mkLo...
Anyone using Windows 10 having some programs show blurry/low res GUIs? This was displaying nice and sharp on OS X but on Windows 10 the GUI is just... meh
I have written some simple code to detect cyclic dependencies for a module loading system and I'd like some feedback on how I can go about improving it. The code itself finds the first cycle in the dependency graph that starts at the provided node and returns a list of all of the nodes traversed ...
I have been given a legacy code to understand and use it to write/execute Selenium Automation test cases.
When I am going through com.oraganization.util package I see this ErrorUtil.java. I can't understand how:
How its written?
What purpose does it serve?
How can I simplify it? So that if som...
Are there better methods for merge and sorting arrays of int and String in more efficient methods both time-complexity wise and code-pattern wise? Also wonder if I could have a generic method that could work for any kind of given type like ?
/* I am preparing for coding interviews so I prefer to ...
I understand that a shell should be able to perform arithmetic expansion. My shell can do it:
$ echo $((1+2*3+4*5))
27
My solution uses the lemon parser where I used a calculator example from SO:
http://stackoverflow.com/questions/34918631/use-lemon-parserlalr-generate-a-calulator-how-to-get-...
@JNS probably not, nope. As I see it, this code is just an example of the actual code. Also the question is rather unclear IMO :/ Aside from that the question asks about a specific issue, which is the domain of Stack Overflow and not Code Review. — Vogel612just now
If your code IS working - you do not have a technical problem but ask for a code review. — TomTom13 secs ago
@TomTom my code is working, but the question is would this continoue working? (my first time with monitor.wait / palse), is the way i implement it the good way? and something like this. i want to know if what i did is good, and if it doesn't cause troubles, as it will become part of complex application. && how to ask for code review? — deadManN47 secs ago
Someone edited my question to change
**Some text containing an i**
to
### Some text containing an i
Which is completely fine.
However, I noticed that when using ### the i's are being capitalized. Is there a reason for this, because it looks a bit odd to me personally..
Here is a screenshot...
I generally tend to work solitarily, I like my space, though I'd love to date someone who was a programmer - though that's mainly because it's hard to explain why programming is interesting to people who aren't
@EBrown I'm implying if you know about my mantra; don't ask me questions you don't want the honest answer to. I will always answer honestly to a question. I will not however always voice my opinion.
Yes, let's drive a sharp corner at >7mph with a really crappily stacked load, and wonder why it fell over and hit the guy standing on the outside of the corner.
"I can't believe they gave me a safety violation!"
And I'm a junior dev, I haven't faced a lot of issues so while I'm confident I can solve the problems, I'm not confident that my solution will be optimal
@DanPantry Self-awareness and impostor syndrom doesn't have to go hand in hand, and I'm kinda suffering from the opposite right now where I wonder why people are so clueless and wing so much XD
That's why I like the team part; people can contribute. But I can't stand people pulling answers out of their hind wildly guessing and posing it as truth when I know they're wrong and they won't admit to it even when I show them technical documentation about how it works
Walking into a senior dev office saying "___ is an idiot" is not nearly as effective as walking in there with a stack of papers saying "I just did some research, and I think the proposed solution by ___ is not the best, here's my alternative."
Working with knowledgeable people is important to me, but I suppose I'm pretty girly in that it's more important to me that I have fun with my colleagues and we can admit that we don't know and teach each other.
I used to take a notebook to meetings with me (the owner of our company was a visual person), and I would draw pictures of how stuff worked to help explain it.
// v2
if (in >> R.l) {
if (0 < R.l) {
if (in >> R.t) {
if (0 < R.t) {
if (in >> R.r) {
if (0 < R.r) {
if (in >> R.b) {
if (0 < R.b) {
return in;
}
}
}
}
}
}
}
}
in.setstate(std::ios::failbit);
return in;
It is often required for some non-scalar structure X to provide input operator std::istream & operator >> (std::istream &, X &);. I tried to implement it in a 3 slightly different ways:
#include <istream>
#include <ostream>
#include <tuple>
#include <cstddef>
struct rectangle
{
std::size_...
@Mast is not inspecting source code to debug it a code review? — abukaj58 secs ago
@abukaj Perhaps that's a version of reviewing code, but it's off-topic for codereview.se. Please, do not recommend SE sites if you're unfamiliar with their scope. — Mast47 secs ago
Somebody please verify this code. Is this efficient? please tell me modular way to accomplish this task.
$(function () {
$(document).on("click", ".showHide", function() {
var hideClasses = $(this).data("group").split(" ");
var showClasses = $(this).data("target").split(" ");
$.eac...
I just encountered this question in codility but apparently this question has been asked in java (Find the missing number in a array, Find all the missing number(s)) . The question is shown below
Task description
A zero-indexed array A consisting of N different integers is given. The array cont...
I have this following piece of code:
@Component
public class ManifestReader {
private final ServletContext servletContext;
private Properties p;
@Autowired
public ManifestReader(final ServletContext servletContext) {
this.servletContext = servletContext;
}
publ...
@DanPantry Considering that "Broken Code" and "No Code at all" are 2 of the most common close reasons, I think having just those in the description is unlikely to cause a net increase in Off-Topic questions.
Replace "Working Code" with "Code that works as intended" and it's even clearer (but maybe a bit verbose)