Tag Archives: algoritmo

Check 2 numbers algorithm

Eu tenho 2 fields on db. Minor and Major:

Minor, Major
0,0
1,0
2,0
3,0
4,0
5,0
7,0
8,0
...
65536,0
0,1
1,1
2,1
3,1
4,1
...
65536,1
0,2

What is best way to compare this. I am doing this Continue lendo

Tagged , , , , | Deixe um comentário

How to determine time span or ranges overlaps?

I am aware that a similar question was asked many times before, but please don’t get me wrong. I am not asking how to find if two ranges overlap, i am instead interested in an efficient way to calculate whereContinue lendo

Tagged , , , , | Deixe um comentário

Cluster Timestamps by Date

I have an array containing timestamps. I would like to know how apps like Facebook etc. cluster posts. For clarity, imagine you have an array of timestamps and would like to group the timestamps by:

Today
This week
This monthContinue lendo

Tagged , | Deixe um comentário

PHP multi dimensional Array removing partial duplicates

I have an array containing this

Array ( 
[0] => Array ( [0] => Sub1 ) 
[1] => Array ( [0] => Sub1 [1] => Gold ) 
[2] => Array ( [0] => Sub1 [1] => Sub2 ) 
[3] => 

Continue lendo

Tagged , , , | Deixe um comentário

Creating user team algorithm based on Zipcode and Ranges Within

In my application we have teams of users based on their location (zipcode) and then an encompassing radius of 100 miles (zipcodes within) to operate with.
My problem is: user one signs up and is designated a team based onContinue lendo

Tagged , , | 1 Comentar

I need an algorithm to measure content quality

is there an algorithm to measure the content quality ? http://www.the-top-tens.com/ in top tens when you vote an item, there is a comment box appearing and when you start writing why you vote this item, it comments automatically about whatContinue lendo

Tagged , , , | Deixe um comentário

Turn algorithm into one line function only using arithmetic operator

I want to turn this function :

    $n=11;
    $k=2;
    $l=$n;
    $total=array();
    do{
        $x=floor($n/$k);
        $y=$k*$x;
        $n=$n-$y+$x;
        array_push($total, $x);
    }while($n>=$k);
    $result = $l + array_sum($total);
    print_r($result);

into a function without looping or conditional statement, and only using arithmetic operator (+,-,*,/) with assumption Continue lendo

Tagged , , , | Deixe um comentário

How to use data in this specific format like cartesian? (php)

i have database with table called ‘fields’. There are fields of some table. This table has columns: ID field, ID column, ID row, valor. How to make double array from this data?
It should be look like this:

array {

    

Continue lendo

Tagged , , , | Deixe um comentário

Algorithm to go through a matrix[matriz] given a string and give a final value based on computation

so this is how it goes the user selects attributes:
example : persuading, performing and teamwork
so questions are generated:
what if the candidate has :

1. persuading and not performing   
2. persuading and not teamwork
3. performing and not 

Continue lendo

Tagged , | Deixe um comentário

Concept of Holding a reservation

I have a question and will be grateful if you can help me out with some ideas.
In an online hotel or ticket booking reservation system, normally a user is allocated a specific time to complete their registration / paymentsContinue lendo

Tagged , , , | Deixe um comentário
12 páginas