text:
//
// $Id: proctran.cpp 1195 2009-08-14 22:12:04Z chambm $
//
//
// Darren Kessner <darren@proteowizard.org>
//
// Copyright 2009 Spielberg Family Center for Applied Proteomics
//   Cedars Sinai Medical Center, Los Angeles, California  90048
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#include "pwiz/analysis/frequency/PeakDetectorNaive.hpp"
#include "pwiz/analysis/frequency/PeakDetectorMatchedFilter.hpp"
#include "pwiz/analysis/frequency/FrequencyEstimatorSimple.hpp"
#include "pwiz/analysis/frequency/FrequencyEstimatorPhysicalModel.hpp"
#include "pwiz/analysis/calibration/Calibrator.hpp"
#include "pwiz/analysis/calibration/MassDatabase.hpp"
#include "pwiz/data/misc/CalibrationParameters.hpp"
#include "pwiz_aux/sfcap/transient/TransientData.hpp"
#include "pwiz/data/misc/FrequencyData.hpp"
#include "pwiz/data/misc/PeakData.hpp"
#include "pwiz/utility/proteome/IsotopeEnvelopeEstimator.hpp"
#include "RecalibratorKnownMassList.hpp"
#include "RecalibratorSimple.hpp"

#include "pwiz_aux/sfcap/peptideSieve/fasta.h" // interface to fasta file handling
using bioinfo::fasta;

#include "pwiz_aux/sfcap/peptideSieve/digest.hpp"// interface for doing trivial tryptic digests

#include "boost/filesystem/operations.hpp"
#include "boost/filesystem/fstream.hpp"
#include "boost/filesystem/exception.hpp"
#include "boost/filesystem/convenience.hpp"
#include "boost/program_options.hpp"

#include <iostream>
#include <fstream>
#include <map>
#include <stdexcept>
#include <iterator>

using namespace std;
using namespace pwiz::calibration;
using namespace pwiz::data;
using namespace pwiz::frequency;
using namespace pwiz::data::peakdata;
using namespace pwiz::pdanalysis;
using namespace pwiz::proteome;
namespace bfs = boost::filesystem;
namespace po = boost::program_options;

struct Configuration
{
    // misc

    bool write_logs;
    const char* label_write_logs;

    // fft

    unsigned int fft_zero_padding;
    const char* label_fft_zero_padding;

    // PeakDetector type

    const char* peak_detector_type_naive;
    const char* peak_detector_type_matched_filter;

    string peak_detector_type;
    const char* label_peak_detector_type;

    // PeakDetectorNaive parameters

    double detect_naive_noise_factor;
    const char* label_detect_naive_noise_factor;

    unsigned int detect_naive_detection_radius;
    const char* label_detect_naive_detection_radius;

    // PeakDetectorMatchedFilter parameters

    int detect_mf_filterMatchRate;
    const char* label_detect_mf_filterMatchRate;
    int detect_mf_filterSampleRadius;
    const char* label_detect_mf_filterSampleRadius;
    double detect_mf_peakThresholdFactor;
    const char* label_detect_mf_peakThresholdFactor;
    double detect_mf_peakMaxCorrelationAngle;
    const char* label_detect_mf_peakMaxCorrelationAngle;
    double detect_mf_isotopeThresholdFactor;
    const char* label_detect_mf_isotopeThresholdFactor;
    int detect_mf_isotopeMaxChargeState;
    const char* label_detect_mf_isotopeMaxChargeState;
    int detect_mf_isotopeMaxNeutronCount;
    const char* label_detect_mf_isotopeMaxNeutronCount;
    double detect_mf_collapseRadius;
    const char* label_detect_mf_collapseRadius;

    // FrequencyEstimator type

    const char* freqest_type_parabola;
    const char* freqest_type_lorentzian;
    const char* freqest_type_physical;

    string freqest_type;
    const char* label_freqest_type;

    // FrequencyEstimatorPhysicalModel parameters

    unsigned int freqest_physical_window_radius;
    const char* label_freqest_physical_window_radius;

    unsigned int freqest_physical_iteration_count;
    const char* label_freqest_physical_iteration_count;

    // Calibrator parameters

    string calibrate_database_filename;
    const char* label_calibrate_database_filename;

    double calibrate_initial_error_estimate;
    const char* label_calibrate_initial_error_estimate;

    unsigned int calibrate_error_estimator_iteration_count;
    const char* label_calibrate_error_estimator_iteration_count;

    unsigned int calibrate_calibrator_iteration_count;
    const char* label_calibrate_calibrator_iteration_count;

    // least squares recalibration

    const char* recal_type_5pep;
    const char* recal_type_calmix;
    const char* recal_type_db;

    string recal_type;
    const char* label_recal_type;

    string lsq_calibrate_database_filename;
    const char* label_lsq_calibrate_database_filename;

    Configuration()
    :   write_logs(false), label_write_logs("write_logs"),
        fft_zero_padding(1), label_fft_zero_padding("fft_zero_padding"),
        peak_detector_type_naive("naive"),
        peak_detector_type_matched_filter("matched_filter"),
        peak_detector_type(peak_detector_type_matched_filter), label_peak_detector_type("peak_detector_type"),
        detect_naive_noise_factor(5), label_detect_naive_noise_factor("detect_naive_noise_factor"),
        detect_naive_detection_radius(2), label_detect_naive_detection_radius("detect_naive_detection_radius"),
        detect_mf_filterMatchRate(4), label_detect_mf_filterMatchRate("detect_mf_filter_match_rate"),
        detect_mf_filterSampleRadius(2), label_detect_mf_filterSampleRadius("detect_mf_filter_sample_radius"),
        detect_mf_peakThresholdFactor(10), label_detect_mf_peakThresholdFactor("detect_mf_peak_threshold_factor"),
        detect_mf_peakMaxCorrelationAngle(30), label_detect_mf_peakMaxCorrelationAngle("detect_mf_peak_max_correlation_angle"),
        detect_mf_isotopeThresholdFactor(10), label_detect_mf_isotopeThresholdFactor("detect_mf_isotope_threshold_factor"),
        detect_mf_isotopeMaxChargeState(6), label_detect_mf_isotopeMaxChargeState("detect_mf_isotope_max_charge_state"),
        detect_mf_isotopeMaxNeutronCount(4), label_detect_mf_isotopeMaxNeutronCount("detect_mf_isotope_max_neutron_count"),
        detect_mf_collapseRadius(15), label_detect_mf_collapseRadius("detect_mf_collapse_radius"),
        freqest_type_parabola("parabola"),
        freqest_type_lorentzian("lorentzian"),
        freqest_type_physical("physical"),
        freqest_type(freqest_type_physical), label_freqest_type("freqest_type"),
        freqest_physical_window_radius(10), label_freqest_physical_window_radius("freqest_physical_window_radius"),
        freqest_physical_iteration_count(20), label_freqest_physical_iteration_count("freqest_physical_iteration_count"),
        calibrate_database_filename("trypsin0_pro_uniq_mass.pdb"), label_calibrate_database_filename("calibrate_database_filename"),
        calibrate_initial_error_estimate(5e-6), label_calibrate_initial_error_estimate("calibrate_initial_error_estimate"),
        calibrate_error_estimator_iteration_count(20), label_calibrate_error_estimator_iteration_count("calibrate_error_estimator_iteration_count"),
        calibrate_calibrator_iteration_count(20), label_calibrate_calibrator_iteration_count("calibrate_calibrator_iteration_count"),
        recal_type_5pep("5pep"),
        recal_type_calmix("calmix"),
	recal_type_db("db"),
        recal_type(recal_type_5pep), label_recal_type("recal_type"),
        lsq_calibrate_database_filename("lsq_db.tfa"), label_lsq_calibrate_database_filename("lsq_calibrate_database_filename")
     {}
};

ostream& operator<<(ostream& os, const Configuration& config)
{
    os.precision(12);
    os <<
        config.label_write_logs << " = " << config.write_logs << endl <<
        config.label_fft_zero_padding << " = " << config.fft_zero_padding << endl <<
        config.label_peak_detector_type << " = " << config.peak_detector_type << endl <<
        config.label_detect_naive_noise_factor << " = " << config.detect_naive_noise_factor << endl <<
        config.label_detect_naive_detection_radius << " = " << config.detect_naive_detection_radius << endl <<
        config.label_detect_mf_filterMatchRate << " = " << config.detect_mf_filterMatchRate << endl <<
        config.label_detect_mf_filterSampleRadius << " = " << config.detect_mf_filterSampleRadius << endl <<
        config.label_detect_mf_peakThresholdFactor << " = " << config.detect_mf_peakThresholdFactor << endl <<
        config.label_detect_mf_peakMaxCorrelationAngle << " = " << config.detect_mf_peakMaxCorrelationAngle<< endl <<
        config.label_detect_mf_isotopeThresholdFactor << " = " << config.detect_mf_isotopeThresholdFactor << endl <<
        config.label_detect_mf_isotopeMaxChargeState << " = " << config.detect_mf_isotopeMaxChargeState << endl <<
        config.label_detect_mf_isotopeMaxNeutronCount << " = " << config.detect_mf_isotopeMaxNeutronCount << endl <<
        config.label_detect_mf_collapseRadius << " = " << config.detect_mf_collapseRadius<< endl <<
        config.label_freqest_type << " = " << config.freqest_type << endl <<
        config.label_freqest_physical_window_radius << " = " << config.freqest_physical_window_radius << endl <<
        config.label_freqest_physical_iteration_count << " = " << config.freqest_physical_iteration_count << endl <<
        config.label_calibrate_database_filename << " = " << config.calibrate_database_filename << endl <<
        config.label_calibrate_initial_error_estimate << " = " << config.calibrate_initial_error_estimate << endl <<
        config.label_calibrate_error_estimator_iteration_count << " = " << config.calibrate_error_estimator_iteration_count << endl <<
        config.label_calibrate_calibrator_iteration_count << " = " << config.calibrate_calibrator_iteration_count << endl <<
      config.label_recal_type << " = " << config.recal_type << endl <<
      config.label_lsq_calibrate_database_filename << " = " << config.lsq_calibrate_database_filename << endl;
    return os;
}

typedef int (*Subcommand)(const vector<string>& args, const Configuration& config);

int defaults(const vector<string>& args, const Configuration& config)
{
    cout << Configuration();
    return 0;
}

int fft(const TransientData& td, FrequencyData& fd, const Configuration& config, const string& filenameOut)
{
    cerr << "Computing FFT..." << flush;
    td.computeFFT(config.fft_zero_padding, fd);
    //fd.write(filenameOut);
    cerr << "done.\n";
    return 0;
}

int fft(const vector<string>& args, const Configuration& config)
{
    if (args.size() < 3) throw runtime_error("Wrong number of arguments.");
    const string& filenameIn = args[1];
    const string& filenameOut = args[2];

    TransientData td(filenameIn);
    FrequencyData fd;
    return fft(td, fd, config, filenameOut);
}

auto_ptr<IsotopeEnvelopeEstimator> createIsotopeEnvelopeEstimator()
{
    const double abundanceCutoff = .01;
    const double massPrecision = .1;
    IsotopeCalculator isotopeCalculator(abundanceCutoff, massPrecision);

    IsotopeEnvelopeEstimator::Config config;
    config.isotopeCalculator = &isotopeCalculator;

    return auto_ptr<IsotopeEnvelopeEstimator>(new IsotopeEnvelopeEstimator(config));
}

