Skip to content

Instantly share code, notes, and snippets.

View cheenamalhotra's full-sized avatar

Cheena Malhotra cheenamalhotra

View GitHub Profile
@cheenamalhotra
cheenamalhotra / HashBenchmark.java
Created June 8, 2018 23:25 — forked from ecki/HashBenchmark.java
JMH Test Crypt Hash Performance
package net.eckenfels.test.jmh;
import java.nio.ByteBuffer;
import java.security.InvalidKeyException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.concurrent.TimeUnit;
import javax.crypto.KeyGenerator;
@cheenamalhotra
cheenamalhotra / test770
Last active August 8, 2018 22:18
Issue 770 repro code
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;
public class test770 {
public static void main(String[] args) throws SQLException {
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
/**
* Setup Table with scripts:
*
* create table em_test (name varchar(max), startTime smalldatetime);
@cheenamalhotra
cheenamalhotra / git_cheat-sheet.md
Created September 16, 2019 04:42 — forked from davfre/git_cheat-sheet.md
git commandline cheat-sheet
@cheenamalhotra
cheenamalhotra / git.md
Created September 16, 2019 05:52
List of useful git commands when working with branches and forks

Summary of most useful 'git' commands

Setting up name and e-mail address

git config --global user.name "First Last"
git config --global user.email "myname@org.com"

Create a repository

@cheenamalhotra
cheenamalhotra / Program.cs
Created September 24, 2020 16:28
Test Token Acquire from MSAL library
using System;
using Microsoft.Identity.Client;
namespace TestMSAL
{
class Program
{
static void Main()
{
RunServicePincipalTest();
@cheenamalhotra
cheenamalhotra / TestTransactionLeak.cs
Created November 4, 2020 05:42
Test Transaction Leak - no repro
using System;
using System.Data.Common;
using System.Threading;
using System.Threading.Tasks;
using System.Data;
using Microsoft.Data.SqlClient;
namespace TestTransactionLeak
{
public class SqlContext : IDisposable, IAsyncDisposable
@cheenamalhotra
cheenamalhotra / TestOrderInQueue
Last active November 18, 2020 23:37
Ordered Queue for Async tasks using SemaphoreSlim
using System;
using System.Collections.Concurrent;
using System.Threading;
using System.Threading.Tasks;
public static class TestOrder
{
internal class ConcurrentQueueSemaphore
{
private readonly SemaphoreSlim _semaphore;
@cheenamalhotra
cheenamalhotra / Repro_422.cs
Created November 24, 2020 20:16
Repro for Issue #422
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Data.SqlClient;
namespace ManagedSNI
{
class _422
@cheenamalhotra
cheenamalhotra / 659_repro.cs
Last active February 10, 2021 19:36
Forced Repro of wrong data issue
using System;
using System.Data;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Data.SqlClient;
namespace AllManagedSNITests
{
class _659_repro
{