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
<?xml version="1.0" encoding="utf-8"?> | |
<log4net debug="false"> | |
<appender name="file-appender" type="log4net.Appender.FileAppender+MinimalLock"> | |
<file value="log-file.txt" /> | |
<appendToFile value="true" /> | |
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" /> | |
<layout type="log4net.Layout.PatternLayout"> | |
<conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" /> | |
</layout> | |
</appender> |
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; | |
using System.Web; | |
using System.Web.Mvc; | |
using log4net; | |
namespace MyApp.Web.Controllers | |
{ | |
public class ClientLogController : Controller |
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
function LogEvent(level, message) | |
{ | |
// Default to WARN level if level is not specified. Since we | |
// are not dependent upon the result of the logging, we leave | |
// the data return function empty. | |
level = level || "Warn"; | |
$.ajax({ | |
url: "/ClientLog/Log" + level + "Event", | |
type: "POST", |
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
// After applying the transform to the cities, redraw them at their new coordinates | |
// Select all cities with a prefix that matches the Id of the state selected. | |
var citySelector = "*[id^='city_" + stateId.substring(0, 2) + "']"; | |
d3.selectAll(citySelector) | |
.each(function (d, i) { | |
var jurisdictionId = d3.select(this).attr("data-id"); | |
d3.select("#cities") | |
.append("svg:circle") |
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
function CalculateStarPoints(centerX, centerY, arms, outerRadius, innerRadius) | |
{ | |
var results = ""; | |
var angle = Math.PI / arms; | |
for (var i = 0; i < 2 * arms; i++) | |
{ | |
// Use outer or inner radius depending on what iteration we are in. | |
var r = (i & 1) == 0 ? outerRadius : innerRadius; |
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
// Thank you StackOverflow!!! | |
// http://stackoverflow.com/questions/7099938/jquery-ui-dialog-behaves-unpredictably | |
var original = $('#dialogId')[0]; | |
var clone = $(original).clone().attr('id', 'dialogIdClone'); | |
var saveHtml = $(original).html(); | |
$(original).html(''); | |
$(clone).dialog({ | |
... // other options | |
open: function (){ | |
// add any dynamic behavior you need to the dialog here |
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
"C:\Program Files (x86)\IIS Express\appcmd.exe" set config /section:system.webServer/fastCGI /+[fullPath='"C:\Program Files (x86)\PHP\php-cgi.exe"'] | |
"C:\Program Files (x86)\IIS Express\appcmd.exe" set config /section:system.webServer/handlers /+[name='PHP_via_FastCGI',path='*.php',verb='*',modules='FastCgiModule',scriptProcessor='"C:\Program Files (x86)\PHP\php-cgi.exe"',resourceType='Unspecified'] |
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
public class SearchParameter | |
{ | |
public string Name { get; set; } | |
public string Criteria { get; set; } | |
public string VariableName { get; set; } | |
public string ParameterName { get; set; } | |
public string ParameterType { get; set; } | |
public string VariableNameSecondary { get; set; } | |
public string ParameterNameSecondary { get; set; } | |
public string ParameterTypeSecondary { get; set; } |
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
// All site search criteria in a dictionary for easy lookup/manipulation | |
// when dynamically building the query. | |
public static Dictionary<string, SearchParameter> GetSearchCriteria() | |
{ | |
var results = new Dictionary<string, SearchParameter> | |
{ | |
{ | |
"SiteID", new SearchParameter | |
( | |
"SiteID", |
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
public static ObjectQuery<T> BuildObjectQuery<T> | |
(ObjectQuery<T> query, | |
NameValueCollection parameters, | |
Dictionary<string, SearchParameter> searchCriteria) | |
{ | |
var results = query; | |
// If there are parameters in our collection, build a where clause | |
// using the search criteria dictionary. Otherwise the method ends | |
// and the query remains the same. |