processing-efficiency Questions
20
Solved
Question: Given an unsorted array of positive integers, is it possible to find a pair of integers from that array that sum up to a given sum?
Constraints: This should be done in O(n) and in-place...
Breadstuff asked 1/12, 2011 at 0:17
5
Solved
From anybody with real experience, how do LIKE queries perform in MySQL on multi-million row tables, in terms of speed and efficiency, if the field has a plain INDEX?
Is there a better alternative...
Salcedo asked 10/7, 2012 at 17:44
5
Solved
I was wondering what the most efficient, in terms of operations, way of swapping integers is in c++, and why? Is something like:
int a =..., b = ...;
a = a + b;
b = a - b;
a = a - b;
more effici...
Helbona asked 2/2, 2016 at 13:12
6
Solved
For a website having users. Each user having the ability to create any amount of, we'll call it "posts":
Efficiency-wise - is it better to create one table for all of the posts, saving the user-id...
Duala asked 25/9, 2011 at 8:52
2
Solved
Is there a difference between:
import turtle
turtle.tracer(0)
turtle.speed(0)
while True:
turtle.goto(turtle.xcor()+1)
turtle.update()
And:
import turtle
turtle.tracer(0)
while True:
turtle.got...
Merca asked 23/6, 2020 at 19:32
5
Solved
I want to define an efficient integer floor function, i.e. a conversion from float or double that performs truncation towards minus infinity.
We can assume that the values are such that no integer...
Shum asked 2/6, 2019 at 17:0
1
Solved
I have a large dataset which I would like to perform post hoc computation:
dat = as.data.frame(matrix(runif(10000*300), ncol = 10000, nrow = 300))
dat$group = rep(letters[1:3], 100)
Here is my ...
Tusche asked 20/8, 2018 at 19:32
14
Solved
What are the benefits of having a member variable declared as read only? Is it just protecting against someone changing its value during the lifecycle of the class or does using this keyword result...
Amritsar asked 10/11, 2008 at 3:37
2
Solved
I have a .csv file with around 300,000 rows. I have set it to group by a particular column, with each group having around 140 members (2138 total groups).
I am trying to generate a numpy array of...
Obloquy asked 14/6, 2018 at 14:34
1
Solved
A similar question was asked about this but it was not exactly asked in the same terms.
I am trying to safely decode base64 binaries, in a context where it's possible the input will not be a binar...
Pegasus asked 23/10, 2017 at 9:19
3
I am trying to implement the Youtube's Thumbnail Preview feature for my Simple Video Player. Here's the Snap for it :
Good thing is : It is working smoothly once the Player fetch all the thu...
Karakalpak asked 16/5, 2016 at 14:3
2
Solved
On a previous question I was asking about multiprocessing, using multiple cores to make a program run faster, and someone told me this:
More often than not, you can get a 100x+ optimization with...
Boner asked 26/8, 2017 at 9:2
4
Solved
Problem
I am building a collage of photos from an array of images that I am placing onto a tableview. I want to make the images wrap when the number of images reaches the boundary of the tableview...
Atticism asked 20/7, 2015 at 6:52
7
Solved
In this code:
if (value >= x && value <= y) {
when value >= x and value <= y are as likely true as false with no particular pattern, would using the & operator be faster ...
Grimbal asked 20/9, 2016 at 7:34
1
Solved
I have looked up online and all I seem to find are answers related to the question of "how does Node benefit from running in a multi core cpu?"
But. If you have a machine with just one core, you c...
Subedit asked 10/8, 2016 at 3:53
6
Is there a noticeable difference (in theory) when reading a while line by line compared to reading the whole file in one go?
Reading the whole file does have a negative impact on the amount of mem...
Kathrinkathrine asked 10/10, 2011 at 3:56
2
Solved
I'm writing a program that reads from an input stream, i.e.
erl -run p main -noshell -s erlang halt < input
The problem is that it takes a lot of time to read it (the input stream is huge) us...
Patronizing asked 7/5, 2016 at 15:28
2
Solved
I have a function which processes a DataFrame, largely to process data into buckets create a binary matrix of features in a particular column using pd.get_dummies(df[col]).
To avoid processing all...
Disinfectant asked 8/4, 2016 at 0:34
6
Solved
I'm writing some code in Java where, at some point, the flow of the program is determined by whether two int variables, "a" and "b", are non-zero (note: a and b are never negati...
Gothicize asked 21/2, 2016 at 1:51
2
Solved
We are reading some signals from pins and setting some more events based on this reading.
To be safe, I want to sample the pins 3 times, compare the three values and use the most common value (i.e...
Arthur asked 10/12, 2015 at 10:53
2
I'm writing an application where performance is fairly critical. I'm a bit confused as to which is the most efficient data type for x64 CPUs.
MDSN says that "In some cases, the common language ru...
Gregoriagregorian asked 23/9, 2015 at 9:47
6
I have access to a computer running Linux with 20 cores, 92 GB of RAM, and 100 GB of storage on an HDD. I would like to use Hadoop for a task involving a large amount of data (over 1M words, over 1...
Productive asked 30/7, 2015 at 20:21
4
Solved
Would sending lots a small packets by UDP take more resources (cpu, compression by zlib, etc...). I read here that sending one big packet of ~65kBYTEs by UDP would probably fail so I'm thought that...
Smaragd asked 21/2, 2013 at 1:17
3
Solved
I'm writing some code in OpenCV and want to find the median value of a very large matrix array (single channel grayscale, float).
I tried several methods such as sorting the array (using std::sort(...
Ahq asked 6/5, 2015 at 13:49
3
In some environments such as Java, it's natural to use TCP/IP sockets to pass messages between processes on the same host using the 'localhost' address (127.0.0.1 in IPv4, or ::1 in IPv6). (Because...
Sitology asked 4/4, 2011 at 10:44
1 Next >
© 2022 - 2025 — McMap. All rights reserved.