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 main | |
import ( | |
"fmt" | |
"github.com/nlopes/slack" | |
"strconv" | |
"strings" | |
"time" | |
) |
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
{ | |
init: function(elevators, floors) { | |
var stopRequested = []; | |
_.each(floors, function(floor) { | |
floor.on("up_button_pressed down_button_pressed", function() { | |
var elevatorsDistance = _.map(elevators, function(elevator) { return [elevator, elevator.loadFactor()* (elevator.currentFloor() - floor.level)]; }); | |
var choosenElevatorDistance = _.min(elevatorsDistance, function(elevatorDistance){ return elevatorDistance[1]; }); | |
var choosenElevator = choosenElevatorDistance[0]; | |
choosenElevator.goToFloor(floor.level); | |
}); |
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 | |
namespace Rousseau\PaymentBundle\Form\DataTransformer; | |
use Symfony\Component\Form\DataTransformerInterface; | |
use Symfony\Component\Form\Exception\TransformationFailedException; | |
use Doctrine\Common\Persistence\ObjectManager; | |
/* | |
Usage: | |
$builder->add( |