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
<div class="form-group"> | |
<label class="col-md-4 control-label" for="plate">Plate</label> | |
<div class="col-md-4"> | |
<input pattern="/^(0[1-9]|[1-7][0-9]|8[01])(([A-PR-VYZ])(\d{4,5})|([A-PR-VYZ]{2})(\d{3,4})|([A-PR-VYZ]{3})(\d{2,3}))$/" | |
minlength="7" maxlength="8" id="plate" name="plate" type="text" placeholder="ex:35GS1905" class="form-control" required> | |
</div> | |
</div |
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 | |
if (!function_exists('write_contents_as_php_array_into_file')) { | |
/** | |
* Writes the contents of given string/object/array to the file in php array format. | |
* | |
* @param mixed $contents | |
* @param bool $die | |
* @return string | |
*/ |
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
load fisheriris | |
onetohundred = [ | |
0.01; | |
0.02; | |
0.03; | |
0.04; | |
0.05; | |
0.06; | |
0.07; |
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
<? | |
/** | |
* @param array $a | |
* @param bool $sample | |
* @return false|float | |
*/ | |
public function calculateStandardDeviationSample(array $a, $sample = true) | |
{ | |
$n = count($a); |
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 calcCurve(): void | |
{ | |
// might take a while, preferred way is to add this to ini | |
ini_set('max_execution_time', 600); | |
$years = [ | |
'2006', | |
'2007', |
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
<? | |
// From 2006 to 2019 | |
$years = config('years'); | |
// Get All normal distribution records of bankrupted companies for selected Country | |
$allBankruptedCompaniesCount = NormalDistribution::join('companies AS c', 'company_id', '=', 'c.id') | |
->where('c.country', '=', 'UK') | |
->where('c.bankrupted', '=', 'yes') | |
->get()->unique('company_id') | |
->count(); |
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
<? | |
// Get all book asset records for given country and type (unlisted and bankrupted companies only) | |
$allUnlistedAssets = BookAsset::join('companies AS c', 'company_id', '=', 'c.id') | |
->where('c.type', '=', 'unlisted') | |
->where('c.country', '=', 'COUNTRY_NAME_HERE') | |
->where('c.bankrupted', '=', 'yes') | |
->get(); | |
// Sort them by their value's descending order |
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
<? | |
/** | |
* @param mixed $search | |
* @param array $arr | |
* @return mixed|null | |
*/ | |
public function getClosestNumber($search, array $arr) | |
{ | |
$closest = null; |
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
<? | |
$years = config('years'); | |
$companies = Company::where('bankrupted', 'yes')->where('country', 'COUNTRY_NAME_HERE')->where('type', 'unlisted')->get(); | |
foreach ($years as $year) { | |
foreach ($companies as $company) { | |
if (AssetMatch::where('unlisted_company_name', $company->name) | |
->where('year', $year)->exists()) { | |
$marketCapitalization = AssetMatch::where('unlisted_company_name', $company->name) |
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
<? | |
/** | |
* @param mixed $y | |
* @return string | |
*/ | |
public function normDistInv($y) | |
{ | |
// Load tabulated values in an array | |
$values = config('table'); | |
// Discriminate upon whether $y is between 0 and 1, then upon its position relative to 0.5 |
OlderNewer