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
package com.experimental; | |
import java.util.Stack; | |
import nu.xom.Attribute; | |
import nu.xom.Document; | |
import nu.xom.Element; | |
import nu.xom.Elements; | |
import org.concordion.api.Evaluator; |
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.Collections.Generic; | |
using System.Linq; | |
using System; | |
using System.Security.Cryptography; | |
using System.Text; | |
namespace UnitTestProject8 | |
{ |
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 Newtonsoft.Json; | |
using Newtonsoft.Json.Linq; | |
using System.Linq; | |
// http://json.codeplex.com/ | |
// NUGET: install-package Newtonsoft.Json | |
// MY TIME: Millisecs = 0, Ticks = 588 (total 357 ms) | |
namespace Reto7 | |
{ |
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
import java.io.FileInputStream; | |
import java.io.FileOutputStream; | |
import java.io.PrintStream; | |
import java.util.Arrays; | |
import java.util.Scanner; | |
public class StudiousStudentWrong { | |
public static void main(String[] args) throws Exception { |
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.Diagnostics; | |
using System.Linq; | |
namespace Reto_6 | |
{ | |
[DebuggerDisplay("Count = {Count}, ActiveCount = {ActiveCount}")] | |
[DebuggerTypeProxy(typeof(CacheDebugView))] |
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.Collections.Generic; | |
using System.Linq; | |
namespace Reto5 | |
{ | |
public class DictionaryPlus<TK, TV> : Dictionary<TK, TV> | |
{ | |
public IEnumerable<TV> this[params TK[] keys] { | |
get { | |
return keys.Select(key => base[key]); |
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
/* | |
We are asked to give a random derangement: http://en.wikipedia.org/wiki/Derangement | |
We use a slight modification of Fisher-Yates shuffle algorithm to make sure it's a derangement. | |
This algoritm works because all elements are moved one or more times to the left so at the end | |
all elements are in different positions than the original one. | |
But with this modification, random properties are not great. For example some permutations are more | |
likely than others, and there are some permutatations which can never happen. |
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.Linq; | |
using System.Linq.Expressions; | |
using Dict = System.Collections.Generic.Dictionary<string, System.Delegate>; | |
using Pair = System.Collections.Generic.KeyValuePair<string, string>; | |
namespace ObjectDumper | |
{ | |
public class ObjectDumper<T> where T: class |
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
// Leo Antoli solution to reto 2 MSDN using add and remove: http://blogs.msdn.com/b/esmsdn/archive/2014/09/19/retosmsdn-reto-2-161-esos-eventos.aspx | |
// NOTE: It's not thread-safe, locking should be added. | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace Reto2ClassLibrary | |
{ |
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
// Leo Antoli solution to reto 2 MSDN: http://blogs.msdn.com/b/esmsdn/archive/2014/09/19/retosmsdn-reto-2-161-esos-eventos.aspx | |
using System; | |
using System.Linq; | |
namespace Reto2ClassLibrary | |
{ | |
public class Reto2 : IReto2 | |
{ | |
public event EventHandler EventFired; |
NewerOlder