This file contains 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
[TestMethod] | |
public void TestAUserWithoutRepShouldNotBeAbleToPropose() { | |
var user = GetLowRepUser(); | |
ShouldRaiseException<InsufficientRepException>(() => TagSynonym.ProposeSynonym(user, "f#", "f-sharp")); | |
} |
This file contains 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
select * from table | |
where 1 = 1 |
This file contains 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
Console.WriteLine("Hello World"); |
This file contains 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
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 |
This file contains 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
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 |
This file contains 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
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 */ |
This file contains 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
[TestMethod] | |
public void EnsurePrimaryKeyViolationsDontExplode() | |
{ | |
var user = GetPseudoMod(); | |
dynamic exposedUser = ExposedObject.From(user); | |
exposedUser.NotifyAbilities(user.AbilityTypeNotifications.Select(a => a.AbilityType)); | |
} |
This file contains 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.Text; | |
using System.Collections.Concurrent; | |
using System.Threading; | |
namespace ConsoleApplication1 | |
{ | |
class Program |
This file contains 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.Text; | |
using System.Data.SqlClient; | |
using System.Reflection.Emit; | |
using System.Collections.Concurrent; | |
using System.Data; | |
using System.Reflection; |
This file contains 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
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) |