Skip to content

Instantly share code, notes, and snippets.

View Lhodge6's full-sized avatar

Leon Quinton Hodges-Austin Lhodge6

View GitHub Profile
DateTime? validatedEventStart = LinkRequestHelper.GetValue<string>(campaignPosted, FieldMapping.FIELD_EVENT_START,(string)null)!= null ? LinkRequestHelper.GetDate(campaignPosted[FieldMapping.FIELD_EVENT_START].ToString(), HttpStatusCode.BadRequest, "The end date parameter is invalid.") : (DateTime?)null;
@Lhodge6
Lhodge6 / gist:4961776
Created February 15, 2013 17:06
key problem
for(i in temp){
html = html + Mustache.to_html(scoreTemplate, temp[i][0]);
for(j in temp[i]){
temp[i][j] = _(temp[i][j]).map(function(num, key){
if(key === 'roiCampaignScoreWeightValue')
{
return new Number(num * 100).toPrecision(4);
} else
{
return num;
@Lhodge6
Lhodge6 / gist:4757677
Created February 11, 2013 21:14
campaign weights
{"campaignWeights":[{"roiCampaignId":1,"roiCampaignScoreId":1,"primaryScore":true,"score_id":1,"score_name":"Influence Vector","score_description":"The standard Influence Vector ranking","scoreKey":"influenceVector","score_attribute_id":1,"score_attribute_name":"States/Provinces Influenced","score_attribute_description":"The number of unique states that the provider influences directly via survey relationship.","scoreAttributeKey":"statesProvincesInfluenced","score_attribute_binding":"stat_states_provinces_influenced","roiCampaignScoreWeightValue":0.139222875},{"roiCampaignId":1,"roiCampaignScoreId":1,"primaryScore":true,"score_id":1,"score_name":"Influence Vector","score_description":"The standard Influence Vector ranking","scoreKey":"influenceVector","score_attribute_id":2,"score_attribute_name":"Zips Influenced","score_attribute_description":"The number of unique zip codes that the provider influences directly via survey relationship.","scoreAttributeKey":"zipsInfluenced","score_attribute_binding":"stat_zi
@Lhodge6
Lhodge6 / gist:4751609
Created February 11, 2013 00:00
this just picks out the older records
SELECT pid.provider_identifier_id
FROM (SELECT dr.project_id, drid.identifier_type_id, drid.provider_identifier_identity, COUNT(*)AS ct
FROM provider_identifier drid
left outer JOIN provider dr ON (dr.provider_id = drid.provider_id)
WHERE identifier_type_id <> 7
GROUP BY dr.project_id, drid.identifier_type_id, drid.provider_identifier_identity
HAVING COUNT(*) > 1) as prob
INNER JOIN provider_identifier pid ON (prob.provider_identifier_identity = pid.provider_identifier_identity)
where pid.provider_identifier_modified_date < '2013-02-05 22:51:21.567'
@Lhodge6
Lhodge6 / gist:4693360
Created February 1, 2013 19:09
fukkin dups
SELECT
ROW_NUMBER() OVER(ORDER BY s.score_id) as RowNum,
rcs.roi_campaign_id,
rcs.roi_campaign_score_id,
rcs.primary_score,
s.score_id,
s.score_name,
s.score_description,
s.score_key,
sa.score_attribute_id,
@Lhodge6
Lhodge6 / gist:3178283
Created July 25, 2012 20:11
magic mangl parser
Ctrl-Alt-Shift-N, *cScoreAttr
@Lhodge6
Lhodge6 / gist:3146050
Created July 19, 2012 19:05
put score with score attribute
curl -v -X PUT -H "Authorization:linklock+clear 6A26C1F1-56A9-45E7-993C-5B8BF7C9AC9E:username:password" -H "Content-type:application/json"-d "{\"roiCampaignId\": 1, \"scoreName\": \"Test Score\", \"scoreDescription\":\"Test Score Description\", \"scoreKey\": \"Test Score Key\", \"scoreAttributeIds\": [{\"scoreAttributeId\": 1},{\"scoreAttributeId\":2}]}" "http://localhost:51324/configurations/scores/1/"
@Lhodge6
Lhodge6 / the WFE
Created June 20, 2012 22:01
"Not Acceptable" WFE
System.ServiceModel.Web.WebFaultException<string> was caught
Message=Not Acceptable
Source=Roi2.Link
Detail=The Accept header passed on the request is not supported by this resource.
StackTrace:
at Roi2.Link.Negotiator.Negotiate.Respond() in C:\Users\Leon\repo\roi2\source\dotnet\link\link\Negotiator\Negotiate.cs:line 79
at Roi2.Link.Service.ConfigurationService.GetConfigurationScores(Int32 perPage, Int32 page, String sidx, String sord, String slice) in C:\Users\Leon\repo\roi2\source\dotnet\link\link\Service\ConfigurationService.cs:line 1303
InnerException:
public const string UriTemplateBaseConfigurationScores = "scores/";
public const string UriTemplateConfigurationScores = UriTemplateBaseConfigurationScores + "?" + URI_FRAGMENT_PAGE_SLICE;
public const string UriTemplateBaseConfigurationScore = UriTemplateBaseConfigurationScores + "{scoreId}/";
[WebInvoke(UriTemplate = UriTemplateBaseConfigurationScores, Method = "POST", BodyStyle = WebMessageBodyStyle.Bare)]
public Message PostConfigurationScore(Stream postData)
{
LinkUser authenticatedLinkUser = Authenticate();
try
{
JObject scorePosted = GetJson(postData, log);
long validatedCampaignId;