- Log in to AWS
- Go to a sensible region
- Start a new instance with Ubuntu Trusty (14.04) - compute-optimised instances have a high vCPU:memory ratio, and the lowest-cost CPU time.
c4.2xlarge
is a decent choice. - Set security group (firewall) to have ports 22, 80, and 443 open (SSH, HTTP, HTTPS)
- If you want a static IP address (for long-running instances) then select Elastic IP for this VM
- If you want to use HTTPS, you'll probably need a paid certificate, or to use Amazon's Route 53 to get a non-Amazon domain (to avoid region blocking).
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
[Tech Advancing] [Information] Flushing old Research Manager values. | |
UnityEngine.StackTraceUtility:ExtractStackTrace () | |
Verse.Log:Message (string) | |
TechAdvancing.LogOutput:WriteLogMessage (TechAdvancing.Errorlevel,string) | |
TechAdvancing.TA_ResearchManager:FlushCfg () | |
TechAdvancing.WorldCompSaveHandler:ExposeData () | |
Verse.ScribeExtractor:SaveableFromNode<RimWorld.Planet.WorldComponent> (System.Xml.XmlNode,object[]) | |
Verse.Scribe_Collections:Look<RimWorld.Planet.WorldComponent> (System.Collections.Generic.List`1<RimWorld.Planet.WorldComponent>&,bool,string,Verse.LookMode,object[]) | |
Verse.Scribe_Collections:Look<RimWorld.Planet.WorldComponent> (System.Collections.Generic.List`1<RimWorld.Planet.WorldComponent>&,string,Verse.LookMode,object[]) | |
RimWorld.Planet.World:ExposeComponents () |
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
# snippet: not all code included | |
# revised loop to do cross-validation | |
for (m in 1:length(allModels)) { | |
allpredicted = rep(NA,n) # storage for honest predictions | |
for (ii in 1: nfolds) { # ii is an easier string to search for index | |
groupii = (cvgroups == ii) | |
trainset = bodyfat[!groupii,] # all data EXCEPT for group ii | |
testset = bodyfat[groupii, ] # data in group ii |
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
data = read.csv("mydata.csv") | |
n = nrow(data) | |
nfolds = 5 # 5-fold CV | |
groups = rep(1:nfolds, length=n) | |
set.seed(2) | |
cvgroups = sample(groups, n) | |
allpredicted = rep(NA, n) |
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
""" | |
Connect to an MS SQL Server and execute a query | |
""" | |
import pyodbc | |
conn = pyodbc.connect('Driver={SQL Server};' | |
'Server=THINKSGIVING\SQL;' | |
'Database=AdventureWorks2017;' | |
'Trusted_Connection=yes;') |
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
for f in $(find src/ include/ hps_eve.cxx -type f); do r=$(cat $f | awk 'NF' | wc -l); echo $f:$r; 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
auto vec = step->GetPreStepPoint()->GetPosition(); | |
const double pos[] = {vec[0], vec[1], vec[2]}; | |
double bfield[] = {0, 0, 0, 0}; | |
G4StepPoint* pre = step->GetPreStepPoint(); | |
G4FieldManager* globalFieldMgr = G4TransportationManager::GetTransportationManager()-> GetFieldManager(); | |
globalFieldMgr->GetDetectorField()->GetFieldValue(pos, bfield); | |
std::cout << ">>>> Field val: " << pre->GetPosition() << " -> (" | |
<< bfield[0] << ", " << bfield[1] << ", " << bfield[2] << ") " << std::endl; |
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
#include <vector> | |
#include <iostream> | |
#include "TEveManager.h" | |
#include "TEveBrowser.h" | |
#include "TEveGeoNode.h" | |
#include "TEveScene.h" | |
#include "TEveViewer.h" | |
#include "TGLViewer.h" |
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
#include <vector> | |
void MakeGeometry() { | |
TGeoManager *geom = new TGeoManager ("simple1", "Simple geometry"); | |
//--- define some materials | |
TGeoMaterial *matVacuum = new TGeoMaterial ("Vacuum", 0, 0, 0); | |
TGeoMaterial *matAl = new TGeoMaterial ("Al", 26.98, 13, 2.7); | |
//--- define some media | |
TGeoMedium *Vacuum = new TGeoMedium ("Vacuum", 1, matVacuum); |
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 boto3 | |
# For a Boto3 client. | |
ddb = boto3.client('dynamodb', endpoint_url='http://localhost:8000') | |
response = ddb.list_tables() | |
print(response) | |
# For a Boto3 service resource | |
ddb = boto3.resource('dynamodb', endpoint_url='http://localhost:8000') | |
print(list(ddb.tables.all())) |
NewerOlder