auto_ptr<IsotopeEnvelopeEstimator> isotopeEnvelopeEstimator_;

auto_ptr<PeakDetector> createPeakDetector(const Configuration& config, ostream* log)
{
    auto_ptr<PeakDetector> pd;

    if (config.peak_detector_type == config.peak_detector_type_naive)
    {
        pd = PeakDetectorNaive::create(config.detect_naive_noise_factor,
                                       config.detect_naive_detection_radius);
    }
    else if (config.peak_detector_type == config.peak_detector_type_matched_filter)
    {
        isotopeEnvelopeEstimator_ = createIsotopeEnvelopeEstimator();

        PeakDetectorMatchedFilter::Config pdconfig;
        pdconfig.isotopeEnvelopeEstimator = isotopeEnvelopeEstimator_.get();
        pdconfig.filterMatchRate = config.detect_mf_filterMatchRate;
        pdconfig.filterSampleRadius = config.detect_mf_filterSampleRadius;
        pdconfig.peakThresholdFactor = config.detect_mf_peakThresholdFactor;
        pdconfig.peakMaxCorrelationAngle = config.detect_mf_peakMaxCorrelationAngle;
        pdconfig.isotopeThresholdFactor = config.detect_mf_isotopeThresholdFactor;
        pdconfig.isotopeMaxChargeState = config.detect_mf_isotopeMaxChargeState;
        pdconfig.isotopeMaxNeutronCount = config.detect_mf_isotopeMaxNeutronCount;
        pdconfig.collapseRadius = config.detect_mf_collapseRadius;
        pdconfig.log = log;
        pd = PeakDetectorMatchedFilter::create(pdconfig);
    }
    else
    {
        throw runtime_error("Peak detector type '" + config.peak_detector_type + "' not supported.");
    }

    return pd;
}

int detect(const FrequencyData& fd, peakdata::Scan& scan, const Configuration& config,
           ostream& report, ostream* log = 0)
{
    cerr << "Running peak detector..." << flush;
    auto_ptr<PeakDetector> pd = createPeakDetector(config, log);
    pd->findPeaks(fd, scan);
    cerr << "done.\n";
    cerr << "Peaks found: " << scan.peakFamilies.size() << endl;

    report.precision(12);
    report << scan << endl;

    return 0;
}

int detect(const vector<string>& args, const Configuration& config)
{
    if (args.size() != 2) throw runtime_error("Wrong number of arguments.");
    const string& filename = args[1];
    const FrequencyData fd(filename);
    peakdata::Scan scan;
    return detect(fd, scan, config, cout, &cerr);
}

class EnvelopeEstimator
{
    public:

    EnvelopeEstimator(const FrequencyEstimator& estimator,
                      const FrequencyData& fd)
    :   estimator_(estimator),
        fd_(fd)
    {}

    peakdata::PeakFamily operator()(const peakdata::PeakFamily& in) const
    {
        peakdata::PeakFamily out;
        out.mzMonoisotopic = in.mzMonoisotopic;
        out.charge = in.charge;

        try
        {
            // estimate each peak in the envelope
            for (vector<peakdata::Peak>::const_iterator it=in.peaks.begin(); it!=in.peaks.end(); ++it)
                out.peaks.push_back(estimator_.estimate(fd_, *it));
        }
        catch (exception&)
        {
            cerr << "[proctran::EnvelopeEstimator] Caught exception from FrequencyEstimator.\n"
                 << "envelope:\n" << in << endl;
        }

        return out;
    }

    private:
    const FrequencyEstimator& estimator_;
    const FrequencyData& fd_;
};

int freqest(const FrequencyData& fd, const peakdata::Scan& scanIn, peakdata::Scan& scanOut,
            const Configuration& config, const string& outputDirectory, ostream& report)
{
    // instantiate FrequencyEstimator

    auto_ptr<FrequencyEstimator> fe;

    if (config.freqest_type == config.freqest_type_physical)
    {
        FrequencyEstimatorPhysicalModel::Config fepmConfig;
        fepmConfig.windowRadius = config.freqest_physical_window_radius;
        fepmConfig.iterationCount = config.freqest_physical_iteration_count;
        fepmConfig.outputDirectory = outputDirectory;
        fe = FrequencyEstimatorPhysicalModel::create(fepmConfig);
    }
    else if (config.freqest_type == config.freqest_type_parabola)
    {
        fe = FrequencyEstimatorSimple::create(FrequencyEstimatorSimple::Parabola);
    }
    else if (config.freqest_type == config.freqest_type_lorentzian)
    {
        fe = FrequencyEstimatorSimple::create(FrequencyEstimatorSimple::Lorentzian);
    }
    else
    {
        throw runtime_error("Unknown frequency estimator type.");
    }

    if (!fe.get())
        throw runtime_error("Error instantiating frequency estimator.");

    // fill in metadata

    scanOut.scanNumber = scanIn.scanNumber;
    scanOut.retentionTime = scanIn.retentionTime;
    scanOut.observationDuration = scanIn.observationDuration;
    scanOut.calibrationParameters = scanIn.calibrationParameters;
    scanOut.peakFamilies.clear();

    // run the estimator on each envelope in the scan

    cerr << "Running " << config.freqest_type << " frequency estimator..." << flush;
    transform(scanIn.peakFamilies.begin(), scanIn.peakFamilies.end(),
              back_inserter(scanOut.peakFamilies), EnvelopeEstimator(*fe, fd));
    cerr << "done.\n";

    report.precision(12);
    report << scanOut << endl;

    return 0;
}

// hack to preserve current functionality -- TODO: make this go away
peakdata::Scan readPeakInfoFile(const string& filename)
{
    ifstream is(filename.c_str());
    if (!is) throw runtime_error(("[freqest] Unable to open file " + filename).c_str());

    peakdata::Scan result;

    while (is)
    {
        double frequency;
        complex<double> value;
        int charge;
        is >> frequency >> value >> charge;
        if (!is) break;

        peakdata::Peak peak;
        peak.frequency = frequency;
        peak.intensity = abs(value);
        peak.phase = std::arg(value);

        peakdata::PeakFamily envelope;
        envelope.charge = charge;
        envelope.peaks.push_back(peak);

        result.peakFamilies.push_back(envelope);
    }

    return result;
}

int freqest(const vector<string>& args, const Configuration& config)
{
    if (args.size() < 3) throw runtime_error("Wrong number of arguments.");
    const string& filenameCfd = args[1];
    const string& filenamePeaks = args[2];
    string outputDirectory = args.size()>3 ? args[3] : "";

    const FrequencyData fd(filenameCfd);

    peakdata::Scan detected = readPeakInfoFile(filenamePeaks);
    peakdata::Scan estimated;

    return freqest(fd, detected, estimated, config, outputDirectory, cout);
}

vector<Calibrator::Measurement> createMeasurements(const peakdata::Scan& scan)
{
    vector<Calibrator::Measurement> result;

    for (vector<peakdata::PeakFamily>::const_iterator it=scan.peakFamilies.begin();
         it!=scan.peakFamilies.end(); ++it)
        result.push_back(Calibrator::Measurement(it->peaks.empty() ? 0 : it->peaks[0].frequency,
                                                 it->charge));

    return result;
}

int calibrate(const FrequencyData& fd, const peakdata::Scan& scan,
              const Configuration& config, const string& outputDirectory)
{
    try
    {
        const string& pdbFilename = config.calibrate_database_filename;
        cout << "Using database " << pdbFilename << endl;
        auto_ptr<MassDatabase> mdb = MassDatabase::createFromPeptideDatabase(pdbFilename);

        vector<Calibrator::Measurement> measurements = createMeasurements(scan);

        if (measurements.empty())
            throw runtime_error("No measurements read.");

        CalibrationParameters cp =  fd.calibrationParameters();

        bfs::create_directories(outputDirectory);

        cerr << "Running calibrator..." << flush;

        auto_ptr<Calibrator> calibrator = Calibrator::create(*mdb,
                                                             measurements,
                                                             cp,
                                                             config.calibrate_initial_error_estimate,
                                                             config.calibrate_error_estimator_iteration_count,
                                                             outputDirectory);

        for (unsigned int i=0; i<config.calibrate_calibrator_iteration_count; i++)
            calibrator->iterate();

        cerr << "done.\n";

        cout << "A: " << calibrator->parameters().A << " B: " << calibrator->parameters().B << endl;
    }
    catch (exception& e)
    {
        cerr << e.what() << endl;
    }

    return 0;
}

int calibrate(const vector<string>& args, const Configuration& config)
{
    throw runtime_error("calibrate broken");

/*
    if (args.size() != 4) throw runtime_error("Wrong number of arguments.");
    const string& filenameCfd = args[1];
    const string& filenamePeaks = args[2];
    const string& outputDirectory = args[3];

    const FrequencyData fd(filenameCfd);

    vector<PeakInfo> peaks;
    ifstream is(filenamePeaks.c_str());
    if (!is) throw runtime_error(("[calibrate] Unable to open file " + filenamePeaks).c_str());
    copy(istream_iterator<PeakInfo>(is), istream_iterator<PeakInfo>(), back_inserter(peaks));

    return calibrate(fd, peaks, config, outputDirectory);
*/
}

