Optimization is the act of improving a method or design. In programming, 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)

1
vote
0answers
16 views

Sprite drawing class improvement

I have written a very Xna spritebatch like interface for drawing sprites in opengl. When begin is called the vertex data buffer is mapped to a float*. The index buffer and vertex buffer are bound in ...
0
votes
1answer
27 views

Would multiple joins boost performance, or are the nested queries an acceptable way to handle the situation?

I'm working on a directory that lists employee information. Each employee can belong to multiple departments and each employee can have multiple job titles. I have 5 ...
8
votes
4answers
231 views

Simplifying many-indents-code

I have the following code, written in Python: ...
7
votes
3answers
144 views

Checking to see whether a document can be deleted

My code looks like this: ...
6
votes
1answer
44 views

Three layout Gallery

I have made a gallery function, this function handles three different types of gallery, one with horizontal nav, other vertical and last one vertical with no nav. ...
5
votes
1answer
38 views

Responsive jQuery restaurant menu system

I have a working restaurant menu system - as the user selects a menu it slides into view. The build is responsive, I've used the 'Debounced Resize() jQuery Plugin', however in implementing the ...
1
vote
2answers
75 views

Converting Anonymous To Dynamic [on hold]

I have a extension method like following that takes Anonymous type objects and returns it after converting into ExpandoObject which falls under ...
4
votes
1answer
37 views

Should I differentiate object types by calling methods via variables?

I have three JavaScript objects. The first one serves merely as a prototype. The other two are implementation of a specific type. ...
3
votes
0answers
28 views

Ways of speeding up this python implementation of SAT (Separating axis theorem)

