Optimization is the act of improving a method or design. In programming, optimization usually takes the form of increasing the speed of an algorithm, or reducing the resources it requires.

learn more… | top users | synonyms (2)

2
votes
2answers
50 views

Project Euler #4 - Largest Palindrome Product

A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. Find the largest palindrome made from the product of two ...
2
votes
1answer
33 views

Review/optimization of craps game rules and code: version 2

Thanks to all who've answered my previous question. I've taken all the advice and created a Craps class and gameplay. I just wanted to ask for more advice on how to optimize my code. #include ...
2
votes
2answers
56 views

get rectangle count from given co-ordinates code review

Problem Description Write a program to find the maximum number of rectangles that can be formed both horizontal and vertical with the help of a given n number of coordinate(x,y) points. [x,y points ...
3
votes
1answer
63 views

A Simple C++ Console Application for math

I am new to C++ and with my basic knowledge of the language, I have attempted to create a simple console application filled with lots of useful functions involving math related stuff. The following ...
2
votes
1answer
34 views

Can this be optimized to perform smoothly?

var activeClass = 'openToggler', showingDropdown, showingMenu, showingParent; /* hides the current menu */ var hideMenu = function () { if (showingDropdown) { ...
4
votes
2answers
88 views

Project Euler problem 92 - square digit chains

Link to problem. A number chain is created by continuously adding the square of the digits in a number to form a new number until it has been seen before. For example, 44 -> 32 -> 13 ...
2
votes
0answers
15 views

summarize two CSS-keyframes [on hold]

I've two css-keyframes. They only differentiate by one statement: @keyframes expand-t{ 0%{ width: 50%; height: 50%; z-index: 100; } 50%{ height: 50%; z-index: 100; top: 0; ...
2
votes
3answers
71 views

Service status checker… Is there a more efficient way?

I've been working on a website status checker.. However this array that I use has around 30 sites within it, I've noticed it's taking around 6-7 seconds to load it. I was wondering if there's any ...
3
votes
0answers
39 views

Refactoring my first python code to learn in deep

I'm beginner for python. Here is my first python demo code. I'm going to re factor this code step by step. any help would be very helpful to learn about python. Code description Batch program to ...
3
votes
0answers
54 views

How to improve this permutations program?

I wrote a small program which shows all possible permutations of choosing m integers from the set {1, 2, ..., n}, as follows: def perm(nlist, m): """ Find all possible permutations of ...
0
votes
0answers
35 views

Optimize Python string handling [duplicate]

How can I better optimize this check? It looks very lengthy. if i >0 and ('Phone:' not in address or 'Fax:' not in address): print 'foo' else: print 'bar Also, how can I strip() \n from ...
2
votes
2answers
54 views

Improve pandigital algorithm

First of all, I am a beginner in Python trying to learn optimizations and proper coding standards. Here is a snippet of code that checks if a number follows the rule: first AND last N digits contain ...
4
votes
5answers
267 views

How can I optimize this array operation for speed in Python

I've been trying to take image pixel data and write it out into printer code and my results are rather slow. Here is a asimplified version of what I have so far (image is a PIL Image object of 1200 x ...
0
votes
2answers
66 views

Find out the second Largest Number in an Array of Elements

Hello i have written this code to find second largest element in an array of random integers if it needs to be optimized then do comment on it. i'm not confined to it your precious code will always be ...
0
votes
3answers
76 views

Optimizing bubble sort code

Please help me optimize this bubble sort code. It's working fine otherwise. int[] randomIntegers = {2,3,1,1,4,5,8,-2,0}; for(int i=0;i<randomIntegers.length;i++){ for(int ...

15 30 50 per page