This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package fibonacci | |
func fib(n uint) uint64 { | |
return uint64(math.Round(math.Pow(1.618, float64(n)) / 2.236)) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function fib(int $n) | |
{ | |
return number_format(round(1.618 ** $n / 2.236)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* $userId - int | |
* $text - post, message etc. text - string | |
* $img - image - resource usually $_FILES['image']['tmp_name'] | |
* $counterLimit - limit of n messages in t period - int | |
* $countFails - limit of x failes after which user will be blocked - int | |
* $addParams - ex.: array('period_same_counter'=>3, 'period_same_time'=>15*60); - array | |
*/ | |
class AntiSpam { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.anumbers.core; | |
import java.awt.image.BufferedImage; | |
import java.io.File; | |
import java.io.IOException; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.Map.Entry; | |
import javax.imageio.ImageIO; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Lightning class offers frequently (daily) used methods (functions) | |
* to free programmer`s hands, avoiding regular/repeated practices | |
* | |
* Some functions have been inherited from PHP stdlib (like numberFormat, htmlspecialchars) | |
* to make lives easier | |
* | |
* Copyright (C) <2015> <Arthur Kushman> | |
* | |
* This program is free software: you can redistribute it and/or modify |