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
{ | |
"value":3.722785, | |
"description":"weight(services.Phone.freeCalls.Daytime:T in 2786) [PerFieldSimilarity], result of:", | |
"details":[ | |
{ | |
"value":3.722785, | |
"description":"score(doc=2786,freq=1.0 = termFreq=1.0 ), product of:", | |
"details":[ | |
{ | |
"value":0.51985043, |
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
### Keybase proof | |
I hereby claim: | |
* I am kstenson on github. | |
* I am kstenson (https://keybase.io/kstenson) on keybase. | |
* I have a public key whose fingerprint is RETU RN T HIS. PGP. GET_ FING ERPR INT( ); | |
} | |
To claim this, I am signing this object: |
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
public static class ObjectExtensions | |
{ | |
public static IEnumerable<Change> Diff<T>(this T obj1, T obj2) | |
{ | |
PropertyInfo[] properties = typeof(T).GetProperties(); | |
List<Change> changes = new List<Change>(); | |
foreach (PropertyInfo pi in properties) | |
{ | |
object value1 = typeof(T).GetProperty(pi.Name).GetValue(obj1, null); |
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
public class MvcApplication : NinjectHttpApplication | |
{ | |
protected void RegisterRoutes(RouteCollection routes) | |
{ | |
routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); | |
routes.MapRoute( | |
"Default", // Route name | |
"{controller}/{action}/{id}", // URL with parameters | |
new |
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
$(document).on("click mousedown mouseup focus blur keydown change",function(e){ | |
console.log(e); | |
}); |
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
-- disable all constraints | |
EXEC sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all" | |
-- delete data in all tables | |
EXEC sp_MSForEachTable "DELETE FROM ?" | |
-- enable all constraints | |
exec sp_msforeachtable "ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all" |
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
namespace MC.Bureau.Adaptation.Service | |
{ | |
public class HealthMonitor :IWantToRunAtStartup | |
{ | |
private string url = "http://localhost:8081/"; | |
private Server _server; | |
private HealthMonitorHub _healthMonitor; | |
public ITransport Transport { get; set; } | |
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
//this class registers the two interceptors in the container with a name for each | |
public class InterceptorsModule: Module | |
{ | |
protected override void Load(ContainerBuilder builder) | |
{ | |
builder.Register(x => new LoggingInterceptor()).Named<IInterceptor>("Logger"); | |
builder.Register(x => new TimingInterceptor()).Named<IInterceptor>("Timing"); | |
} | |
} |
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
builder.RegisterModule(new DataModule() | |
{ | |
AssemblyMapper = typeof(AcquireConfig).Assembly, | |
BuildSchema = true, | |
ConnectionString = Properties.Settings.Default.DataAcquisitionStoreConnection, | |
Web = false | |
}); | |
public class DataModule : Module | |
{ |
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
public class LoggingInterceptor: IInterceptor | |
{ | |
private static readonly ILog Logger = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | |
public void Intercept(IInvocation invocation) | |
{ | |
try | |
{ | |
StringBuilder sb = null; |
NewerOlder