A project I was working on required the usage of the Separating Axis Theorem to detect collisions between two convex polygons in real time. So I implemented a basic class (...
4
votes
1answer
56 views

Optimize vector rotation

I have a trivial function that rotates 2d vectors, and a method in a class representing a polygon that rotates every point in the polygon around an origin. The code is fairly optimized as it is, but I ...
4
votes
2answers
90 views

Counting matrices

I need help optimizing my code to run faster (it works but I get Time Limit Exceeded) for this problem. (Don't pay attention to readInt() function, its only used ...
4
votes
1answer
47 views

Price Slider using jQuery UI working in Java environment to be optimised

I am working on a price slider that is for a Java environment. It is working correctly but I would like to optimise it as much as possible. Any tips/advice? ...
2
votes
0answers
34 views

Optimizing a thread library

Please give thoughts and optimization tips on my thread library. Update 1 : I have renamed the different method types. ...
3
votes
2answers
95 views

Recursive uniform cost search that needs to be optimized

I have this uniform cost search that I created to solve Project Euler Questions 18 and 67. It takes the numbers in the txt file, places them into a two dimensional list, and then traverses them in a ...
0
votes
0answers
32 views

Learning using Neural Network

This is my code for MLP backpropagation. ...
9
votes
4answers
822 views

Constructor to transform an Outlook contact into a Dynamics CRM contact

This is my constructor to transform an Outlook contact into a Dynamics CRM contact: ...
4
votes
1answer
31 views

SEDE query to find users with exactly one post in a particular tag

I'm doing some research for a meta post on Gardening.SE (where I'm a pro tempore moderator). I'm using the Stack Exchange Data Explorer (SEDE) to find information about first time users who post ...
1
vote
1answer
31 views

Optimize jQuery code includes autocomplete function for different input box with different autocomplete content

I have this code below for autocomplete feature of several inputTextbox. The input box also share same class".wikiInput". When user typed something in either of them, a relevant autocomplete dropdown ...
3
votes
1answer
65 views

Redunancy Issues in PHP Class

I've been studying PHP for a while now and decided to dive into OOP. Most of my code was a mess and I've begun to refactor much of the website to OOP; however, I'm having an issue with redundancy in ...
0
votes
0answers
27 views

Codeigniter ActiveRecord Wrapper Model

Can someone help me refactor this to be more optimized? Performance seems to be very optimal, but I think more can be squeezed from it. ...
6
votes
2answers
143 views

Inversion of an array that contains indices

I have an array of length n that contains numbers from 0 to n-1 in random order. I now want to "inverse" this array to one that where index i corresponds to the location of i in the source array. ...
7
votes
1answer
127 views

Creating map from ids

I am getting List ids and by using those ids I am creating a Map by fetching related data of ...
4
votes
1answer
47 views

Smoothen page transition for mobile devices

I have next/previous buttons on my site and all they do is slide sections of the site from left to right and vice versa, it is smooth and looks good on a desktop but on mobile devices it is a bit slow ...
8
votes
3answers
94 views

Longest 'balanced' substring

I was given a task where given a string of '0's and '1's, return the longest substring where the count of '0's and '1's are equal. I was told also that the code should be O(n) and space O(1). Below ...
4
votes
2answers
75 views

Matrix falling effect

How can I make this matrix effect more like the matrix movie? ...
9
votes
3answers
141 views

How can I make my solution for Chef and Digits run faster?

Problem Statement Given n digits and m indices x from 1 to n, calculate the difference ...
1
vote
1answer
41 views

Optimising and consolidating multiple PHPMailer functions

So the two functions below both send emails via PHPMailer but both hold different messages (which use different data from the db). I was just wondering (as I plan to use PHPMailer more) a way to ...
1
vote
1answer
29 views

Store object in memory or de-reference it for performance

I have a GUI that contains a Table Object (for displaying columns of data) and a Table Model. The Table Object contains the Table Model. Is it better to store the Table Model as a object in the User ...
2
votes
1answer
45 views

Efficiency of moving ball

Here is another example of a moving ball. I would like to see how to make it more efficient and better. I think that moving the variables to the top of the function would be better but then I tried ...
6
votes
3answers
451 views

Anagram Checking

...
7
votes
3answers
184 views

Optimizing unique partitions of integers

I am working on a project involving the unique partitioning of integers. I.e. I am looking to have all of the partitions of n = x1 + x2 + x3 + ... + xk, where xi = xj implies i = j. For example, if I ...
2
votes
1answer
37 views

Am I optimally closing this modal window?

I have a modal window that needs to be closed, obviously. I've created this piece of code that works okay. But is there a way to optimize it? ...
11
votes
2answers
769 views

First prime number larger than given integer

How can I test this C program for "efficiency"? The most interesting usage is that it returns negative output for large enough input, otherwise the behavior is about expected. Will you suggest how to ...
7
votes
1answer
118 views

Determine total number of ways of reaching a destination

Question: One of Scotland Yard’s most wanted criminal (Mister X) is on the run and needs to reach a certain destination safely. There are three modes of transport available for him - By ...
4
votes
1answer
37 views

Baseline tagger

This is a baseline tagger coed I have written. How can I optimize this code? ...
4
votes
2answers
72 views

Ping-pong JavaScript Canvas

I have created my first ping-pong game with JavaScript and Canvas. I will be glad if anybody can tell me how to optimize the code and functionality. https://github.com/nikitalarionov/js-pong First ...
13
votes
5answers
766 views

Looking for a cleaner way to write a jQuery function

I've got a piece of code that takes an element, checks where it is, and if it's beyond a set place in the viewport, make the opacity increase to 1. I've made the code so that it only runs the checks ...
2
votes
0answers
64 views

Insert and Delete (a list of specified) characters/words in headline [duplicate]

I'm very new to JavaScript and I'd appreciate some help. Here's a jsfiddle: http://jsfiddle.net/KYjF9/3/ I'm trying to make that code more elegant and also valid at http://www.jslint.com/ (browser ...
3
votes
2answers
77 views

Optimize a Makefile

Since my project is getting bigger every day and I am just a starter in the wonderful world of makefiles, I need some help improving mine because, although it works (almost) as I wish, it really ...
4
votes
2answers
65 views

More efficient update macro in Excel

So I have a macro that makes comparisons and then this macro exports all of the changes based on if the information doesn't match. I have it so that each column gets their own worksheet in the new ...
3
votes
2answers
39 views

Python Unit Coversion Code Optimization in terms of Space and Time Complexity

Ok I am making unit converter and I have attached temperature conversion code below. The problem with this code I think is that I have written function for each and every single unit to convert to ...
3
votes
0answers
55 views

Smart pointer memory pool

Using a third-party library which utilize boost::shared_ptr for memory management. Problem is that I need to allocate very many objects and I have detected that the ...
0
votes
0answers
8 views

Performance consideration and code reduction for Templates [migrated]

I'm trying to decide if this might be a good idea to help reduce the size of some of my xaml resource dictionaries on a large project. Except I'm concerned about any potential performance issues going ...
5
votes
2answers
183 views

How best to keep track of an unknown number of objects?

I have a manager class that will manage an unknown number of objects. I'm currently storing the objects in a NSMutableArray object, and when I need to find one, I ...
8
votes
1answer
93 views

PDO sign up function inserting data into multiple tables

This is a sign up function called on form submission. It firstly inserts key user data into the users table. If successful, secondary data is then inputted into ...
5
votes
2answers
46 views

SQL Query that pulls rows in current table based on parent id optimization

I am creating a user permission system. I will have my user permissions set up off of "objects" and not pages. For example, I have an EVENTS section. Within that ...
5
votes
2answers
86 views

Better method for updating data table

I have completed an application which gathers specific records and marks them as Collected. As of now, the application runs perfectly, does exactly what I need it ...
3
votes
2answers
28 views

Number Division Theory

I have a JavaScript function that takes in a user number (total amount placed on a betting table in denominations of 50) and returns an Array of the optimum chips (lowest # required) to form each ...
7
votes
1answer
155 views

Can the following code that tests if treeview's node is checked be improved?

Recently I have answered a question on Stack Overflow where OP wanted to programmatically determine if treeview's node is checked or not, among other things. My ...
7
votes
2answers
112 views

Pulling JSON using jQuery and manipulating the Front-end

My JavaScript is fairly new and want to learn new ways to create clean, fast code. Can you have a look at this code and guide me on how to optimise this code to improve my skills? I have provided the ...