> Regardless of whether or not it's "your question", site policy states that edits invalidating answers are to be rolled back. Continuing to roll back to invalidating edits will result in your question being locked.
The task is to find the top two elements from the array without sorting. how can we achieve it? Can we use any DS to achieve this? Say tree? Please pour in your suggestions.
Between, iterative way of solving the problem is also one way. I have done that. Below is the code. I will also welcome if...
I get itchy when people edit my posts with superfluous edits which don't increase readability. Fixing spelling is ok, re-phrasing something because the editor likes it better that way is a whole different ballpark.
It wouldn't hurt to ask, though we may never get an answer. Answerer still active on here. One way or the other though, the comments thread on that answer ... ouch
and fyi, i'm not frustrated, i'm p¡$$ed. this enire community is toxic and i if i could delete from my SE account, i would. I've only ever had one good exchange on this community, the resy have all been answered with smug, know-it-all, keyboard jocks who think because they can voluntarily moderate a site, they suddenly have some great power and deserve more respect than they give. I'll delete this comment in a second, but your the first i've seen to not answer like a jerk. please just help me delete that question or remove me from it. i don't want it associated with my acc anymore. — SpYk3HH9 mins ago
It was built as a learning exercise, not for real use in production. It was originally designed to teach me how to get JSON responses, but I ended up using it to also learn about async calls and completion handlers. This code is based largely off of a stack overflow answer so it's largely not my...
@snakecharmerb It's not on-topic for Code Review and I will not comment on whether it is for programmers. Keep in mind that suggestions like those are only useful if you're familiar with the scope of said sites. The gist of it can be found here and here. — Mast37 secs ago
I have the following code that will skip certain URLs if needed:
SEARCH = "inurl:index.php?id="
def get_urls
puts "Searching for possible SQL vulnerable sites, using search query #{SEARCH}"
agent = Mechanize.new
agent.user_agent = @user_agent
page = agent.get('http://www.google.com/')
...
hi i am looking for some OOP inputs when designing a cricket game,(not the actualy game, just identify classes, and identify the system as a whole) is this the right forum to ask?
I almost wonder if we shouldn't have a "Programme Architecture" or something SE site for questions like that. Because I'm pretty sure Programmers will shoot it down.
There is a gray area between Programmers & Code Review regarding design reviews.
Code Review's on-topic page explicitly calls out design reviews as off-topic.
However, if your question is not about a particular piece of code and instead is a generally applicable question about …
Hi...
/*
Write a short recursive Java method that rearranges an array of integer values so
that all the even values appear before all the odd values.
*/
Hi! When I use isEven() on an array, and then print the array in the main method, it prints the original array rather than a sorted array.
I think I...
I wrote C++ implementation of Sparse Table (I wrote it for an arbitrary function) and I want so much to ask for a review. I'd like to know how I can make it better, especially the consistency of the code and the design. Thank you!
template<typename T_Type, typename Function_Type>
class SparseTab...
I'm looking for general feedback on this module. Here is what it handles on the page:
This is a private "class" meaning none of its properties are available outside of it.
init is run at run-time. pre sets up parameters to be sent to the server via ajax and post receives the ajax response.
...
I have a program which is designed to be highly parallelizable. I suspect that some processors are finishing this Python script sooner then other processors, which would explain behavior I observe upstream of this code. Is it possible that this code allows some mpi processes to finish sooner than...
I wanted to get some stats on who has done the most edits on Code Review, so I wrote the following query on SE Data Explorer. All improvement suggestions are welcome.
Note that I used a cursor to partition top users by year because at first there was a fundamental flaw in my logic trying to get...
Write a program that declares a two-dimensional array of integers with four rows and four columns and uses a loop to initialize the array in the pattern below. Study the pattern of the numbers in the table to use the simplest way to initialize the array. (You must use some form of a loop).
0 0 ...
Currently Resource Files in asp.net mvc c# are the typical file.resx
MVC controller method:
public ActionResult GetResources()
{
return GetResources(Lookup.ResourceManager);
}
Javascript
IFFE
dM.getResources() // dM = reportGroupDataManager.js
Which then a javascript "data mana...
I downvoted your question, because it looks like you MCVE'd your post, and are looking for a better high-level approach, not a peer review addressing any & all aspects of your code, as stated in our help center - that makes it a "gray-area" question. I'll retract my vote (and quite possibly actually reverse it) if you edit your actual code into the post; only with sufficient context we can help with refactoring. — Mat's Mug ♦23 secs ago
It was built as a learning exercise, not for real use in production. It was originally designed to teach me how to get JSON responses, but I ended up using it to also learn about async calls and completion handlers. This code is based largely off of a stack overflow answer so it's largely not my...
I am looking for feedback on my implementations of Queue, Stack, and LinkedList using Java generics. I would very much appreciate feedback on what I can improve and any errors I made.
Here is my code:
LinkedList
public class LinkedList<T> {
private int size;
private Node<T> head;
public Lin...
I don't know about the rules, maybe programmers.stackexchange.com is a better place to ask such question, but I think usually nobody here performs a code review to find the problem of complete project. Read about mcve. — Reza Aghaei14 secs ago
I've seen “tag spring cleaning” meta threads on many sites, where people are invited to raise problematic tags, one tag per answer. They usually end up in a mess: after the first few, nobody pays attention to anymore, and being able to discuss things only in comments is stifling (is this tag real...
Firstly, magic values are avoided in programming by using variables or constants. CSS does not support variables, so even if magic values were frowned on, you don't have much of a choice (except using a preprocessor as SASS, but you wouldn't do that for a single snippet).
Secondly, values might ...
When running the sparkling-shell :
bin/sparkling-shell
The following error occurs:
org.apache.spark.SparkException: Asked to launch cluster with 2048 MB RAM / worker but requested 20480 MB/worker
We have set following in spark-env.sh :
export SPARK_WORKER_MEMORY=108GB
export SPARK_WORKER_I...
As a first step in learning Haskell I am solving this problem. In an imperative language I would make a zeroed array c of length 200, increment c[h] for each height h, compute cumulative sums of c and then binary search c to determine the height corresponding to each given index. Because max_heig...