Tagged Questions

Optimization is the act of improving a method or design. Optimization usually takes the form of improving the efficiency of an algorithm, or reducing the resources it requires (space in memory, on disk, or amount of network traffic, etc.).

learn more… | top users | synonyms (2)

2
votes
1answer
18 views

Improving efficiency and flow by changing subroutine orders

A batch file executes WinSCP.exe's console mode to download files and log the actions. Upon exit, WinSCP returns: ERRORLEVEL 0 if the files are successfully ...
0
votes
1answer
17 views

Django ListView with MySQL query for the queryset

(Note: Even if you don't know Django, it's probably the query that needs work anyway, so you probably don't need to know Django/Python) I have a ListView that ...
3
votes
0answers
30 views

Grayscale bilinear patch extraction - SSE optimization

My program makes an intensive use of small sub-images extracted using bilinear interpolation from larger grayscale images (some call this problem subpixel translation). I am using the following c++ ...
5
votes
2answers
239 views

Convert Roman to Int

I made a function that converts Roman letters to integers. But I'm not happy with it, as I feel like I used too much code for a such a simple task. Any suggestion on how I can minimize it? ...
3
votes
4answers
98 views

Faster Way of Comparing Generic Sets

The following extension method is the limiting factor in the performance of an application I am developing, according to Visual Studio 2012 Performance Analysis profiler. Is there a faster way to ...
0
votes
1answer
56 views

LINQ method to create objects of different types

I have the following code inside a method: ...
2
votes
1answer
57 views

Speeding up the process of obtaining data

I created this script to obtain data from graphs online, from monavisaxmldata. But I were wondering if there was a way to obtain the data faster. The program which uses this data gets presented in a ...
-1
votes
1answer
47 views
1
vote
1answer
62 views

Utilization of Steam APIs and web-scraping

Some background info here: This is a small fun project I made utilizing Steam APIs and web-scraping This is the first time I've ever used Python, so I'm not very familiar with the language I used ...
6
votes
2answers
120 views

Limited memory priority queue

I'm trying to implement a highly efficient limited memory priority queue. The interface is the same as a std::priority_queue. Can anyone suggest any performance ...
3
votes
2answers
46 views

Hide / Show panels depending of value of a dropdown

According to the value of a dropdown menu I have to show/hide two panels. For option 'derive' and 'reject' I should show the comment panel, and just for the 'derive' panel I should also show a ...
2
votes
0answers
21 views

Directions to refactor class for GPS track points

The story started here (Parsing GPS Data) and continued here (Class for median filter) I've done a lot work and faced new questions. In short - I made: Classes for parsers. TrackParser and ...
6
votes
7answers
534 views

Project Euler #5 - Lowest Multiple of 1 through 20

I was trying to solve problem 5 of Project Euler, and this was I needed to do: 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. ...
0
votes
2answers
91 views

Increment a text field value

So let's take this code which increments a Javascript text field value: ...
4
votes
1answer
22 views

Grouping counts from tables by account ID

I'm working with this query to get counts from three different tables, and to group the results by account ID: ...
4
votes
1answer
86 views

Is a Number Prime?

Haven't posted here in a while, but I think I've come up with a very efficient way of finding if a number is prime, using TI-BASIC for use with TI-83/84/+/SE calculators. I am trying to optimize it ...
7
votes
2answers
147 views

Linked list implementation of a stack

I am working on a basic linked list implementation of a stack of ItemType (currently set to double but can be changed) values. The stack code will then be used in a ...
3
votes
1answer
60 views

Convert between two bases, each between 2 and 36

I'm doing some Python practice for fun and I wrote some code that converts between two bases. I'm thinking about expanding on this later, so the docstrings are pretty redundant from function to ...
3
votes
1answer
50 views

Improving efficiency of Prim's Algorithm

I have implemented Prim's Algorithm in Java. I am wondering how it can be made more efficient. Below is the class Node for vertices. ...
5
votes
2answers
205 views

Draw crosshairs on the screen - ZedGraph

Here's some part of my code is use to draw objects on the screen : Class members: ...
4
votes
1answer
68 views

Custom marquee consumes a lot of CPU power

I've a code which applies marquee to certain elements by using the requestAnimFrame method. However, when I test my application on a lower spec PC (Intel Celeron ...
2
votes
1answer
45 views

Defining functions in Vigenere cipher

I'm trying to learn the process of defining/calling a (somewhat) complex function. I understand the main idea, and can do it on a small (simple) scale. A simple example: ...
5
votes
4answers
212 views

Character permutations - Revisited

Several hours ago I posted this question about Generating character permutations in Python. User rolfl said that my main problem was not using the right tool for the job, as Python is interpreted it ...
4
votes
1answer
35 views

Efficiency of looping though a text map to draw objects

I am making a game that uses a text map to draw obstacles and courses for the player to navigate. However, I am concerned that my method of looping through the text map to draw objects on the screen ...
4
votes
1answer
48 views

Speeding up nested for-loop analysis code

I have two matrices, the first one is mat 2000*500, the second one is 6000*500 ...
3
votes
2answers
159 views

Generating character permutations

I want to generate a 'dictionary' containing all 8 character permutations of upper-case letters such that the output file looks like: ...
10
votes
1answer
680 views

Memory-Test for Soldiers

I am solving the following problem on code chef: \$N\$ Soldiers are lined up for a memory test. They are numbered from 0 to N-1 from left to right. In the test, there are \$M\$ rounds. In each ...
12
votes
2answers
172 views

Calculating the minimum distance of a linear code

This is a solution for the problem named Codes on the kattis platform: Given a generator matrix of a linear code, calculate the minimum distance of the code. I'm looking for reviews on ...
3
votes
1answer
114 views

Find next highest number with the same digits

Question: Given any integer, efficiently find the next highest integer that uses the same digits. For example if the number is 15432, you should return ...
6
votes
5answers
283 views

Is there a more efficient way of executing multiple SQL prepared statements at once?

I'm updating more than one table at once and, as you will see, it uses a lot of similar looking code. Is there a more efficient way of doing this, perhaps some way of combining the queries? For ...
4
votes
2answers
229 views

How do I decrease compile time and execution time of following program?

How can I decrease the running time and compile time of the following code? Given three integers A, B and ...
5
votes
1answer
41 views

Formatting database like table

The goal of my program is take some headers and fields and display a nicely formatted table like this: ...
3
votes
2answers
151 views

How do I (beautifully) extract this part of code to a subclass?

I have thought a lot about this but can't come to a proper solution. Also, it's hard to google things like this. Note: The code itself is irrelevant, it's about how to do such a thing in general. I ...
4
votes
1answer
42 views

Dirty but Efficient Texture Atlas in Spritekit

I have spent quite a bit of time trying to optimize the performance of my 2D mining game. After a lot of research, experimentation, and testing, I finally found something very interesting that ...
13
votes
5answers
267 views

Fastest way of removing a substring from a string

Taking a break from my C++ series, I recently reviewed the code in this question. I ended up writing my own separate derivation of the function so that I could remove all of the substrings from a ...
1
vote
1answer
25 views

Implementation of Vertex Similarity algorithm (Blondel's Similarity Measure)

I am implementing the vertex similarity algorithm in this paper. The adjacency matrices I will be dealing with, however, will be very large, on the order of 30k vertices (I provided sample matrices in ...
3
votes
1answer
61 views

Non-concurrent write creates bottleneck

I have some efficient methods that recursively creates a tree structure (NSTreeNode) of by looping recursively over a directory structure. The result is displayed ...
5
votes
3answers
423 views

Trip Advisor - Train routes

Gives advice to the user on which trains to take to reach a destination ...
6
votes
1answer
70 views

Is this a correct implementation/use of move semantics?

I'm trying to account for the fact that my program will contain calculations such as: v(t) = w ∗ v(t−1)+ c1∗r1∗( pBest − x(t −1)) + c2∗r2∗(gBest − x(t−1)) where ...
2
votes
2answers
49 views

Function that normalizes a vector of double

I have written the following function in order to normalize a container of double, so that it sums up to 1.0: ...
6
votes
3answers
90 views

Making backtracking Knight's Tours solution more efficient

This was a previous homework assignment I was required to do. While I did the assignment and turned it in for credit, I am not completely satisfied with the result I have. The rule for the assignment ...
6
votes
1answer
47 views

Passing a 1D array (single column of a Range object) to .NET to manipulate it without loops and returning it back to VBA

Background Kind of a follow up - slightly related to my other SO question. I thought that if somehow I find a way in VBA to pass a single column to .NET and convert it to a native .NET type then I ...
2
votes
1answer
44 views

CAPTCHA with images of objects

This CAPTCHA is not text but basically images of objects that the users has to identify between an array of options. My current code is kind-of slow because the query takes almost .7s to execute and ...
1
vote
1answer
67 views

Is there a beter way to check input besides a switch case?

So I am running a Switch case to check if a user has filled in all the necessary fields within a form, and if not I prompt them to do so. I was wondering if there was a better way to do this, or if a ...
5
votes
1answer
128 views

Iterative Fibonacci sequence using standard library functions

We're all aware of Fibonacci sequence calculators but they look like C-style code. I want to avoid that and take advantage of the standard library. This code is very short, so I'm focusing on ...
26
votes
9answers
6k views

Solving the Lazy Hobo Riddle

I would like help in optimizing this calculation, which is from the Lazy Hobo Riddle: There once were 4 hoboes travelling across the country. During their journey, they ran short on funds, so ...
5
votes
1answer
114 views

What are the latest Odds?

The main problem the following query is solving, is the following: Each Offer has multiple Odds (...
1
vote
2answers
76 views

Improving performance on file reading

I got a small assignment to read IP adresses and from a bunch of external text files identify which country the IP adress comes from.. I opted to use XmlReader and read the ranges from an XML file but ...
2
votes
1answer
81 views

Optimizing breadth-first-search code

I wrote code using some kind of breadth-first-search algorithm in order to find a path (any path!) from a start point to an end point. There are no weights/different distances involved from path-to ...
7
votes
1answer
72 views

Sorting algorithms with utility functions and iterators

My implementation of insertion, merge, and quick sort, with some utility testing functions. I just wanted to know how I can improve the efficiency and general cleanliness of my code. (note: I know ...