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 async Task<List<string>> DownloadTMXsAsync(List<TMInfo> tms) | |
{ | |
List<Task> tasks = new List<Task>(); | |
List<string> tmxs = new List<string>(); | |
foreach (var tm in tms) | |
{ | |
tasks.Add(Task.Run(async () => | |
{ | |
var result = await _memoQTM.DownloadTMXAsync(".", tm.Guid); | |
if (result.status.Equals("ok", StringComparison.InvariantCultureIgnoreCase)) |
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 ReportFactory | |
{ | |
public static IReport<T> CreateReport<T>() | |
{ | |
if (typeof(T) == typeof(OrdersInfoBiWeekly)) | |
return (IReport<T>) new OrdersInfoBiWeekly(); | |
if (typeof(T) == typeof(ContentTypeInfo)) | |
return (IReport<T>) new ContentTypeInfo(); |
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
void bubbleSort(int list[], int listLength) { | |
int doItAgain = 0; | |
for (int i = 0; i < listLength; i++) { | |
int thisValue = list[i]; | |
int nextValue = (i + 1 < listLength) ? list[i+1] : INT_MAX; | |
if (nextValue < thisValue) { | |
list[i] = nextValue; | |
list[i+1] = thisValue; |
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 System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
// Adapted from JavaScript example in The Imposter's Hanbook by Rob Conery | |
// Doesn't support negative edges! | |
namespace Djikstra | |
{ |
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 System; | |
using System.Collections.Generic; | |
using System.Linq; | |
// Adapted from JavaScript example in The Imposter's Handbook by Rob Conery | |
namespace BellmanFord | |
{ | |
class Path | |
{ |
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
#get time | |
MYTIME=$(date) | |
#get IPs | |
IP=$(/sbin/ip -o -4 addr list | awk '{print $2 ": ", $4}') | |
#remove linebreak | |
IPF=$(echo $IP) | |
#json content | |
post='{"public":false,"files":{"IP.txt":{"content":"'$MYTIME' : '${IPF}'"}}}' | |
#create a command | |
crl="curl --header 'Authorization: bearer YOUR_TOKEN_HERE' --header 'Accept: application/json' --header 'Content-type: application/json' --request POST --data '${post}' https://api.github.com/gists" |
NewerOlder