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
Importing data: | |
--------------- | |
readr (flat files) | |
exell (excel files) | |
haven (foreign data formats) | |
Data processing | |
--------------- | |
tydyr | |
dplyr |
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
'//Name : AttachDSNLessTable | |
'//Purpose : Create a linked table to SQL Server without using a DSN | |
'//Parameters | |
'// stLocalTableName: Name of the table that you are creating in the current database | |
'// stRemoteTableName: Name of the table that you are linking to on the SQL Server database | |
'// stServer: Name of the SQL Server that you are linking to | |
'// stDatabase: Name of the SQL Server database that you are linking to | |
'// stUsername: Name of the SQL Server user who can connect to SQL Server, leave blank to use a Trusted Connection | |
'// stPassword: SQL Server user password |
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
# Diagnostic plots | |
diagPlots <- function(model){ | |
p1 <- ggplot(model, aes(.fitted, .resid)) + | |
geom_point() + | |
stat_smooth(method = "loess") + | |
geom_hline(yintercept = 0, col="red", linetype = "dashed") + | |
xlab("Fitted values") + | |
ylab("Residuals") + | |
ggtitle("Residual vs Fitted Plot") + | |
theme_bw() |
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
{ | |
$match: { | |
createdAt: { | |
$gte: fromDate.toISOString() | |
} | |
} | |
}, | |
{ | |
"$project" : |
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 | |
geometry::UnionAggregate (Boundaries).STEnvelope().STPointN(1).STX as xmin, | |
geometry::UnionAggregate (Boundaries).STEnvelope().STPointN(3).STX as xmax, | |
geometry::UnionAggregate (Boundaries).STEnvelope().STPointN(1).STY as ymin, | |
geometry::UnionAggregate (Boundaries).STEnvelope().STPointN(3).STY as ymax | |
FROM [GIS].[BOUNDARIES].[PoliceTownsAndVillages] | |
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 | |
ROW_NUMBER() OVER (Order by (select 0)) AS RowNumber, | |
(CASE WHEN CONVERT(INT, (ROW_NUMBER() OVER (ORDER BY (SELECT 0)) % 16)) = 0 THEN 0 ELSE 1 END) + CONVERT(INT, (ROW_NUMBER() OVER (ORDER BY (SELECT 0)) / 16)) as PageGroup, | |
(CASE WHEN CONVERT(INT, (ROW_NUMBER() OVER (ORDER BY (SELECT 0)) % 8)) = 0 THEN 0 ELSE 1 END) + CONVERT(INT, (ROW_NUMBER() OVER (ORDER BY (SELECT 0)) / 8)) as RowGroup, | |
* | |
FROM <<TABLE>> |
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
USE [ReportServer]; | |
GO | |
SELECT USR.UserName AS SubscriptionOwner | |
,SUB.ModifiedDate | |
,SUB.[Description] | |
,SUB.EventType | |
,SUB.DeliveryExtension | |
,SUB.LastStatus | |
,SUB.LastRunTime |
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 | |
DB_NAME(dbid) as DBName, | |
COUNT(dbid) as NumberOfConnections, | |
loginame as LoginName | |
FROM | |
sys.sysprocesses | |
WHERE | |
dbid > 0 | |
GROUP BY | |
dbid, loginame |
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
$site = Get-SPSite http://urltofreakinlockedsite/ | |
$site.GetType().GetProperty(“MaintenanceMode”).GetSetMethod($true).Invoke($site, @($false)) |
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 name, default_version, installed_version, left(comment,30) As comment | |
FROM pg_available_extensions | |
WHERE installed_version IS NOT NULL | |
ORDER BY name; |
OlderNewer