This project was bootstrapped with Create React App.
Below you will find some information on how to perform common tasks.
You can find the most recent version of this guide here.
string swapLexOrder(string str, int[][] pairs) { | |
// If 1 can swap with 3, and 3 can swap with 4, then 1 can eventually swap with 4. Transitive. | |
// For this reason we can build a graph -- connected components that have all the positions of possible | |
// would-be swaps. | |
// We end up just putting the sorted letters (vertices) in the positions that would be possible to swap them to. | |
// 1. Build adjacency list (beginner/intermediate graph theory) | |
var adjacencyLists = new Dictionary<int, List<int>>(); | |
foreach(var pair in pairs) | |
{ |
private void AutoGenEntryDetailSequenceNumbers() | |
{ | |
AchFile.Batches.ToList().ForEach(batch => | |
{ | |
var currentMaxSequenceNumber = batch.EntryDetails.Max(d => d.EntryDetailSequenceNumber); | |
batch.EntryDetails.OrderBy(d => d.EntryDetailSequenceNumber).ToList() | |
.ForEach(d => d.EntryDetailSequenceNumber = d.EntryDetailSequenceNumber ?? ++currentMaxSequenceNumber); | |
}); | |
} |
public class MessageOperationPacket<TMessage> | |
{ | |
public MessageOperationPacket(QueueItem queueItem) | |
{ | |
this.queueItem = queueItem; | |
} | |
protected QueueItem queueItem { get; } | |
protected TMessage data |
This project was bootstrapped with Create React App.
Below you will find some information on how to perform common tasks.
You can find the most recent version of this guide here.
filters = fd.Terms(av => av.Vin, vins) && | |
fd.Or( | |
d => d.Range(f => f.OnField(ff => ff.AuctionDate) | |
.GreaterOrEquals(DateTime.Now.AddDays(daysHistory * -1).ToString("yyyyMMdd"))), | |
d => d.Term(f => f.AuctionDate, null) | |
) && | |
BuyerGroupSearchHelper.BuildBuyerGroupsFilter(fd, buyerGroups); |
if (profile.RetailPriceEstimate.UseProvisionSetting.HasValue && | |
profile.RetailPriceEstimate.UseProvisionSetting.Value) | |
{ | |
profile.RetailPriceEstimate.SelectedBook = PriceGuideId.RADAR; | |
} | |
if (profile.WholesalePriceEstimate.UseProvisionSetting.HasValue && | |
profile.WholesalePriceEstimate.UseProvisionSetting.Value) | |
{ | |
profile.WholesalePriceEstimate.SelectedBook = PriceGuideId.RADAR; |
var targetPrice = null; | |
if (priceGuideType === PriceGuideType.Radar && priceEstimate.UseProvisionSetting) { | |
targetPrice = wrapper.Financials.TargetPricePct; | |
var method = this.settings[EntitySettingDefinitions.Stocking_TargetPriceCalculationMethod]; | |
if (method.toLowerCase().indexOf("pricingtarget") >= 0) { | |
var pricingTargets = priceEstimate.PricingTargets; | |
var defaultRuleSet = pricingTargets.RuleSets.filter(ruleSet => { return ruleSet.Id === pricingTargets.DefaultRuleSetId; })[0]; |
private matchTargetPriceBucket(ruleSet: Models.IPricingTargetRuleSet, dayValue: number): number { | |
if (ruleSet === null || ruleSet.Rules.length === 0) { | |
console.error("No price buckets were provided."); | |
return null; | |
} | |
if (!dayValue || dayValue < 0) { | |
console.error("Invalid day value. Won't match any price target bucket."); | |
return null; | |
} |
[Unit] | |
Description=Puma HTTP Server | |
After=network.target | |
# Uncomment for socket activation (see below) | |
# Requires=puma.socket | |
[Service] | |
# Foreground process (do not use --daemon in ExecStart or config.rb) | |
Type=simple |
# This file is used by Rack-based servers to start the application. | |
require_relative 'config/environment' | |
run Rails.application |