void computePrintCalibrationStatistics(const KnownMassList::MatchResult & before, const CalibrationParameters & cpBefore, const KnownMassList::MatchResult & after,const CalibrationParameters & cpAfter,const bfs::path& pathOutput,const string& filenameBase,const string& addendum)
{
  KnownMassList::MatchResult prunedAfter;

  string filename = (pathOutput / (filenameBase + ".recal." + addendum +".txt")).string();
  ofstream os(filename.c_str());

  if (!os)
    throw runtime_error(("Unable to open file " + filename).c_str());

  os << "# label mzKnown frequency mzOriginalF mzOriginal dmz frequency mzRecalF mzRecal dmzRecal ddmz dmzOrigRecal\n";

  //this is Parag's hack - might want to rollback later.

  /*
    if (before.matches.size() != after.matches.size() ||
    before.matchCount != after.matchCount)
    throw runtime_error("[proctran] Matches don't match!");
  */

  for (unsigned int i=0; i<before.matches.size(); ++i){
      if (!before.matches[i].entry)
	throw runtime_error("[proctran] Null KnownMassList::entry.");

      const KnownMassList::Entry* entry = before.matches[i].entry;
      const peakdata::PeakFamily* orig = before.matches[i].peakFamily;

      for (unsigned int j=0; j<after.matches.size(); ++j){ //this could be searched smarter

	const peakdata::PeakFamily* recal = after.matches[j].peakFamily;
	double beforeFrequency = orig && !orig->peaks.empty() ? orig->peaks[0].frequency : 0;
	double afterFrequency = recal && !recal->peaks.empty() ? recal->peaks[0].frequency : 0;
	if((beforeFrequency != 0) && (beforeFrequency == afterFrequency)){

	  prunedAfter.matches.push_back(after.matches[j]);

	  os << setprecision(10)
	     << entry->label << "\t"
	     << entry->mz << "\t"
	     << beforeFrequency << "\t"
	     << cpBefore.mz(beforeFrequency)<<"\t"
	     << (orig ? orig->mzMonoisotopic : 0) << "\t"
	     << 1.0e6 * ((entry->mz - (orig ? orig->mzMonoisotopic : 0)) / entry->mz) << "\t"
	     << cpAfter.mz(beforeFrequency)<<"\t"
	     << (recal ? recal->mzMonoisotopic : 0) << "\t"
	     << 1.0e6 * ((entry->mz - (recal ? recal->mzMonoisotopic : 0))/entry->mz) << "\t"
	     << abs(entry->mz - (orig ? orig->mzMonoisotopic : 0)) - abs(entry->mz - (recal ? recal->mzMonoisotopic : 0))<< "\t"
	     << abs((recal ? recal->mzMonoisotopic : 0) - (orig ? orig->mzMonoisotopic : 0)) 	 	     << "\n";
	  continue;
	}
      }
  }
  // output recalibration data
  prunedAfter.reComputeStatistics();

  string filenameStats = (pathOutput / (filenameBase + ".recal." + addendum + ".stats")).string();
  ofstream osStats(filenameStats.c_str());
  if (!osStats)
    throw runtime_error(("Unable to open file " + filenameStats).c_str());

  osStats << "# label A B matchCount dmzMean dmz2Mean dmzRel2Mean rmsAbs rmsRel\n";
  osStats << setprecision(10)
	  << "original\t"
	  << cpBefore.A << "\t"
	  << cpBefore.B << "\t"
	  << before.matchCount << "\t"
	  << before.dmzMean << "\t"
	  << before.dmz2Mean << "\t"
	  << before.dmzRel2Mean << "\t"
	  << sqrt(before.dmz2Mean) << "\t"
	  << sqrt(before.dmzRel2Mean) << "\n";

  /*    osStats << "recalibrated\t"
	<< cpAfter.A << "\t"
	<< cpAfter.B << "\t"
	<< after.matchCount << "\t"
	<< after.dmzMean << "\t"
	<< after.dmz2Mean << "\t"
	<< after.dmzRel2Mean << "\t"
	<< sqrt(after.dmz2Mean) << "\t"
	<< sqrt(after.dmzRel2Mean) << "\n";
  */
  osStats << "re-recalibrated\t"
	  << cpAfter.A << "\t"
	  << cpAfter.B << "\t"
	  << prunedAfter.matchCount << "\t"
	  << prunedAfter.dmzMean << "\t"
	  << prunedAfter.dmz2Mean << "\t"
	  << prunedAfter.dmzRel2Mean << "\t"
	  << sqrt(prunedAfter.dmz2Mean) << "\t"
	  << sqrt(prunedAfter.dmzRel2Mean) << "\n";
}

void recalibrateLeastSquares(peakdata::Scan& scan,
                             const bfs::path& pathOutput,
                             const string& filenameBase,
                             const Configuration& config)
{

    KnownMassList kml_train;

    if (config.recal_type == config.recal_type_5pep)
    {
        cout << "Recalibrating using least squares with 5-Peptide masses." << endl;
        kml_train.insert_5pep();
    }
    else if (config.recal_type == config.recal_type_calmix)
    {
        cout << "Recalibrating using least squares with Calmix masses." << endl;
        kml_train.insert_calmix();
    }
    else if (config.recal_type == config.recal_type_db)
    {
        cout << "Recalibrating using least squares with masses from database." << endl;
	fasta<string> mf(config.lsq_calibrate_database_filename);
	std::vector<std::string> peptideVector;

	for(fasta<string>::const_iterator seqIter = mf.begin();seqIter != mf.end();seqIter++){
	  const fasta_seq<string>* fseq = *seqIter;
	  const string& str = fseq->get_seq();
//	  std::cout<<str<<endl<<endl;
	  Digest peptides(str);
	  for(size_t pepNdx=0;pepNdx<peptides.numPeptides();pepNdx++){
	    string peptide = peptides.currentPeptide();
//	    std::cout<<peptide<<endl;
	    peptide.erase(0,1); //drop the first character
	    peptide.erase(peptide.length() - 1,1); //drop the last character
//	    std::cout<<peptide<<endl;
	    peptideVector.push_back(peptide);
	    peptides.next();
	  }
	}
        kml_train.insert_db(peptideVector);
    }
    else
    {
        cout << "[proctran] Unknown recalibration type.\n";
        return;
    }

    Scan scanBefore = scan;
    CalibrationParameters cpBefore = scan.calibrationParameters;

    RecalibratorSimple rks(cpBefore); //this fixes the mz of peaks in the scan?
    rks.recalibrate(scan);
    rks.recalibrate(scanBefore);

    //determine which peaks are actually around.
    KnownMassList::MatchResult before_train = kml_train.match(scanBefore, 4.2); //PM Change
    kml_train.replace_entryVector(before_train.getMatchedEntries());

    //pull a subset of peaks for testing purposes
    KnownMassList kml_test;
    kml_test.insert_entryVector(kml_train.splitEntries(.33));

    //do the match for real on the training set.
    before_train = kml_train.match(scanBefore, 4.2); //PM Change

    //do the match for real on the testing set.
    KnownMassList::MatchResult before_test = kml_test.match(scanBefore, 4.2); //PM Change

    //recalibrate
    RecalibratorKnownMassList rkml(kml_train);
    rkml.recalibrate(scan);

    KnownMassList::MatchResult after_train = kml_train.match(scan, 100.00); //PM Change
    KnownMassList::MatchResult after_test = kml_test.match(scan, 100.00); //PM Change

    CalibrationParameters cpAfter = scan.calibrationParameters;

    computePrintCalibrationStatistics(before_train,cpBefore,after_train,cpAfter,pathOutput,filenameBase,"train");
    computePrintCalibrationStatistics(before_test,cpBefore,after_test,cpAfter,pathOutput,filenameBase,"test");
}

void writePeakDataFile(const peakdata::Scan& scan,
                       const bfs::path& filename)
{
    peakdata::PeakData pd;
    pd.scans.push_back(scan);

    bfs::ofstream os(filename);
    os << pd;
}

int all(const vector<string>& args, const Configuration& config)
{
    if (args.size() != 3) throw runtime_error("Wrong number of arguments.");
    bfs::path pathTransient(args[1]);
    bfs::path pathOutput(args[2]);

    string filenameBase = basename(pathTransient);
    bfs::create_directories(pathOutput);

    cout << "filename: " << pathTransient.string() << endl;
    cout << "outputDirectory: " << pathOutput.string() << endl;

    // fft
    TransientData td(pathTransient.string());
    FrequencyData fd;
    bfs::path pathCFD = pathOutput / (filenameBase + ".cfd");
    if (exists(pathCFD)) throw runtime_error(("[proctran] " + pathCFD.string() + " already exists.").c_str());
    fft(td, fd, config, pathCFD.string());

    // detect
    peakdata::Scan scanDetected;
    bfs::path pathPeaksDetected = pathOutput / (filenameBase + ".detected.txt");
    bfs::ofstream osPeaksDetected(pathPeaksDetected);
    bfs::path pathPeakDetectorLog = pathOutput / (filenameBase + ".detected.log");
    bfs::ofstream osPeakDetectorLog; //(pathPeakDetectorLog);
    detect(fd, scanDetected, config, osPeaksDetected, &osPeakDetectorLog);
    writePeakDataFile(scanDetected, pathOutput / (filenameBase + ".detected.peaks"));

    // freqest
    peakdata::Scan scanEstimated;
    bfs::path pathPeaksEstimated = pathOutput / (filenameBase + ".estimated.txt");
    bfs::ofstream osPeaksEstimated(pathPeaksEstimated);
    string outputDirectoryFreqest = config.write_logs ?
        (pathOutput / (filenameBase + ".estimated.logs")).string() : "";
    freqest(fd, scanDetected, scanEstimated, config, outputDirectoryFreqest, osPeaksEstimated);
    writePeakDataFile(scanEstimated, pathOutput / (filenameBase + ".estimated.peaks"));

    // calibrate
    string outputDirectoryCalibration = config.write_logs ?
        (pathOutput / (filenameBase + ".dbcalibration.logs")).string() : "";
    calibrate(fd, scanEstimated, config, outputDirectoryCalibration);

    // recalibrate least squares
    peakdata::Scan scanRecalibrated = scanEstimated; // make a copy
    recalibrateLeastSquares(scanRecalibrated, pathOutput, filenameBase, config);
    writePeakDataFile(scanRecalibrated, pathOutput / (filenameBase + ".recal.peaks"));

    cout << endl;
    return 0;
}

void initializeSubcommands(map<string, Subcommand>& subcommands, string& usage)
{
    subcommands["defaults"] = defaults;
    usage += "    defaults\n";
    usage += "        (outputs default options)\n\n";

    subcommands["fft"] = fft;
    usage += "    fft filename.dat filename.cfd\n";
    usage += "        (converts MIDAS file to FrequencyData)\n\n";

    subcommands["detect"] = detect;
    usage += "    detect filename.cfd\n";
    usage += "        (runs peak detector on frequency data)\n\n";

    subcommands["freqest"] = freqest;
    usage += "    freqest filename.cfd peaklist.txt [outputDirectory]\n";
    usage += "        (runs frequency estimator)\n\n";

    subcommands["calibrate"] = calibrate;
    usage += "    calibrate filename.cfd peaklist.txt outputDirectory\n";
    usage += "        (runs calibrator)\n\n";

    subcommands["all"] = all;
    usage += "    all filename.dat outputDirectory\n";
    usage += "        (runs everything)\n\n";
}

