joubin's Kardz


COL_LENGTH

Returns the table's column length in bytes:

COL_LENGTH ( 'table' , 'column' )

References:

https://docs.microsoft.com/en-us/sql/t-sql/functions/col-length-transact-sql

Shared by joubin on Wed Apr 29 2020

Using MSI for debugging in Visual Studio

To debug against Azure (e.g. getting access to Key Vault etc.) configure Visual Studio to use the account with which it uses to send credentials to Azure.

This configuration is under: Options => Azure Service Authentication => Account Selection

References:

https://docs.microsoft.com/en-us/azure/azure-app-configuration/howto-integrate-azure-managed-service-identity?tabs=core2x

https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview

Shared by joubin on Fri Apr 17 2020

Azure Data Factory Trigger files

The trigger files are stored in a location similar to:

/common/workflows/datafactory/trigger/*.json

Each trigger has the following information:

  • the schedule/condition defintion
  • a collection of pipelines references

References:

https://docs.microsoft.com/en-us/azure/data-factory/concepts-pipeline-execution-triggers#schedule-trigger-definition

Shared by joubin on Fri Apr 03 2020

Roslyn & RyuJIT

Roslyn

  • The .NET Platform Compiler i.e. compiles your C# (etc) code into IL
  • Has a public API e.g. could be included in your app to compile other code on-the-fly

RyuJIT

  • Compiles the Roslyn generated IL into native code (only x64)
  • No public API available

Shared by joubin on Thu Apr 02 2020

tracert, Windows

The TRACERT diagnostic utility determines the route to a destination by sending Internet Control Message Protocol (ICMP) echo packets to the destination.

References:

https://support.microsoft.com/en-ca/help/314868/how-to-use-tracert-to-troubleshoot-tcp-ip-problems-in-windows

Shared by joubin on Tue Mar 31 2020

.NET Portability Analyzer

The .NET Portability Analyzer is an open source tool that is utitlized to analyze assemblies, files or directory of files for compatibility across .NET implementations.

This tool reports on the compatibility of the current app across .NET implementations.

It comes as:

  1. Visual Studio Extension - analyzes individual assemblies/projects or the solution
  2. A console app (ApiPort) - analyzes assemblies/files/directories

References:





Shared by joubin on Fri Sep 06 2019

Debugging modes, VS Code

In VS Code, there are two core debugging modes, Launch and Attach.

  1. Starting in the browser
    • When you open DevTools in a browser, you are attaching DevTools to the open browser tab.
  2. Starting in the code editor
    • The editor launches your process, and it automatically attaches its debugger to the newly launched process.

References:

Shared by joubin on Fri Aug 09 2019

Launch Configuration, VS Code

A configuration file allows you to configure and save debugging setup details.

VS Code keeps debugging configuration information in a launch.json file located in a .vscode folder in your workspace (project root folder)

References:

Shared by joubin on Fri Aug 09 2019

Angular Framework app version

1. ng --version (or ng v)

2. Open Developer Tools in the browser. Under the 'Elements' tab, look for html/body/app-root[ng-version]

3. To render the Angular version on a page, import VERSION from @angular/cli.

const version = VERSION.full;







Shared by joubin on Wed Jul 31 2019

Prune/Cleanup the local references to remote branch

Dry-run: The command git remote prune origin --dry-run lists branches that can be deleted/pruned on your local.

To remove the local remove '--dry-run'.

References:

Shared by joubin on Mon Jun 03 2019

OData - Querying Data

$filter: The expression specified with $filter is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response.

serviceRoot/People?$filter=FirstName eq 'Scott'

$orderby: The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc.

serviceRoot/People('scottketchum')/Trips?$orderby=EndsAt desc

$count: The $count system query option allows clients to request a count of the matching resources included with the resources in the response.

serviceRoot/People/$count

$select: The $select system query option allows the clients to requests a limited set of properties for each entity

serviceRoot/Airports?$select=Name, IcaoCode

$top & $skip: The $top system query option requests the number of items in the queried collection to be included in the result. The $skip query option requests the number of items in the queried collection that are to be skipped and not included in the result.

serviceRoot/People?$top=2

$expand: The $expand system query option specifies the related resources to be included in line with retrieved resources.

serviceRoot/People('keithpinckney')?$expand=Friends

Supporting multiple filters:

Use the and/or operators to apply multiple filters.

References:

http://www.odata.org/getting-started/basic-tutorial

Shared by joubin on Fri Jun 23 2017

Theory attribute, xUnit

Marks a test method as being a data theory.

Data theories are tests which are fed various bits of data from a data source, mapping to parameters on the test method.

If the data source contains multiple rows, then the test method is executed multiple times (once with each data row). Data is provided by attributes which derive from Xunit.Sdk.DataAttribute:

  • Xunit.InlineDataAttribute
  • Xunit.MemberDataAttribute

References:

https://github.com/xunit/xunit

Shared by joubin on Thu May 16 2019

Content-Disposition, Http Header

The Content-Disposition response-header field has been proposed as a means for the origin server to suggest a default filename if the user requests that the content is saved to a file.

Example:

Content-Disposition: attachment; filename="fname.csv"

Note: In the context of a CORS request, use the Access-Control-Expose-Headers Http header to expose Content-Disposition as a header value.

References:

https://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html

Shared by joubin on Thu May 16 2019

CORS related headers

All CORS related headers are prefixed with "Access-Control-".

Access-Control-Allow-Origin
Access-Control-Allow-Credentials
Access-Control-Expose-Headers

References:

https://www.html5rocks.com/en/tutorials/cors/

Shared by joubin on Thu May 16 2019

Azure Security Center

Azure Security Center (ASC) is a monitoring service that provides threat protection across all of your services both in Azure, and on-premises.

ASC is part of the Center for Internet Security (CIS) recommendations.

References:

https://docs.microsoft.com/en-us/learn/modules/top-5-security-items-to-consider/2-azure-security-center

Shared by joubin on Mon May 13 2019

Center for Internet Security

The Center for Internet Security (CIS) is a nonprofit organization, formed in October, 2000.

Its mission is to "identify, develop, validate, promote, and sustain best practice solutions for cyber defense and build and lead communities to enable an environment of trust in cyberspace".

The organization is headquartered in East Greenbush, New York, with members including large corporations, government agencies, and academic institutions.

References:

https://en.wikipedia.org/wiki/Center_for_Internet_Security

Shared by joubin on Mon May 13 2019

SIEM, Security

Security information and event management (SIEM) software products and services combine security information management (SIM) and security event management (SEM). They provide real-time analysis of security alerts generated by applications and network hardware.

Vendors sell SIEM as software, as appliances or as managed services; these products are also used to log security data and generate reports for compliance purposes.

See also:

SIM - Security Information Management

SEM - Security Event Management

References:

https://en.wikipedia.org/wiki/Security_information_and_event_management

Shared by joubin on Mon May 13 2019

Global Error Handling, Angular

Create a class that implements ErrorHandler.

It has one method needs implementing: handleError 

References:

https://angular.io/api/core/ErrorHandler

Shared by joubin on Mon May 13 2019

Http Interception, Angular

You declare a class as an interceptor in Angular by implementing the HttpInterceptor interface.

An interceptor will transform the client requests and responses from the server.

References:

https://angular.io/guide/http#intercepting-requests-and-responses

Shared by joubin on Wed May 08 2019

Anaconda

Anaconda is a Python distribution that comes pre-installed with many data science related libraries.

References:

Shared by joubin on Sat Jun 03 2017