Models | Examples |
---|---|
Display ads | Yahoo! |
Search ads |
This file contains 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 | |
/** | |
* isset( $var['a'], $var['b'] ) shortcut: array_has( $var, 'a', 'b' ); | |
*/ | |
function array_has( &$var ) { | |
$args = func_get_args(); | |
if ( ! empty( $args ) && is_array( $args[0] ) && count( $args ) > 1 ){ | |
This file contains 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
function isset_assign( $needle, $haystack ) { | |
if ( isset( $haystack[$needle] ) ) { | |
return $haystack[$needle]; | |
} | |
else { | |
return $needle; | |
} | |
} |
This file contains 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
function linksnis($skaicius, $komentaras, $komentarai, $komentaru) { | |
if ( $skaicius % 10 == 0 || between(substr($skaicius, -2), 10, 20) ) { | |
return $komentaru; | |
} | |
elseif ( substr($skaicius, -1) == 1 && $skaicius != 11 ) { | |
return $komentaras; | |
} |
This file contains 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
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
This file contains 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 | |
/** | |
* Lietuviškų vardų linksniai. | |
* | |
* @author Maug Lee <[email protected]> | |
* @copyright Copyleft (ↄ) 2011, Maug Lee | |
* @version 0.3 | |
* @package Vardai | |
*/ |
This file contains 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
import collection.mutable.ListBuffer | |
object NetworkUtils { | |
def ip2Long(ip: String): Long = { | |
val atoms: Array[Long] = ip.split("\\.").map(java.lang.Long.parseLong(_)) | |
val result: Long = (3 to 0 by -1).foldLeft(0L)( | |
(result, position) => result | (atoms(3 - position) << position * 8)) | |
result & 0xFFFFFFFF | |
} |
Measures if there is backpressure on an Akka Stream at the given stage.
When an Akka Stream doesn't perform as intended, it is difficult to tell where the bottleneck is, since all stages operate at the same rate (see e.g. here ).
So when things are not fast as expected, this pressure gauge can help you to narrow down on the slow stage. Imagine