void parseCommandLine(int argc, char* argv[], Configuration& config, vector<string>& args, string& usage)
{
    string configFilename = "proctran.cfg";
    const char* label_config_file = "config_file";

    po::options_description od_config("Options");
    od_config.add_options()
        (label_config_file,
            po::value<string>(&configFilename)->default_value(configFilename),
            "")
        (config.label_write_logs,
            po::value<bool>(&config.write_logs)
                ->default_value(config.write_logs),
            "")
        (config.label_fft_zero_padding,
            po::value<unsigned int>(&config.fft_zero_padding)
                ->default_value(config.fft_zero_padding),
            "")
        (config.label_peak_detector_type,
            po::value<string>(&config.peak_detector_type)
                ->default_value(config.peak_detector_type),
            "")
        (config.label_detect_naive_noise_factor,
            po::value<double>(&config.detect_naive_noise_factor)
                ->default_value(config.detect_naive_noise_factor),
            "")
        (config.label_detect_naive_detection_radius,
            po::value<unsigned int>(&config.detect_naive_detection_radius)
                ->default_value(config.detect_naive_detection_radius),
            "")
        (config.label_detect_mf_filterMatchRate,
            po::value<int>(&config.detect_mf_filterMatchRate)
                ->default_value(config.detect_mf_filterMatchRate),
            "")
        (config.label_detect_mf_filterSampleRadius,
            po::value<int>(&config.detect_mf_filterSampleRadius)
                ->default_value(config.detect_mf_filterSampleRadius),
            "")
        (config.label_detect_mf_peakThresholdFactor,
            po::value<double>(&config.detect_mf_peakThresholdFactor)
                ->default_value(config.detect_mf_peakThresholdFactor),
            "")
        (config.label_detect_mf_peakMaxCorrelationAngle,
            po::value<double>(&config.detect_mf_peakMaxCorrelationAngle)
                ->default_value(config.detect_mf_peakMaxCorrelationAngle),
            "")
        (config.label_detect_mf_isotopeThresholdFactor,
            po::value<double>(&config.detect_mf_isotopeThresholdFactor)
                ->default_value(config.detect_mf_isotopeThresholdFactor),
            "")
        (config.label_detect_mf_isotopeMaxChargeState,
            po::value<int>(&config.detect_mf_isotopeMaxChargeState)
                ->default_value(config.detect_mf_isotopeMaxChargeState),
            "")
        (config.label_detect_mf_isotopeMaxNeutronCount,
            po::value<int>(&config.detect_mf_isotopeMaxNeutronCount)
                ->default_value(config.detect_mf_isotopeMaxNeutronCount),
            "")
        (config.label_detect_mf_collapseRadius,
            po::value<double>(&config.detect_mf_collapseRadius)
                ->default_value(config.detect_mf_collapseRadius),
            "")
        (config.label_freqest_type,
            po::value<string>(&config.freqest_type)
                ->default_value(config.freqest_type_physical),
            "")
        (config.label_freqest_physical_window_radius,
            po::value<unsigned int>(&config.freqest_physical_window_radius)
                ->default_value(config.freqest_physical_window_radius),
            "")
        (config.label_freqest_physical_iteration_count,
            po::value<unsigned int>(&config.freqest_physical_iteration_count)
                ->default_value(config.freqest_physical_iteration_count),
            "")
        (config.label_calibrate_database_filename,
            po::value<string>(&config.calibrate_database_filename)
                ->default_value(config.calibrate_database_filename),
            "")
        (config.label_calibrate_initial_error_estimate,
            po::value<double>(&config.calibrate_initial_error_estimate)
                ->default_value(config.calibrate_initial_error_estimate),
            "")
        (config.label_calibrate_error_estimator_iteration_count,
            po::value<unsigned int>(&config.calibrate_error_estimator_iteration_count)
                ->default_value(config.calibrate_error_estimator_iteration_count),
            "")
        (config.label_calibrate_calibrator_iteration_count,
            po::value<unsigned int>(&config.calibrate_calibrator_iteration_count)
                ->default_value(config.calibrate_calibrator_iteration_count),
            "")
        (config.label_recal_type,
            po::value<string>(&config.recal_type)
                ->default_value(config.recal_type),
            "")
       (config.label_lsq_calibrate_database_filename,
            po::value<string>(&config.lsq_calibrate_database_filename)
                ->default_value(config.lsq_calibrate_database_filename),
            "")
         ;

    // append options description to usage string

    ostringstream usage_options;
    usage_options << od_config << endl;
    usage += usage_options.str();
    usage += "Notes:\n";
    usage += "  Options will be read from the specified config file if it exists.\n";
    usage += "\n";
    usage += "  To recreate the default config file, use:\n";
    usage += "      proctran defaults > proctran.cfg\n";
    usage += "\n";
    usage += "  freqest_type = physical | parabola | lorentzian\n";
    usage += "\n";
    usage += "  peak_detector_type = naive | matched_filter\n";
    usage += "\n";
    usage += "  recal_type = 5pep | calmix | db\n";

    // handle positional arguments

    const char* label_args = "args";

    po::options_description od_args;
    od_args.add_options()
        (label_args, po::value< vector<string> >(), "")
        ;

    po::options_description od_parse;
    od_parse.add(od_config).add(od_args);

    po::positional_options_description pod_args;
    pod_args.add(label_args, -1);

    // parse and save results

    po::variables_map vm;
    po::store(po::command_line_parser(argc, argv).
          options(od_parse).positional(pod_args).run(), vm);

    ifstream is(vm[label_config_file].as<string>().c_str());
    po::store(parse_config_file(is, od_config), vm);

    po::notify(vm);

    if (vm.count(label_args))
        args = vm[label_args].as< vector<string> >();
}

int main(int argc, char* argv[])
{
    try
    {
        string usage("Usage: proctran subcommand [args] [options]\n\nSubcommands:\n\n");

        map<string, Subcommand> subcommands;
        initializeSubcommands(subcommands, usage);

        Configuration config;
        vector<string> args;
        parseCommandLine(argc, argv, config, args, usage);

        Subcommand subcommand = args.empty() ? 0 : subcommands[args[0]];
        if (!subcommand) throw runtime_error(usage);

        if (subcommand != defaults)
            cerr << config << endl;

        return subcommand(args, config);
    }
    catch (exception& e)
    {
        cout << e.what() << endl << endl;
        return 1;
    }
}

redpajama_set_name: RedPajamaGithub


text:
Put Boom Arts on your calendar
Kaboom.
That's the sound of a most impressive 2013-14 programme arriving in the line up from Boom Arts.
Run by Ruth Wikler-Luker, the small Portland arts group has been around for almost three years and produces innovative and socially relevant theatre with a strong international current.
Details of Boom's 2013-14 season have been sent out by email but are not yet up on the web site. But you'll want to put these dates on your radar ASAP.
Yaroslava Pulinovich – THE NATASHA PLAYS – Girlhood and the class divide in Russia
When: Thursday-Saturday, November 21-23, 2013, at 7:30pm
Where: Lincoln Hall Studio Theatre, Portland State University
How Much: Free/donation suggested. Reserve at http://www.boomarts.org.
What: In The Natasha Plays, two short plays presented in counterpoint, the realities of Russia's stark class divide emerge through the perspectives of two 16-year old girls from different backgrounds, each of whom will stop at nothing to achieve her goal.
Who: Playwright Yaroslava Pulinovich (Russia); Translator John Freedman (Russia); Director Karin Magaldi (PDX).
Conversations: special guests will join us following each performance to respond to the play through a variety of lenses. November 21: contemporary Russian drama and theatre (with playwright Yaroslava Pulinovich, via Skype). Nov. 22: gender issues (with Prof. Ann Mussey, Portland State University, and Prof. Tatiana Osipovich, Lewis & Clark College). Nov. 23: inequality in contemporary Russia (guest TBA).
Partners: Portland State University's School of Theatre and Film; World Affairs Council. Produced by special arrangement with Agency North Ltd., agencynorth.com.
Alicia Jo Rabins – A KADDISH FOR BERNIE MADOFF – Spiritual implications of the financial collapse
When: Thursday-Sunday, February 6-9, 2013, at 7:30pm. An work-in-progress showing will be held the previous week for Fertile Ground Festival passholders only.
Where: Portland Playhouse, 602 NE Prescott Street, Portland OR.
What: A Kaddish for Bernie Madoff is a new music theatre work by acclaimed indie rocker, poet, and Torah scholar Alicia Jo Rabins (Golem, Girls in Trouble). Through electro-acoustic music, documentary theatre, and meditative poetry, Rabins views Bernie Madoff and the system which allowed him to function through the lens of ancient Jewish and Buddhist texts on financial ethics, ecology, and cycles. West Coast premiere.
Who: Creator/performer Alicia Jo Rabins (PDX/NYC); Director Maureen Towey (SF/NYC; Sojourn Theater; Arcade Fire); Original Animation by Zak Margolis (PDX).
Conversations: TBA
Partner: Portland Playhouse
Deborah Assimwe – APPOINTMENT WITH GOD – The US visa process from an African perspective
When: Friday, April 11 & Saturday, April 12 at 7:30pm; Sunday, April 13 at 2pm.
What: Award-winning Ugandan playwright Deborah Asiimwe's witty ensemble play Appointment with gOD takes place in the waiting room of a US embassy in an unnamed "developing country" after 9/11. A motley crew of visa applicants make their appeals to the visa-bestowing "gODs" behind the counter.
Who: Playwright Deborah Asiimwe (Uganda); Director Emily Mendelsohn (NY/LA).
Partners: Portland State University School of Theatre and Film; World Affairs Council of Oregon.
Plus: Artist Talk Series
Theatre of Global Engagement: International Collaboration & Social Change
Friday, February 21: Bond Street Theatre (NYC/International)
Monday, April 7: Cooking Oil (Emily Mendelsohn & Deborah Asiimwe, NY/Uganda)
Where: Lewis and Clark College
Partners: Lewis and Clark College; World Affairs Council of Oregon
October 14, 2013 November 9, 2015 Boom Arts
Previous Previous post: 50 words: WILDE TALES at Shaking The Tree
Next Next post: What's on in Seattle?

redpajama_set_name: RedPajamaCommonCrawl


The first Philippine Zero Waste Fair took off on January 22, in Quezon Memorial Circle, Quezon City. Organized by EcoWaste Coalition, Global Alliance for Incinerator Alternatives, Mother Earth Foundation, and Health Care Without Harm, the Zero Waste Fair was an excellent opportunity to learn more about zero waste initiatives, lifestyle, municipalities and organizations.
The Zero Waste (ZW) fair, celebrated in the context of the Zero Waste Month proclaimed by President Benigno Aquino III, was the first ever exhibition on waste, workshops on and trading of discards, and exchange of ideas and practices on waste in ways and forms that were accessible to everyone. Its aim was to multiply the pursuers of zero waste, and grow the benefits exponentially!
The workshops on recycling, composting, repurposing, and the proper handling of electronic waste were one key activity in the Fair. Most importantly, it was a gathering of people who wanted to learn from each other.
The diverse booths showcasing products made from recycled materials were particularly inspiring. Junk Not shared her stories of how most of plastic reused for her creations was found in a scrapyard and was going to be burnt. All her products were effectively (and beautifully) diverted from landfills and incinerators.
People could walk around exhibits; listen, discuss with others; participate in checking out propositions; even repair or repurpose their discards right on the fair site; and engage and trade online and carry it forward during the fair.
Interestingly, the ZW Fair counted with the participation of an international delegation of 'zero-wasters' that presented a perspective of Zero Waste experiences around the world. Nalini Shenkar from Hasiru Dala in Bangalore introduced the audience to the experience of organizing a cooperative of grassroots recyclers, which has involved the creation of 500 jobs in 2 years. Shibu K Nair from the Kerala-based organization Thanal talked about Zero Waste Himalayas, a network of more than 30 groups created in 2010 that promotes better resource use and recovery practices in the region of the Himalayas, particularly strategic since it holds the source of water for half of humanity in the planet. From the Global North, Monica Wilson, Recycler of the Year 2012 and GAIA's US and Canada Coordinator, explained the specific steps in the implementation of the Zero Waste program in San Francisco, a city that has been continually reducing its waste generation and it's committed to a zero waste goal by 2020. Similarly, Mariel Vilella Zero Waste Europe's Associate Director, introduced some of the European zero waste best practices.
These experiences reinforced a zero waste vision for Philippines, where the debate around waste management is currently hot and contentious. The National Solid Waste Management Commission is a designated group by the government to assess new waste management technologies and revise the Clean Air Act and the Ecological Solid Waste Act, which could potentially lower the current targets for air pollution and allow incinerators back in the country. The incinerator moratoria in Philippines has been a world-wide example to ensure a toxic-free environment, and its eventual cancellation is seen as a global threat.
Later in the week, Zero Waste Europe's Mariel Vilella and Dr.Jorge Emmanuel called for the protection of this legislation and the pursuing of ZW goals in the Philippines.
Precisely, the Zero Waste Fair showed several municipalities that are already taking steps towards implementing zero waste programs. Nueva Vizcaya was one of the highlighted places that is actively working towards zero waste goals, with several initiatives on education, training, livelihoods, and planning.
Moreover, Mother Earth Foundation organized a visit to the local Barangay of Fort Bonifacio, Taguig (the native Filipino term to refer to the smallest administrative division in the Philippines, ie. a village, district or ward) that has transformed a former illegal landfill into a Materials Recovery Facility (MRF), along with a source separation system that has currently reached 95% compliance. The separate collection scheme and management of materials in the MRF has formalized the work of 12 waste pickers and 5 MRF staff members, with a considerable raise in their monthly earnings and livelihood stability.
As a closing event, the Zero Waste Fair gave the Zero Waste Awards, as a salute to ZW heroes and pioneers, and a celebration of how far we've come on the road to Zero Waste.


