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
37 views

Tail recursive sort

I've heard of this implementation of quick sort (in pseudocode): ...
0
votes
0answers
53 views

Optimizing a social network website

I am developing my social network website, and I want to know if it's optimized or not. I am good at ASP.NET 4 and WebForms, but not MVC or JavaScript. This code is for "liking" a post. I did not ...
5
votes
1answer
37 views

File validator configured using XML

I am making an application to check for any files that does not follow a specific pattern defined in a XML file. The application works well, but the source code is not the greatest, and memory ...
5
votes
1answer
60 views

Fast string formatting in for loop

I have a function that loops through large objects of raw data, translating coded strings into readable words. The function is very basic, and I keep wondering if I should use an object instead ...
-2
votes
0answers
41 views

Which Encryption Code is More Secure? [on hold]

I have made some C# code for encryption and decryption that converts whole files to one huge byte[] not blocks so after scouring the internet i found a few code samples that do the encryption in ...
0
votes
0answers
35 views

Checking a value before assigning it to variable [on hold]

Throughout my code, I find myself testing if the output of a function is undefined or blank before i use the output. In this case, getQuery checks if the property of an object is either blank or if ...
0
votes
1answer
34 views

Optimize setting parameters from query string

I am currently setting over a hundred global variables by performing individual checks against the URL string. ...
5
votes
3answers
131 views

Project Euler #9 - Pythagorean triplets

This code works, and I'm trying to figure out if there's a better way to optimize it. As you can see, I've cut down drastically on time just by using numbers that work for ...
6
votes
1answer
88 views

Reducing memory footprint of ReportViewer

We have implemented a process using C# and ReportViewer to create PDFs by the LocalReport.Render method. When we have to process ...
0
votes
0answers
45 views

Optimizing nested “Select Distinct” query

I am updating this question. I am using following query which causing issue. Note following points I am using 4 tables in this query message_share messages myusertable friends What i am trying ...
0
votes
1answer
29 views

Ruby Optimize Performance

I'm trying to do the Reverse Groups Challenge on Codeeval. My logic is function but when I try to submit my solution is says that timed out at 10 seconds. How can I improve the speed here? ...
8
votes
6answers
849 views

Is it possible to optimize the following boolean checks?

The following code works and it prints out only True as it is supposed to, for all the different cases: ...
1
vote
0answers
10 views

Creating a “Produce and Consume” using Swingworkers

I am experimenting with the produce and consume concept while trying to incorporate it into my own project. I basically have two Workers in a small example I made: ...
2
votes
1answer
47 views

How can I make this implementation of Euler's method more efficient?

I have an implementation of an Euler method for solving N-many 1st order coupled differential equations, but I feel that I did not write it as efficiently as I could, due to lack of programming ...
-2
votes
1answer
45 views

Faster implementation of Project Euler #35 (circular primes) [closed]

Problem #35 on Project Euler is: The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime. There are thirteen such primes below ...
4
votes
2answers
110 views

Reverse Game HackerRank Ruby Solution

Problem Statement Akash and Akhil are playing a game. They have N balls numbered from 0 to N−1. Akhil asks Akash to reverse the position of the balls, i.e., to change the order ...
-3
votes
0answers
77 views

Reducing operations in n-queens implementation [closed]

We're trying to write our fastest code to solve the n-queens problem. We made our best effort to reduce the number of operations per iteration. We wrote this code and we have two questions related to ...
3
votes
3answers
124 views

Complex if statements in authentication method

I had asked questions about my entire class which I'll flag for closing soon. It appeared to be a little too broad for 1 post so I chopped it up and will be asking a little more specific questions ...
11
votes
2answers
174 views

Why is my Neural Network so slow?

I have some neural network Julia code which I'm hoping to speed up. It's possibly simply poorly-designed, but I'm not convinced. ...
3
votes
0answers
26 views

Inserting data in 3 tables of a database with JPA

I am starting a personal project and my first step is to insert a lot of statuses from tweeter in a database along with it's user and place (if applicable). This is the database structure: Pretty ...
6
votes
1answer
58 views

Traversal of descendants using stack [closed]

I have a type Unit which has a property ChildUnits that returns the children of the unit instance, as a ...
5
votes
2answers
105 views

Reducing the execution time of Online Community-Even Groups challenge

I have a coding problem for which I have attempted to solve with the below coding. However, my program is assessed as too slow in its execution and thus needs to be optimized to reduce the execution ...
8
votes
2answers
187 views
+50

Serializing JSON data coming from two URLs in the same object

I have two URLs (urlA and urlB) and both the URL gives me a JSON response back in the same JSON format. Below is my JSON string ...
3
votes
1answer
39 views

Showing the domain of a URL

I have such a method which takes a URL, such as http://twitter.com/ttt or twitter.com/dasd, and should show its domain with http: http://twitter.com and name twitter ...
11
votes
3answers
176 views

Substitution cipher algorithm performance boost

