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
[ | |
{ | |
"EntryId": 5, | |
"StartDate": "2010-03-04T00:00:00", | |
"EndDate": "2020-03-04T23:59:59", | |
"MonthlyMax": 100000.00, | |
"WeeklyMax": 10000.00, | |
"DailyMax": 1000.00, | |
"BillingUnitId": 2, | |
"BillingRate": 10.00, |
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 Stripe; | |
using hdl.Infrastructure.Interfaces; | |
using Microsoft.Extensions.Configuration; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
namespace hdl.Infrastructure.Services | |
{ |
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 AppClass { | |
private User _mainUser; | |
public bool Login() { | |
Console.Clear(); | |
return User.Login(_mainUser); | |
} | |
} |
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
WITH cts AS (SELECT COUNT(Id) as UniqueCount, MIN(Triggers.Id) as LowestTriggerId | |
FROM Triggers | |
GROUP BY DeviceId, AccelerationPeakMagnitude_G, PeakOverPressure_Psi) | |
SELECT COUNT(cts.UniqueCount) AS UniqueTriggers FROM cts | |
WITH cte AS (SELECT MIN(Triggers.Id) as LowestTriggerId | |
FROM Triggers | |
GROUP BY DeviceId, AccelerationPeakMagnitude_G, PeakOverPressure_Psi) | |
SELECT Count(*) FROM (SELECT COUNT(*) AS theCounts FROM cte | |
left JOIN PressureData ON cte.LowestTriggerId = PressureData.TriggerId |
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
WITH cte1 AS ( | |
SELECT t.* | |
, (DATEDIFF(SECOND, TriggerStart, GETUTCDATE()) / 5) AS interval | |
, ROW_NUMBER() OVER (PARTITION BY DeviceId, (DATEDIFF(SECOND, TriggerStart, GETUTCDATE()) / 5) ORDER BY DeviceId, TriggerStart) AS pn | |
FROM Triggers AS t where Id = 458 | |
) | |
SELECT * | |
FROM cte1 | |
ORDER BY DeviceId |
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
SELECT COUNT_BIG(t1.Id) FROM dbo.Triggers AS t1 | |
JOIN dbo.Triggers AS t2 | |
ON ( | |
t1.Id < t2.Id | |
AND | |
DATEDIFF(MINUTE, t1.TriggerStart, t2.TriggerStart) <= 2 | |
AND | |
t1.DeviceId != t2.DeviceId) |
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
import { React, useEffect, useState } from 'react'; | |
import AdminMenu from './Admin/Menu'; | |
import LoginPage from '../Pages/Login'; | |
import SearchPage from '../Pages/Search'; | |
import UavDetailsPage from '../Pages/UavDetailsPage'; | |
import ForgotPasswordPage from '../Pages/ForgotPassword'; | |
import RequestAccountPage from '../Pages/RequestAccount'; | |
import RequestReviewPage from '../Pages/Admin/RequestReview'; | |
import SUASRequests from '../Pages/Admin/sUASRequests'; | |
import PrivacyPage from '../Pages/Privacy'; |
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
let RouteController = () => { | |
return ( | |
<div> | |
<AdminMenu></AdminMenu> | |
<Switch> | |
<Route path="/search"> | |
<SearchPage /> | |
</Route> | |
<Route path="/privacy"> | |
<PrivacyPage /> |
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 async Task AddAllAsync(PostedJsonData data) | |
{ | |
try | |
{ | |
//refactor for async enumerables | |
foreach (var t in data.Triggers) | |
{ | |
t.Device = _context.Devices.FirstOrDefault(x => x.Serial.Equals(t.Device.Serial)) ?? t.Device; | |
t.DeviceAssignment.Unit = _context.Units.FirstOrDefault(x => x.SummaryDataUnitID.Equals(t.DeviceAssignment.Unit.SummaryDataUnitID)) ?? t.DeviceAssignment.Unit; |
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
Gson gson = new Gson(); | |
String jsonOutput = gson.toJson(dataFile); | |
File jsonFile = new File("jsonoutput.json"); | |
try (BufferedWriter br = new BufferedWriter(new FileWriter(jsonFile))) { | |
br.write(jsonOutput); | |
} |
NewerOlder