How far is Houston from Tampa?
The total distance from TPA to IAH is 787 miles.
This is equivalent to 1 267 kilometers or 684 nautical miles.
It ends at George Bush Intercontinental Airport in Houston, Texas.
Your flight direction from TPA to IAH is West (-77 degrees from North).
The distance calculator helps you figure out how far it is to fly from TPA to IAH. It does this by computing the straight line flying distance ("as the crow flies"). It uses the great circle formula to compute the total travel mileage.


Visit each of the participating locations on the course, purchase a craft beer or wine and get your stamp on the corresponding location on the treasure map.
Once your map is filled with stamps from each location, you can redeem your treasure at the last location on your trail – you must visit every location on the trail to claim your prize.
Redeem your treasure by presenting your completed treasure map to a staff person at your final location the trail. A government-issued ID showing date of birth (must be over 21) must also be presented. Once validated, you will receive your official swag! Prize is limited to one item per person. Available at any participating brewery/winery.
While you're on your journey, share your photos on social media using #tcwineandaletrail for a chance to to win official Treasure Coast Wine & Ale Trail swag!


Honorio Aurelio "Mariano" Esposo, 88, of Omao, Kauai, a retired McBryde Sugar Plantation seed cutter and Wackenhut security guard, died in Wilcox Memorial Hospital. He was born in Ilocos Norte, Philippines. He is survived by wife Guadalupe "Fe"; sons Roming and Windelle; daughters Barbara Holland, Marina Mori, Yolanda Remigio, Carolinda Jennings and Glenda Fernandez; 16 grandchildren; 23 great-grandchildren; and a great-great-grandchild. Visitation: 9 a.m. Dec. 1 at Borthwick Kauai Mortuary. Services: 10 a.m. Burial to follow at Hanapepe Public Cemetery.


Security is a feature, not a bolted on after thought.
We contine to invest in, and futher develop the security of Paygle.
Paygle utilises Azure Key Vault to provide its encryption via a periodically rotated internal RSA key, with unencrypted content physically isolated from the Paygle Platform and Services.
All received data and sensitive fields are encrypted at rest.
Each customer and organisations data is partitioned from all other users and organisations.
Determined at time of login, Paygle uses short lived Shared Access Signatures that only last for a set number of minutes that enforce the partitioning. Once expired, a Shared Access Signature can no longer access any Paygle data.
The Paygle Website, it's associated API and any other internal services are all served over HTTPS.
Your communication to and from Paygle is secure.


text:
Q: Is std::random_shuffle thread safe? In C++11, is the algorithm std::random_shuffle thread safe (when called by two different threads on two different containers) ?
And particularly this form:
template <class RandomIt> void random_shuffle(RandomIt first, RandomIt last);

A: A function is threadsafe if two concurrent executions of that function do not "work" on the same data. "work" here means that none of the functions may modify the data in a non-atomic, non-consistent way. There are three ways how data can be accessed by the function:

*

*via function parameters, including objects referred to by those parameters

*via the objects a member function is called on

*Function static, class static and global data, including data used by functions that get called indirectly.

Since random_shuffle is a free function, 2. does not apply. The function however has parameters, and it works on them in the sense that it alters the underlying sequence's content. But there will be no problem if concurrent calls do not operate on overlapping sequences.
That leaves the static/global data. Most randum number generators will use some kind of global data for their seed. The default random function rand is not required to be threadsafe and probably will not explicitly synchronize access to its global seed.
So in your case no, it's not threadsafe (unless the random number generator is).
You will want to either write a synchronized version of random number generator ore use different generators in concurrent calls. I'd prefer to use the latter, so the concurrent shuffles dont interfere with the random number sequence of each other. (But I am by no means an expert in random number generation).

A: It is thread-safe if it uses a thread-safe random number generator. The generator is implementation-defined (and, if it uses std::rand, it's implementation-defined whether that is safe), so you'll need to consult the documentation for the implementation you're using.
To be sure, you should use one of the other variants, providing either a thread-safe generator, or a separate generator for each thread.

redpajama_set_name: RedPajamaStackExchange


Wakebaits are a unique class of baits in that they can serve a dual purpose. They can be used as a topwater bait (slower retrieval) or as a shallow diver (faster retrieval). We have a couple of offerings to this new, but increasingly popular category.
Custom Painted "Baby Gargoyle" Wakebait - "Beauty Gill"
Custom Painted "Zero" Wakebait - "Beauty Gill"
Custom Painted "Zero" Wakebait - "Largemouth"
Custom Painted .5 Squarebill - "Beauty Gill"


Chillicothe Police Dept. need your help locating a missing/runaway juvenile. Andrew Cunningham is 15 years old and has not been seen by his family since 4/2/19. His hair is cut shorter than pictured. If you see this young man call Chillicothe Police at 740-773-1191 or Southern Ohio Crime Stoppers, Inc.


What an amazing book is the work of Habakkuk. This gem is tucked away in a group of greatly neglected Old Testament books called the Minor Prophets. Eighth in a list of twelve (at least according to the Massoretic Text) its scant three chapters carry a profound message of faith and assurance quite relevant for the third-millennium believer.
The book of Habakkuk divides nicely into two parts, each beginning with a title about the prophet.1 The opening dialog between the prophet and God (1:1–2:5) concludes with a series of five messages of woe (woe oracles, 2:6–20). These woe oracles are collected into a taunt-song as indicated by the title (2:6). The second part is a psalm (theophanic hymn) that both praises the Lord and illustrates the faith of Habakkuk (3:1–19).
either of these suggestions. The text clearly tells us that Habakkuk was a prophet and the endnote to chapter three suggests that he may have had musical abilities.
The book of Habakkuk is unique among the prophetic writings for several reasons. Prophets generally brought God's revelation to the people, but this book begins with the prophet bringing questions to God. The usual proclamations of God's authority, "Thus says the Lord," (messenger formula) are not found in Habakkuk. In addition, his use of traditional genre (מַּשָּׂא, maśśāʾ or 'burden' and the lament) is developed in unusual ways in this book.
God called this unique individual to help Israel by strengthening his, and ultimately their, faith in the Lord. One can only pray that a thorough study of this insightful book will do the same today.


text:
Q: Correct way create action in vuex Is it enough to create simple (without chaining then/catch calls) vuex-actions as a1? Or I need write it each time with Promise creating as a2 (+also add reject branch)?
Thank you in advance...

import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex);

const debug = process.env.NODE_ENV !== 'production';