This algorithm is meant to read a string of numbers on an input, a naive substitution cipher code (A = 1, B = 2, ..., Z = 26) and output the number of ways the code could be interpreted (e.g. 25114 ...
4
votes
0answers
34 views

Vectorize Fisher's Exact Test

I have two data frames/ lists of data, humanSplit and ratSplit, and they are of the form ...
2
votes
3answers
101 views

“Remove Friends” problem time efficiency too slow

I'm doing this problem: After getting her PhD, Christie has become a celebrity at her university, and her Facebook profile is full of friend requests. Being the nice girl she is, Christie ...
3
votes
1answer
35 views

Content filtering of webpage

This is code for filtering the data of webpage, for the web crawler I made for my project. I know python scripts can lag than other languages, but this takes a lot of time when processing even a ...
19
votes
5answers
2k views

Aliens at the train

I solved this problem on SPOJ: The aliens have arrived to Earth and everything is in harmony, the two races can live together. However, one specific Female Alien does not want to see humans ...
2
votes
2answers
68 views

DataTable to given type T simple mapper

I threw this together and would love any suggestions on how to improve on this simple DataTable to given Type T mapper. Anything ...
8
votes
2answers
279 views

Optimize total code in one sub

I have the following code which works fine, but there has to be a faster way to do this. I want to have it all in one sub. ...
3
votes
2answers
194 views

Checking whether a given timestamp is more than two weeks old

I am trying to see whether a given timestamp is more than two weeks old or not. If it is two weeks old, then print out "Hello" and if it is not more than two weeks old then print out "World". I have ...
4
votes
1answer
53 views

Increasingly Long Runtime for Macro

My code works, but the problem is that it is taking an increasingly long time to run, with the time required to complete calculations increasing every time I use the macro. I've tried a variety of ...
4
votes
4answers
85 views

Index mechanics for Rock Paper Scissors

I just went through a very easy online example creating a Rock-Paper-Scissors game, but it seemed like it was not a great use of computing power. It seemed like I was writing out results for every ...
16
votes
4answers
2k views

Generating 1000 random numbers

I have got the following C code and I feel it is crazy stupid and there must be a better way to do this, but just can't think of one and have yet to learn algorithms. ...
7
votes
5answers
344 views

Finding the most frequently used sequence of characters in a comma-delimited input string of words

I'm making a demo program for a job interview and I'd like to know if there is anything I can make work faster in my current solution. It's a C# console application that accepts input in form of a ...
7
votes
3answers
237 views

Replacing non-ASCII characters

I wrote a C# program to remove non-ASCII characters in a text file, and then output the result to a .NonAsciiChars file. The input file is in XML format. In fact, ...
2
votes
1answer
43 views

Returning JSON depending on the route_id

I have a controller that has a purpose of returning json depending on the route_id being passed from the route (Using laravel). There's a point in my code where I ...
3
votes
2answers
104 views

Optimizing Conway's Game of Life code to run faster

How could I take this code and optimize it so that I could possibly run Conway's Game of Life on a large grid at 15 frames per second? ...
2
votes
1answer
32 views

Slow calculation of trigonometric sine function

Background Creating a client-side pie chart in XSLT 1.0, without extensions or external dependencies (i.e., cannot use FXSLT, EXSLT, JavaScript, etc.). Problem The code is slow; at least fifteen ...
1
vote
2answers
60 views

Calculating the Nth number in the supertable of two numbers

Below is the problem: Little Timmy is exceptionally good at math tables, so his teacher decided to make things a bit more interesting. His teacher gave him two numbers, A and B, and told him to ...
3
votes
2answers
78 views

Optimization/speed up of reduction function

I'm working on an implementation of Rainbow tables as part of a project. I understand the main principles behind it had have a working solution. Unfortunately the reduction function portion of my ...
10
votes
4answers
375 views

Moving character in Unity3D based on accelerometer input

I am building a infinite vertical platformer for mobile platforms using Unity3D. I am using the accelerometer to move the character left and right on the screen. ...
11
votes
3answers
364 views

Efficiency of this constantly running time processor for an HTML5 video control bar

I built a custom HTML5 video control bar, and for each second, it updates two readings: Time Elapsed Time Remaining in hh:mm:ss notation, like so: Because of how often this function runs, I ...
3
votes
1answer
69 views

Splitting My Code Into Classes/Functions

I'm looking for code correctedness, best practices. The player will have different spells, that can be cast on different keyboard key combinations. Right now what I have is one .as file with ...
3
votes
1answer
102 views

Web page based on a sample from a book

I've created a web page based on a sample from a book. It works fine, but seems to have become too complicated. ...
11
votes
3answers
151 views

Algorithm to calculate semi perfect integers, lack of efficiency

I'm working on an algorithm to calculate weird numbers, and to do so there are several properties that needs to be calculated, one of them being, if it is NOT a semi-perfect/pseudoperfect number. My ...
5
votes
2answers
84 views

Finding prime numbers in a range

Finding the prime numbers between two given integers in the minimum number of comparisons: ...
9
votes
2answers
78 views

Contest code for a maze problem

I would like to ask your comments on my contest code for the following problem: We're going to have a slightly more logical puzzle today. We're going to write a program that will find a path through ...