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<Case> StartCase(int caseId, int userId) | |
{ | |
using (var connection = new ConScope(_dataService)) | |
using (var transaction = new TransScope()) | |
{ | |
// A transaction is used inside of the settings service as well. | |
// It uses the same "ConScope" and "TransScope" types internally, | |
// allowing us to share a single IDbConnection and IDbTransaction. | |
var caseContext = await _settingsService.GetSetting<CaseContext>(); | |
if (caseContext.CurrentCaseId == caseId) |
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
-- MySQL dump 10.13 Distrib 5.5.62, for debian-linux-gnu (x86_64) | |
-- | |
-- Host: localhost Database: huginn_production | |
-- ------------------------------------------------------ | |
-- Server version 5.5.62-0ubuntu0.14.04.1 | |
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | |
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | |
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | |
/*!40101 SET NAMES utf8 */; |
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
function dec-to-hex() { | |
echo "ibase=10;obase=16;$1" | bc | |
} | |
function dec-to-bin() { | |
echo "ibase=10;obase=2;$1" | bc | |
} | |
function hex-to-dec() { | |
echo "ibase=16;obase=A;$1" | bc |
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
#!/bin/bash | |
DB=$1 | |
COLLECTIONS=$(mongo localhost:27017/$DB --quiet --eval "db.getCollectionNames()" | tr -d '\[\]\"[:space:]' | tr ',' ' ') | |
for collection in $COLLECTIONS; do | |
echo "Exporting $DB/$collection ..." | |
mongoexport -d $DB -c $collection -o $collection.json | |
done |
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 double PlotFromHighToLow(double highTide, double lowTide, double distance, double at) | |
{ | |
var halfAmplitude = Math.Abs(highTide - lowTide) / 2; | |
var center = halfAmplitude + lowTide; | |
var y = halfAmplitude * Math.Sin(((Math.PI / (distance)) * (at + (distance / 2)))) + center; | |
return y; | |
} | |
public static double PlotFromLowToHide(double lowTide, double highTide, double distance, double at) |
OlderNewer