_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 33 8k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q20300 | Observable.concatMapTo | train | public function concatMapTo(ObservableInterface $observable, callable $resultSelector = null): Observable
| php | {
"resource": ""
} |
q20301 | Observable.publishValue | train | public function publishValue($initialValue, callable $selector = null): Observable | php | {
"resource": ""
} |
q20302 | Observable.singleInstance | train | public function singleInstance(): Observable
{
$hasObservable = false;
$observable = null;
$source = $this;
$getObservable = function () use (&$hasObservable, &$observable, $source): Observable {
if (!$hasObservable) {
$hasObservable = true;
| php | {
"resource": ""
} |
q20303 | Observable.shareReplay | train | public function shareReplay(int $bufferSize, int $windowSize = null, SchedulerInterface $scheduler = | php | {
"resource": ""
} |
q20304 | Observable.repeat | train | public function repeat(int $count = -1): Observable
{
if ($count === 0) {
return self::empty();
}
| php | {
"resource": ""
} |
q20305 | Observable.timeout | train | public function timeout(int $timeout, ObservableInterface $timeoutObservable = null, AsyncSchedulerInterface $scheduler = null): Observable
{
return $this->lift(function () use ($timeout, $timeoutObservable, $scheduler) {
| php | {
"resource": ""
} |
q20306 | Observable.bufferWithCount | train | public function bufferWithCount(int $count, int $skip = null): Observable
{
return $this->lift(function () use ($count, $skip) {
| php | {
"resource": ""
} |
q20307 | Observable.startWith | train | public function startWith($startValue, SchedulerInterface $scheduler = | php | {
"resource": ""
} |
q20308 | Observable.startWithArray | train | public function startWithArray(array $startArray, SchedulerInterface $scheduler = null): Observable
{
return $this->lift(function () use ($startArray, $scheduler) {
| php | {
"resource": ""
} |
q20309 | Observable.timestamp | train | public function timestamp(SchedulerInterface $scheduler = null): Observable
{
return $this->lift(function () use ($scheduler) {
return | php | {
"resource": ""
} |
q20310 | Observable.partition | train | public function partition(callable $predicate): array
{
return [
$this->filter($predicate),
| php | {
"resource": ""
} |
q20311 | Observable.race | train | public static function race(array $observables, SchedulerInterface $scheduler = null): Observable
{
if (count($observables) === 1) {
return $observables[0];
}
return | php | {
"resource": ""
} |
q20312 | Observable.average | train | public function average(): Observable
{
return $this
->defaultIfEmpty(Observable::error(new \UnderflowException()))
->reduce(function ($a, $x) {
static $count = 0;
| php | {
"resource": ""
} |
q20313 | Observable.throttle | train | public function throttle(int $throttleDuration, SchedulerInterface $scheduler = null): Observable
{
return $this->lift(function () use ($throttleDuration, $scheduler) {
| php | {
"resource": ""
} |
q20314 | RolesServiceProvider.loadSeedsFrom | train | private function loadSeedsFrom()
{
if (config('roles.defaultSeeds.PermissionsTableSeeder')) {
$this->app['seed.handler']->register(
DefaultPermissionsTableSeeder::class
);
}
if (config('roles.defaultSeeds.RolesTableSeeder')) {
$this->app['... | php | {
"resource": ""
} |
q20315 | HasRoleAndPermission.hasOneRole | train | public function hasOneRole($role)
{
foreach ($this->getArrayFrom($role) as $role) {
| php | {
"resource": ""
} |
q20316 | HasRoleAndPermission.checkRole | train | public function checkRole($role)
{
return $this->getRoles()->contains(function ($value) use ($role) {
return $role | php | {
"resource": ""
} |
q20317 | HasRoleAndPermission.hasOnePermission | train | public function hasOnePermission($permission)
{
foreach ($this->getArrayFrom($permission) as $permission) {
if ($this->checkPermission($permission)) {
| php | {
"resource": ""
} |
q20318 | HasRoleAndPermission.allowed | train | public function allowed($providedPermission, Model $entity, $owner = true, $ownerColumn = 'user_id')
{
if ($this->isPretendEnabled()) {
| php | {
"resource": ""
} |
q20319 | HasRoleAndPermission.isAllowed | train | protected function isAllowed($providedPermission, Model $entity)
{
foreach ($this->getPermissions() as $permission) {
if ($permission->model != '' && get_class($entity) == $permission->model
| php | {
"resource": ""
} |
q20320 | RoleHasRelations.attachPermission | train | public function attachPermission($permission)
{
return (!$this->permissions()->get()->contains($permission)) | php | {
"resource": ""
} |
q20321 | TwitterAPIExchange.buildBaseString | train | private function buildBaseString($baseURI, $method, $params)
{
$return = array();
ksort($params);
foreach($params as $key => $value)
{
$return[] = rawurlencode($key) . '=' . rawurlencode($value);
| php | {
"resource": ""
} |
q20322 | TwitterAPIExchange.request | train | public function request($url, $method = 'get', $data = null, $curlOptions = array())
{
if (strtolower($method) === 'get')
{
$this->setGetfield($data);
}
else
| php | {
"resource": ""
} |
q20323 | WiFi.buildWifiString | train | protected function buildWifiString()
{
$wifi = $this->prefix;
if (isset($this->encryption)) {
$wifi .= 'T:'.$this->encryption.$this->separator;
}
if (isset($this->ssid)) {
$wifi .= 'S:'.$this->ssid.$this->separator;
}
if (isset($this->password... | php | {
"resource": ""
} |
q20324 | WiFi.setProperties | train | protected function setProperties(array $arguments)
{
$arguments = $arguments[0];
if (isset($arguments['encryption'])) {
$this->encryption = $arguments['encryption'];
}
if (isset($arguments['ssid'])) {
$this->ssid = $arguments['ssid'];
}
| php | {
"resource": ""
} |
q20325 | SMS.setProperties | train | protected function setProperties(array $arguments)
{
if (isset($arguments[0])) {
$this->phoneNumber = $arguments[0];
} | php | {
"resource": ""
} |
q20326 | SMS.buildSMSString | train | protected function buildSMSString()
{
$sms = $this->prefix.$this->phoneNumber;
if (isset($this->message)) {
| php | {
"resource": ""
} |
q20327 | BTC.setProperties | train | protected function setProperties(array $arguments)
{
if (isset($arguments[0])) {
$this->address = $arguments[0];
}
if (isset($arguments[1])) {
$this->amount = $arguments[1]; | php | {
"resource": ""
} |
q20328 | BTC.setOptions | train | protected function setOptions(array $options)
{
if (isset($options['label'])) {
$this->label = $options['label'];
}
if (isset($options['message'])) {
$this->message = $options['message'];
}
| php | {
"resource": ""
} |
q20329 | BTC.buildBitCoinString | train | protected function buildBitCoinString()
{
$query = http_build_query([
'amount' => $this->amount,
'label' => $this->label,
'$message' => $this->message,
'r' | php | {
"resource": ""
} |
q20330 | ImageMerge.merge | train | public function merge($percentage)
{
$this->setProperties($percentage);
imagecopyresampled(
$this->sourceImage->getImageResource(),
$this->mergeImage->getImageResource(),
$this->centerX,
$this->centerY,
0,
0,
$this-... | php | {
"resource": ""
} |
q20331 | ImageMerge.calculateCenter | train | private function calculateCenter()
{
$this->centerY = ($this->sourceImageHeight / 2) | php | {
"resource": ""
} |
q20332 | ImageMerge.calculateOverlap | train | private function calculateOverlap($percentage)
{
$this->postMergeImageHeight = $this->sourceImageHeight * $percentage;
| php | {
"resource": ""
} |
q20333 | BaconQrCodeGenerator.generate | train | public function generate($text, $filename = null)
{
$qrCode = $this->writer->writeString($text, $this->encoding, $this->errorCorrection);
if ($this->imageMerge !== null) {
| php | {
"resource": ""
} |
q20334 | BaconQrCodeGenerator.merge | train | public function merge($filepath, $percentage = .2, $absolute = false)
{
if (function_exists('base_path') && !$absolute) {
$filepath = base_path().$filepath;
}
$this->imageMerge = | php | {
"resource": ""
} |
q20335 | BaconQrCodeGenerator.mergeString | train | public function mergeString($content, $percentage = .2)
{
$this->imageMerge = $content;
| php | {
"resource": ""
} |
q20336 | BaconQrCodeGenerator.format | train | public function format($format)
{
switch ($format) {
case 'png':
$this->writer->setRenderer(new Png());
break;
case 'eps':
$this->writer->setRenderer(new Eps()); | php | {
"resource": ""
} |
q20337 | BaconQrCodeGenerator.size | train | public function size($pixels)
{
$this->writer->getRenderer()->setHeight($pixels); | php | {
"resource": ""
} |
q20338 | BaconQrCodeGenerator.color | train | public function color($red, $green, $blue)
{
$this->writer->getRenderer()->setForegroundColor(new | php | {
"resource": ""
} |
q20339 | BaconQrCodeGenerator.backgroundColor | train | public function backgroundColor($red, $green, $blue)
{
$this->writer->getRenderer()->setBackgroundColor(new | php | {
"resource": ""
} |
q20340 | Auth.login | train | public static function login(UserInterface $user): void
{ | php | {
"resource": ""
} |
q20341 | ReportHtmlLine.render | train | public function render($renderer)
{
if ($this->x1 === ReportBaseElement::CURRENT_POSITION) {
$this->x1 = $renderer->getX();
}
if ($this->y1 === ReportBaseElement::CURRENT_POSITION) {
$this->y1 = $renderer->getY();
}
if ($this->x2 === ReportBaseElement:... | php | {
"resource": ""
} |
q20342 | GedcomCodeQuay.getValues | train | public static function getValues(): array
{
$values = [];
foreach (self::TYPES as $type) {
$values[$type] = | php | {
"resource": ""
} |
q20343 | CustomCssJsModule.getAdminAction | train | public function getAdminAction(): ResponseInterface
{
$this->layout = 'layouts/administration';
return $this->viewResponse('modules/custom-css-js/edit', [
'title' => $this->title(),
| php | {
"resource": ""
} |
q20344 | EventRepository.getCommonFacts | train | private function getCommonFacts(): array
{
// The list of facts used to limit the query result
return array_merge(
Gedcom::BIRTH_EVENTS,
| php | {
"resource": ""
} |
q20345 | ReportParserGenerate.startElement | train | protected function startElement($parser, string $name, array $attrs): void
{
$newattrs = [];
foreach ($attrs as $key => $value) {
if (preg_match("/^\\$(\w+)$/", $value, $match)) {
if (isset($this->vars[$match[1]]['id']) && !isset($this->vars[$match[1]]['gedcom'])) {
... | php | {
"resource": ""
} |
q20346 | ReportParserGenerate.endElement | train | protected function endElement($parser, string $name): void
{
if (($this->process_footnote || $name === 'Footnote') && ($this->process_ifs === 0 || $name === 'if') && ($this->process_gedcoms === 0 || $name === 'Gedcom') && ($this->process_repeats === 0 || $name === 'Facts' || $name === | php | {
"resource": ""
} |
q20347 | ReportParserGenerate.characterData | train | protected function characterData($parser, $data): void
{
if ($this->print_data && $this->process_gedcoms | php | {
"resource": ""
} |
q20348 | ReportParserGenerate.gedcomStartHandler | train | private function gedcomStartHandler(array $attrs): void
{
if ($this->process_gedcoms > 0) {
$this->process_gedcoms++;
return;
}
$tag = $attrs['id'];
$tag = str_replace('@fact', $this->fact, $tag);
$tags = explode(':', $tag);
... | php | {
"resource": ""
} |
q20349 | ReportParserGenerate.gedcomEndHandler | train | private function gedcomEndHandler(): void
{
if ($this->process_gedcoms > 0) {
$this->process_gedcoms--;
} else {
| php | {
"resource": ""
} |
q20350 | ReportParserGenerate.addDescendancy | train | private function addDescendancy(&$list, $pid, $parents = false, $generations = -1): void
{
$person = Individual::getInstance($pid, $this->tree);
if ($person === null) {
return;
}
if (!isset($list[$pid])) {
$list[$pid] = $person;
}
if (!isset($l... | php | {
"resource": ""
} |
q20351 | ReportParserGenerate.addAncestors | train | private function addAncestors(array &$list, string $pid, bool $children = false, int $generations = -1): void
{
$genlist = [$pid];
$list[$pid]->generation = 1;
while (count($genlist) > 0) {
$id = array_shift($genlist);
if (strpos($id, 'empty') === 0) {
... | php | {
"resource": ""
} |
q20352 | ReportParserGenerate.getGedcomValue | train | private function getGedcomValue($tag, $level, $gedrec): string
{
if (empty($gedrec)) {
return '';
}
$tags = explode(':', $tag);
$origlevel = $level;
if ($level == 0) {
$level = $gedrec[0] + 1;
}
$subrec = $gedrec;
foreach ... | php | {
"resource": ""
} |
q20353 | ReportParserGenerate.substituteVars | train | private function substituteVars($expression, $quote): string
{
return preg_replace_callback(
'/\$(\w+)/',
function (array $matches) use ($quote): string {
if (isset($this->vars[$matches[1]]['id'])) {
if ($quote) {
return "'"... | php | {
"resource": ""
} |
q20354 | File.mkdir | train | public static function mkdir($path): bool
{
if (is_dir($path)) {
return true;
}
if (dirname($path) && !is_dir(dirname($path))) {
self::mkdir(dirname($path));
}
try {
| php | {
"resource": ""
} |
q20355 | FunctionsPrintLists.surnameTagCloud | train | public static function surnameTagCloud(array $surnames, ?ModuleListInterface $module, bool $totals, Tree $tree): string
{
$minimum = PHP_INT_MAX;
$maximum = 1;
foreach ($surnames as $surn => $surns) {
foreach ($surns as $spfxsurn => $count) {
$maximum = max($maxim... | php | {
"resource": ""
} |
q20356 | FunctionsPrintLists.surnameList | train | public static function surnameList($surnames, $style, $totals, ?ModuleListInterface $module, Tree $tree): string
{
$html = [];
foreach ($surnames as $surn => $surns) {
// Each surname links back to the indilist
if ($module instanceof ModuleListInterface) {
if ... | php | {
"resource": ""
} |
q20357 | ModuleController.list | train | public function list(): ResponseInterface
{
return $this->viewResponse('admin/modules', [
'title' => I18N::translate('All modules'),
'modules' | php | {
"resource": ""
} |
q20358 | ColorsTheme.menuPalette | train | public function menuPalette(): Menu
{
$request = app(ServerRequestInterface::class);
/* I18N: A colour scheme */
$menu = new Menu(I18N::translate('Palette'), '#', 'menu-color');
foreach ($this->palettes() as $palette_id => $palette_name) {
$url = (string) $request->getU... | php | {
"resource": ""
} |
q20359 | Carbon.local | train | public function local(): Carbon
{
$locale = app(LocaleInterface::class)->code();
$timezone = Auth::user()->getPreference('TIMEZONE', | php | {
"resource": ""
} |
q20360 | IndividualFactsTabModule.historicalFacts | train | private function historicalFacts(Individual $individual): array
{
return $this->module_service->findByInterface(ModuleHistoricEventsInterface::class)
| php | {
"resource": ""
} |
q20361 | IndividualFactsTabModule.associateFacts | train | private function associateFacts(Individual $person): array
{
$facts = [];
/** @var Individual[] $associates */
$associates = array_merge(
$person->linkedIndividuals('ASSO'),
$person->linkedIndividuals('_ASSO'),
$person->linkedFamilies('ASSO'),
... | php | {
"resource": ""
} |
q20362 | SearchController.quick | train | public function quick(ServerRequestInterface $request, Tree $tree): ResponseInterface
{
$query = $request->get('query', '');
// Was the search query an XREF in the current tree?
// If so, go straight to it.
$record = GedcomRecord::getInstance($query, $tree);
| php | {
"resource": ""
} |
q20363 | SearchController.extractSearchTerms | train | private function extractSearchTerms(string $query): array
{
$search_terms = [];
// Words in double quotes stay together
while (preg_match('/"([^"]+)"/', $query, $match)) {
$search_terms[] = trim($match[1]);
$query = str_replace($match[0], '', $query);
... | php | {
"resource": ""
} |
q20364 | SearchController.phonetic | train | public function phonetic(ServerRequestInterface $request, Tree $tree): ResponseInterface
{
$firstname = $request->get('firstname', '');
$lastname = $request->get('lastname', '');
$place = $request->get('place', '');
$soundex = $request->get('soundex', 'Russell');
// W... | php | {
"resource": ""
} |
q20365 | SearchController.advanced | train | public function advanced(ServerRequestInterface $request, Tree $tree): ResponseInterface
{
$default_fields = array_fill_keys(self::DEFAULT_ADVANCED_FIELDS, '');
$fields = $request->get('fields', $default_fields);
$modifiers = $request->get('modifiers', []);
$other_field = $re... | php | {
"resource": ""
} |
q20366 | SearchController.otherFields | train | private function otherFields(array $fields): array
{
$unused = array_diff(self::OTHER_ADVANCED_FIELDS, array_keys($fields));
$other_fileds = [];
foreach ($unused as $tag) {
| php | {
"resource": ""
} |
q20367 | ChartDistribution.getIso3166Countries | train | private function getIso3166Countries(): array
{
$countries = $this->country_service->getAllCountries();
// Get the country names for each language
$country_to_iso3166 = [];
foreach (I18N::activeLocales() as $locale) {
I18N::init($locale->languageTag());
for... | php | {
"resource": ""
} |
q20368 | ChartDistribution.createChartData | train | private function createChartData(array $places): array
{
$data = [
[
I18N::translate('Country'),
I18N::translate('Total'),
],
];
// webtrees uses 3 letter country codes and localised country names, but google uses 2 letter codes.
... | php | {
"resource": ""
} |
q20369 | ChartDistribution.getBirthChartData | train | private function getBirthChartData(): array
{
// Count how many people were born in each country
$surn_countries = [];
$b_countries = $this->placeRepository->statsPlaces('INDI', 'BIRT', 0, true);
foreach ($b_countries as $country => $count) {
// Consolidate places (Ge... | php | {
"resource": ""
} |
q20370 | ChartDistribution.getDeathChartData | train | private function getDeathChartData(): array
{
// Count how many people were death in each country
$surn_countries = [];
$d_countries = $this->placeRepository->statsPlaces('INDI', 'DEAT', 0, true);
foreach ($d_countries as $country => $count) {
// Consolidate places (G... | php | {
"resource": ""
} |
q20371 | ChartDistribution.getMarriageChartData | train | private function getMarriageChartData(): array
{
// Count how many families got marriage in each country
$surn_countries = [];
$m_countries = $this->placeRepository->statsPlaces('FAM');
// webtrees uses 3 letter country codes and localised country names, but google uses 2 letter ... | php | {
"resource": ""
} |
q20372 | ChartDistribution.getSurnameChartData | train | private function getSurnameChartData(string $surname): array
{
if ($surname === '') {
$surname = $this->individualRepository->getCommonSurname();
}
// Count how many people are events in each country
$surn_countries = [];
$records = $this->queryRecords($su... | php | {
"resource": ""
} |
q20373 | ChartDistribution.getIndivdualChartData | train | private function getIndivdualChartData(): array
{
// Count how many people have events in each country
$surn_countries = [];
$a_countries = $this->placeRepository->statsPlaces('INDI');
// webtrees uses 3 letter country codes and localised country names, but google uses 2 letter c... | php | {
"resource": ""
} |
q20374 | DescendancyModule.getPersonLi | train | public function getPersonLi(Individual $person, $generations = 0): string
{
$icon = $generations > 0 ? 'icon-minus' : 'icon-plus';
$lifespan = $person->canShow() ? '(' . $person->getLifeSpan() . ')' : '';
$spouses = $generations > 0 ? $this->loadSpouses($person, 0) : '';
return... | php | {
"resource": ""
} |
q20375 | DescendancyModule.getFamilyLi | train | public function getFamilyLi(Family $family, Individual $person, $generations = 0): string
{
$spouse = $family->spouse($person);
if ($spouse) {
$spouse_name = $spouse->getSexImage() . $spouse->fullName();
$spouse_link = '<a href="' . e($person->url()) . '" title="' . strip_tag... | php | {
"resource": ""
} |
q20376 | DescendancyModule.loadSpouses | train | public function loadSpouses(Individual $individual, $generations): string
{
$out = '';
if ($individual->canShow()) {
foreach ($individual->spouseFamilies() as $family) {
| php | {
"resource": ""
} |
q20377 | DescendancyModule.loadChildren | train | public function loadChildren(Family $family, $generations): string
{
$out = '';
if ($family->canShow()) {
$children = $family->children();
if ($children->isNotEmpty()) {
foreach ($children as $child) {
$out .= $this->getPersonLi($child, $g... | php | {
"resource": ""
} |
q20378 | PendingChangesController.acceptAllChanges | train | public function acceptAllChanges(ServerRequestInterface $request, Tree $tree): ResponseInterface
{
$url = $request->get('url', '');
$changes = DB::table('change')
->where('gedcom_id', '=', $tree->id())
->where('status', '=', 'pending')
->orderBy('change_id')
... | php | {
"resource": ""
} |
q20379 | PendingChangesController.rejectAllChanges | train | public function rejectAllChanges(ServerRequestInterface $request, Tree $tree): ResponseInterface
{
$url = $request->get('url', '');
DB::table('change')
->where('gedcom_id', '=', $tree->id())
->where('status', '=', 'pending')
->update(['status' | php | {
"resource": ""
} |
q20380 | FunctionsDate.getAgeAtEvent | train | public static function getAgeAtEvent(string $age_string): string
{
switch (strtoupper($age_string)) {
case 'CHILD':
return I18N::translate('Child');
case 'INFANT':
return I18N::translate('Infant');
case 'STILLBORN':
return I... | php | {
"resource": ""
} |
q20381 | BatchUpdateBasePlugin.getActionPreview | train | public function getActionPreview(GedcomRecord $record): string
{
$old_lines = explode("\n", $record->gedcom());
$new_lines = explode("\n", $this->updateRecord($record));
$algorithm = new MyersDiff();
$differences = $algorithm->calculate($old_lines, $new_lines);
$diff_li... | php | {
"resource": ""
} |
q20382 | BatchUpdateBasePlugin.createEditLinks | train | public static function createEditLinks($gedrec, GedcomRecord $record): string
{
return preg_replace(
"/@([^#@\n]+)@/m",
'<a href="' . e(route('edit-raw-record', [
'ged' => $record->tree()->name(), | php | {
"resource": ""
} |
q20383 | ReportPdfFootnote.render | train | public function render($renderer)
{
$renderer->setCurrentStyle('footnotenum');
$renderer->Write($renderer->getCurrentStyleHeight(), | php | {
"resource": ""
} |
q20384 | ReportPdfFootnote.getWidth | train | public function getWidth($renderer)
{
// Setup the style name, a font must be selected to calculate the width
$renderer->setCurrentStyle('footnotenum');
// Check for the largest font size in the box
$fsize = $renderer->getCurrentStyleHeight();
if ($fsize > $renderer->largest... | php | {
"resource": ""
} |
q20385 | Media.mediaFiles | train | public function mediaFiles(): Collection
{
return $this->facts(['FILE'])
->map(function (Fact $fact): MediaFile {
| php | {
"resource": ""
} |
q20386 | Media.firstImageFile | train | public function firstImageFile(): ?MediaFile
{
foreach ($this->mediaFiles() as $media_file) {
| php | {
"resource": ""
} |
q20387 | Media.getNote | train | public function getNote(): string
{
$fact = $this->facts(['NOTE'])->first();
if ($fact instanceof Fact) {
// Link to note object
$note = $fact->target();
if ($note instanceof Note) {
| php | {
"resource": ""
} |
q20388 | HitCountFooterModule.countHit | train | protected function countHit(Tree $tree, string $page, string $parameter): int
{
// Don't increment the counter while we stay on the same page.
if (
Session::get('last_gedcom_id') === $tree->id() &&
Session::get('last_page_name') === $page &&
Session::get('last_pag... | php | {
"resource": ""
} |
q20389 | ReportEngineController.reportList | train | public function reportList(Tree $tree, UserInterface $user): ResponseInterface
{
$title = I18N::translate('Choose a report to run');
return $this->viewResponse('report-select-page', [
| php | {
"resource": ""
} |
q20390 | DoHousekeeping.runHousekeeping | train | private function runHousekeeping(): void
{
$data_filesystem = app(FilesystemInterface::class);
$root_filesystem = new Filesystem(new Local(Webtrees::ROOT_DIR));
// Clear files in the (user-specified) data folder - which might not be local files
$this->housekeeping_service->deleteOld... | php | {
"resource": ""
} |
q20391 | FunctionsExport.convertMediaPath | train | private static function convertMediaPath($rec, $path): string
{
if ($path && preg_match('/\n1 FILE (.+)/', $rec, $match)) {
$old_file_name = $match[1];
// Don’t modify external links
if (strpos($old_file_name, '://') === false) {
// Adding a windows path? ... | php | {
"resource": ""
} |
q20392 | CalendarService.calendarMonthsInYear | train | public function calendarMonthsInYear(string $calendar, int $year): array
{
$date = new Date($calendar . ' ' . $year);
$calendar_date = $date->minimumDate();
$month_numbers = range(1, $calendar_date->monthsInYear());
$month_names = [];
foreach ($month_numbers as $m... | php | {
"resource": ""
} |
q20393 | CalendarService.getEventsList | train | public function getEventsList(int $jd1, int $jd2, string $events, bool $only_living, string $sort_by, Tree $tree): array
{
$found_facts = [];
$facts = [];
foreach (range($jd1, $jd2) as $jd) {
$found_facts = array_merge($found_facts, $this->getAnniversaryEvents($jd, $events... | php | {
"resource": ""
} |
q20394 | CalendarService.defaultAnniversaries | train | private function defaultAnniversaries(Builder $query, AbstractCalendarDate $anniv): void
{
if ($anniv->day() === 1) {
$query->where('d_day', '<=', 1);
| php | {
"resource": ""
} |
q20395 | CalendarService.adarIIAnniversaries | train | private function adarIIAnniversaries(Builder $query, JewishDate $anniv): void
{
if ($anniv->day() === 1) {
$query->where('d_day', '<=', 1);
} elseif ($anniv->day() === $anniv->daysInMonth()) {
$query->where('d_day', '>=', $anniv->daysInMonth());
} else {
$... | php | {
"resource": ""
} |
q20396 | CalendarService.nisanAnniversaries | train | private function nisanAnniversaries(Builder $query, JewishDate $anniv): void
{
if ($anniv->day === 1 && !$anniv->isLeapYear()) {
$query->where(static function (Builder $query): void {
$query->where(static function (Builder $query): void { | php | {
"resource": ""
} |
q20397 | ChartChildren.chartChildren | train | public function chartChildren(): string
{
$data = [
[
I18N::translate('Century'),
I18N::translate('Average number')
]
];
foreach ($this->queryRecords() as $record) {
$data[] = [
$this->century_service->centu... | php | {
"resource": ""
} |
q20398 | AbstractCensusColumnCondition.isChild | train | private function isChild(Individual $individual): bool
{
$age = Date::getAgeYears($individual->getEstimatedBirthDate(), | php | {
"resource": ""
} |
q20399 | AbstractCensusColumnCondition.isDead | train | private function isDead(Individual $individual): bool
{
return $individual->getDeathDate()->isOK() && | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.