Tag Archives: algoritmo

Creating timer algorithm in php

I’m working on an application that sends alerts to users via email. The user chooses a time-frame and sets up any number of alerts to receive in that time-frame.
The goal is to send the alerts at equal time intervals.Continua a leggere

Tagged , , , , | Lascia un commento

Anagram Algorithm in PHP

I’m totally a newbie with PHP. Today I just got a problem that I can’t know how to solve, even after searching google and digging SOF. It’s the Anagram algorithm.
Quindi, fondamentalmente, I understand the problem here : When userContinua a leggere

Tagged , , | Lascia un commento

Algoritmi di riconoscimento di pattern in PHP?

I would like to begin experimenting with algorithms that recognize patterns in data. I deal with many types of sequences (image pixels, text input, user movement), and it would be fun to make use of Pattern Recognition to try toContinua a leggere

Tagged , , , | Lascia un commento

Implement Atwood's Equipping our ASCII armor in PHP

I’m trying to implement in PHP something similar to Jeff Atwood’s
Equipping our ASCII armor.
Here’s C# Implementation of ASCII85.
Here’s PHP Implementation of ASCII85
Here’s how I convert the string to byte array:

$byteArr = str_split($uid);
foreach ($byteArr as 

Continua a leggere

Tagged , , , , | Lascia un commento

Any flaws in this method of selecting random records from the db?

I have a db table filled with about ~30k records.
I want to randomly select a record one at a time (when demanded by users), delete the record from the table, and insert it in another table.
I’ve heard/found thatContinua a leggere

Tagged , , , | Lascia un commento

algorithm to find most realistic market price average in dataset

What I have:

users are selling foobars on an auction site.
each foobar is identical.
price of foobar determined by user.
i will be scrapping each price listing to form a data set that looks like:
$prices = (‘foobar’ =>… Continua a leggere

Tagged , , | Lascia un commento

PHP: How to sort values of an array in alphabetical order?

I want to sort values of an array in alphabetical order in PHP. If all values started with same character then they should be sorted using second character and so on. Ignore case sensitive.
Per esempio:

before:
values[0] = "programming";

Continua a leggere

Tagged , , , | 2 Commenti

ESL Elo formula (something wrong)

I’m trying to implement ELO formula like ESL portal have. ( http://cheater.esl.eu/uk/faq/rankmodules/ )
A first example corresponds to the example of ESL but the second and third give crazy results. Where I’m wrong?

    function eloEsl($k1, $k2, $g1, $g2)
{
    $per1 

Continua a leggere

Tagged , | Lascia un commento

Come estendere punteggio ELO?

Nella mia lega calcio Im utilizzando (in cui gli utenti giocano con squadre) ELO. Everything works fine. I need advice on how to extend the formula to reflect the addition of the coefficient and power of the team players. (Teams haveContinua a leggere

Tagged , | Lascia un commento

Calculating Floating Point Powers (PHP/BCMath)

I’m writing a wrapper for the bcmath estensione, and bug #10116 regarding bcpow() is particularly annoyingit casts the $right_operand ($exp…) to an (native PHP, not arbitrary length) numero intero, so when you try to calculate the square Continua a leggere

Tagged , , , , | Lascia un commento
8 pagine