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
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 user… Continua a leggere
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 to… Continua a leggere
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 …
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 that… Continua a leggere
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
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";
…
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 …
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 have… Continua a leggere
Calculating Floating Point Powers (PHP/BCMath)
I’m writing a wrapper for the bcmath estensione, and bug #10116 regarding bcpow() is particularly annoying — it 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





