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; | |
class Program | |
{ | |
sealed class EscapeContinuation<T> : Exception | |
{ | |
public T Value { get; private set; } | |
public void Raise(T value) | |
{ |
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
% problem 1.01 | |
my_last(X, [X]). | |
my_last(X, [_|TL]) :- my_last(X, TL). | |
% problem 1.02 | |
last_but_one(X, [X, _]). | |
last_but_one(X, [_,Y|TL]) :- last_but_one(X, [Y|TL]). | |
% problem 1.03 | |
element_at(X, [X|_], 1). |
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.Services.Client; | |
using System.Linq; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using JetBrains.Annotations; | |
namespace Blah | |
{ |
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; | |
static class Program { | |
static void Main() { | |
var xs = EnumerableEx.Create<int>(async yield => { | |
try { | |
await yield.Return(42); | |
} finally { |
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; | |
static class LiftingClosureToDelegateTarget { | |
static void Main() { | |
// normal lambda | |
{ | |
var str = GetString(); | |
Func<string> f = () => str; | |
Console.WriteLine(f()); | |
} |
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
static class BooleanSolver { | |
class T { | |
public static T operator |(T x, T y) => null; | |
public static T operator |(T x, F y) => null; | |
public static T operator &(T x, T y) => null; | |
public static F operator &(T x, F y) => null; | |
public static F operator !(T x) => null; | |
} | |
class F { |
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
class ReverseForLookupItem : ForLookupItemBase | |
{ | |
public ReverseForLookupItem([NotNull] PrefixExpressionContext context, | |
[NotNull] LiveTemplatesManager templatesManager, | |
[CanBeNull] string lengthPropertyName) | |
: base("forR", context, templatesManager, lengthPropertyName) { } | |
protected override IForStatement CreateStatement(CSharpElementFactory factory, ICSharpExpression expression) | |
{ | |
... |
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
class C | |
{ | |
void M(int[] xs) | |
{ | |
var firstTime = true; | |
foreach (var x in xs) | |
{ | |
// меня так раздражает тратить столько строк и целый блок на такую конструкцию | |
if (firstTime) | |
{ |
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; | |
public struct S { | |
int _value; | |
public S(int value) { _value = value; } | |
public int Value { get { return _value; } } | |
public void Mutate() { _value++; } | |
} | |
public class C { |
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
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> | |
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ExpressionIsAlwaysNull/@EntryIndexedValue">DO_NOT_SHOW</s:String> | |
</wpf:ResourceDictionary> |
OlderNewer