Skip to content

Instantly share code, notes, and snippets.

[TestMethod]
public void TestAUserWithoutRepShouldNotBeAbleToPropose() {
var user = GetLowRepUser();
ShouldRaiseException<InsufficientRepException>(() => TagSynonym.ProposeSynonym(user, "f#", "f-sharp"));
}
select * from table
where 1 = 1
Console.WriteLine("Hello World");
select b.Id as BadgeId, b.Name as BadgeName, u.UserId, p.Id as PostId, pv.CreationDate
into #upvotes
from Badges b
join Users2Badges u on u.BadgeId = b.Id
join Posts p on p.OwnerUserId = u.UserId and p.CommunityOwnedDate is null and p.DeletionDate is null
join Posts2Votes pv on pv.DeletionDate is null and pv.PostId = p.Id and pv.VoteTypeId = 2
join PostTags pt on pt.Tag = b.Name and p.ParentId = pt.PostId
where Class = 3 and TagBased = 1
go
rep.Value = AppSettings.Reputation.NeededForAbility.ModerationTools; id.Value = ModerationTools.Id; cmd.ExecuteNonQuery();
rep.Value = AppSettings.Reputation.NeededForAbility.CloseQuestion; id.Value = CloseQuestion.Id; cmd.ExecuteNonQuery();
rep.Value = AppSettings.Reputation.NeededForAbility.PostEditing; id.Value = PostEditing.Id; cmd.ExecuteNonQuery();
rep.Value = AppSettings.Reputation.NeededForAbility.VoteCounts; id.Value = VoteCounts.Id; cmd.ExecuteNonQuery();
rep.Value = AppSettings.Reputation.NeededForAbility.CloseOwnQuestion; id.Value = CloseOwnQuestion.Id; cmd.ExecuteNonQuery();
rep.Value = AppSettings.Reputation.NeededForAbility.PostCommenting; id.Value = PostCommenting.Id; cmd.ExecuteNonQuery();
rep.Value = AppSettings.Reputation.NeededForAbility.CommunityPostEditing; id.Value = CommunityPostEditing.Id; cmd.ExecuteNonQuery();
rep.Value = AppSettings.Reputation.NeededForAbility.TagEditi
select *
into #ElightenedReasons
from (select a.OwnerUserId as UserId,
a.Id as ReasonId
from Posts a with (nolock)
where a.PostTypeId = 2
and a.DeletionDate is null
and a.OwnerUserId is not null
and a.Score >= 10
and exists (select 1 /* question owner cannot own accepted answer */
[TestMethod]
public void EnsurePrimaryKeyViolationsDontExplode()
{
var user = GetPseudoMod();
dynamic exposedUser = ExposedObject.From(user);
exposedUser.NotifyAbilities(user.AbilityTypeNotifications.Select(a => a.AbilityType));
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Concurrent;
using System.Threading;
namespace ConsoleApplication1
{
class Program
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Reflection.Emit;
using System.Collections.Concurrent;
using System.Data;
using System.Reflection;
Unhandled Exception: System.FormatException: Input string was not in a correct f
ormat.
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffe
r& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo in
fo)
at ServiceStack.Text.Common.DeserializeBuiltin`1.<GetParseFn>b__4(String valu
e)
at ServiceStack.Text.Common.JsReader`1.<>c__DisplayClass6`1.<GetParseFn>b__3(
String value)