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
https://github.com/alexandru/scala-best-practices | |
https://github.com/Sergic/functional-programming-in-scala/tree/master/notes | |
https://github.com/Sergic/ru-neophyte-guide-to-scala |
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 | |
/** | |
* Sample implementation fo the CarQueryAPI Json database | |
*/ | |
class CarQueryAPI | |
{ | |
/** | |
* @var string Url to the CarQueryAPI database | |
*/ | |
protected $apiUrl = 'http://www.carqueryapi.com/api/0.3/?cmd='; |
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 shapeless._ | |
import shapeless.labelled._ | |
import shapeless.ops.record.Merger | |
import shapeless.syntax.SingletonOps | |
import scala.annotation.implicitNotFound | |
import scala.collection.generic.CanBuildFrom | |
import scala.language.experimental.macros | |
import scala.language.higherKinds |
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
#!/bin/bash | |
trap '[ "$?" -eq 0 ] || read -p "Looks like something went wrong... Press any key to continue..."' EXIT | |
VM=nb | |
DOCKER_MACHINE=./docker-machine.exe | |
#mount data | |
SHARE_NAME=projects | |
SHARE_PATH=c:\\home\\projects |
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 java.io.*; | |
import java.util.*; | |
/** The class encapsulates an implementation of the Apriori algorithm | |
* to compute frequent itemsets. | |
* | |
* Datasets contains integers (>=0) separated by spaces, one transaction by line, e.g. | |
* 1 2 3 | |
* 0 9 | |
* 1 9 |
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 | |
//function build tree --- recursive | |
function show_tree( &$data, $point, $str ){ | |
//reset($data); | |
$str .= " "; | |
while ( list( $index, $point_data ) = each( $data ) ){ | |
if ( $point_data[ 'parent_id' ] == $point ){ | |
echo $str.$point_data[ 'name' ].'<br>'; | |
unset( $data[ $index ] ); |
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 | |
/** | |
* Please be aware that private properties are private for good purpose, | |
* changing it during runtime so is only OK during Unit Testing for example. | |
* So use this only if you're knowing what you're doing :) | |
*/ | |
class BareDemoClass() { |
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
VERSION=0.20.6 | |
sudo apt-get update | |
sudo apt-get install openjdk-6-jdk | |
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-$VERSION.deb | |
sudo dpkg -i elasticsearch-$VERSION.deb | |
# be sure you add "action.disable_delete_all_indices" : true to the config!! |
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 | |
$collection = new Doctrine\Common\Collection\ArrayCollection(); | |
// add objects to the collection that contain a getCreated method returning a DateTime instance | |
$iterator = $collection->getIterator(); | |
$iterator->uasort(function ($first, $second) { | |
if ($first === $second) { |
NewerOlder