This file contains hidden or 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
| /* | |
| references: | |
| - https://dev.mysql.com/doc/refman/5.7/en/insert-on-duplicate.html | |
| - https://stackoverflow.com/questions/32777081/bulk-insert-and-update-in-mysql | |
| - https://thewebfellas.com/blog/conditional-duplicate-key-updates-with-mysql | |
| */ | |
| /* create a new database and use it */ | |
| drop database if exists test_upsert; | |
| create database test_upsert; |
This file contains hidden or 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
| using Microsoft.VisualStudio.TestTools.UnitTesting; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| namespace Calculator | |
| { | |
| public class Position | |
| { | |
| public string Trader { get; set; } |
This file contains hidden or 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
| db.persons.insert( { fname : "John" , lname : "Doe", gender : "M" }) | |
| db.persons.insert( | |
| [ | |
| { fname : "Jane" , lname : "Doe", gender : "F" }, | |
| { fname : "James" , lname : "Bond", gender : "M", Age : 31 }, | |
| { fname : "Jack" , lname : "Daniel", Age : 24 }, | |
| ]) | |
| db.persons.find ( |
This file contains hidden or 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
| using System; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| namespace GenericTypeCollection | |
| { | |
| class Car |
This file contains hidden or 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
| using System; | |
| using System.Collections.Generic; | |
| using System.Data; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| namespace LambdaExpressionTraining | |
| { |
This file contains hidden or 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
| using System; | |
| using Microsoft.VisualStudio.TestTools.UnitTesting; | |
| using System.Diagnostics; | |
| namespace TopCoderBarclays | |
| { | |
| [TestClass] | |
| public class UnitTest1 | |
| { | |
| [TestMethod] |
This file contains hidden or 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
| IEnumerable<int[]> IterateWithReverse(int lower = 0, int upper = 10, int depth = 10, int[] slots = null) | |
| { | |
| if (slots == null) slots = new int[depth]; | |
| for (int i = lower; i < upper; i++) | |
| { | |
| slots[depth - 1] = i; | |
| if (depth > 1) | |
| foreach (var x in IterateWithReverse(lower, upper, depth - 1, slots)) yield return x; | |
| else |