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.Continue lendo

Tagged , , , , | Deixe um comentário

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.
Então, basicamente,, I understand the problem here : When userContinue lendo

Tagged , , | Deixe um comentário

Padrão algoritmos de reconhecimento em PHP?

Eu gostaria de começar a experimentar com algoritmos que reconhecem padrões em dados. Eu lido com vários tipos de seqüências (pixels da imagem, entrada de texto, o movimento do usuário), and it would be fun to make use of Pattern Recognition to try toContinue lendo

Tagged , , , | Deixe um comentário

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 

Continue lendo

Tagged , , , , | Deixe um comentário

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 thatContinue lendo

Tagged , , , | Deixe um comentário

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’ =>… Continue lendo

Tagged , , | Deixe um comentário

PHP: Como classificar os valores de um array em ordem alfabética?

Eu quero classificar valores de um array em ordem alfabética em PHP. If all values started with same character then they should be sorted using second character and so on. Ignore case sensitive.
Para o Exemplo:

before:
values[0] = "programming";

Continue lendo

Tagged , , , | 2 Comentários

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 

Continue lendo

Tagged , | Deixe um comentário

Como estender rating ELO?

Na minha liga de futebol Im usando (onde os usuários jogar com times) Sistema ELO. Tudo funciona bem. Preciso de conselhos sobre como estender a fórmula para refletir a adição do coeficiente eo poder dos jogadores da equipe. (Teams haveContinue lendo

Tagged , | Deixe um comentário

Calculating Floating Point Powers (PHP/BCMath)

I’m writing a wrapper for the bcmath extensão, and bug #10116 regarding bcpow() is particularly annoyingit casts the $right_operand ($exp…) to an (native PHP, not arbitrary length) número inteiro, so when you try to calculate the square Continue lendo

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