Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Performance is a subset of Optimization: performance is the goal when you want the execution time of your program or routine to be optimal.
10
votes
3
answers
21k
views
Find a bitmap within another bitmap
I have a function that will try to find a bitmap within another bitmap.
If it successfully finds it, then it will return the center point of bitmap #1.
I've only seen negativity towards goto which i …
2
votes
1
answer
14k
views
Check OpenVPN's connection status
I wrote a method that will start OpenVPN on a config file, and then wait to be connected.
It relies on OpenVPN using Local Area Connection 2, which hurts code reusability, but I'm not sure how to do …
10
votes
5
answers
33k
views
Order a list of points by closest distance
I wrote a function that will take a list of points and then order them so they sort of... "chain together".
The function will start with point #1 in the list.
It will add point #1 to the list of ord …
2
votes
1
answer
3k
views
Pixelate image with average cell color
I wrote a function that will pixelate an image using the average color of each 4x4 cell.
The function will "split" the image into 4x4 cells, and find the average color of each pixel in the 4x4 cell, …
5
votes
4
answers
5k
views
Join a collection of strings until character limit is reached
Question
I wrote a function which will take a collection of strings — and return a comma-separated string which doesn't exceed the specified character limit.
It essentially works by joining the coll …
2
votes
1
answer
149
views
Cross-thread label countdown
Short and sweet...
I wrote a cross-thread method that displays the countdown [in seconds] of a delay on a label.
I'm fairly confident it's far from optimal, so I'm in need of that glorious optimizat …
12
votes
1
answer
16k
views
Human-like mouse movement
The code will move the mouse from a start point (xs, ys) to finish point (xe, ye) like a human would.
I'd like some help possibly shortening the code (by optimizing it) and making it more readable.
…
2
votes
2
answers
1k
views
Processing lots of JSON objects
I want to process a ton of JSON objects as quickly as possible.
I've done my best to make the processing as concise and efficient as I can.
How can I make it more efficient?
private void processBut …
16
votes
6
answers
17k
views
Determine if an image is opaque or transparent
bitmap.UnlockBits(bitmapData);
return false;
}
}
}
bitmap.UnlockBits(bitmapData);
return true;
}
Concerns:
Can performance … Is it possible to improve readability and reusability without affecting performance? …
15
votes
2
answers
10k
views
Guitar Hero III Bot
I'd like some help optimizing my code so that my bot can match the performance of other bots. …
5
votes
1
answer
7k
views
Generate video thumbnail
I wrote a simple, yet disgusting video thumbnail image generator method—which uses the MediaToolkit .NET library.
The code is not self-explanatory whatsoever, and it's extremely inefficient.
It acce …
0
votes
1
answer
5k
views
Retry cancelled tasks
I wrote an extension method for retrying tasks when cancelled.
Can speed, versatility, readability, or elegance be improved at all?
public static async Task<T> Try<T>(this Task<T> task, int retries) …
5
votes
4
answers
13k
views
Get the brightest rectangle within an image
(subsequently improving performance tremendously)
Method:
public static Rectangle GetBrightestRectangle(this Bitmap bitmap, int width, int height)
{
// Each rectangle's value is its average …