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
bonferroni.holm <- function(pValues, alpha=0.05, sidak=FALSE) { | |
pOrders <- order(pValues) | |
unadjusted.p <- pValues[pOrders] | |
undoOrder = order(pOrders) | |
m <- rev(rank(unadjusted.p, ties.method = "min")) | |
if (sidak) { | |
adjusted.alpha <- 1 - (1 - alpha) ^ (1 / m) | |
adjusted.p <- 1 - (1 - unadjusted.p) ^ m | |
} else { | |
adjusted.alpha <- alpha / m |
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
// taken from https://stackoverflow.com/questions/71222556/how-to-convert-any-of-the-5-islamic-hijri-calendars-dates-to-any-of-18-world | |
// watch the temporal ECMAscript proposal which will make much of this obsolete - https://github.com/tc39/proposal-temporal | |
const formatters = {} | |
function getFormatter (calendar) { | |
const locale = 'en-u-ca-' + calendar | |
let returnFormatter = formatters[locale] | |
if (returnFormatter) return returnFormatter | |
const support = ['islamic-umalqura', 'islamic-civil', 'islamic-tbla', 'islamic-rgsa', 'islamic'] | |
if (!support.includes(calendar)) throw new Error(`calendar must be one of '${support.join("', '")}'`) |
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
-- ============================================= | |
-- Author: Brent McSharry | |
-- Create date: Aug 2020 | |
-- Description: Any periods off respiratory support OR with less respiratory support | |
-- (i.e. lower resp support = having a higher integer categorisation EPI_CAT) | |
-- which lasts for less than 24 hours, results in the episodes with greater | |
-- levels of support coalescing into a single episode | |
-- ============================================= | |
CREATE FUNCTION [dbo].[ANZICSEpisodeSubmissionFields] | |
( |
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
CREATE Function [dbo].[StripNonAlphaCharacters](@Temp VarChar(50)) | |
Returns VarChar(50) | |
AS | |
Begin | |
Declare @KeepValues as varchar(50) | |
Set @nonAlphaRegex = '%[^a-zA-Z]%' | |
While PatIndex(@nonAlphaRegex, @Temp) > 0 | |
Set @Temp = Stuff(@Temp, PatIndex(@nonAlphaRegex, @Temp), 1, '') | |
Return @Temp | |
End |
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
using NHIValidation; | |
using System.Collections.Generic; | |
using Xunit; | |
using Xunit.Abstractions; | |
namespace TestNhi | |
{ | |
public class NHIValidationUnitTests | |
{ | |
private readonly ITestOutputHelper _output; |
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
# see http://hedwig.mgh.harvard.edu/biostatistics/node/30 for the original paper and an excel spreadsheet with macros | |
# the spreadsheet does much the same in VBA, but with considerably more code | |
# unlike the vba spreadsheet, this also takes into acount the fraction of age in years at entry and exit (in creating per patient risk) | |
# if the age is greater than the maximum data (101 years old), each subsequent year is a repeat of the final annual risk available | |
library(survival) | |
oneSampleSurvival <- function(df, description) { | |
# NZ data between 0 and 100 for each year | |
# 10 years of population and death data was averaged (2009-2018) for each year of age until 89 years old | |
# data is then repeated in 5 yearly blocks as more granular data was hard to obtain |
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
if (!HTMLFormElement.prototype.requestSubmit) { | |
HTMLFormElement.prototype.requestSubmit = function() { | |
const submitBtn = document.createElement('input'); | |
submitBtn.type = 'submit'; | |
submitBtn.hidden = true; | |
this.appendChild(submitBtn); | |
submitBtn.click(); | |
this.removeChild(submitBtn); | |
}; | |
} |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>svg markup offset</title> | |
</head> | |
<body> | |
<form> | |
<label> | |
add to x |
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
namespace MyMvcApp.Controllers | |
{ | |
public class HomeController : Controller | |
{ | |
[HttpPost] | |
[ValidateAntiForgeryToken] | |
public async Task<ActionResult> ContactSubmit( | |
[Bind(Include = "FromName, FromEmail, FromPhone, Message, ContactId")] | |
ContactViewModel model) | |
{ |