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
| version: '3.8' # Specifies the version of the Docker Compose file format | |
| services: | |
| ros: # Service name | |
| image: osrf/ros:humble-desktop # Specifies the Docker image to use for this service | |
| container_name: ros # Sets the container name to "ros" | |
| network_mode: host # Uses the host's networking stack (container shares the host's network) | |
| volumes: | |
| - /tmp/.X11-unix:/tmp/.X11-unix # Mounts the X11 Unix socket for GUI applications | |
| - /etc/localtime:/etc/localtime:ro # Mounts the local timezone file in read-only mode to sync container 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
| <?php | |
| class Store | |
| { | |
| public function __construct(\PDO $db) | |
| { | |
| $this->db = $db; | |
| $this->db->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); | |
| } |
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 App\Policies; | |
| use Illuminate\Contracts\Auth\Access\Gate as GateContract; | |
| class ApplicationPolicy | |
| { | |
| /** | |
| * @var GateContract | |
| */ |
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 | |
| class Bin | |
| { | |
| private $capacity; | |
| private $content; | |
| /** | |
| * @param integer $capacity | |
| * @param array $content |
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 | |
| /** | |
| * Class BinPool | |
| * simple implementation of the 0-1 Knapsack problem, with multiple knapsacks (bins) | |
| * | |
| * Given a pool of item sizes/weights, a bin size and a quantity of bins, can the pool be fully allocated to the bins | |
| * and have room to add another item | |
| */ |
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 | |
| // example_1 | |
| // creates a new Request from the default namespace ie "\Request" | |
| $x = new Request(); | |
| // example_2 | |
| // creates a new Request from the CorpName\App namespace ie "CorpName\App\Request" | |
| namespace CorpName\App; | |
| $x = new Request(); |