Skip to content

Instantly share code, notes, and snippets.

public class Solution
{
public int FindDuplicate(int[] nums)
{
var i1 = nums[0];
var i2 = nums[0];
do
{
i1 = nums[i1];
@kyrylomyr
kyrylomyr / PgsqlToPoco.cs
Last active November 26, 2019 08:35
PostgreSQL to C# POCO
void Main()
{
// 1. Generate CREATE TABLE command for the existing table.
// 2. Select only text with the columns definitions and copy to the Clipboard.
// 3. Run the code below. C# properties will be in the Clipboard.
var sql = Clipboard.GetText();
var exclusions = new[] { "primary key", "constraint .*", "unique" };
var typeMapping = new Dictionary<string, string>