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 StatusController : Controller | |
{ | |
public ILoggerFactory LoggerFactory { get; } | |
public DbConnectionStringBuilder ConnectionStringBuilder { get; } | |
public StatusController(DbConnectionStringBuilder connectionStringBuilder, ILoggerFactory loggerFactory) | |
{ | |
ConnectionStringBuilder = connectionStringBuilder; | |
LoggerFactory = loggerFactory; | |
} | |
} |
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 Startup | |
{ | |
public IConfigurationRoot Configuration { get; } | |
public ILoggerFactory LoggerFactory { get; } | |
public DbConnectionStringBuilder DbConnectionStringBuilder { get; } | |
public Startup() | |
{ | |
Configuration = new ConfigurationBuilder() | |
.AddEnvironmentVariables("TROICENET_") |
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
scp root@oldhost:/root/.bash_history /tmp/migrate.sh | |
sudo sh /tmp/migrate.sh |
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
var apolloUpdateAdjustment = new Apollo.UpdateAdjustment | |
{ | |
supply = record["SUPPLY"].ToString(), | |
prosales = record["ProSales"].ToString(), | |
release_date = record["Release Date"].ToString(), | |
reason_for_update = record["Reason For Update"].ToString(), | |
itemid = Convert.ToInt64(record["ItemID"].ToString()), | |
}; |
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
var apolloUpdateAdjustment = new Apollo.UpdateAdjustment(); | |
apolloUpdateAdjustment.itemid = Convert.ToInt64(record["ItemID"].ToString()); | |
apolloUpdateAdjustment.reason_for_update = record["Reason For Update"].ToString(); | |
apolloUpdateAdjustment.release_date = record["Release Date"].ToString(); | |
apolloUpdateAdjustment.prosales = record["ProSales"].ToString(); | |
apolloUpdateAdjustment.supply = record["SUPPLY"].ToString(); |
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 void ImportPricingFile() | |
{ | |
using (var streamReader = new StreamReader(@"C:\Users\d.gallmeier\gits\daytoday\20180308\pricingFile.csv")) | |
using (var csv = new CsvReader(streamReader)) | |
using (var db = new SqlConnection(Config.AthenaConnectionString)) | |
{ | |
var pricingLines = csv | |
.GetRecords<dynamic>() | |
.Select(record => | |
{ |
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
private static List<CriterionBidLandscape> GetCriterionBidLandscapes(DataService dataService, string awql) | |
{ | |
var bidLandscapes = Enumerable | |
.Range(0, Int32.MaxValue) | |
.AggregateUntil( | |
new CriterionBidLandscapePage() | |
{ | |
entries = new CriterionBidLandscape[] { }, | |
totalNumEntries = 0, | |
}, |
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 TAccumulate AggregateUntil<TSource, TAccumulate>(this IEnumerable<TSource> source, | |
TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> func, Func<TAccumulate,bool> untilFunc) | |
{ | |
if (source == null) | |
{ | |
throw new ArgumentNullException(nameof(source)); | |
} | |
if (func == 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
using (var reportResponse = reportRequest.GetResponse()) | |
using (var reportReader = new StreamReader(reportResponse.Stream)) | |
using (var csv = new CsvReader(reportReader)) | |
{ | |
var records = csv | |
.GetRecords<dynamic>() | |
.Select(record => | |
{ | |
var recordDictionary = new RouteValueDictionary(record); | |
var newKeywordStat = new KeywordPerformanceStat() { |
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var grabby = new Grabby(); | |
string output = grabby.Grab("http://www.dotnetnerd.dk/cv"); | |
Console.WriteLine(output); | |
File.WriteAllText("c:\\test.html", output); | |
} |