This file contains hidden or 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 os | |
| import nbformat | |
| from nbconvert.preprocessors import ExecutePreprocessor | |
| if os.path.exists('./foo.csv'): | |
| os.remove('./foo.csv') | |
| with open('test-notebook.ipynb') as ff: | |
| # This notebook creates foo.csv |
This file contains hidden or 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
| Sub ExtractHL() | |
| ' | |
| ' Macro1 Macro | |
| ' Extract hyperlink from cell in first column in Excel | |
| ' | |
| Dim HL As Hyperlink | |
| Dim xCell As Range | |
| Dim char As Integer | |
This file contains hidden or 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
| G4VPhysicalVolume* DetectorConstruction::Construct() | |
| { | |
| // ...... | |
| // some code here | |
| // ...... | |
| cellPhysical = new G4Ellipsoid("cell", cell_x, cell_y, cell_z); |
This file contains hidden or 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 numpy as np | |
| import ROOT | |
| typeDict = {"Char_t": 'S16', 'Double_t': 'f8', 'Int_t': 'i8'} | |
| def load_tuple_to_array(filename, tuplename, directory=None): | |
| """ | |
| load_tuple_to_array(filename, tuplename, directory=None) | |
| Return root tuple as numpy structured array |
This file contains hidden or 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
| Command directory path : /chem/ | |
| Guidance : | |
| Sub-directories : | |
| /chem/gun/ | |
| /chem/reaction/ ...Title not available... | |
| Commands : | |
| activate * ...Title not available... |
This file contains hidden or 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
| /* | |
| A note on sources: Prior to October 2016, the biomolecules in G4 had | |
| inconsistently set density and ionisation values. While NIST provides | |
| density and mean excitation energy values for Adenine and Guanine, | |
| these are not well-cited and of dubious reliability. In Oct. 2016, | |
| the materials were updated. Mean excitation energy is based of | |
| Sauer et al. (2011) Mean Excitation Energies for Biomolecules: | |
| Glycine to DNA, (Advances in Quantum Chemistry, vol 62) | |
| DOI: 10.1016/B978-0-12-386477-2.00011-5 |
This file contains hidden or 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 <sstream> | |
| Event::Event(): | |
| G4UserEventAction(), | |
| fOutfile(0) // initialise as empty | |
| { | |
| // constructor | |
| } | |
| Event::BeginOfEventAction(){ |
This file contains hidden or 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
| from multiprocessing import Queue, Pool | |
| def run_job(val): | |
| x = 0 | |
| for ii in range(val): | |
| x += ii**2 | |
| return x | |
This file contains hidden or 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
| echo "std::log10((a+(b/3))/4);" | sed 's|std::log10|1./G4Pow::logZ(10)*G4Log|' |