I hereby claim:
- I am NickCraver on github.
- I am nickcraver (https://keybase.io/nickcraver) on keybase.
- I have a public key whose fingerprint is 9854 D2C3 4BEF 984F 7310 DC97 A163 F138 E6C1 87DF
To claim this, I am signing this object:
void Main() | |
{ | |
var child = new Child(); | |
child.Prop = false; | |
child.Prop.Dump(); | |
var propertyInfo = typeof(Child).GetProperty(nameof(Child.Prop)); | |
propertyInfo.GetGetMethod().Dump(); | |
propertyInfo.GetSetMethod().Dump(); | |
} | |
public class Base |
// Here's a normal query as you'd expect | |
db.QuerySingleOrDefault<PostCacheEntry>(@"SELECT | |
(Select Count(*) From Posts Where PostTypeId = @Question And DeletionDate Is Null) TotalQuestions, | |
(Select Count(*) From Posts Where PostTypeId = @Question And IsNull(IsAnswered, 0) = 0 And AcceptedAnswerId Is Null And ClosedDate Is Null And DeletionDate Is Null) TotalUnanswered, | |
(Select Count(*) From Posts Where PostTypeId = @Question And AcceptedAnswerId Is Not NulL And DeletionDate Is Null) TotalAccepted, | |
(Select Count(*) From Posts Where PostTypeId = @Answer And DeletionDate Is Null) TotalAnswers", | |
new { PostTypeId.Question, PostTypeId.Answer }); | |
// In this case though, PostTypeId.Question and PostTypeId.Answer are values that never change. | |
// In this case they're constants, but this same trick works for enums. |
var tb = AppDomain.CurrentDomain | |
.DefineDynamicAssembly(new AssemblyName("Test"), AssemblyBuilderAccess.Run) | |
.DefineDynamicModule("DM") | |
.DefineType("Type with spaces in the name", TypeAttributes.Public); | |
tb.DefineField("Is💩Post", typeof(bool), FieldAttributes.Public); | |
var spt = tb.CreateType(); | |
this.Connection.QueryFirstOrDefault(spt, "Select 1 as [Is💩Post]").Dump(); |
void Main() | |
{ | |
var c = new DbColumn() { ColumnName = "test" }; | |
var sw = Stopwatch.StartNew(); | |
for (var i = 0; i < 10000000; i++) | |
{ | |
var test = c["ColumnName"]; | |
} | |
sw.Stop(); | |
sw.ElapsedMilliseconds.Dump(); |
I hereby claim:
To claim this, I am signing this object:
void Main() { } | |
public class DbColumn | |
{ | |
private readonly Dictionary<string, object> _customValues = new Dictionary<string, object>(); | |
public virtual bool AllowDBNull { get; set; } | |
public virtual string BaseCatalogName { get; set; } | |
public virtual string BaseColumnName { get; set; } | |
public virtual string BaseSchemaName { get; set; } | |
public virtual string BaseServerName { get; set; } |
# Simple script to remove the Windows 10 "Nag" Updates and telemetry additions for Windows 7 & 8 users | |
# This will uninstall the updates and hide them, preventing installation in the future | |
# Note: MUST BE RUN AS ADMINISTRATOR, setting updates to hidden requires admin permissions | |
# Updates removed: | |
# KB3035583 - Update installs Get Windows 10 app in Windows 8.1 and Windows 7 SP1 | |
# https://support.microsoft.com/en-us/kb/3035583 | |
# KB2952664 - Compatibility update for upgrading Windows 7 | |
# https://support.microsoft.com/en-us/kb/2952664 | |
# KB2976978 - Compatibility update for Windows 8.1 and Windows 8 | |
# https://support.microsoft.com/en-us/kb/2976978 |
<?xml version="1.0" encoding="utf-16"?> | |
<ShowPlanXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.2" Build="11.0.5343.0" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan"> | |
<BatchSequence> | |
<Batch> | |
<Statements> | |
<StmtSimple StatementCompId="1" StatementEstRows="1" StatementId="1" StatementOptmLevel="FULL" StatementSubTreeCost="162.511" StatementText="Select Count(*)
 From InterfaceTraffic" StatementType="SELECT" QueryHash="0x9DA8413D2DA45AE8" QueryPlanHash="0xDCB2FBECB646294A" RetrievedFromCache="true"> | |
<StatementSetOptions ANSI_NULLS="true" ANSI_PADDING="true" ANSI_WARNINGS="true" ARITHABORT="true" CONCAT_NULL_YIELDS_NULL="true" NUMERIC_ROUNDABORT="false" QUOTED_IDENTIFIER="true" /> | |
<QueryPlan DegreeOfParallelism="24" MemoryGrant="51280" CachedPlanSize="512" CompileTime="766" CompileCPU="765" CompileMemory="15912"> | |
<ThreadStat Branches="2" UsedThreads="48"> | |
< |
string.Concat(): 3011 ms | |
string.Format(): 18337 ms | |
string.Concat(): 2885 ms | |
string.Format(): 18312 ms |
C:\DNXTest\Client\runtimes\dnx-coreclr-win-x86.1.0.0-beta8\bin>dnx | |
The default servicing root does not exist. | |
Loaded module: dnx.win32.coreclr.dll | |
Found export: CallApplicationMain | |
Failed to start CLR host |