Software engineering

C Sharp

DotNet SDK The even version-numbers are the LTS(long term support) versions. For big projects its good to stick to the latest even .Net version. Only opt fo...

Entity Framework

Setup After you defined your DB context you can run these commands:

Linq

Get first match List<int> numbers = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; int result = numbers.FirstOrDefault(n => n > 5);

Sample Code

Get random strings of length between min and max ```` public static string GenerateRandomString(int minLength, int maxLength) { var random = ...

Ms Sql Server

Fresh installation To work with MS SQL database locally, the easiest way is to run SQL Server 2019 Express or SQL Server 2019 Developer edition locally. The ...

Transactsql

SELECT COUNT SELECT COUNT(*) FROM WITH (NOLOCK)

Azure Devops

Pipeline runs: pull requests can require (via branch policy: Build Validation) builds to happen before they can be merged.

Enums

Check if your variable is part of enum values Stream.of(MyEnum.values()).anyMatch(v -> v.name().equals(strValue))

Java Collections

List Create and init List List<String> ids = List.of("Id1","Id2");

Java Profiling

VisualVM Download VisualVM (doesn’t need to be installed) and run it. Run the java application In VisualVM, you should see started application under “...

Java

Create Test via IntelliJ First you need declare the test-folder as Test Sources Root

Spring

Spring basic 3 tier pattern You can split your application into 3 layers:

Stream

String dataScopes = stream(InstructionType.values()) .filter(party::getInstruction) .map(Enum::name) .collect...

Encoding

https://www.joelonsoftware.com/2003/10/08/the-absolute-minimum-every-software-developer-absolutely-positively-must-know-about-unicode-and-character-sets-no-e...

Authentication

SAML 2.0 Open standard for passing authentication and authorization information between three actors: the principal the service provider the identity ...

Dns

CNAME and A DNS entries An A (Address) record maps a domain name to an IP address. A CNAME (Canonical Name) record maps a domain name to another domain name....

Https

TLS facts Even if you don’t understand how it really works, you can assume following points are true:

Troubleshooting

Who the internet see me Useful website to test local area network from outside (does port forwarding works?): https://canyouseeme.org/

Builder Pattern Java

This creates an immutable object which can only be created via a builder object. This is nicer than put everything into a constructor.

Observer Pattern Csharp

https://learn.microsoft.com/en-us/dotnet/standard/events/how-to-raise-and-consume-events#example-2

Software Patterns

Builder If you want to instantiate a specific class with a lot of constructor parameters, or the class should be immutable, the builder pattern encapsulates...

Solid

SOLID Single Responsibility principle Open closed principle Liksov substitution principle Interface segregation Dependency inversion principle

Testing

Test comments Include these comments to structure the testcase. //given //when //then

React

React-scripts If you have a username with spaces on windows, you will have a hardtime to setup a react-script project.

Cwe 80

To prevent Cross-Site Scripting attacks on outbound: https://docs.veracode.com/r/Supported_Java_Cleansing_Functions