Suppose that two interfaces clash:
interface Alpha
{
function foo();
}
interface Beta
{
function foo();
Suppose that two interfaces clash:
interface Alpha
{
function foo();
}
interface Beta
{
function foo();
Jag skäms inte över att vara svensk.
Men jag skäms över hur vissa ser ned på dem som vill bli svenskar.
Jag skäms inte över den svenska flaggan.
Men jag skäms över hur den används mot dem som vill hissa den.
Jag skäms inte över Sverige.
Men jag skäms över hur vissa anser sig ha ensamrätt till landet.
100 Continue | |
101 Switching Protocols | |
102 Processing (WebDAV; RFC 2518) | |
200 OK | |
201 Created | |
202 Accepted | |
203 Non-Authoritative Information (since HTTP/1.1) | |
204 No Content | |
205 Reset Content | |
206 Partial Content |
Mes byönner wa nest Klumbosbrun | |
og warger iemwid knautum, | |
og kullur auti budum add ien öx i böjem sen, | |
då belldum wi wa däler og int stjåv dar ini klautum, | |
fast brö wa slut å nådår kam bå tråj og fjuäre i renn. | |
Byönn fick kåjt för öxn å bröde wart fel stjört åv bartjem, | |
men wi Blibjäskaller warum fel lasog Nuäak auti artjem, | |
men wi Blibjäskaller warum fel lasog Nuäak auti artjem. |
<?php | |
if(isset($_POST['sendRequest'])) | |
{ | |
//Jag tar emot start-date och end-date via ett formular. | |
//Jag kor strtotime pa varderna for att omvandla dem till Unix timestamp | |
$startDate = strtotime($_POST['startDate']); | |
$endDate = strtotime($_POST['endDate']); | |
//Uppbyggnad av tabell | |
echo '<table width="100%" border="1">'; |
<?php | |
class Logger | |
{ | |
protected $rows = array(); | |
public function __construct() | |
{ | |
register_shutdown_function(array($this, 'shutdown')); | |
} | |
function sec2time($time) | |
{ | |
if(!is_numeric($time)) | |
return false; | |
$value = array( | |
'seconds' => 60, | |
'minutes' => 60, | |
'hours' => 24, | |
'days' => 365, |
I often find a need to let all objects of one class to have access to the same service. It then feels like waste of both time and memory to inject the service into each single object. Instead I'd like to inject the service into the whole class and let in be located on class level. | |
Example: | |
You have a web store with order and customer objects. | |
An order object can - via a customer repository - supply the customer who made the order. | |
If you fetch a sequence of orders, e.g. to show a list of orders and the customers who made them, every order needs access to the customer repository. At the same time the orders should be filled with information from the database. | |
I've never seen a discussion about class level DI. Is that never done? If not, how are cases like this handled? |
For binary trees I've found a variant of nested sets. | |
The idea is to let | |
- the root node be represented by the interval [0, 1], | |
- the two children of the root node be represented by the intervals [0, 1/2] and [1/2, 1] respectively, | |
- the grandchild nodes by [0, 1/4], [1/4, 1/2], [1/2, 3/4] and [3/4, 1]. | |
Then it's easy to find: | |
- the left and right children (one or both), | |
- all descendents of a node, |