export default new Vuex.Store({
    state: { ... }
    ...
    actions: {
        a1: (state, response) => {
            state.commit('setNavMenu',{signIn: true, signUp: true, signOut: false});
        ...
        },
        a2: (state, response) => {
            return new Promise((resolve) => {
                state.commit('setNavMenu',{signIn: true, signUp: true, signOut: false});
            ...
            resolve();
            });
        },

...

A: It is possible to create a synchronous action (without a promise or other asynchronous code) just like your first one a1
However, you could then directly call the mutation function instead, in a1 case, it would be setNavMenu.
The main difference between actions and mutations is that actions can be asynchronous when mutations cannot, basically if you do not need your action to perform async. code, you do not need an action and can just go with the mutation.
For further details you can check the official doc on actions https://vuex.vuejs.org/en/actions.html

A: You don't, you would only do that if the  action has an asynchronous aspect or want to get a response from your action.
If all your updates are of synchronous nature (not relying on an API or any asynchronous feedback), you could even call the mutations directly, skipping the actions altogether.
i.e.  (from official doc)
import { mapMutations } from 'vuex'

export default {
  // ...
  methods: {
    ...mapMutations([
      'increment', // map `this.increment()` to `this.$store.commit('increment')`

      // `mapMutations` also supports payloads:
      'incrementBy' // map `this.incrementBy(amount)` to `this.$store.commit('incrementBy', amount)`
    ]),
    ...mapMutations({
      add: 'increment' // map `this.add()` to `this.$store.commit('increment')`
    })
  }
}

The reason why you would use an action is when you have are dealing with a asynchronous change, like when you want your mutation to use data that comes from an API.


text:
package com.zimbra.soap.admin.message;

import javax.xml.bind.annotation.XmlRootElement;

import com.zimbra.common.soap.AdminConstants;

@XmlRootElement(name=AdminConstants.E_ADD_DISTRIBUTION_LIST_MEMBER_RESPONSE)
public class AddDistributionListMemberResponse {

    public AddDistributionListMemberResponse() {
    }
}


No matter what you do to protect your skin, there may come a point in your life when preventing age-related blemishes feels like an impossible task. As we grow older, many of us will develop fine lines near our eyes known as crow's feet. Even though these imperfections are completely natural, they might prematurely age your face. With BOTOX® injections, our team in Nashville can quickly and safely soften these wrinkles near your eyes.
Wrinkles take place for many different reasons, including damage from UV rays, chemical beauty products, and cigarette smoke. They can also develop when the facial muscles near your eyes and forehead become permanently contracted. These dynamic wrinkles are very difficult to get rid of without professional assistance, and they aren't always responsive to traditional dermal fillers. BOTOX® injections treat the root of the problem by relaxing the muscles that control your facial expressions.
This injectable has been used by doctors for decades to treat dozens of different health issues. For many years, doctors injected it into certain areas to treat involuntary twitching of the eyes and lips. Over time, those same doctors noticed that the wrinkles closest to the injections would fade away as well. BOTOX® works by blocking the nerve impulses that keep muscles contracted. Within just days of the injections, the wrinkles will fade away as the muscles become relaxed.
Most appointments at our office in Nashville can be completed in just minutes. During the treatment, the solution is skillfully injected into the preselected facial muscles. In the days following your appointment, you'll see as the crow's feet fade from view.
We ask all of our patients in Nashville to schedule an initial consultation before having any cosmetic procedures carried out. During this appointment, you will learn more about all of your treatment options. BOTOX® is a popular injectable, but it isn't right for everyone. To see if it's right for you, make an appointment at Restored Images in Nashville. Contact our office today to schedule a consultation and learn more!


It's been almost a week since I bought my iPad in Hong Kong. It's a wonderful device and unlike other gadgets that I previously bought, I did not experience buyer's remorse whatsoever with the device. For those who read my blog – I think you will know by now that the biggest disappointment I experienced with gadgets is with the Nokia N97. The latter had a lot of promise but apart from taking good pictures and being able to make phone calls, it fell short of my expectations.
- Battery Life – 10 Hours of usage and more on Stand By. I have an iPod Touch and after using it to surf the net for one hour, I have to plug it into a power outlet.
- Portability – I have a Ferrari One 200 – a very powerful and Handy PC. However – it is still heavy and bulky. The iPad can fit into the sleeve of my Brief Case.
- Applications from Apple – I discovered that I can install the Applications I bought for my iPod into the iPad. They are wonderful iPod applications and the experience was just made "bigger" with the size of the iPad.
- 64GB of Storage – I opted for the 32 GB of storage. I have an iPod Touch. Up to now, I have not filled up that gadget with Music, Videos and Photos. I recognize that with a bigger device – the same content will fill up more space. That's alright, the iPad is too big to be an MP3 player – so I don't foresee storing my Music on that device.
- 3G Connection – I did not choose to get the 3G model. I got the WiFi model. This lack of 3G connection is addressed by my purchase of the Mobile WiFi router – HuaWei E585. With the Mobile WiFi – I can connect – not just the iPad – but also my other devices.
- Apart from the Mobile connection – the only other feature that 3G has is GPS. From my experience of the other devices I have – GPS does not work well in Manila. For some reason – the GPS Satellites can not pinpoint well where I am. The "triangulated" location from the Wi-Fi network is accurate enough for my needs.
Now on the missing features on iPad and why it is not a deal breaker for me.
- Camera – I don't do Video Chat. I have a WebCam on my laptop and have never used it.
- Good display under the Sun – I stay indoors most of the time. I cannot stand staying outdoors – unless I'm on vacation.
- Flash Support – I never missed it in on my iPod Touch – and it is actually refreshing when I don't see the FLASH based advertisements on Websites.
- Open Environment for Applications – I can Jailbreak my iPad if I want to. I don't see the need for it. I have Jailbroken my iPod Touch and it seems to be running slower. As for downloading applications for free – Come On – I work for the IT industry. I support paying for applications for our enterprising brethren.
I guess it's clear – I love my new iPad 32 GB Wi-Fi. It is exactly what I wanted – so for now, I'm in gadget heaven.
I've got a new Macbook on loan just now, oh it's amazing, it's so much better than my old computer, everything's so fast and pics download so quickly, I've got one week left till I go back to my old one - hand cranked by a monkey in a sweater.
The Macbook is the only gadget missing from my collection of Apple must haves. I've always used Windows based computers. Which is generally good - but it does seem to crawl when I have to process photos and videos. Hmmm ... does this mean I have to get a Macbook?
On the iPad - it's a great gadget and I'm happy that I can continue using it to read Bourbons and Pearls.


text:
Honest John Cars For Sale » Used Search »
New Used Leasing
228,036 matches found
National 1 mile 10 miles 20 miles 30 miles 40 miles 60 miles 100 miles 200 miles
(Any) Abarth (342) AC (2) Alfa Romeo (525) Alpina (9) Aston Martin (223) Audi (15,252) Bentley (261) BMW (14,396) Cadillac (1) Caterham (8) Chevrolet (215) Chrysler (72) Citroen (6,824) Dacia (1,594) Daewoo (3) Daihatsu (29) Daimler (1) Dax (2) Dodge (12) DS (1,523) Ferrari (126) FIAT (5,541) Ford (25,042) Glas (11) Honda (5,452) Hummer (2) Hyundai (6,812) Infiniti (247) Isuzu (15) IVECO (3) Jaguar (2,738) Jeep (924) Kia (6,586) Lamborghini (71) Lancia (1) Land Rover (6,123) Lexus (910) Lotus (48) Maserati (165) Maybach (2) Mazda (3,527) McLaren (51) Mercedes-Benz (13,967) MG (348) Microcar (1) Mini (5,084) Mitsubishi (1,445) Morgan (15) Nissan (15,720) Opel (1) Perodua (5) Peugeot (9,922) Porsche (778) Proton (12) Renault (7,369) Rolls-Royce (52) Rover (23) SAAB (109) SEAT (4,486) Skoda (5,455) smart (848) SsangYong (352) Subaru (398) Suzuki (2,549) Tesla (25) Toyota (6,371) Triumph (6) TVR (2) Vauxhall (25,276) Volkswagen (16,675) Volvo (5,038) Westfield (2)
(Any) Hatchback (133,526) Estate (33,122) SUV (22,353) Saloon (14,935) Coupe (9,012) MPV (7,456) Convertible (4,509) Wheelchair Accessible (213) Pick-up (140)
(Any) up to 1 year old (70,192) up to 2 years old (98,115) up to 3 years old (143,339) up to 4 years old (168,994) up to 5 years old (182,821) up to 6 years old (193,391) up to 7 years old (200,873) up to 8 years old (206,548) up to 9 years old (211,351) up to 10 years old (215,436)
(Any) up to 100 miles (14,616) up to 1,000 miles (20,760) up to 5,000 miles (43,165) up to 10,000 miles (66,413) up to 20,000 miles (109,795) up to 30,000 miles (142,262) up to 40,000 miles (167,093) up to 50,000 miles (183,566) up to 60,000 miles (195,742) up to 70,000 miles (205,074) up to 80,000 miles (212,063) up to 90,000 miles (217,119) up to 100,000 miles (220,938)
(Any) from £500 from £1,000 from £2,000 from £3,000 from £4,000 from £5,000 from £6,000 from £7,000 from £8,000 from £9,000 from £10,000 from £11,000 from £12,000 from £13,000 from £14,000 from £15,000 from £16,000 from £17,000 from £18,000 from £19,000 from £20,000 from £22,500 from £25,000 from £27,500 from £30,000 from £35,000 from £40,000 from £50,000 from £75,000 from £100,000 from £250,000
(Any) to £500 to £1,000 to £2,000 to £3,000 to £4,000 to £5,000 to £6,000 to £7,000 to £8,000 to £9,000 to £10,000 to £11,000 to £12,000 to £13,000 to £14,000 to £15,000 to £16,000 to £17,000 to £18,000 to £19,000 to £20,000 to £22,500 to £25,000 to £27,500 to £30,000 to £35,000 to £40,000 to £50,000 to £75,000 to £100,000 to £250,000
Get GAP insurance
from £87 per year with ALA
Looking to save on insurance?
We all worry about the rising cost of car insurance, but with a little help, you'll discover there are plenty of simple ways to make huge savings on your car insurance.
Save On Car Insurance
Check your credit score
Where to check your credit score and how to improve it.
Credit Checks Explained
Enter your postcode for local results
Sort by Lowest price first Highest price first Recently added Showing 131 to 140 of 228,036
First Previous ... 9 10 11 12 13 14 15 16 17 18 19 ... Next
2016 SEAT Ibiza 1.2 TSI 110 FR Technology 3dr Petrol Hatchback
Bristol Street Motors SEAT Birmingham
Nechells
Dealer website More details
2016 Ford Fiesta 1.5 TDCi Zetec ECOnetic 5dr
CarShop Wakefield
2018 Vauxhall Corsa 1.4 Energy 5dr Petrol Hatchback
Bristol Street Motors Vauxhall Hexham
2014 Ford Fiesta 5Dr Titanium 1.0 100PS
Gates of Hertford
2016 Skoda Rapid Spaceback 1.6 TDI CR 115 SE Sport 5dr
Hendy Car Store Exeter
2017 Kia Rio 1.25 1 5dr
Autosave.co.uk Cars Delivered Direct To Your Door
2016 Honda Jazz 1.3 S 5dr Petrol Hatchback
Bristol Street Motors Vauxhall Keighley
Nr Keighley
2016 Ford B-MAX 1.6 ZETEC 5d AUTO 104 BHP
Bridge End Motors Ltd
Chester le Street
2015 Peugeot 2008 1.6 e-HDi (115bhp) Feline Mistral Ambience (S/S)
Motor Match Bolton
2016 Nissan Micra 1.2 n-tec 5-Door Hatchback Auto
West Way Mill Hill


text:
The Anglican Diocese of Grafton is one of the 23 dioceses of the Anglican Church of Australia. The diocese is located in north-east New South Wales and covers the area from the Queensland border to Port Macquarie in the south and west to the Great Dividing Range.

Created in 1914 as a result of a division of the previous Diocese of Grafton and Armidale it has 22 parishes and 3 transitional ministry districts  and an Anglicare organisation seeking to support community and social needs within the diocese. The cathedral church is the Cathedral Church of Christ the King in Grafton.

The Church of St Thomas at Port Macquarie was built by an early Governor of New South Wales, Thomas Brisbane. It is the fifth oldest church building in Australia.

The current Bishop of Grafton, Murray Harvey, is the 12th bishop of the diocese. He was installed at Christ Church Cathedral, Grafton, on 29 September 2018.

Sarah Macneil the 11th Bishop of Grafton become the first woman to lead an Australian diocese as bishop. Macneil announced her resignation on 17 November 2017, to be effective from 3 March 2018.

The bishop is based in Grafton.

Bishops

Cathedral
The cathedral church is Christ Church Cathedral in Grafton which was designed by John Horbury Hunt and commenced in 1884 during the episcopacy of Bishop James Turner and completed to its present stage in 1937. The building is of brick construction in a Gothic Revival style with towering arches and ornate stained glass windows. An organ was installed in 1884 by George Fincham of Melbourne which was replaced in 1992 by a 1903 instrument brought from London by Peter D.G. Jewkes Pty Ltd of Sydney.

The cathedral is a National Trust listed building.

Deans of Grafton
The following individuals have served as Deans of Grafton:

Church schools
The diocese also has a number of church-based schools providing education across a range of age groups.

References

External links

Grafton
1914 establishments in Australia
Anglican Church of Australia Ecclesiastical Province of New South Wales
Grafton, New South Wales
John Horbury Hunt buildings

redpajama_set_name: RedPajamaWikipedia


A Pioneering Union at Columbia?
In December of 2013, students at New York University created the only union of graduate teaching and research assistants that is recognized by a private university in the United States. Six miles uptown, Lindsey Dayton, a doctoral student in Columbia University's history department, heard the news and got excited. Dayton had spent time working as a labor organizer with hotel and restaurant workers before enrolling at Columbia. If N.Y.U. students could win unionization, she thought, maybe student workers at Columbia, who were worried about issues like job security and benefits, could do the same. Quietly, Dayton began talking to likeminded Columbia students, and they eventually decided to try to follow N.Y.U.'s lead. Their campaign culminates on Friday, when dozens of students plan to enter the university's administrative offices and deliver a letter to the university president, Lee Bollinger, seeking support for a union of student workers that would be affiliated with the United Automobile Workers. If they are successful in their larger campaign, Columbia could become the second private university in the U.S. whose student workers belong to a recognized union.
The campaign reflects an evolution, which has taken place in recent decades, in how universities operate. They have increasingly relied on graduate students as workers—to aid full professors in teaching lecture-hall classes, help them with research in university labs, and so on—partly to help keep costs down. The graduate students develop work experience and relationships with professors, along with receiving wages and some benefits. Unionizing could allow these students to collectively bargain and get formal help addressing grievances. At many public universities, including the University of California system, graduate students have been unionized for years, with the support of the state labor-relations boards that govern them. But that hasn't been the case at most private universities. Employees at private companies, including private universities, have to follow a different path to unionization: they must petition the National Labor Relations Board or persuade their employer to voluntarily recognize them. In several N.L.R.B. decisions handed down in the nineteen-seventies, the board made clear that it believed students shouldn't be able to unionize because their main relationship with their institution was as students, not employees. For a long time, this understanding went unchallenged, with students at private universities simply accepting that they couldn't unionize.
In 2000, however, a Democratic-controlled N.L.R.B. concluded that students at N.Y.U. could, in fact, unionize as employees. Students at Columbia and other institutions, including Brown University, were emboldened and tried to gain recognition for their own unions. But in 2004, an N.L.R.B. controlled by Republicans who had been appointed by George W. Bush decided, in a case involving Brown, that students shouldn't be able to unionize, after all; they reasoned, as boards had done until the 2000 decision, that a student's relationship with a university was primarily educational. That essentially killed the efforts of the students at Columbia and other universities, too. A year later, N.Y.U. stopped recognizing its students' union, a story that Rachel Aviv documented in her 2013 Profile of John Sexton, the school's president.
But lately, the atmosphere seems to have changed. In 2013, instead of going through the N.L.R.B., the N.Y.U. students won voluntary support from their university. Following this decision, Dayton and other Columbia students thought that their own administration might be more inclined to support unionization. They also had a feeling that the current N.L.R.B., controlled by Democrats appointed by Barack Obama, might look more favorably on them if they were to petition the board along with, or instead of, being voluntarily recognized by Columbia. (A spokeswoman for the N.L.R.B. declined to comment, as did a spokesman for Columbia.) Plus, their concerns as employees weren't getting addressed on their own. "It was kind of like, 'Enough is enough,'" Dayton told me.
In January of this year, the Columbia students contacted Maida Rosenstein, the president of U.A.W. Local 2110, which represents the N.Y.U. students, and asked for help unionizing at Columbia. (A union for auto workers might seem like an odd choice for grad students, but it represents thousands of higher-education workers at institutions including the University of California system and Columbia itself.) The students also started getting in touch with friends and acquaintances on campus to gauge their interest. When they exhausted those contacts, they began going door to door in Columbia's offices and research labs, introducing themselves and collecting e-mail addresses and phone numbers. There seemed to be momentum outside of Columbia, too; around the same time, student workers at Yale University were seeking union recognition from their administration.
It is unclear how useful unionization will be in achieving these goals. There is little research into the status of unionized student workers versus non-unionized ones. In 2004, when the N.L.R.B. ruled that Brown students couldn't unionize, the board suggested that doing so might complicate relationships between professors and students and even impinge upon the academic freedom of faculty members and administrators by limiting their decision-making power. Last year, however, professors at Rutgers University and the University of New Mexico published a paper that looked at how unionization had affected graduate-student employees at public universities. They found that unionized students reported better pay and higher levels of personal and professional support from the faculty advisers supervising them, as compared to their non-unionized peers; students noticed similar levels of academic freedom whether they were unionized or not.
"That's what we were really trying to say: 'O.K., is there any evidence for these awful outcomes that the board has predicted if graduate students unionize?'" Adrienne Eaton, the chair of the department of labor studies and employment relations at Rutgers, and a co-author of the paper, told me.
"No, there aren't awful outcomes." She acknowledged that differences exist between public universities, which she and her co-authors studied, and private ones, but she described them as minimal.
Of course, administrators at private universities have another good reason to resist unionization. If graduate-student workers get together and demand better pay and benefits, that could put pressure on university budgets. Bollinger hasn't often commented publicly on the unionization question, but his administration opposed such efforts in the early aughts, and in 2004, he told a University Senate gathering, "The graduate students and the administration will be better if we do not have a union acting as an intermediary between graduate students and the faculty," according to the Columbia Daily Spectator, the school's student newspaper.
*Clarification: An earlier version of this post didn't note that Seth Prins, a graduate student at Columbia, has health insurance that includes some basic dental services.


text:
Partner Home
Pro Kids - The First Tee of San Diego
Pro Kids | The First Tee of San Diego joined Live Well San Diego as a recognized partner on August 1, 2018. Pro Kids has been in the community for almost 25 years, challenging youth to excel in life by promoting character development, life skills, and values through education and the game of golf. Since 1994 over 20,000 kids have walked the course of opportunity that set them on the path to healthy, successful futures.
Pro Kids | The First Tee of San Diego was founded on the belief that "golf is the hook; education is the payoff". We offer welcoming, accessible facilities in the heart of City Heights and Oceanside, year-round, 6 days a week. Through a unique set of programs that combine sport, study, and service, we provide youth grades 2 – 12 with equitable access to opportunities for growth, with support and scholarship service for program alumni.
At Pro Kids this year:
Of 850 kids served, over 62% improved one level or more in golf
100% of High School Seniors who completed high school graduation or the GED in 2018 have a post-secondary plan
43 students earned $134,500 in scholarships through the Pro Kids Scholarship program
70% of members qualified for a fee waiver year-round
71% of kids improved one letter grade or maintained a B average in math and literacy
252 members joined the Pro Kids program across two sites
27 new volunteers joined the Pro Kids family
Pro Kids | The First Tee of San Diego is committed to continuing to advance Live Well San Diego by improving the quality of life for kids and families creating an inclusive, welcoming environment and democratizing the game of golf to empower communities to take the lead in their own health, safety and well-being on and off the course.
Learn more about Pro Kids - The First Tee of San Diego


Monashees Capital is a Brazilian Venture Capital firm focused on Internet and Education. Our business model, tailored to the Brazilian environment, is based on long-term vision, autonomy, agility and engagement in the companies in which we invest. We partner with outstanding entrepreneurs determined to build innovative high-growth businesses.


text:
package com.amazonaws.services.wafv2.model.transform;

import java.util.List;
import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.wafv2.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * LoggingConfigurationMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class LoggingConfigurationMarshaller {

    private static final MarshallingInfo<String> RESOURCEARN_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ResourceArn").build();
    private static final MarshallingInfo<List> LOGDESTINATIONCONFIGS_BINDING = MarshallingInfo.builder(MarshallingType.LIST)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("LogDestinationConfigs").build();
    private static final MarshallingInfo<List> REDACTEDFIELDS_BINDING = MarshallingInfo.builder(MarshallingType.LIST)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("RedactedFields").build();
    private static final MarshallingInfo<Boolean> MANAGEDBYFIREWALLMANAGER_BINDING = MarshallingInfo.builder(MarshallingType.BOOLEAN)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ManagedByFirewallManager").build();
    private static final MarshallingInfo<StructuredPojo> LOGGINGFILTER_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("LoggingFilter").build();

    private static final LoggingConfigurationMarshaller instance = new LoggingConfigurationMarshaller();

    public static LoggingConfigurationMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(LoggingConfiguration loggingConfiguration, ProtocolMarshaller protocolMarshaller) {

        if (loggingConfiguration == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(loggingConfiguration.getResourceArn(), RESOURCEARN_BINDING);
            protocolMarshaller.marshall(loggingConfiguration.getLogDestinationConfigs(), LOGDESTINATIONCONFIGS_BINDING);
            protocolMarshaller.marshall(loggingConfiguration.getRedactedFields(), REDACTEDFIELDS_BINDING);
            protocolMarshaller.marshall(loggingConfiguration.getManagedByFirewallManager(), MANAGEDBYFIREWALLMANAGER_BINDING);
            protocolMarshaller.marshall(loggingConfiguration.getLoggingFilter(), LOGGINGFILTER_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


725 driver has 15 offset .812 machined recessed well head to capture hard to reach bolts (Dodge hub bolts). Non-turning slots.
990 short straight 1 hammer head driver wont rotate off bolt/work area with non-turning slots.
Great for strut work, hub work, front end, exhaust, spring and suspension repair.
Comes packaged in a heavy duty roll-up cordura nylon storage bag.


ProLocked Window System utilises its unique and cutting-edge internal beading system to make removal from outside impossible. Unlike most systems, ProLocked stops intruders from simply removing the double glazed units from outside, making it the absolute first line of defence for customers.
The ProLocked Window System is the easy way to gain an effortless elegant look, which will complement every type of home whether it is a static caravan or park home. Our window range delivers enhanced security and energy efficiency, combined with stunning aesthetics.
A normal installation of windows would take around a day to complete and this would be to install 8-10 windows and 2 doors.
If you are looking for double glazing for static caravans or park homes give us a call for a free no obligation quotation or click on the free online quotation button at the top of this page and send us pictures of your static caravan and we can give you a quotation by e-mail.
Our windows are fitted with 28mm double glazed sealed units, most other companies install 20 mm units into there windows.
The wider the double glazed unit the warmer they are and the less chance of condensation.
which have 2 locking points and are operated from one handle, the locking system is installed inside the window sash, which is far more secure than the standard two cockspur handles that lock against the frame which is offered by most other companies.
( Slightly open) which is great for those hot summer nights, and also if pets are kept in the caravan this allows constant ventilation, and the windows are locked for security , windows with cockspur locking handles offered by most other companies do not have this facility.
Our windows are fixed from the inside of the caravan with aluminum brackets, these brackets also form a cover between the window and the existing frame to finish off the inside of the window ,along with plastic corner trims.
Our windows are fitted without the use of screws and sealants and are the latest static caravan double glazing system to be used by some of the large caravan manufacturers.
• Internally beaded for peace of mind. More secure than any window on the market.
• Choice of 6 coloured foils.
• All windows and doors are installed with a foam gasket not silicone sealants.


text:
January 1795: The University of North Carolina
This Month in North Carolina History
The University of North Carolina held its opening ceremony on January 15, 1795, and soon after became the first state university to enroll students.
The winter of 1794-1795 had been rough, and by mid January the roads were a muddy mess. Governor Richard Dobbs Spaight made the difficult trip from Raleigh to Chapel Hill for the official opening and was met by members of the Board of Trustees and other government officials. When these dignitaries gathered to open the University on January 15th, 1795, it was a cold, windy, rainy day and the area looked more like a construction site than a college campus. Only the two-story East Building and the unpainted wooden house of the Presiding Professor had been completed. The rest of the campus was filled with tree stumps, recently dug clay, and piles of lumber to be used for additional buildings. The North Carolina Journal reported that "the buildings prepared for the reception and accommodation of students are in part finished, and that youth disposed to enter the University may come forward with the assurance of being received."
With the campus ready, and the Governor and school officials gathered for the ceremony, all that was missing was students. Unfortunately, none showed up. It wasn't until three weeks later that 18-year-old Hinton James arrived on campus from his home in Wilmington from which, as legend has it, he walked all the way to Chapel Hill. For two weeks James comprised the entire student body, but he soon had company. By the end of the first term, the new university had 41 students receiving instruction from two faculty members. When the first graduation was held in 1798, James was among seven students receiving degrees.
The North Carolina Constitution of 1776 authorized "one or more" state universities. The university was formally established by the North Carolina General Assembly in December 1789, and the first members of the Board of Trustees met later that month to begin raising funds and to select a site for the school. A small group of commissioners charged with finding a location viewed more than a dozen sites in Orange and Chatham counties before selecting a spot at what was then called New Hope Chapel Hill. The cornerstone for the first building, East Building (now "Old East"), was laid on October 12, 1793. The drawing of East Building by a UNC student in 1797, shown on this page, is the first known image of the University of North Carolina.
Suggestions for Further Reading:
Powell, William S. The First State University: A Pictorial History of the University of North Carolina at Chapel Hill. Chapel Hill: University of North Carolina Press, 1992.
Snider, William D. Light on the Hill: A History of the University of North Carolina at Chapel Hill. Chapel Hill: University of North Carolina Press, 1992.
Battle, Kemp Plummer. History of the University of North Carolina. Raleigh: Edwards & Broughton, 1912.
Author Nicholas GrahamPosted on January 1, 2004 Categories 01 - January, From the Stacks, History, Tar Heelia, Tar Talk, This Month in N.C. History, UNC History
One thought on "January 1795: The University of North Carolina"
Bill Maths, '73 says:
From humble beginnings a great University!
Previous Previous post: December 1870: The Cape Hatteras Lighthouse
Next Next post: February 1820: Bunkum


I've received a few emails recently from readers asking for me to share some office-appropriate outfits. Though I work from home now, I remember how difficult it was in the summer to dress for the warmer weather, while still keeping my look work-friendly. This type of light layering is just right because it gives off a business feel, but still has a little bit of modern edge to it (also a great way to wear your crop tops in a more conservative way). If your building is one that has the air conditioning running constantly, you could layer a blazer over the top of this to keep warm indoors. And if you're not a fan of heels, this pairing would look just as chic with pointed flats or menswear loafers.


text:
The Public Apology
Kevin Durant's Legacy is The Only Thing that Matters
July 5, 2016 by edmachine23 0 comments on "Kevin Durant's Legacy is The Only Thing that Matters"
Kevin Durant has agreed to join the Golden State Warriors. It seemed absurd that this could even happen, but the rumours were indeed true after all.
There will be a plethora of hot takes on Durant's move over the coming days, now that he's made his decision to leave the Oklahoma City Thunder in what Forbes has already described as a "smart business/basketball decision."
Here's the thing: Durant could have taken a one-year extension and stayed at Oklahoma, a team that came ridiculously close to edging out the Warriors in the Western Conference Finals. Make no mistake: OKC was a genuine title contender. They made a three-man trade for the declining Serge Ibaka that many viewed as a good net win. They just had to convince Kevin Durant to stay the course and stick things out. And they couldn't even do that. How is it even possible?
Well, here's the thing. Durant is being driven by a thing called "legacy".
The dictionary definition of "legacy" is quite modest, in that it basically refers to a) something (such as property or money) that is received from somebody who has died; b) something that happened in the past or that comes from someone in the past. However, when viewed as a social construct, the importance of "legacy" suddenly makes a lot more sense.
"Legacy" is something that is usually, but not always, viewed after-the-fact. US President Barack Obama is currently in his own legacy-burnishing years, hyper-aware that every decision he has made will be framed within the context of how it will look to historians 50 years down the track. He's got plenty of rings to his name: Obamacare, the Paris Climate Deal, ordering the raid that killed Bin Laden, etc. In politics, one must collect as many "rings" as possible, and deflect to these throughout the remainder of your life whenever questioned about your tenure (Howard, J, on gun control, etc).
Obama is all about legacy
High-profile athletes take a similar stance in regards to the importance of legacy. We are in a fast-moving social media world, where people can air their unfiltered thoughts via smartphones and have that message communicated globally.
Everyone has an opinion on who the Greatest of All Time (GOAT) is, whether we're offering a POTUS power ranking, or picking our top five point guards. It's the easiest thing to do. So you think that Michael Jordan is the greatest athlete of all time? Why not Bradman, who statistically was a more dominant player in his chosen sport? And so on and so forth. It's silly and unscientific, but nonetheless enjoyable.
On Bradman, it's difficult to imagine he was conscious of the legacy he would be leaving in 1948, when he was dismissed for a duck in his final test. But then again, perhaps he was thinking about it, after all? An average of 99.94 has a certain symmetry and assonance to it, and perhaps the Don knew, even then, that this imperfect yet pure number would secure his legacy forever.
That said, the idea of "legacy" does seem to be a distinctly 21st Century phenomenon. It has coincided with the uber-professionalism of sport (i.e. money) and the ubiquity of social media. Players make official written statements when they leave their club to justify the move in terms of their career, and to keep themselves from appearing the villain.
Kevin Durant released a statement on the Players Tribune website entitled 'My Next Chapter'. In a bid to get on the front foot and control the message, he gave the following explanation for his decision.
"The primary mandate I had for myself in making this decision was to have it based on the potential for my growth as a player — as that has always steered me in the right direction. But I am also at a point in my life where it is of equal importance to find an opportunity that encourages my evolution as a man: moving out of my comfort zone to a new city and community which offers the greatest potential for my contribution and personal growth. With this in mind, I have decided that I am going to join the Golden State Warriors."
Durant's effort to categorise this move as not just a career decision but one based on "personal growth" and "my evolution as a man" is a commendable attempt to spin this in a positive fashion. Of course, this is corporate comms 101. He can't exactly come out and say "I don't think I can win at Oklahoma with this current roster. My best chance is to go to the best team in the Western Conference and win titles there. If you can't beat 'em, join 'em." Even though this is obviously the reason for his departure, he cannot actually say that. We're not quite ready to hear that, yet.
It's perhaps unfair that Durant has always been lumped alongside "one-club men" like Dirk Nowitzki, Tim Duncan, Larry Bird and Magic Johnson, as someone who would play out their career for the team that drafted them. But it's worth noting that all those players managed to win a championship. It's this fear of missing out that has driven Durant to make the move to the Bay Area. What's the point of being a "one-club man" if you can't win a ring there, in a world where rings mean literally everything?
Like Obama, we see in Durant what we wanted to see. Durant was a friendly, polite young man with bucket-loads of integrity. But based on events somewhat out of his control, Durant has made a difficult decision based on realist principles (i.e. the relentless pursuit of championship rings), which will ultimately shape the way he is viewed both today and after his career is over. In short, the ruthless world of modern professional sport is no place for an idealist.
The fans and media cannot fault Durant for taking this opportunity even if it clashes with their desired perception of him as a loyal franchise player, for it's the fans and media themselves who have forced players to carefully consider their legacies. The word "legacy" is a socially constructed idea that is influencing athletes to consider their careers in binary terms. If Durant doesn't win a ring at the Warriors, he will be considered one of the great failures.
It's reductive reasoning, sure, but sadly true.
By Dave Edwards
Posted in: NBA, Opinion
Tagged: Barack Obama legacy, Dirk Nowitzki, Kevin Durant free agency, Kevin Durant legacy, Kevin Durant Warriors, Larry Bird, LeBron James Decision, Magic Johnson, Oklahoma City Thunder, Tim Duncan
Previous Previous post: TPA's Election Analysis: Week Seven – The Night Before Shitmas
TPA's Election Analysis: Week Seven – The Night Before Shitmas
TPA's Election Analysis: Week Six – The Media
TPA's Election Analysis: Week Five – The Grind
TPA's Election Analysis: Week Four – "Economics, Dear Watson…"
'News'
Copyright © 2020 The Public Apology. Powered by WordPress and Themelia.


This is my favorite White Bread recipe for my bread machine! It has a soft, dense texture with just a bit of crunch to the edges. It works great for sandwiches when sliced thin, and works great for a dinner bread when sliced thick. I use a Westbend Bread Maker on Setting 1: Basic. I love making bread at home because the whole house smells amazing and it's cheaper than buying it at the store!
Add the ingredients above (except butter) into the bread machine, in the order listed. Be sure to put the yeast in a shallow well in the center. Do not lift the bread machine lid during baking. When the bread is done, remove the pan from the bread maker immediately, allow pan to cool 15 minutes, then remove bread by turning pan upside down. Set bread upright and brush with melted butter. Allow to cool a few more minutes before slicing with a bread knife. Serve thick slices warm as a side dish. Delicious with jam or honey! Slice thin slices for sandwiches and allow to cool completely before storing in an airtight container or plastic bag.
As much as I love my smartphone, I hate that it won't hold a charge all day long. If my battery drains while I'm out shopping, I certainly don't want to spend an hour standing next to an electrical outlet. If I'm traveling, finding an available outlet is nearly impossible. Being mobile is important, but so is being able to keep in contact with my family and my email. Besides, how can I post amazing travel pics if my battery is dead? The Chic Buds Crossbody Power Purse solves all these problems!
This gorgeous Crossbody Power Purse is stylish, sleek, and charges my phone! It's made of soft vegan leather material and is available in 13 great colors. Choose from versatile neutral colors like clay, taupe, black, and navy, or fabulous bright colors like plum, coral, yellow, and cobalt. The purse compartment measures 8.75"W x 9.75"H, which is more than enough room for everything I carry around.
It has a flat design, so it naturally hugs against my body, and the outside zipper pocket (where I usually keep my phone in any purse) is the charging zone with a built-in USB cord. The interior material is soft so it won't scratch my phone and I simply love the polka-dot design. The interior zipper pocket stores the thin, lightweight, 3000 mAh battery, which offers more than one full charge for most smartphones.
The Chic Buds Crossbody Power Purse has great design features like the goldtone chains on the straps and an adjustable carry strap with a goldtone buckle. Inside this purse, there are also two open-top side pockets for the little things I carry. I love this Crossbody purse, because it keeps my hands free and offers me more security than a handbag. It offers me everything I need, everything I want, and I can charge my phone anytime!
Go get your Chic Buds Crossbody Power Purse at www.chicbuds.com!
Check out my review of the Chic Buds Clutchette too!
It's a whole new year and it's time to get started on a new project. You could do one project a month this year, or you could go even bigger and remodel one room a month this year! Either way, finances are tight after the holidays, so my giveaway will help you jumpstart your first project. After you enter my giveaway, hop around to the other blogs below and enter their giveaways too!
Giveaway ends on 1/18/2016. Good luck!
$25 Home Depot Gift Card!
Giveaway ends on 1/16/2016. Good luck!
Every January, talk of New Year's resolutions flood social media, television news, and even face-to-face conversations. Rather than make a lame resolution this year, make this year the year you decide to live on purpose. Don't just make yourself a promise that you likely won't keep. Instead, decide to actually LIVE.
BE BRAVE. Do something you have always been afraid to do. Whether it's learn a skill that you think you're too old to do, travel to a place that you've always wanted to go, or walk away from something you know just isn't right for you. Be brave at least once a month.
BE A GIVER. Most of us have too much stuff in our house. Take the time to go through every room of your house and gather up absolutely everything you haven't used, worn, or even touched in the past year. Donate all of it. No garage sales, no online sales, just give it away to a charity. You will bless someone else and you will feel blessed yourself.
BE PRESENT. It's troubling how much time people spend looking at a screen. Whether it's the television, the computer, or a phone, it disconnects us from the people we love and all the amazing people we could have met if we hadn't been looking at a screen. Talk to people, really talk to people, not just a greeting, but a real conversation. Do it daily.
BE OUTSIDE. Breathe the air, walk through the neighborhood, wave at people, and smile at them. Sit in the sun, even in the winter-time. Stroll in the rain. Leave your phone and your camera at home. Enjoy the beautiful sights, sounds, and smells of the earth, just for the pure enjoyment of it. Do it several times a week.
BE REAL. Instead of texting or messaging someone, actually call them to find out how things are going. Call your parents and even your grandparents. Call your siblings, your cousins, your best friends from school. Write a newsy letter with an ink pen and send it through the postal service. Have lunch with friends or family, at your home or theirs. Meet your neighbors. Connect on a personal level and build relationships that have true meaning.
JUST BE. Slow down. Enjoy your life. Stop over-scheduling yourself and your family. Take the time to just spend time together. Memories are made just snuggling together. Memories are made sitting on backyard swings and talking. Memories are even made doing chores together. Once a day is gone, it's gone, and only the memories are left.
Live on purpose this year. And the next. And the one after that.
You'll leave a legacy of love.