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.time.LocalTime | |
import java.time.temporal.ChronoUnit | |
fun main() { | |
val time = LocalTime.now().truncatedTo(ChronoUnit.SECONDS) | |
val clock = time.toBerlinClock() | |
println("$time => $clock") | |
} | |
const val Off = "O" |
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 | |
/* | |
|-------------------------------------------------------------------------- | |
| Application Routes | |
|-------------------------------------------------------------------------- | |
| | |
| Here is where you can register all of the routes for an application. | |
| It's a breeze. Simply tell Laravel the URIs it should respond to | |
| and give it the controller to call when that URI is requested. |
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 android.arch.lifecycle.Lifecycle | |
import android.arch.lifecycle.LifecycleObserver | |
import android.arch.lifecycle.LifecycleOwner | |
import android.arch.lifecycle.OnLifecycleEvent | |
import kotlinx.coroutines.experimental.CoroutineStart | |
import kotlinx.coroutines.experimental.Deferred | |
import kotlinx.coroutines.experimental.Job | |
import kotlinx.coroutines.experimental.android.UI | |
import kotlinx.coroutines.experimental.async | |
import kotlinx.coroutines.experimental.launch |
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 static java.util.Calendar.DAY_OF_MONTH; | |
import static java.util.Calendar.MONTH; | |
import static java.util.Calendar.YEAR; | |
import static java.util.Locale.ITALY; | |
import java.util.Calendar; | |
public class CodiceFiscale { | |
public static final int LENGTH = 16; |
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
public function runReportIssueGetFields(framework\Request $request) | |
{ | |
if (!$this->selected_project instanceof entities\Project) | |
{ | |
return $this->renderText('invalid project'); | |
} | |
$fields_array = $this->selected_project->getReportableFieldsArray($request['issuetype_id'], true); | |
$available_fields = entities\DatatypeBase::getAvailableFields(); | |
$available_fields[] = 'pain_bug_type'; |
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
public function runGenReportActivity(Request $request) | |
{ | |
$activities = []; | |
$date_from = trim($request['date_from']); | |
$date_to = trim($request['date_to']); | |
$time_spent_table = entities\IssueSpentTime::getB2DBTable(); | |
$crit = $time_spent_table->getCriteria(); | |
$crit->addWhere(tables\IssueSpentTimes::EDITED_AT, $date_from, $crit::DB_GREATER_THAN_EQUAL); | |
$crit->addWhere(tables\IssueSpentTimes::EDITED_AT, $date_to, $crit::DB_LESS_THAN_EQUAL); | |
$crit->addOrderBy(tables\IssueSpentTimes::EDITED_AT, $crit::SORT_DESC_NUMERIC); |
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 FastPriorityQueue from 'faspriorityqueue'; | |
import { Swatch } from './palette'; | |
const COMPONENT_RED = -3; | |
const COMPONENT_GREEN = -2; | |
const COMPONENT_BLUE = -1; | |
const QUANTIZE_WORD_WIDTH = 5; | |
const QUANTIZE_WORD_MASK = (1 << QUANTIZE_WORD_WIDTH) - 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
SELECT Tax | |
FROM ( | |
SELECT Bookings.Tax AS Tax | |
FROM Bookings | |
JOIN Field | |
ON Bookings.Code = Field.Code | |
WHERE Field.IsCovered = 0 | |
GROUP BY Tax | |
HAVING COUNT(Tax) >= 2 | |
) |
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 restringiMenu(restrictions, menu) { | |
var finalMenu = { primi: [], secondi: [], dessert: [] }; | |
for(var type in menu) { | |
plate: | |
for(var plate in menu[type]) { | |
for(var ingredient in menu[type][plate].ingredienti) { | |
for(var restriction in restrictions) { | |
if(!puoMangiare(restriction, ingredient)) continue plate; | |
} | |
} |
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
class BaseActivity extends Activity { | |
@SuppressWarnings("unchecked") | |
public <T extends View> T $(int id) { | |
return (T) findViewById(id); | |
} | |
} |
NewerOlder