After using PHP for a while now, I've noticed that not all PHP built in functions as fast as expected. Consider the below two possible implementations of a function that finds if a number is prime using a cached array of primes.
Ccna final exam - java, php, javascript, ios, cshap all in one. This is a collaboratively edited question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
Friday, June 8, 2012
List of Big-O for PHP functions
Tuesday, June 5, 2012
Good Java graph algorithm library?
Has anyone had good experiences with any Java libraries for Graph algorithms. I've tried JGraph and found it ok, and there are a lot of different ones in google. Are there any that people are actually using successfully in production code or would recommend?
Monday, June 4, 2012
How to improve my algorithm for analyzing twitters messages from users?
Hello I had a nice idea to implement, that may be a useful for the human kind. I call it
Tuesday, May 29, 2012
How to create a GUID / UUID in Javascript?
I'm trying to create globally-unique identifiers in Javascript. I'm not sure what routines are available on all browsers, how "random" and seeded the built-in random number generator is, etc..
Friday, May 25, 2012
Algorithm improvement for Coca-Cola can shape recognition
One of the most interesting projects I've worked in the past couple years as I was still a student, was a final project about image processing. The goal was to develop a system to be able to recognize Coca-Cola cans (note that I'm stressing the word cans, you'll see why in a minute). You can see a sample below, with the can recognized in the green rectangle with scale and rotation.
Wednesday, May 23, 2012
How to check if a number is a power of 2
Today I needed a simple algorithm for checking if a number is a power of 2.
Friday, May 18, 2012
How does Facebook Sharer select Images?
When using Facebook Sharer, Facebook will offer the user the option of using 1 of a few images pulled from the source as a preview for their link. How are these images selected, and how can I ensure that any particular image on my page is always included in this list?
Wednesday, May 16, 2012
An intuitive understanding of heapsort?
At school we are currently learning sorting algorithms in Java and I got for my homework the Heap Sort. I did my reading, I tried to find out as much as I could, but it seems I just can't grasp the concept.
Monday, May 7, 2012
Implementation of a simple algorithm (to calculate probability)
EDIT: I've got it, thanks for all the help everyone! + Cleaned up post a little bit.
Thursday, April 19, 2012
Search matrix for all rectangles of given dimensions (select blocks of seats)
All,
I have been trying to work out how to select say 15 tickets within a single block of seats.
Sunday, April 8, 2012
javascript data structures library
I'd like to ask for recommendation of JavaScript library/libraries that supply an implementation of some basic data structures such as a priority queue, map with arbitrary keys, tries, graphs, etc. along with some algorithms that operate on them.
I'm mostly interested in:
- The set of features covered,
- Flexibility of the solution - this mostly applies to graphs. For example do I have to use a supplied graph implementation,
- Use of functional features of the language - again it sometimes gives greater flexibility,
- Performance of the implementation
EDIT
Ok, I'd like to point out that I'm aware that it's possible to implement using js the following data structures:
- A map, if key values are either strings or numbers,
- A set, (using a map implementation),
- A queue, although as was pointed out below, it's inefficient on some browsers,
At the moment I'm mostly interested in priority queues (not to confuse with regular queues), graph implementations that aren't very intrusive as to the format of the input graph. For example they could use callbacks to traverse the structure of the graph rather than access some concrete properties with fixed names.
Source: Tips4all
Tuesday, February 14, 2012
Common sequences in two strings [closed]
I am looking to find all common sequences of works between two strings. For example:
Friday, February 10, 2012
Find duplicates in large file - java
I have really large file with approximately 15 million entries. Each line in the file contains a single string (call it key).