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)

3
votes
3answers
116 views

Merge Sort - Efficiency

I've written this Java code to implement Merge Sort. ...
1
vote
0answers
15 views

XML data-parsing design that doesn't sacrifice efficiency [on hold]

I have the following method signature ...
5
votes
1answer
83 views

Optimizing FirstOrDefault

I'm working on an application in which it takes quite a bit of time to initialize the data. Some background: I'm creating a sort of pivot table in which I turn Figure 1 below into Figure 2. I've ...
3
votes
1answer
32 views

Python small brute-forcer

I have 20+ key set. Keyset is like: Key[0] = { "PossibleKey0", "PossibleKey0Another", "AnotherPossibleKey0" } Key[1] = { .... There is an encryption which needs ...
2
votes
1answer
70 views

Any improvements for my LoginController class?

This is probably going to be my final question regarding controllers. I feel like I have a good enough understanding of them now and am able to write them cleanly. I've recently adapted a less error ...
4
votes
1answer
33 views

Optimization of Barnes-Hut Multithread Insertion algorithm

I'm currently working on optimizing a Barnes-Hut implementation (connected to a previous post I did) and I need help to optimize it further. After some testing, the main problem appears to be in the ...
2
votes
1answer
28 views

Time complexity of 0/1 Knapsack challenge

The code gives correct output. How do I calculate time complexity for code like this? The program finds all the combinations of items and sees if the combination gives the max profit. If the last ...
5
votes
0answers
89 views

Is my LoginView class valid?

I know the Model, Controller and View's purpose, but I have never really found a good concrete class example of a View class. Usually I see people having some small ...
2
votes
2answers
62 views

Answer to an implementation of Project Euler #8

I saw that there was a previous question asking to review an answer to the Project Euler question #8. My answer didn't look anything like the answer in that question and as a beginner, I was wondering ...
4
votes
1answer
68 views

Is this algorithm efficient for the 01Knapsack?

This code uses recursion to solve the 01Knapsack problem. It evaluates all the item permutations that can be added to the knapsack and checks if it gives the maximum profit. What else could have been ...
1
vote
0answers
22 views

Extracting country data from HTML tables

I am trying to optimize/improve my coding skills in python The rationale behind this code is to extract some data from files and store them in a dictionary. I tried to comments lines to improve ...
6
votes
3answers
277 views

Leaving out the max value in an Enumeration

This is part of a school assignment and I came up with the following solution to leave out the max value in a Enumeration: ...
0
votes
0answers
44 views

Ugly optimized caching of SimpleDateFormat

Concerning the optimization of this simple function String formatDate(String format, Locale locale, Date date) {...} formatting a ...
2
votes
2answers
52 views

How to efficiently use RestTemplate with HttpComponentsClientHttpRequestFactory in multithreaded environment?

I am working on a project in which I need to make a HTTP URL call to my server which is running Restful Service which returns back the response as a JSON String. I ...
1
vote
0answers
27 views

Lightweight tabulation written in Python

I wrote this module in python for some minor tabulation needs in my science projects. This was very helpful for testing, debugging and plotting various data. I often use dictionaries for storing such ...
1
vote
1answer
41 views

Efficiently use RestTemplate for http request timeout?

I am using RestTemplate to make an Http call to one of my service and I would like to have timeout for my Http Request - ...
4
votes
2answers
129 views

IMDB website query to find actors by time period

I'm using data from a database from the IMDB website. The database consists of five relevant tables. Actor (id, fname, lname, gender) Movie (id, name, year, rank) Director (id, fname, lname) Cast ...
5
votes
1answer
333 views

Summing two time periods using JodaTime

I'm building a Java method to sum arithmetically two time periods, using the JodaTime library. My code works fine, but I think that it's possible optimize to reduce the time execution. ...
11
votes
2answers
112 views

CSV reader using StreamReader and LINQ

Mostly due to readability, I am using the following code to find a specific csv file on a drive read that CSV file using a streamReader parse it into a ...
12
votes
8answers
1k views

Increase difficulty based on score

What I'm trying to do is very straightforward and easy, but I am wondering whether there is a more elegant solution. Basically I have a game and I want the difficulty to increase the moment the ...
-1
votes
0answers
46 views

Optimizing searching and comparisons [closed]

There are big words, small words and "rarity" of the small wards. I have to find for each small word that big words, which starts with this small word. And take 10 of them with top rarity. I ...
5
votes
1answer
78 views

Producing the intersection of several sequences

Based on this SO answer I have created a method that produce the set intersection of several sequences: ...
4
votes
2answers
114 views

Serializing data from two URLs in the same object efficiently

This is a follow-up to: Serializing JSON data coming from two URLs in the same object I have two URLs (urlA and urlB) and they ...
2
votes
0answers
30 views

Careful simulation of a 3D space [closed]

What is an accurate computer-description of space? I've been building up my abilities with various population simulations, and I'd like to add a spacial element to them now. I'm self-taught with ...
1
vote
1answer
64 views

Spreading the load more evenly from a background thread

I have a background thread which runs every 5 minutes. I am using ScheduledExecutorService for this. Every five minutes, I am making a call to one of my service and ...
7
votes
3answers
244 views

Having full atomicity against all the threads without impacting performance or throughputs

I am working on a project in which I construct a URL with a valid hostname (but not a blocked hostname) and then execute that URL using RestTemplate from my main ...
6
votes
1answer
49 views

Implementation of Tower of Hanoi iterative procedure

I have been working last night on implementing Tower of Hanoi without using recursion. I have found an algorithm on Wikipedia about the same topic here. I have implemented it and it's working fine ...
2
votes
2answers
81 views

Filtering by value X from array Y with a fallback

I wrote a function that solve a special problem. But one of my 'special hardcore software engineers' told me that this is a bad solution - but he will not give me a better solution. So I ask you: What ...
1
vote
0answers
30 views

Efficient C Code Alternative to MATLAB's im2col

The function im2col in MATLAB is very useful to vectorize Patch based Image Processing algorithms. The problem is the function isn't optimized and doesn't use C ...
11
votes
1answer
153 views

Making loop in CSS Stylus more efficient

I'm not sure if this could be more efficient because I don't think I should need 2 keyframe loops in addition to the for loop? ...
3
votes
1answer
117 views

Interview task to efficiently find compact representation of nodes in tree and find big O time

I recently had an interview problem where I was asked to find a compact representation of nodes in a tree. As an example, consider the following tree: ...
4
votes
2answers
39 views

Batch file-download script - is it necessary to re-phrase commands?

I run a script to download a file and unzip it. An import process then runs and leaves the files in their source location. I wrote the fully functioning code below to clean up that directory to be ...
2
votes
1answer
69 views

Optimization of Hibernate DAO in desktop application

I'm working on medium sized desktop application (with around 100 tables in database). For persistence layer I decided to use Hibernate for the first time to avoid massive redundancy of code for ...
3
votes
0answers
26 views

jQuery cycle content of static HTML page

I am making a simple jQuery code that changes the content of a static HTML page when a button (previous/next aka left/right) are pressed. The page is static, so the content that must be cycled (images ...
1
vote
2answers
91 views

Large arrays make runtime very slow

So I have the following code that takes the input of two arrays, and apply some queries to match elements from DBpediaClassesArray with elements from ...
3
votes
4answers
315 views

Need help to optimise my C# code

I have a section of my code that seems to take a while during processing. Basically rawArray contains ~1.5 million rows and ...
4
votes
2answers
69 views

Is this the optimal way to write “find these IDs in a list of objects” using linq?

I've got a situation where I have a list of Organizations (code to follow), and a user has a list of OrganizationIds (ints). I ...
2
votes
2answers
52 views

Optimizing a particle filter weighted selection step

I have a vector with 10000 particles that I use in a Particle Filter. The problem is that it's taking too long to compute the weighted selection of the particles. I want to use a vector of weights ...
6
votes
1answer
79 views

Check a collection of prices against an associated collection of minimum prices

I would like to find a more efficient way to solve this problem. My current implementation has 3 separate loops through the data. I'm creating an algorithm to check a collection of prices against an ...
12
votes
2answers
343 views

My final sign up controller

I've asked a couple of questions here before regarding my controller, but I think I've finally gotten to understand controllers completely, but I'll never be sure unless I get my code reviewed. I've ...
2
votes
1answer
55 views

Tail recursive sort

I've heard of this implementation of quick sort (in pseudocode): ...
1
vote
1answer
97 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 ...
6
votes
1answer
52 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
65 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 ...
0
votes
0answers
51 views

Checking a value before assigning it to variable

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
36 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
154 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
140 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 ...
2
votes
2answers
75 views

Optimizing nested “Select Distinct” query

I am using the following query which is causing issues. Note following points: I am using 4 tables in this query: message_share ...
0
votes
1answer
40 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? ...