//! Compute the depth of coverage in a BAM file for a list of reference sequences and positions.\n//!\n//! ## Input:\n//! A BAM file and a positions file.\n//! The positions file contains the name of one reference sequence and one position per line (tab separated).\n//! Example:\n//! ```\n//! 16    1\n//! 17    1\n//! 17    2\n//! 17    38\n//! 17    39\n//! ```\n//!\n//! Positions are read from stdin, the BAM file is the first argument.\n//!\n//! ## Output:\n//! Depth are written to stdout as tab-separated lines, similar to the positions input.\n//! Example:\n//! ```\n//! 16    1    0\n//! 17    1    5\n//! 17    2    5\n//! 17    38    14\n//! 17    39    13\n//! ```\n//!\n//! ## Usage:\n//!\n//! ```bash\n//! $ rbt bam-depth tests/test.bam < tests/pos.txt > tests/depth.txt\n//! ```\n//! Where `pos.txt` is a positions file, as described above.\n//!\n//!\nuse anyhow::Result;\nuse log::info;\nuse std::cmp;\nuse std::io;\n\nuse serde::Deserialize;\n\nuse rust_htslib::bam;\nuse rust_htslib::bam::{FetchDefinition, Read};\nuse std::path::Path;\n\n#[derive(Deserialize, Debug)]\nstruct PosRecord {\n    chrom: String,\n    pos: u32,\n}\n\npub fn depth<P: AsRef<Path>>(\n    bam_path: P,\n    max_read_length: u32,\n    include_flags: u16,\n    exclude_flags: u16,\n    min_mapq: u8,\n) -> Result<()> {\n    let mut bam_reader = bam::IndexedReader::from_path(&bam_path)?;\n    let bam_header = bam_reader.header().clone();\n    let mut pos_reader = csv::ReaderBuilder::new()\n        .has_headers(false)\n        .delimiter(b'\t')\n        .from_reader(io::stdin());\n    let mut csv_writer = csv::WriterBuilder::new()\n        .delimiter(b'\t')\n        .from_writer(io::BufWriter::new(io::stdout()));\n\n    for (i, record) in pos_reader.deserialize().enumerate() {\n        let record: PosRecord = record?;\n\n        // jump to correct position\n        let tid = bam_header.tid(record.chrom.as_bytes()).unwrap() as i32;\n        let start = cmp::max(record.pos as i64 - max_read_length as i64 - 1, 0);\n        bam_reader.fetch(FetchDefinition::Region(\n            tid,\n            start as i64,\n            start as i64 + (max_read_length * 2) as i64,\n        ))?;\n\n        // iterate over pileups\n        let mut covered = false;\n        for pileup in bam_reader.pileup() {\n            let pileup = pileup?;\n            covered = pileup.pos() == record.pos - 1;\n\n            if covered {\n                let depth = pileup\n                    .alignments()\n                    .filter(|alignment| {\n                        let record = alignment.record();\n                        let flags = record.flags();\n                        (!flags) & include_flags == 0\n                            && flags & exclude_flags == 0\n                            && record.mapq() >= min_mapq\n                    })\n                    .count();\n\n                csv_writer.serialize((&record.chrom, record.pos, depth))?;\n                break;\n            } else if pileup.pos() > record.pos {\n                break;\n            }\n        }\n        if !covered {\n            csv_writer.serialize((&record.chrom, record.pos, 0))?;\n        }\n\n        if (i + 1) % 100 == 0 {\n            info!('{} records written.', i + 1);\n        }\n    }\n    Ok(())\n}\n


use crate::bcf::report::table_report::create_report_table::create_report_data;\nuse crate::bcf::report::table_report::create_report_table::manipulate_json;\nuse crate::common::Region;\nuse anyhow::Result;\nuse chrono::{DateTime, Local};\nuse itertools::Itertools;\nuse std::io;\nuse std::io::Write;\nuse std::path::Path;\nuse tera::{Context, Tera};\n\npub(crate) fn plot_bam<P: AsRef<Path> + std::fmt::Debug>(\n    bam_paths: &[P],\n    fasta_path: P,\n    region: &Region,\n    max_read_depth: u32,\n) -> Result<()> {\n    let mut plots = Vec::new();\n\n    let Region { target, start, end } = region.clone();\n    for bam_path in bam_paths {\n        let content = create_report_data(&fasta_path, None, bam_path, region, max_read_depth)?;\n        let visualization = manipulate_json(content, start, end)?;\n\n        plots.push(visualization);\n    }\n\n    let bams = bam_paths\n        .iter()\n        .map(|b| b.as_ref().iter().last().unwrap().to_str().unwrap())\n        .collect_vec();\n\n    let mut templates = Tera::default();\n    templates.add_raw_template('bam_plot.html.tera', include_str!('bam_plot.html.tera'))?;\n    let mut context = Context::new();\n    let local: DateTime<Local> = Local::now();\n    context.insert('time', &local.format('%a %b %e %T %Y').to_string());\n    context.insert('version', &env!('CARGO_PKG_VERSION'));\n    context.insert('plots', &plots);\n    context.insert('bams', &bams);\n    context.insert('chrom', &target);\n    context.insert('start', &start);\n    context.insert('end', &end);\n\n    let html = templates.render('bam_plot.html.tera', &context)?;\n    io::stdout().write_all(html.as_bytes())?;\n\n    Ok(())\n}\n


pub mod plot_bam;\n


use anyhow::Result;\nuse bio::io::fasta;\nuse rand::prelude::{SliceRandom, ThreadRng};\nuse rand::seq::IteratorRandom;\nuse rust_htslib::bam;\nuse rust_htslib::bam::Read;\nuse std::collections::HashMap;\nuse std::ops::Range;\nuse std::path::Path;\nuse uuid::Uuid;\n\npub fn anonymize_reads<P: AsRef<Path> + std::fmt::Debug>(\n    bam: P,\n    input_ref: P,\n    output_bam: P,\n    output_ref: P,\n    chr: String,\n    interval: Range<u64>,\n    keep_only_pairs: bool,\n) -> Result<()> {\n    let start = interval.start;\n    let end = interval.end;\n    let mut fasta_reader = fasta::IndexedReader::from_file(&input_ref)?;\n    fasta_reader.fetch(&chr, start, end)?;\n    let mut reference = Vec::new();\n    reference.resize((end - start) as usize, 0);\n    fasta_reader.read(&mut reference)?;\n    let mut rng = rand::thread_rng();\n    let alphabet = [b'A', b'C', b'G', b'T'];\n\n    //Build artificial reference\n    let mut artificial_reference = Vec::new();\n    add_random_bases(end - start, &mut artificial_reference, &mut rng, &alphabet)?;\n    let mut altered_bases = init_altered_bases(&reference, &artificial_reference)?;\n    let mut fa_writer = fasta::Writer::to_file(output_ref)?;\n    let ref_id = Uuid::new_v4().to_hyphenated().to_string();\n    fa_writer.write(&ref_id, None, &artificial_reference)?;\n\n    let mut bam_reader = bam::IndexedReader::from_path(bam)?;\n    bam_reader.fetch((chr.as_bytes(), start, end + 1))?;\n\n    let mut header = bam::Header::new();\n    header.push_record(\n        bam::header::HeaderRecord::new(b'SQ')\n            .push_tag(b'SN', &ref_id)\n            .push_tag(b'LN', &(end - start)),\n    );\n    let mut bam_writer = bam::Writer::from_path(output_bam, &header, bam::Format::Bam)?;\n    let mate_in_range = |record: &bam::Record| -> bool {\n        (record.mtid() == record.tid())\n            && (record.mpos() >= (start as i64))\n            && (record.mpos() < (end as i64))\n    };\n    for result in bam_reader.records() {\n        let mut record = result?;\n        if (record.pos() >= start as i64)\n            && (record.cigar().end_pos() < end as i64)\n            && (!keep_only_pairs || mate_in_range(&record))\n        {\n            record.cache_cigar();\n            //Check if mate record end within region\n            let artificial_seq = if record.is_unmapped() || record.seq_len() == 0 {\n                let mut seq = Vec::new();\n                add_random_bases(record.seq_len() as u64, &mut seq, &mut rng, &alphabet)?;\n                seq\n            } else {\n                build_sequence(\n                    &mut altered_bases,\n                    &record,\n                    start as usize,\n                    &mut rng,\n                    &alphabet,\n                )?\n            };\n            let artificial_record = build_record(&record, &artificial_seq, start as i64)?;\n            bam_writer.write(&artificial_record)?;\n        }\n    }\n    Ok(())\n}\n\nfn init_altered_bases(\n    original_ref: &[u8],\n    artificial_reference: &[u8],\n) -> Result<HashMap<usize, HashMap<u8, u8>>> {\n    let mut altered_bases = HashMap::new();\n    for (i, (artifical_base, original_base)) in artificial_reference\n        .iter()\n        .zip(original_ref.iter())\n        .enumerate()\n    {\n        altered_bases\n            .entry(i)\n            .or_insert_with(HashMap::new)\n            .insert(*original_base, *artifical_base);\n    }\n    Ok(altered_bases)\n}\n\nfn build_record(record: &bam::Record, artificial_seq: &[u8], offset: i64) -> Result<bam::Record> {\n    let mut artificial_record = bam::record::Record::new();\n    artificial_record.set(\n        record.qname(),\n        Some(&record.cigar()),\n        artificial_seq,\n        record.qual(),\n    );\n    set_mandatory_fields(&mut artificial_record, record, offset)?;\n    for aux_result in record.aux_iter() {\n        let (tag, aux_field) = aux_result?;\n        artificial_record.push_aux(tag, aux_field)?;\n    }\n    Ok(artificial_record)\n}\n\nfn build_sequence(\n    altered_bases: &mut HashMap<usize, HashMap<u8, u8>>,\n    record: &bam::Record,\n    offset: usize,\n    rng: &mut ThreadRng,\n    alphabet: &[u8],\n) -> Result<Vec<u8>> {\n    let mut artificial_seq = Vec::new();\n    let record_seq = record.seq().as_bytes();\n    let mut record_pos = 0;\n    let mut ref_pos = record.pos() as usize - offset;\n    //Create random seq for leading softclips\n    for cigar in record.cigar_cached().unwrap().iter() {\n        match cigar.char() {\n            'S' => {\n                add_random_bases(cigar.len() as u64, &mut artificial_seq, rng, alphabet)?;\n                record_pos += cigar.len() as usize;\n            }\n            'M' | 'X' | '=' => {\n                (0..cigar.len()).for_each(|_| {\n                    let base_mappings = altered_bases.get(&ref_pos).unwrap().clone();\n                    let altered_base = *altered_bases\n                        .get_mut(&ref_pos)\n                        .unwrap()\n                        .entry(*record_seq.get(record_pos).unwrap())\n                        .or_insert_with(|| {\n                            *alphabet\n                                .iter()\n                                .filter(|&x| !base_mappings.values().any(|y| x == y))\n                                .choose(rng)\n                                .unwrap()\n                        });\n                    artificial_seq.push(altered_base);\n                    ref_pos += 1;\n                    record_pos += 1;\n                });\n                // Add reference bases except for mismatches\n            }\n            'I' => {\n                add_random_bases(cigar.len() as u64, &mut artificial_seq, rng, alphabet)?;\n                record_pos += cigar.len() as usize;\n            }\n            'D' | 'N' => {\n                ref_pos += cigar.len() as usize;\n            }\n            _ => {}\n        }\n    }\n\n    Ok(artificial_seq)\n}\n\nfn set_mandatory_fields(\n    target_rec: &mut bam::Record,\n    source_rec: &bam::Record,\n    offset: i64,\n) -> Result<()> {\n    target_rec.set_pos(source_rec.pos() - offset);\n    target_rec.set_tid(0);\n    let (mtid, mpos) = if source_rec.mtid() == -1 {\n        (-1, -1)\n    } else if source_rec.mtid() == source_rec.tid() {\n        (0, source_rec.mpos() - offset)\n    } else {\n        (1, source_rec.mpos())\n    };\n    target_rec.set_mtid(mtid);\n    target_rec.set_mpos(mpos);\n    target_rec.set_flags(source_rec.flags());\n    target_rec.set_insert_size(source_rec.insert_size());\n    target_rec.set_mapq(source_rec.mapq());\n    Ok(())\n}\n\nfn add_random_bases(\n    length: u64,\n    seq: &mut Vec<u8>,\n    rng: &mut ThreadRng,\n    alphabet: &[u8],\n) -> Result<()> {\n    (0..length).for_each(|_| seq.push(*alphabet.choose(rng).unwrap()));\n    Ok(())\n}\n


use crate::common::CalcConsensus;\nuse bio::io::fastq;\nuse bio::stats::probs::LogProb;\nuse bio_types::sequence::SequenceRead;\nuse bio_types::sequence::SequenceReadPairOrientation;\nuse derive_new::new;\nuse itertools::Itertools;\nuse rust_htslib::bam;\nuse rust_htslib::bam::record::Aux;\nuse std::collections::{HashMap, HashSet};\nuse std::ops::BitOrAssign;\n\nconst ALLELES: &[u8] = b'ACGT';\n\npub fn get_umi_string(rec: &bam::record::Record) -> String {\n    let umi = match rec.aux(b'RX') {\n        Ok(Aux::String(value)) => {\n            format!(' RX:Z:{}', value)\n        }\n        _ => String::from(''),\n    };\n    umi\n}\n\n#[derive(Eq, PartialEq)]\nenum StrandObservation {\n    None,\n    Forward,\n    Reverse,\n    Both,\n}\n\nimpl BitOrAssign for StrandObservation {\n    fn bitor_assign(&mut self, rhs: Self) {\n        if let StrandObservation::None = self {\n            *self = rhs;\n        } else if *self != rhs {\n            *self = StrandObservation::Both;\n        }\n    }\n}\n\n#[derive(new)]\npub struct CalcOverlappingConsensus<'a> {\n    recs1: &'a [bam::Record],\n    recs2: &'a [bam::Record],\n    r1_vec: &'a [bool],\n    r2_vec: &'a [bool],\n    seqids: &'a [usize],\n    uuid: &'a str,\n    read_ids: &'a mut Option<HashMap<usize, Vec<u8>>>,\n}\n\nimpl<'a> CalcOverlappingConsensus<'a> {\n    pub fn calc_consensus(&self) -> (fastq::Record, LogProb) {\n        let seq_len = self.r1_vec().len();\n        let mut consensus_seq: Vec<u8> = Vec::with_capacity(seq_len);\n        let mut consensus_qual: Vec<u8> = Vec::with_capacity(seq_len);\n        let mut consensus_strand = b'SI:Z:'.to_vec();\n        let read_orientations_opt = self.build_read_orientation_string();\n        let mut consensus_lh = LogProb::ln_one();\n        for i in 0..seq_len {\n            match (\n                self.recs1().len() == 1,\n                self.map_read_pos(i, self.r1_vec()),\n                self.map_read_pos(i, self.r2_vec()),\n            ) {\n                (true, Some(base_pos), None) => {\n                    let base = self.recs1()[0].seq().as_bytes()[base_pos];\n                    consensus_seq.push(base);\n                    consensus_qual.push(self.recs1()[0].qual()[base_pos] + 33);\n                    consensus_lh += Self::overall_allele_likelihood(self, &base, i);\n                }\n                (true, None, Some(base_pos)) => {\n                    let base = self.recs2()[0].seq().as_bytes()[base_pos];\n                    consensus_seq.push(base);\n                    consensus_qual.push(self.recs2()[0].qual()[base_pos] + 33);\n                    consensus_lh += Self::overall_allele_likelihood(self, &base, i);\n                }\n                _ => {\n                    let likelihoods = ALLELES\n                        .iter()\n                        .map(|a| Self::overall_allele_likelihood(self, a, i))\n                        .collect_vec();\n                    Self::build_consensus_sequence(\n                        likelihoods,\n                        &mut consensus_lh,\n                        &mut consensus_seq,\n                        &mut consensus_qual,\n                        33.0,\n                    );\n                }\n            };\n            self.build_consensus_strand(&mut consensus_strand, consensus_seq[i], i);\n        }\n        let name = if self.read_ids.is_some() {\n            Self::build_verbose_read_name(self.uuid(), self.seqids(), self.read_ids)\n        } else {\n            format!(\n                '{}_consensus-read-from:{}_reads',\n                self.uuid(),\n                self.seqids().len(),\n            )\n        };\n        if let Some(mut read_orientations) = read_orientations_opt {\n            consensus_strand.append(&mut read_orientations)\n        }\n        let umi = get_umi_string(&self.recs1()[0]);\n        let description = format!('{}{}', String::from_utf8(consensus_strand).unwrap(), umi);\n        let consensus_rec =\n            fastq::Record::with_attrs(&name, Some(&description), &consensus_seq, &consensus_qual);\n        (consensus_rec, consensus_lh)\n    }\n\n    fn recs1(&self) -> &[bam::Record] {\n        self.recs1\n    }\n\n    fn recs2(&self) -> &[bam::Record] {\n        self.recs2\n    }\n\n    fn r1_vec(&self) -> &[bool] {\n        self.r1_vec\n    }\n\n    fn r2_vec(&self) -> &[bool] {\n        self.r2_vec\n    }\n\n    fn build_consensus_strand(&self, consensus_strand: &mut Vec<u8>, ref_base: u8, pos: usize) {\n        let mut strand = StrandObservation::None;\n        let rec1_pos = self.map_read_pos(pos, self.r1_vec());\n        let rec2_pos = self.map_read_pos(pos, self.r2_vec());\n        let mut strand_observation = |recs: &[bam::Record], rec_pos: Option<usize>| {\n            if let Some(pos) = rec_pos {\n                recs.iter().for_each(|rec| {\n                    if rec.base(pos) == ref_base {\n                        match rec.is_reverse() {\n                            true => strand |= StrandObservation::Reverse,\n                            false => strand |= StrandObservation::Forward,\n                        };\n                    }\n                });\n            }\n        };\n        strand_observation(self.recs1(), rec1_pos);\n        strand_observation(self.recs2(), rec2_pos);\n        match strand {\n            StrandObservation::Forward => consensus_strand.push(b'+'),\n            StrandObservation::Reverse => consensus_strand.push(b'-'),\n            StrandObservation::Both => consensus_strand.push(b'*'),\n            StrandObservation::None => consensus_strand.push(b'.'),\n        }\n    }\n    fn build_read_orientation_string(&self) -> Option<Vec<u8>> {\n        let mut read_orientations_set: HashSet<_> = self\n            .recs1()\n            .iter()\n            .filter_map(|rec| match rec.read_pair_orientation() {\n                SequenceReadPairOrientation::F2F1 => Some(b'F2F1,'),\n                SequenceReadPairOrientation::F2R1 => Some(b'F2R1,'),\n                SequenceReadPairOrientation::F1F2 => Some(b'F1F2,'),\n                SequenceReadPairOrientation::R2F1 => Some(b'R2F1,'),\n                SequenceReadPairOrientation::F1R2 => Some(b'F1R2,'),\n                SequenceReadPairOrientation::R2R1 => Some(b'R2R1,'),\n                SequenceReadPairOrientation::R1F2 => Some(b'R1F2,'),\n                SequenceReadPairOrientation::R1R2 => Some(b'R1R2,'),\n                SequenceReadPairOrientation::None => None,\n            })\n            .collect();\n        let mut read_orientations_string = b' RO:Z:'.to_vec();\n        read_orientations_set\n            .drain()\n            .for_each(|entry| read_orientations_string.extend_from_slice(entry));\n        match read_orientations_string.pop() {\n            Some(b',') => Some(read_orientations_string),\n            Some(b':') => None,\n            Some(_) => unreachable!(),\n            None => unreachable!(),\n        }\n    }\n    fn map_read_pos(&self, consensus_pos: usize, alignment_vec: &[bool]) -> Option<usize> {\n        match alignment_vec[consensus_pos] {\n            true => Some(\n                alignment_vec[0..(consensus_pos + 1)]\n                    .iter()\n                    .filter(|&v| *v)\n                    .count()\n                    - 1,\n            ),\n            false => None,\n        }\n    }\n}\n\nimpl<'a> CalcConsensus<'a, bam::Record> for CalcOverlappingConsensus<'a> {\n    fn overall_allele_likelihood(&self, allele: &u8, pos: usize) -> LogProb {\n        let mut lh = LogProb::ln_one();\n        let rec1_pos = self.map_read_pos(pos, self.r1_vec());\n        let rec2_pos = self.map_read_pos(pos, self.r2_vec());\n        for (rec1, rec2) in self.recs1().iter().zip(self.recs2()) {\n            if let Some(pos) = rec1_pos {\n                lh += Self::allele_likelihood_in_rec(\n                    allele,\n                    &rec1.seq().as_bytes(),\n                    rec1.qual(),\n                    pos,\n                    0,\n                );\n            };\n            if let Some(pos) = rec2_pos {\n                lh += Self::allele_likelihood_in_rec(\n                    allele,\n                    &rec2.seq().as_bytes(),\n                    rec2.qual(),\n                    pos,\n                    0,\n                );\n            };\n        }\n        lh\n    }\n\n    fn seqids(&self) -> &'a [usize] {\n        self.seqids\n    }\n\n    fn uuid(&self) -> &'a str {\n        self.uuid\n    }\n}\n\n#[derive(new)]\npub struct CalcNonOverlappingConsensus<'a> {\n    recs: &'a [bam::Record],\n    seqids: &'a [usize],\n    uuid: &'a str,\n    read_ids: &'a mut Option<HashMap<usize, Vec<u8>>>,\n}\n\nimpl<'a> CalcNonOverlappingConsensus<'a> {\n    pub fn calc_consensus(&self) -> (fastq::Record, LogProb) {\n        let seq_len = self.recs()[0].seq().len();\n        let mut consensus_seq: Vec<u8> = Vec::with_capacity(seq_len);\n        let mut consensus_qual: Vec<u8> = Vec::with_capacity(seq_len);\n        let mut consensus_strand = b'SI:Z:'.to_vec();\n        let mut cigar_map = HashMap::new();\n        for record in self.recs() {\n            let cached_cigar = record.raw_cigar();\n            if !cigar_map.contains_key(cached_cigar) {\n                cigar_map.insert(cached_cigar, Vec::new());\n            }\n            cigar_map.get_mut(cached_cigar).unwrap().push(record);\n        }\n\n        // Potential workflow for different read lengths\n        // compute consensus of all reads with max len\n        // compute offset of all shorter reads\n        // pad shorter reads\n        // drop first consensus, compute consensus of full length reads and padded reads\n        // ignore padded bases for consensus computation\n\n        let mut consensus_lh = LogProb::ln_one();\n\n        for i in 0..seq_len {\n            // Maximum a-posteriori estimate for the consensus base.\n            // Find the allele (theta \in ACGT) with the highest likelihood\n            // given the bases at this position, weighted with their quality values\n            let likelihoods = ALLELES\n                .iter()\n                .map(|a| Self::overall_allele_likelihood(self, a, i))\n                .collect_vec(); //Check this. See below\n            Self::build_consensus_sequence(\n                likelihoods,\n                &mut consensus_lh,\n                &mut consensus_seq,\n                &mut consensus_qual,\n                33.0,\n            );\n            self.build_consensus_strand(&mut consensus_strand, consensus_seq[i], i);\n        }\n        let name = if self.read_ids.is_some() {\n            Self::build_verbose_read_name(self.uuid(), self.seqids(), self.read_ids)\n        } else {\n            format!(\n                '{}_consensus-read-from:{}_reads',\n                self.uuid(),\n                self.seqids().len(),\n            )\n        };\n        let umi = get_umi_string(&self.recs()[0]);\n        let description = format!('{}{}', String::from_utf8(consensus_strand).unwrap(), umi);\n        let consensus_rec =\n            fastq::Record::with_attrs(&name, Some(&description), &consensus_seq, &consensus_qual);\n        (consensus_rec, consensus_lh)\n    }\n    pub fn recs(&self) -> &[bam::Record] {\n        self.recs\n    }\n    fn build_consensus_strand(\n        &self,\n        consensus_strand: &mut Vec<u8>,\n        ref_base: u8,\n        current_pos: usize,\n    ) {\n        let mut strand = StrandObservation::None;\n        self.recs().iter().for_each(|rec| {\n            if rec.base(current_pos) == ref_base {\n                match rec.is_reverse() {\n                    true => strand |= StrandObservation::Reverse,\n                    false => strand |= StrandObservation::Forward,\n                };\n            }\n        });\n        match strand {\n            StrandObservation::Forward => consensus_strand.push(b'+'),\n            StrandObservation::Reverse => consensus_strand.push(b'-'),\n            StrandObservation::Both => consensus_strand.push(b'*'),\n            StrandObservation::None => consensus_strand.push(b'.'),\n        }\n    }\n}\n\nimpl<'a> CalcConsensus<'a, bam::Record> for CalcNonOverlappingConsensus<'a> {\n    fn overall_allele_likelihood(&self, allele: &u8, i: usize) -> LogProb {\n        let mut lh = LogProb::ln_one(); // posterior: log(P(theta)) = 1\n        for rec in self.recs() {\n            lh += Self::allele_likelihood_in_rec(allele, &rec.seq().as_bytes(), rec.qual(), i, 0);\n        }\n        lh\n    }\n    fn seqids(&self) -> &'a [usize] {\n        self.seqids\n    }\n    fn uuid(&self) -> &'a str {\n        self.uuid\n    }\n}\n


mod calc_consensus;\nmod pipeline;\n\nuse anyhow::Result;\nuse bio::io::fastq;\nuse log::info;\nuse pipeline::CallConsensusRead;\nuse rust_htslib::bam;\nuse rust_htslib::bam::{Format, Header, Read};\nuse std::path::Path;\n\npub fn call_consensus_reads_from_paths<P: AsRef<Path>>(\n    bam_in: P,\n    fq1: P,\n    fq2: P,\n    fq_se: P,\n    bam_skipped_out: P,\n    verbose_read_names: bool,\n) -> Result<()> {\n    info!('Reading input files:\n    {}', bam_in.as_ref().display());\n    info!(\n        'Writing forward consensus reads to:\n    {}',\n        fq1.as_ref().display()\n    );\n    info!(\n        'Writing reverse consensus reads to:\n    {}',\n        fq2.as_ref().display()\n    );\n    info!(\n        'Writing single end consensus reads to:\n    {}',\n        fq_se.as_ref().display()\n    );\n    info!(\n        'Writing skipped reads to:\n    {}',\n        bam_skipped_out.as_ref().display()\n    );\n    let bam_reader = bam::Reader::from_path(bam_in)?;\n    let fq1_writer = fastq::Writer::to_file(fq1)?;\n    let fq2_writer = fastq::Writer::to_file(fq2)?;\n    let fq_se_writer = fastq::Writer::to_file(fq_se)?;\n    let bam_skipped_writer = bam::Writer::from_path(\n        bam_skipped_out,\n        &Header::from_template(bam_reader.header()),\n        Format::Bam,\n    )?;\n    CallConsensusRead::new(\n        bam_reader,\n        fq1_writer,\n        fq2_writer,\n        fq_se_writer,\n        bam_skipped_writer,\n        verbose_read_names,\n    )\n    .call_consensus_reads()\n}\n\npub fn unmark_record(record: &mut bam::record::Record) -> Result<()> {\n    record.unset_duplicate();\n    let _ = record.remove_aux(b'PG');\n    let _ = record.remove_aux(b'DI');\n    let _ = record.remove_aux(b'DS');\n    Ok(())\n}\n


//! Tools that work on BAM files\npub mod anonymize_reads;\npub mod collapse_reads_to_fragments;\npub mod depth;\npub mod plot;\n


use anyhow::Context;\nuse approx::relative_eq;\nuse bio::stats::probs::{LogProb, PHREDProb};\nuse bio_types::sequence::SequenceRead;\nuse itertools::Itertools;\nuse ordered_float::NotNaN;\nuse std::cmp;\nuse std::collections::HashMap;\nuse std::str::FromStr;\n\nconst PROB_CONFUSION: LogProb = LogProb(-1.0986122886681098); // (1 / 3).ln()\nconst ALLELES: &[u8] = b'ACGT';\n\npub trait CalcConsensus<'a, R: SequenceRead> {\n    fn validate_read_lengths(recs: &[R]) -> bool {\n        let reference_length = recs[0].len();\n        recs.iter()\n            .map(|rec| rec.len())\n            .all(|len| len == reference_length)\n    }\n    /// Compute the likelihood for the given allele and read position.\n    /// The allele (A, C, G, or T) is an explicit parameter,\n    /// the position i is captured by the closure.\n    ///\n    /// Likelihoods are managed in log space.\n    /// A matching base is scored with (1 - PHRED score), a mismatch\n    /// with PHRED score + confusion constant.\n    fn allele_likelihood_in_rec(\n        allele: &u8,\n        seq: &[u8],\n        qual: &[u8],\n        i: usize,\n        offset: u8,\n    ) -> LogProb {\n        let q = LogProb::from(PHREDProb::from((qual[i] - offset) as f64));\n        if *allele == seq[i].to_ascii_uppercase() {\n            q.ln_one_minus_exp()\n        } else {\n            q + PROB_CONFUSION\n        }\n    }\n    fn build_consensus_sequence(\n        likelihoods: Vec<LogProb>,\n        consensus_lh: &mut LogProb,\n        consensus_seq: &mut Vec<u8>,\n        consensus_qual: &mut Vec<u8>,\n        offset: f64,\n    ) {\n        if relative_eq!(*likelihoods[0], *likelihoods[1])\n            && relative_eq!(*likelihoods[1], *likelihoods[2])\n            && relative_eq!(*likelihoods[2], *likelihoods[3])\n        {\n            consensus_seq.push(b'N');\n            consensus_qual.push(offset as u8);\n        } else {\n            let (max_posterior, allele_lh) = likelihoods\n                .iter()\n                .enumerate()\n                .max_by_key(|&(_, &lh)| NotNaN::new(*lh).unwrap())\n                .unwrap();\n            *consensus_lh += *allele_lh;\n            let marginal = LogProb::ln_sum_exp(&likelihoods);\n            // new base: MAP\n            consensus_seq.push(ALLELES[max_posterior]);\n            // new qual: (1 - MAP)\n            let qual = (likelihoods[max_posterior] - marginal).ln_one_minus_exp();\n            // Assume the maximal quality, if the likelihood is infinite\n            let truncated_quality: f64 = if (*PHREDProb::from(qual)).is_infinite() {\n                93.0\n            } else {\n                *PHREDProb::from(qual)\n            };\n            // Truncate quality values to PHRED+33 range\n            consensus_qual\n                .push(cmp::min(93 + offset as u64, (truncated_quality + offset) as u64) as u8);\n        }\n    }\n    fn build_verbose_read_name(\n        uuid: &str,\n        seq_ids: &[usize],\n        read_ids: &Option<HashMap<usize, Vec<u8>>>,\n    ) -> String {\n        format!(\n            '{}_consensus-read-from:{}',\n            uuid,\n            seq_ids\n                .iter()\n                .map(|i| String::from_utf8(\n                    read_ids\n                        .as_ref()\n                        .map(|x| x.get(i).unwrap())\n                        .unwrap()\n                        .to_vec()\n                )\n                .unwrap())\n                .join(',')\n        )\n    }\n\n    fn overall_allele_likelihood(&self, allele: &u8, i: usize) -> LogProb;\n    fn seqids(&self) -> &'a [usize];\n    fn uuid(&self) -> &'a str;\n}\n\n#[derive(Debug, Clone)]\npub struct Region {\n    pub(crate) target: String,\n    pub(crate) start: u64,\n    pub(crate) end: u64,\n}\n\nimpl FromStr for Region {\n    type Err = anyhow::Error;\n\n    fn from_str(s: &str) -> Result<Self, Self::Err> {\n        let (target, range) = s.split_once(':').context('No ':' in region string')?;\n        let (start, end) = range.split_once('-').context('No '-' in region string')?;\n        let start = start.parse::<u64>()?;\n        let end = end.parse::<u64>()?;\n        Ok(Region {\n            target: target.into(),\n            start,\n            end,\n        })\n    }\n}\n


<end> Introducing another superb waterfront property by Prince Bay Luxury Homes. This one-of-a kind luxury estate with a grandeur presence on Las Olas, offers the highest quality design + architecture. This home has 3 stories of ultra luxury living. Under air areas are 2722 on main floor, 2639 on second floor and 1195 on the sky high third floor.  The home is built with 100% concrete including all roofs...also the best system for floors which is poured in place 100% concrete. Visit the site now to appreciate the quality prior to drywall...equipped to meet the highest standards and lifestyles. Estimated completion is March 2022. <end> One of a kind, Modern Masterpiece designed by Affiniti Architects. Over 9,000 total sq ft on 100' of waterfrontage, a walk away to Fort Lauderdale's beach or a Restaurant off Las Olas. Custom home in Las Olas Isles with 6 Bedrooms 7 Full Bathrooms and 2 Half Baths.


<end> *Premium Double Lot: Open Lake Views, Half an Acre (24,024 sf) lot* Gorgeous custom home with an open floor plan, never-ending views of the lake, expansive living room, light and bright finishes, vaulted ceilings, and spacious gourmet kitchen is appointed for entertaining. Luxury finishes, include marble floors, custom ceilings, new ACs, three car garage, gorgeous backyard with a pool and water views. Unlike other properties in Bocaire, this estate is positioned on a premium half an acre double lot with wide-open, stunning lake views, making this property the most prominent in Bocaire Country Club. Furthermore, this property is located on the most desirable lakefront street in Bocaire.Come and live in paradise. The moment you enter Bocaire you understand why it's one of South Florida's top rated private clubs. Gated community with 24-hour manned security. $8 million golf course, designed by Kipp Schulties, featuring some of the highest elevations in the area. At over 7-thousand-yards, with 7 different tee locations on every hole, it's playable for championship tournaments as well as golfers at all levels of play.


The spacious clubhouse is the center of community life at Bocaire. Offering exquisite cuisine among many dining options and an extensive social calendar, there's truly something for everyone at Bocaire. Features include a wide array of entertainment, innovative programs, stimulating card games, and the latest in fitness, golf and tennis events for every level of play. Exceptional golf, tennis, recreation, fitness and social programs. Welcoming 36,000 sq. ft. clubhouse, bustling with social activity in multiple dining venues, beautifully appointed locker and card rooms, athletic studio, tennis and recreation complexes. Luxury resort-style aquatic center, just to name a few... <end>


Beautiful and modern single family, located on a quiet side-street, has an amazing floor plan that is difficult to find in the South End. The main floor has formal living and dining with a large eat-in kitchen all on one level. The house's generous width (22') and a large extension make this plan possible. The deck off of the kitchen is piped for gas for outdoor grilling, and there are gas fireplaces in both the living and dining rooms. The full-floor family room opens out to a large and sunny terrace surrounded by trees and the convenient wet-bar makes for easy entertaining. There is also a built out office on this level.The primary bedroom has vaulted ceilings, walk-in closet and a spa like bath with deep soaking tub and glass enclosed shower. There are two large bedrooms on the guest level with a full laundry room and all tile bath. The garden level has playroom/home gym, guest room, full bath and great storage. Hardwood floors throughout, central a/c and two full parking spaces.


Ontario premier pleads with incoming Biden administration for COVID-19 vaccine help https://t.co/HyhL40S1vM
Not going to happen. Biden has promised to increase inoculation speed in US. He will look after his own and we certainly can't blame him.


COVID-19 misinformation: scientists create a 'psychological vaccine' to protect against fake news https://t.co/WZJrYDo65K via @ConversationUK


She can not answer a simple question, now Canadians except her to get us vaccine. She is so shameless that after repeating the question 3 time starts smiling. #cdnpoli https://t.co/xkmOxpKHFJ


Last December, Canada voted against a WTO proposal to waive patent and intellectual property rights for all Covid19 vaccines and now we're at the mercy of Pfizer. Utter failure by @JustinTrudeau and @AnitaOakville here. https://t.co/62I0A3SEOH


@marwilliamson @andrealane1 There should also be a group Of Life Coaches comprised of 80% Women of Color who crushed COVID19 100% in 2O20 who are both COVID19 and CANCER Survivors.
This book by Dr. David Spangler MD. PHD. wil provecthat we offer a clear scientifically viable option to vaccines. https://t.co/RGMrHJvYqQ


The counselor helped the laborer because

he is a very kind person.
she is a very kind person.


The lawyer talked with the counselor because

she needed to gather additional evidence for the case.


The driver offered a ride to the teacher but

he refused the offer.
she refused the offer.


The cleaner got mad at the farmer because

she brought lots of dirt.
he brought lots of dirt.


The carpenter met with the teacher so that

she could fix the cabinets in the classroom.


The salesperson met with the counselor because


The receptionist reminded the cook to wear suits because


The sheriff told the counselor that

he was under investigation.
she was under investigation.


The supervisor was impressed by the tailor because

she is easily impressed.
he is easily impressed.


The driver picked up bread from the baker because


Remember what she said in my last letter? "


Goodwill helps people get off of public assistance.


Sherry learned through our Future Works class that she could rise out of the mire of the welfare system and support her family.


Coming to Goodwill was the first step toward my becoming totally independent.


I am now... totally off of welfare."


Goodwill prepares people for life-long employment.


Here's another story of success from what might seem like an unlikely source: Goodwill's controller, Juli.


Cornell found a number of employment options that he never dreamed existed after a work-site injury forced him out of his job at a foundry.


He trained in desktop publishing and combined his enthusiastic work ethic with new-found skills in a burgeoning industry. "


Nana came into the room with a puzzled look on her face.


Nana came into the room with a puzzled look on her face.

She held up an orange sock and a blue one.


Nana came into the room with a puzzled look on her face. She held up an orange sock and a blue one.

My daughter jumped up and grabbed the blue one out of her hand.


Nana came into the room with a puzzled look on her face. She held up an orange sock and a blue one. My daughter jumped up and grabbed the blue one out of her hand.

She took off running down the hall while waving the sock in the air.


Nana came into the room with a puzzled look on her face. She held up an orange sock and a blue one. My daughter jumped up and grabbed the blue one out of her hand. She took off running down the hall while waving the sock in the air.

Nana chased her down, caught her, and tickled her until she laughed.


Context: function $$(){	if (!arguments) return false;	if (arguments.length == 1){		if (!arguments[0]) return false;		if (arguments[0]._elements_extended_) return arguments[0];	}	var items = [];	var elements = [];	$each(arguments, function(selector){		if ($type(selector) == 'string') items.extend(document.getElementsBySelector(selector));		else if ($type(selector) == 'element') items.push($(selector));		else if (selector.length){			$each(selector, function(sel){				items.push(sel);			});		}	});	items.each(function(item){		if ($(item)) elements.push(item);	});	elements._elements_extended_ = true;	return Object.extend(elements, new Elements);};


if ($type(selector) == 'string') items.extend(document.getElementsBySelector(selector)); else if ($type(selector) == 'element') items.push($(selector)); else if (selector.length){ $each(selector, function(sel){ items.push(sel); });

switch ($type(selector)){ case 'element': elements.push($(selector)); break; case 'string': selector = document.getElementsBySelector(selector); default: if (selector.length){ $each(selector, function(el){ if ($(el)) elements.push(el); }); }


}); items.each(function(item){ if ($(item)) elements.push(item);


Paulina: we're approaching the town
Amy: where are you?
Jesus: waiting at the platform, no worries

Paulina and Amy are reaching the town. Jesus is waiting at the platform.


Ray: It was awesome, thank you all!
Amy: <3
Garry: Thank youuuu, it was so much fun. I'm sorry I couldn't stay longer. Hugs for everyone :D
Amy: (Y)
Paula: I agree with Garry. It short yet intense :D it was so good to see everyone, and you Amy. Again happy happy birthday, NOT relatively good as Artie wrote hahaha
Amy: :D
Kris: We also had so much fun :D Thank you so much :D it was super cool to get to know Amy's friends :) P.S. standing ovation for choral performances :)
Amy: <3
Rory: I also wanna thank you Amy. Unfotunately, "boogers" didn't allow us to stay longer.
Amy: :D
Paula: Did you catch a cold rory? haha :D

Amy's birthday party gets great feedback from Ray, Garry, Paula, Kris and Rory. Some people like Rory or Garry had to leave earlier.


Veki: Are they finished their job?
Meki: No, they are playing right now.
Veki: Who is the better?
Meki: Rada is the best, then Radmila and at the end is Gorjana.
Veki: which game they are playing?
Meki: Canasta game.
Veki: do you know to play a Canasta?
Meki: No, I do not like to play cards.
Veki: Why?
Meki: For me, playing a cards is rather losing i nice time.
Veki: Hm.
Meki: It is better to read something actual rom news papers or from some Internet blogs.
Veki: You are right.
Meki: Good bye, I love you.
Veki: I love you too. Good bye.

Meki is watching Rada, Radmila, and Gorjana play Canasta. Meki prefers reading to playing cards.


Anne: <file_photo>
Nick: Wow, what's that?
Anne: You remember the curry wurst you brought me from Berlin?
Nick: Yeah, how was it?
Anne: Frankly? I've just thrown it away and used the jar as a pot for this lovely hyacinth!
Nick: You're not only creative, but also have green fingers, wow!

Anne didn't eat the curry wurst Nick brought her from Berlin. She disposed of it and used the jar as a flower pot.


Josef: join me today
Bryan: where?
Josef: i will be selling my products in the old town
Bryan: oh, wow
Josef: yeah, there is a market of local products and i go there with my cheese
Bryan: so i will help ypu
Josef: you dont need to i just want you to be there with me :)

Josef will be selling his cheese at a market in the old town and wants Bryan to join him.


Hank: Mom were out of ice cream
Fay: Is this your way of asking for more?
Hank: Mom please!
Fay: you have money you can go to the store
Hank: yeah but youre going anyway
Fay: and you wonder why your sister is our favourite


Rob: can you man the calls today
Sue: fine all day?
Rob: well I have the meeting in Plymouth so will probably be out of the office most of the day
Sue: ok thats fine, what time is the meeting?
Rob: need to be in the centre of Plymouth for about 11.30
Sue: no worries.. let me know how you get on
Rob: will do should be a good little job ongoing
Sue: great will we get Graham Mason on that?
Rob: yes I think so we can start after the new yer

Rob has a meeting in Plymouth at 11.30 and asks Sue to man the calls today. Rob expects a good job, engage Graham Mason in the job and start it after the New Year.


Roc: I spy with my little eye
Will: Who is this?
Roc: It's Roc!
Will: I'm sorry, but I think you got the wrong number.
Roc: Oops, really sorry.
Will: No problem :)


able play youtube alexa


able recognize indian accent really well drop function helpful call device talk person near device smart plug schedule work seamlessly con would sound kindloud but lack clarity mid frequency need tweeked optimum clarity rarely device doesnt respond call alexa


absolute smart device amazon connect external sub woofer sound amaze recons voice even close room like almost collection songs english hindi must quite moneys worth


absolutely amaze new member family control home voice connect home anywhere world


absolutely amaze previously sceptical invest money but arrive worth ityou absolutely buy wont regret cheer


absolutely cheat customer if buy amazon product definitely want buy amazon prime members also case if song want play absolutely need amazon prime membership otherwise can not play music app no google apps not work amazon alexa if anybody want amazon alexa go google home everything also free cost app


absolutely house hold item fair price intuitive speech recognition superb use hindi english sometimes hinglish also big thank amazon team even place draw room call alexa bedroom ears us play favourite songs flawlessly overall best fit must guess guests visit us purchase enjoy performance must buy


absolutely mind blow device beautiful shape excellent work nice performance verry easy usebut problem no battery storage work pluggedotherwise amaze


accept dutch language


accessibility limit amazon apps music appsexcellent use bluetooth speaker


A boy is on a rock near calm waters taking a photograph of the scenery .

Two young guys with shaggy hair look at their hands while hanging out in the yard .


Two young , White males are outside near many bushes .


Two men in green shirts are standing in a yard .


A man in a blue shirt standing in a garden .


A man taking a photograph in a small body of water .


Question: What Should Investors In Conservation Syndications Do When DOJ Seeks Injunction?

Last month, I wrote about the Department of Justice beginning to crack down on abusive conservation easement syndications. DOJ is seeking an injunction against people associated with EcoVest Capital, which according to Peter Elkind of Fortune is the most prolific syndicator of conservation easements. I explained the concept behind conservation easement deductions in that piece last month (and other coverage over the last several years). Here we are going to discuss them from the point of view of investors, which greatly simplifies things. To an investor, the program is something of a black box. The Black Box  An investor (Let's go with Terry for a name) in an EcoVest deal pays them some money. Before Form 1040 for that year is due, Terry will get a K-1 showing a charitable contribution that is a multiple of the amount invested (probably between four or five times). So Terry will get back more than the investment in tax savings. That, of course, is the essence of the deal as far as Terry is concerned. In a few years, the property as encumbered by the easement is sold by the partnership. Terry will then get some of the original investment back. Terry needs to make sure the return preparer includes all required disclosures. But now Terry has heard that DOJ is calling the deals all sorts of nasty names. They literally refer to the persons named having "ill-gotten gains". Terry put $20,000 into a 2017 deal and $20,000 into a 2018 deal. Tax savings federal and state were $30,000 in 2017 and are projected about the same for 2018. I was actually asked that question. Not by anybody who has ever been my client, just to be clear. Worst case, as far as I can figure, Terry might have to give back the $30,000 in savings from 2017 along with a 40% penalty. In principle, Terry might avoid the penalty by filing an amended return (or returns if there were state savings) which leaves the question of what to do about 2018. What To Do About Return Not Yet Filed  The 2018 question is a lot easier to answer. Terry should ask for the $20,000 back from EcoVest and consider supplementing the fourth quarter estimate, although that probably won't make much difference. I spoke with EcoVest investor relations and they made it clear that they won't just cut a check. Their point of view is that DOJ has arbitrarily struck demanding that five hard-working people, who are connected to EcoVest one way or another, are being asked to take up different work. Due to the government shutdown, they have not been able to respond. The EcoVest representative who only gave me his first name indicated that a statement has been sent out to the twenty or so broker-dealers that they use. I haven't gotten my hands on a copy of that yet. If Terry has the stomach for this sort of thing there could be complaints to various regulatory bodies which might encourage EcoVest to reconsider. I think the stakes are too low to engage a lawyer. Assuming the refund exercise is fruitless, Terry should plan on going on extension. EcoVest has indicated that the K-1s will be issued. But even if they are issued, my inclination would be to extend based on the assumption that the tax savings will not be available and see what develops. My partner often chides me about procrastinating. She is usually right. I've yet to see the dirty dishes spontaneously clean themselves, but I can keep hoping. Here, though, procrastination is the right answer. I don't give audit lottery advice, but this circumstance is different. I really don't think that Terry should amend the 2017 return and give back the tax savings. When you get a K-1, you are supposed to put on your return what the K-1 shows. What Terry should do is verify that the correct disclosures were included with the 2017 return and, if not, possibly amend for that. I really think that engaging a tax attorney is premature. You don't know for sure that your deal is going to be attacked and what the actual outcome will be. If you have the means (and you should if you were a qualified investor), plan to have your tax saving plus 40% or so liquid in a couple of years. Kiss it goodbye mentally now, which will cut your stress a lot. If it develops, as is not that unlikely, that you get to keep it, I think you should donate it to a legitimate conservation organization as a kind of penance for having profited from these shenanigans, but that is just me moralizing. My Sympathies  In EcoVest vs DOJ, I am rooting for DOJ. Syndication of conservations easement charitable deductions is a travesty. It doesn't even make good nonsense. The investors are a different story. From what I can gather, somebody told them that these deals are legitimate and there is a sense in which that is true. So they have some sympathy from me. As Learned Hand wrote:  Over and over again courts have said that there is nothing sinister in so arranging one's affairs as to keep taxes as low as possible. Everybody does so, rich or poor; and all do right, for nobody owes any public duty to pay more than the law demands: taxes are enforced exactions, not voluntary contributions. To demand more in the name of morals is mere cant. Future investors get less sympathy. IRS Notice 2017-10 indicates the syndicated conservation easements are listed transactions. Reilly's Fourteenth Law of Tax Planning - If something is a listed transaction, just don't do it.

Summary: DOJ is seeking an injunction against people associated with EcoVest Capital. EcoVest is the most prolific syndicator of conservation easement syndications. To an investor, the program is something of a black box.


Question: What Should Investors In Conservation Syndications Do When DOJ Seeks Injunction?

Summary: Department of Justice is seeking an injunction against people associated with EcoVest Capital. The company is the most prolific syndicator of conservation easements. To an investor, the program is something of a black box. The investor (Let's go with Terry for a name) may have to give back $30,000 in savings from 2017.


Question: Why Didn't Apple Use Qualcomm's Modems In 2018 iPhones?

Like I said last week in my article entitled If The FTC Case Against Qualcomm Seems Like a Clown Show Right Now, It's Because It Started That Way, if you havent been following the FTC versus Qualcomm case and are in the tech industry, you probably should. Whats likely at stake are future inventors rights to monetize their inventions, the U.S. government becoming an IP price fixer, U.S. 5G competitiveness, and competitiveness in related industries like self-driving cars and smart cities and potentially even national security. One of the things that caught my eye last week was Apple COO Jeff Williams FTC testimony that Qualcomm wouldnt sell it chips for its 2018 iPhones. This could be viewed as support for the FTCs no license-no chips accusation against Qualcomm and be damaging to Qualcomms defense. Williams testified that But in the end, they (Qualcomm) would not support us and sell us chips- I contacted Steve (Mollenkopf), I sent him emails, I called. We tried to get them to sell us chips and they would not.  Three days ago, Bloombergs Ian King and Mark Gurman ran a piece from leaked emails in September 2017 between Apple and Qualcomm suggesting Qualcomm CEO Steve Mollenkopf did offer to sell Apple its wireless chips for use in 2018 iPhones. The article said that Apple wanted source code for the modems and Qualcomm wanted a commitment to 50% of the supply over two years. If accurate, this article would support what Qualcomm CEO Steve Mollenkopf testified to when asked, was there ever a time when Qualcomm withdrew from competing for business at Apple? and Mollenkopf answered, no.  While I would have preferred to see the Qualcomm-Apple emails in testimony versus leaked emails, no one so far is questioning the email authenticity with me. Ill assume this wasnt part of FTC evidence because the FTC limited its investigation through 2016. I want to peel back the onion a bit and dig in on a few things. First off, this exchange seems like good, old fashioned negotiating. I spent over 20 years at hardware OEMs and chip companies, did a lot of negotiating from both sides, and this is what negotiation looks like. It appears Qualcomm wanted a volume commitment and Apple, based on Williams testimony, seemed prepared to offer it, given Williams earlier testimony on a desire to dual-source. Apple also appears to want the source code for the thin modem. I will assume that Apple wanted Qualcomms latest X20 LTE modem at the time and the X20 source code. What I dont understand is why Apple wouldnt just keep using the X16 modem, which lined up well right next to Intels XMM 7560 gigabit class modem from a feature and speed standpoint. Apple already had the source code for the X16 modem and continues to ship the X16 in older iPhone models today. In November 2017, Qualcomm asked a San Diego court to force Apple to provide a software audit on how Apple was using its source code. In September 2018, Qualcomm filed a breach of contract lawsuit against Apple for trade secret misappropriation. What is evident from this chain of events from September 2017 to September 2018 is that Qualcomm was worried Apple was going to misappropriate its X20 source code as Qualcomm believed it did with the X16. Apples stock response to these trade secret theft accusations was, "Qualcomm's illegal business practices are harming Apple and the entire industry. They supply us with a single connectivity component, but for years have been demanding a percentage of the total cost of our products - effectively taxing Apple's innovation." Even though Qualcomm had its fears over trade secret theft, according to the Bloomberg emails, the company was still prepared to sell it modems with a volume commitment. To the core of the FTCs suit against Qualcomm is that it wouldnt sell chips unless customers paid for licensing fees. If the emails referenced to in the Bloomberg article are accurate, then it looks like Qualcomm's Mollenkopf was prepared to sell its chips to Apple but Apple didnt like the terms. This all strikes me as negotiation, not anti-trust harm, particularly when Apple could have used the X16 modem with which it already had the source code and is still buying. This he said-she said are what courts are for, to piece through these things and as I have said, Im no lawyer and dont play one on TV. I hope to see a day that Apple and Qualcomm can resolve its differences and focus all on what consumers want- innovative products and great experiences, because Im getting sick of all this. Disclosure: Moor Insights & Strategy, like all research and analyst firms, provides or has provided paid research, analysis, advising, or consulting to many high-tech companies in the industry, including Advanced Micro Devices, Apstra, ARM Holdings, Bitfusion, Cisco Systems, Dell EMC, Diablo Technologies, Echelon, Ericcson, Frame, Gen Z Consortium, Glue Networks, GlobalFoundries, Google (Nest), HP Inc. HewlettPackard Enterprise, Huawei Technologies, IBM, Jabil Circuit, Intel, Interdigital, Konica Minolta, Lenovo, Linux Foundation, MACOM (Applied Micro), MapBox, Mavenir, Mesosphere, Microsoft, National Instruments, NOKIA (Alcatel Lucent), Nortek, NVIDIA, ONUG, OpenStack Foundation, Peraso, Portworx, Protequus, Pure Storage, Qualcomm, Rackspace, Rambus, Red Hat, Samsung Technologies, Silver Peak, SONY, Springpath, Sprint, Stratus Technologies, TensTorrent, Tobii Technology, Synaptics, Verizon Communications, Vidyo, Wellsmith, Xilinx, Zebra, which may be cited in this article.

Summary: Apple COO Jeff Williams testified last week that Qualcomm wouldnt sell it chips for its 2018 iPhones. This could be viewed as support for the FTCs no license-no chips accusation against Qualcomm and be damaging to Qualcomm's defense.


Question: Will NFL adopt CFL policy for pass interference review after officiating error?

Toronto Argonauts defensive back Matt Black can see the winds of change blowing through the NFL after Sundays controversial finish to the NFC title game  just like in the CFL in 2014. The Los Angeles Rams advanced to the Super Bowl with a 26-23 overtime win over the New Orleans Saints  the first game of a wild semifinal Sunday that started a debate about rules that happen to be different in the CFL. Greg Zuerlein kicked the game-winning 57-yard field goal after forcing overtime with a 48-yard boot late in the fourth quarter thanks in large part to a blown call in the quarter. On third-and-10 inside the Rams 15-yard line, Saints quarterback Drew Brees threw a pass toward receiver Tommylee Lewis. But Rams cornerback Nickell Robey-Coleman not only didnt turn his head to see the ball, but delivered a helmet-to-helmet hit on Lewis at about the five-yard line before it arrived. Amazingly, no flag was thrown. Had a penalty been called, New Orleans wouldve received a fresh set of downs and the chance to run the clock down and kick a short game-winning field goal. Wil Lutzs 31-yard field goal put the Saints ahead 23-20 but St. Louis got the ball at its 25-yard line with 1:41 remaining and drove for a tying field goal. Saints head coach Sean Payton was incensed with the non-call, but could do nothing about it. Had this happened in a CFL game, Payton wouldve had an opportunity to challenge the play. CFL teams can make one challenge per game so long as they have at least one timeout. If the challenge is unsuccessful, a timeout is charged. But a team keeps the timeout if the challenge is successful. Regardless of the outcome, no other challenges can be made. So under CFL rules, Payton wouldve still had to have his challenge and at least one timeout to have the play reviewed. On Sunday, the CFL drew praise from ESPN, which also suggested it was time for the NFL to expand its replay rules. And the Edmonton Eskimos tweeted: If anything has been learned today, it is that the @CFL rules are @NFL rules and that theres less of a chance of seeing the same teams in the championship.  Black, entering his 11th CFL season with the Argos, expects the NFL to look hard at making pass interference a reviewable offence. I think this will spur change in the NFL, said Black, a two-time Grey Cup champion. I think youll see the review of this because of that play. But Id want it to go both ways. If theres offensive pass interference then you can challenge it and if theres defensive pass interference then you could do that too.  In 2014, the CFL became the first football league to make pass interference reviewable. That came after Hamilton defensive back Evan McCollough wasnt called for contacting Montreal receiver Duron Carter in the end zone late in the Tiger-Cats 19-16 overtime win in the 13 East Division semifinal. Instead of getting the ball at the Hamilton one-yard line, Montreal had to settle for a game-tying field goal. Coaches initially had two challenges but that number was reduced to one in 2017. In the 2015 Grey Cup, a successful challenge by head coach Chris Jones helped Edmonton beat Ottawa 26-20 in Winnipeg. Jones challenged an incompletion that was changed to pass interference and put the Esks on the Redblacks 10-yard line. That set up Jordan Lynchs one-yard TD run with 3:22 remaining and Mike Reillys completion to Akeem Shavers for the two-point convert to erase a 20-18 deficit. Glen Johnson, the former CFL official who later served as the leagues director of officiating, said there was no doubt Robey-Coleman interfered with Lewis. I did (expect a flag to be thrown). Johnson said. Absolutely (it was pass interference) and I say that with all empathy for the official because people just dont know until theyre out there just how hard it is. As an official, way back I went from not liking (replay) to feeling it was a really good tool to help us. And when I went into management I went, This is absolutely mandatory to protect the integrity of the game.  The AFC championship game wasnt immune from criticism, either, and it too revolved around a rule unique to the NFL. The New England Patriots, after winning the coin toss for overtime, marched 80 yards on 15 plays  capped by Rex Burkheads two-yard TD run  to beat the Kansas City Chiefs 37-31. Chiefs quarterback Patrick Mahomes, who threw for 295 yards and three TDs in regulation, never touched the field in the extra session. In the CFL, both teams get the ball in overtime. In the NFL, a touchdown ends the game. That prompted Calgary Stampeders punter Rob Maver to tweet: I say this as an objective viewer: the NFLs overtime rules are complete and utter garbage.  But Nik Lewis, the CFLs all-time receptions leader (1,051) now in his first season as the B.C. Lions running backs coach, likes the NFLs overtime policy during the regular season, But he thinks both teams should get the ball in the playoffs. Its a battle to earn the right to go to the next stage, he said. Really, the coin toss decides the game.  Black supports the NFLs OT format. If you drive 80 yards and score a touchdown, tell me why the New England Patriots dont deserve to go to the Super Bowl, he said. If New England had to kick a field goal, Mahomes gets the ball back and the Chiefs get an opportunity to march down the field. If they score a TD, were sitting here talking about how amazing a 23-year-old kid is whos taking his team to the Super Bowl. I dont think there has ever been or will ever be another combination like Tom Brady and (Pats coach) Bill Belichick.  However, it was the non-call in the NFC contest that drew the most attention. Like Black, Johnson believes the incident will move the NFL closer to allowing coaches to challenge pass interference. I hope it does, he said. I hope it serves as good dialogue for the rules committee.  But Johnson believes the CFLs challenge system could be tweaked. The hardest part in figuring all of this out is you want a system, method or approach you can get to that leaves you that challenge for that moment, Johnson said. Had we not had two (challenges) in the 15 Grey Cup, they might not have had that other challenge to use late in the game to fix that PI. I think fundamentally there has to be a system to use replay to get egregious calls fixed. The officials want it, the fans want it, the coaches want it. Everybody wants it.  Lewis, though, doesnt see it that way. The reason is its never consistent, theyre judgment calls, said Lewis. Theres not a consistent rule on pass interference so I think its very hard to decide which is interference and which isnt. But theres no doubt that play was pass interference.  Still, Lewis said the Saints couldve made the play moot by scoring TDs in a dominant first half rather than settling for field goals. As a player or coach, you know theres going to be calls for and against you that are borderline, he said. So you dont want to put yourself in that situation (where game is decided by officials call).  Jim Daley, a former head coach with Winnipeg and Saskatchewan, said with CFL coaches having just one challenge, a viable option could be having the replay official buzzing the game official when theres an obvious miss. It was a huge mistake, an obvious mistake and (NFL) has already admitted that, he said. In the CFL if youve already used your challenge, youre not challenging that play anyway. I just think there might be a process where a review official whos away from the heat of the game but sees the whole picture can somehow reach the game official and review it.

Summary: Under CFL rules, Saints head coach Sean Payton would've had opportunity to challenge the play. The CFL made pass interference reviewable in 2014 after a controversial play in the East Division semifinal against the Hamilton Tiger-Cats. Black expects the NFL to look hard at making pass interference a reviewable offence.


Question: Can Corning Sustain Its Momentum in the Fourth Quarter?

Corning Incorporated (NYSE: GLW) is slated to announce fourth-quarter 2018 results on Tuesday, January 29, 2019. Shares of the glass technologist are down modestly from its exceptional third-quarter report in October as of this writing -- albeit primarily driven by the broader market's decline since then. To be clear, last quarter Corning demonstrated accelerating growth and expanding margins as its investments in innovation and manufacturing capacity began to yield fruit. And if management's commentary is any indication, shareholders should expect to see more of the same next week. Before Corning's Q4 results hit the wires, then, let's have a look at what investors should be watching. Multiple panes of Corning glass. More  IMAGE SOURCE: CORNING. A "step change" in profitability  Three months ago, Corning Chairman and CEO Wendell Weeks boasted that Q3 marked a "step change in our earnings power," particularly as Corning leveraged its "recent phase of intense operating and capital investments to capture substantial benefits." Remember, Corning is in the home stretch of its four-year Strategic and Capital Allocation Framework announced in late 2015. Under that framework as of the end of last quarter, the company had already returned $11.4 billion (of a $12.5 billion goal) to shareholders through dividends and repurchases, and remained on track to invest $10 billion back into the business to solidify its industry leadership and capture future growth. Next week, the market will expect the company to confirm it has continued to make notable progress toward those goals, as per usual. But shareholders should also listen closely for any updates regarding Corning's targets for the duration of this year, as well as potential plans to extend its framework at the end of 2019. As for this quarter's headline numbers, Corning's latest guidance calls for full-year 2018 sales to "exceed $11.3 billion." Based on its sales of $8.255 billion through the first nine months of the year, that means the fourth quarter should arrive (conservatively) at around $3.05 billion. Meanwhile, Corning does not provide specific consolidated bottom-line guidance. So for perspective, and though we usually don't lend much credence to Wall Street's expectations, most analysts will be looking for Corning's core earnings to increase roughly 14% to $0.57 per share. Breaking it down  Corning did offer some broad expectations in October for each of its five primary segments to end the year. At optical communications, its single largest business, fourth-quarter sales should climb in the low-single-digit percent range sequentially, from $1.117 billion last quarter, helped by large ongoing projects from multiple carrier and data center customers. All told, that should mean optical achieves slightly higher year-over-year growth than the 9% increase we saw in Q3. Next, Corning's display technologies segment should benefit from ever-larger television screen sizes. Coupled with the recent ramp of Corning's Gen 10.5 LCD glass substrate facility in China, display technologies should see volume growth slightly above the low-single-digit sequential increase expected from the broader display glass market. At the same time, its revenue and earnings benefit for this segment will be held back by continued annual display glass price declines -- though it's worth noting Corning has done an admirable job moderating those declines in recent years.

Summary: Corning Incorporated is slated to announce fourth-quarter 2018 results on Tuesday. Analysts are looking for core earnings to increase roughly 14% to $0.57 per share.


Question: Can Corning Sustain Its Momentum in the Fourth Quarter?

Summary: Corning Incorporated is slated to announce fourth-quarter 2018 results on Tuesday. Analysts are looking for core earnings to increase roughly 14% to $0.57 per share. At optical communications, fourth-quarter sales should climb in the low-single-digit percent range.


Question: Did J.R. Smith call Marcus Smart a "bum" for DeAndre' Bembry incident?

originally appeared on nbcsportsboston.com  J.R. Smith appeared to call out one of two players Saturday night on Instagram. Scroll to continue with content Ad  We think we have a pretty good guess. After ESPN's "SportsCenter" Instagram account posted a video of Marcus Smart charging at DeAndre' Bembry during Saturday night's Boston Celtics-Atlanta Hawks game, the former Cleveland Cavaliers guard chimed in by writing "such a bum" in the comment section. JR Smith's not a fan of Marcus Smart. pic.twitter.com/SNTxMLeCgv  Josh Poloha (@JorshP) January 20, 2019  Technically, Smith's "bum" jab could be directed at Smart or Bembry. But Smith and Smart have serious history. A quick recap: During the 2018 NBA playoffs, Smart confronted Smith after the Cavs guard pushed Al Horford while he was in the air attempting to catch an alley-oop. When Boston and Cleveland met this preseason, Smart and Smith scuffled again, and their beef continued off the court with some nasty postgame remarks and tweets. So, it's safe to say Smith's comments aren't directed at Bembry. Smart has bigger problems to worry about, though: His Celtics will aim for their fourth consecutive win Monday, while Smith has stepped away from the Cavs while seeking a trade. Click here to download the new MyTeams App by NBC Sports! Receive comprehensive coverage of your teams and stream the Celtics easily on your device.

Summary: ESPN's "SportsCenter" Instagram account posted a video of Marcus Smart charging at DeAndre' Bembry. Former Cleveland Cavaliers guard JR Smith chimed in by writing "such a bum" in the comment section.


Question: Did J.R. Smith call Marcus Smart a "bum" for DeAndre' Bembry incident?

Summary: ESPN's "SportsCenter" Instagram account posted a video of Marcus Smart charging at DeAndre' Bembry. Former Cleveland Cavaliers guard JR Smith chimed in by writing "such a bum" in the comment section.   Technically, Smith's "bum" jab could be directed at Smart or Bembry.


Question: Did Ciara, Russell Wilson respond to Future saying the NFL pro is 'not being a man'?

CLOSE Ciara shared a photoshoot she recently did for Harper's Bazaar that has people wondering what Russell Wilson is doing. Keri Lumm (@thekerilumm) reports. Buzz60  Ciara and husband Russell Wilson seem to be taking the high road. The couple posted Instagram messages that seem directed at her ex, Future, who dissed their relationship Thursday, slamming Wilson for "not being a man" in his marriage to the "Level Up" singer. "Rise Above," Ciara said alongside a photo of herself in a pink and black plaid shirt and sky-high black boots. NFL star Wilson stuck with family, posting, "All that matters. #Love" along with a super-sweet photo of Ciara and Future's 4-year-old son, Future Zahir, kissing his little sister, 1-year-old Sienna, Ciara's daughter with Wilson. Celebrity power couple: Ciara and Russell Wilson's love story  The couple haven't publicly discussed Future's appearance on Apple Musics Beats 1 Radio on Thursday. He do exactly what she tell him to do. He not being a man in that position, the rapper, 35, said. You not tellin her, Bro, chill out with that on the internet. Dont even talk to him. Im your husband! You better not even bring Futures name up!  He continued, "If that was me, she couldn't even bring his name up. She know that. She couldn't even bring her exes' names up." Ciara and Future were engaged in 2013, but broke off their relationship three months after Future Zahir was born. The singer and Wilson married in 2016. USA TODAY has reached out to Ciara's and Wilson's representatives for comment. Read or Share this story: https://www.usatoday.com/story/life/people/2019/01/22/ciara-russell-wilson-future/2641749002/

Summary: Ciara and Russell Wilson posted Instagram messages that seem directed at her ex, Future. Future said Wilson is "not being a man" in his marriage to Ciara.


Question: Did Ciara, Russell Wilson respond to Future saying the NFL pro is 'not being a man'?

Summary: Ciara and Russell Wilson seem to be taking the high road. The couple posted Instagram messages that seem directed at her ex, Future. Future slammed Wilson for "not being a man" in his marriage to the singer. Wilson stuck with family, posting, "All that matters.


Check her correspondence, and cut-and-paste from it.

At least until you are confident that you get her writing style.

Create yourself a library of templates from her correspondence.

Create yourself a listing of her favorite expressions.

If she asks you to write a specific letter to a party and you can't think of a template or an original letter that you can use, ask her if she can think of an original letter she wrote that you can use as a template.

If you are doing cut-and-paste, do it but don't admit to it :)

How you make the sausage and from what ingredients is between you and the wall.

Make a draft letter and ask for her opinion.

You are not in her mind, so you have no idea how to proceed yet.

Start by reading some of her writings to get inspiration, then write a first draft.

Review it by yourself, and ask yourself what words she would not have used and what you could improve.

Then you can show her your draft and ask for her opinion.

Take careful notes of her remarks, and re-write the letter accordingly.

The second version should be much closer to what she wants.

To imitate her writing style read as much of her writing as you can.

Look for common turns of phrase or idioms that she uses, look for a pattern in first and last sentences of correspondence (problem statement, well wishing, summing up, etc), look at the number and length of paragraphs used, does she commonly use passive voice (starting the sentence with the object rather than the subject).

Someone copying my style for emails would see a common pattern of statement of problem - steps taken - request for action.

Common phrase would be "as your schedule allows", "Let me know if there is anything I can do", and "Please advise".

My emails will contain a lot of passive voice.

Break things down As with any challenging task, breaking things down into manageable pieces makes sense.

It sounds as though your boss puts some effort into maintaining good relationships with her readers.

Look at the following aspects of her letters:

How they start and finish - The opening and closing of letters

set the mood, reinforcing the relationship between writer and reader.

Tone

- How is the language used?

Is it business/professional, or is it open/informal in nature?

Is it buzzword heavy or in plain language?

Structure

- How long are the paragraphs and sentences inside them?

How do sentences typically start (and are parentheses used a lot)?

Use of contractions - e.g. or "for example"?

Aim - Letters are written for a reason.

How does your boss get down to the point and either ask for what she wants, and how does she inform the user of key facts?

How does she get what she wants out of the communication?

Analysing these aspects should help in building a decent facsimile of how she constructs letters herself.

Read lots and lots of stuff she has written.

Then try writing something up and ask her to critique it.

After a few rounds of doing this, you should get better.

Question: I've been asked to start writing letters for my boss. My boss will then send out these letters with her signature underneath them.   My boss has a particular writing style, and she wants me to write using her writing style. I've never imitated someone's writing style before. Does anyone here have any advice on how to do this?

How to imitate my boss's writing style?

Read as much of her writing as you can for inspiration and make a list of her favourite expressions that you can cut and paste into your writing. Write a draft letter and ask for her opinion on it.

An important step when trying to imitate your boss' writing style would be to read her previous correspondence for inspiration. From this, you can also try to identify commonly used expressions and idioms or even create a template for future correspondence. Of course, you may also wish to get her feedback on any draft letters that you do write.

Check your boss's previous correspondence and try to identify any particular expressions or features of her writing style which you can use in the future.

An important step in imitating your bosses writing style would be to read a lot of her previous correspondence to get inspiration.

Write a draft letter and ask for your boss's feedback.

If you can, use previous correspondence to create a template for future letters and e-mails.


If you have asked this person to stop this behavior, in a documented way ( email ) begin doing the following while making sure your supervisor is in the loop.

( You should usually give your supervisor the chance to address an issue before moving on to HR ) Document each occurrence with pictures and dates/times.

Make a note of witnesses.

After a couple such documented occurrences go to HR with your evidence.

This person sounds like the type of person who needs to be either reprimanded so his behavior changes, or fired.

This is similar to or could be considered bullying and should not be tolerate d. If the jokes are not well received by the person being pranked and the jokester, then this falls into bullying and typically is not condoned by professional companies.

Pranks at work are one thing, but messing with another person's car is not acceptable.

I would advise that you speak to your manager immediatly.

Explain that the atmosphere is making you uncomfortable and that people have interfered with your vehicle.

Insist that the behaviour has to stop.

As Mister Positive said, keep a paper trail.

If any damage has occured to your vehicle, get it fixed and present the bill to the prankster.

Advise your boss that you will be doing this (again, in writing) or, if you are uncomfortable giving the bill to the prankster, give it to your boss.

After you flag this to your boss, if anything further happens to your car call the police, file a report for criminal damage (or whatever your local equivalent is).

This approach may seem harsh or extreme, but cars are expensive.

A simple "prank" could cause thousands of pounds/dollars/bolivars of damage, or potentially have an impact on the safety and roadworthiness of the vehicle.

Tell your boss that this "picking on" is affecting your work and let him deal with it.

If people are messing around in the office then I would document everything, and think about contacting HR.

If they're messing around with your car I would see HR immediately.

A few jokes can be pretty bad but interfering with someones car is a criminal offence.

If they are messing with your property, especially if they are making your car potentially unsafe to drive, you need to go to a manager.

Now.

Document, in writing, what they've done and when.

If you can take pictures, do it.

Don't discuss the issue with the bullies.

Don't tell them you're going to speak to a manager.

Question: What can I do about people picking on me at work? When asked they reply with:   I only pick on people that I like   This keeps happening to me weekly, and has now progressed to pranks that involve messing with my car.

How to handle/deal with people pranking me at work?

You should think about going to HR or your manager and reporting the bullying. You should also document it and make note of any witnesses. You could even go to the police and file a report for criminal damage to your car.

Initially, you may wish to simply ask the bully to stop bothering you. However, if this is now repeated behaviour, you will probably want to report the matter to your boss or your company's HR department so that they can handle the matter correctly. Be sure to keep a record of all details, including photos, and don't discuss the matter with the party in question. If any criminal damage is inflicted, of course, there is the option of reporting the matter to the police or presenting the culprit with a bill for the damage.

If this behaviour is repeated, consider reporting the matter to HR.

You may wish to consider discussing the issue with your boss so that they can handle the matter appropriately.

Be sure to keep a record or all details, including witnesses.

Don't discuss the issue with the bullies and don't inform them that you are reporting them.

If any criminal damage is caused, consider filing a police report or sending a bill to the culprit.

You may wish to simply ask the bully to stop.


You have two choices: do it, in a nondemeaning way.

You don't have to wear a silly costume, film in a silly location, etc.

If you have a choice of music you can choose something you're ok with.

Someone may "tut" that you didn't make a fool of yourself, but you participated.

don't do it.

Either by "not getting around to it" because you've "got a lot on your plate this week" or by replying to the reminders saying you're not going to do it.

Either may cause someone to feel you're not a team player.

These videos are rarely designed to be demeaning.

They are supposed to be fun, and to demonstrate a more personal side to your coworkers or customers.

I've done my share, and they can be pleasant.

(They've always been optional and the recording is just of yourself, and gets cut into a larger montage.

The department-by-department approach here makes things trickier.)

I'm not going to put on a crazy wig or dance on my desk.

I don't think you have to either.

Just suck it up and do it.

Things like this matter more than you would think, and you might actually have fun.

Management remembers who was and was not a team player.

Not saying its fair, just telling you how it is.

( at least in the US )

I'm going to answer in a somewhat different direction.

If you don't want to do this, assert confidently that you are not going to participate.

If this causes backlash and insistence on you participating, then keep in mind the following.

Your company is trying to force you to do an activity that is: Not related to your job at all Not (strongly*) related to the company's goal or mission

Clearly making you uncomfortable

And because you (and perhaps others) are being forced into doing it despite all this, completely missing

it's only potentially valid point of being "fun" or "teambuilding", since it clearly isn't to you.

This is not about "being a teamplayer" at all.

This is about the company trying to coerce you into a pointless activity that makes you uncomfortable while trying to pretend they're doing "something fun".

It is a sign of a strongly dysfunctional organization, and you should start looking for a new job.

Forcing people to do things that make them uncomfortable "because it'll be fun" is not okay.

(And while you're searching for a new job, calling in sick is probably the best way to get out of this specific event)

*this might be meant as a cute marketing stunt, in which case there's some connection to the goal of the company, but still no reason at all to force anyone into participating.

If you can't avoid it, then someone has to be film-crew, animal-wrangler, key-grip etc.

Be creative and think up some very important reason why you can't be on the action side of the camera.

I'd take a sick day - hey, the very thought of participating in the video makes me sick.

Or I'd take a personal day - hey, my pet rock is feeling neglected :)

I'd suggest a different approach to the situation.

Such videos also need much more than "actors in them".

They need someone: to help setting up some decorations in the location where it's filmed to go pick up the costumes or hats or whatever to go pick up the camera from the manager's brother who agreed to lend it for a few days to actually film the thing to actually add the music / edit the video / publish it etc. to do other stuff that I can't think of right now

There's a lot of stuff that needs to be done so that such a video is a "successfull" one.

If you don't want to risk being seen as "not a team player", then you can participate in such a video without being an "actor".

Just suggest it to your manager or whoever is responsible for it.

As a side-note / personal comment: I too think such videos are kind of a waste of time and frankly quite pathetic.

Managers / executives simply want to portray an image of "look how fun we are and what a great place to work this is", but it's simply fake and everyone sees through it... or they should.

I'm kinda surprised that no one mentioned this yet, but compelling people to participate in any "holiday celebration"

is assuming that it is a holiday for everyone.

Basically not everyone celebrates these holidays and forcing people to participate, in what could be seen as religious holidays, could be an HR nightmare.

Even if this isn't your reason, you could drop that bug in someone's ear and get the whole thing called off.

"You know I like the holidays as much as anyone, but have you considered..."

Question: Management expects every department to pick a song and participate in a song and dance video to be shown company-wide (think  https://youtu.be/X0v_InsGdSE  ). Everyone is "expected" to participate, though many find it demeaning. How do we opt out without being perceived as non team players?

Management expects full participation in holiday nonsense video

Come up with a reason that you would better off participating on the other side of the camera or just inform management that you won't be taking part. If all else fails, try taking a sick day.

The simplest way to not participate would be either to not be in work that day or to insist that you are not taking part. However, if you want to avoid being perceived as a "non-team-player", you could look for other ways of participating that mean that you don't have to appear on camera.

You could simply assert that you are not going to participate.

You might want to look for other ways that you can participate in this activity without appearing on camera.

You may simply look for an excuse not to be in work that day, although it would be highly unprofessional.


I had TERRIBLE withdrawal from sertraline.

SO.... Don't just quit without the supervision of your doctor TELL NOBODY ON THE JOB.

It's not their business

Be prepared to take a sick day or two if you're not feeling right.

Even with your Psychiatrist dropping you down slowly, you can still get withdrawal, be very aware of the side effects and if you feel them coming on, address them.

The bathroom is always a good choice, or go home if they get too bad Discuss all of this with your psychiatrist If HR or your boss takes notice of any of this, get a note from your psychiatrist and bring that to HR. Do not say anything other than the fact that you are under a doctor's care, and "here's the note"

If the side effects are going to be intense (they sound pretty serious), then maybe you should consider going on medical leave while you sort yourself out (discuss this with your psychiatrist).

If however, you're going to keep going in to the office, then you may indeed wish to inform your boss and/or HR that you're transitioning off some medication (with the blessing of your medical professional), and may experience some side effects which they should know about.

This situation is tricky because you would be voluntarily disclosing medical information.

However, if you suddenly snap and yell at someone in the office it might not hurt for your boss to be aware that you don't "mean it", and might need some time alone to compose yourself, or to head home for the remainder of the day.

Either way, I would strongly suggest taking a few days off and monitoring your reaction to the withdrawal.

Never tell anyone except your closest family about changes in your medication.

If you tell our boss or co-workers that you are going off sertraline, they are going to look up the drug to find out what to expect.

Having read all about its indications and effects, they will naturally assume you will now exhibit anger, irritability, confusion, dizziness, sleepiness, or depression.

Confirmation bias will set in and at least some of them will believe you are presenting these symptoms, even as you actually become more forgiving, calm, focused, alert, awake, and motivated.

(Of course, on the positive side, they will also see you as less thirsty, more trim and fit, better rested, and more potent -- assuming they have read up on the side effects.)

A lot will depend upon your relationship with the boss and the size of the company and its HR department.

It may be helpful to tell those with whom you have a lot of interaction (including your boss) that you are going to be changing some medications and that you don't expect any problems, but there's a possibility of adverse reactions that might require using a different treatment.

Don't go into specifics about what is being changed; there's no particular reason your boss or coworkers should need to know or care.

What is important is that they understand that if they notice adverse changes in your mood or other such problems and they let you know, you will be able to pass that information along to your doctor so he can try something else.

If stopping the medication does adversely affect your work performance, you will need to talk to your doctor to figure out how to address the problem, but that would be a medical issue more than a workplace one.

You don't say where you are based, but if it's somewhere with disability discrimination legislation then by not disclosing your mental health issues you have no protection under the law.

I would recommend always letting HR know about health issues, and usually warn my boss and colleagues about medication changes if it might affect my behaviour at work.

Let's assume next week you act angry, irritable, or confused.

All not things that are particularly liked in the workplace.

Ask your doctor whether you would know if that happens (and if it is safe to restore the original dose if that happens).

If your doctor tells you that you might behave in a way that is not appropriate for the workplace, without realising it, then it might be safer if someone who works with you and who you can trust knows what's going on and saves you from getting into trouble.

HR or your boss if he doesn't work with you directly might not be the right person.

Question: I've been taking sertraline for about 3 years, and this year I, with the supervision of my psychiatrist, decided to stop taking it by reducing the dosage slowly. Some of the common symptoms of sertraline withdrawal are ( taken from here ):   anger  irritability  confusion  dizziness  sleepiness  depression   I don't know how I specifically will be affected, or if my productivity will be affected. Should I tell my boss or HR about it?

Should I tell my boss that I'm stopping a medication that affects my mood?

Many people recommend informing your boss and colleagues that you might experience some side-effects that could affect your work. However, it does depend on your relationship with your boss and colleagues. Other people argue that you should never tell people at work about medication you are on.

The answer to this question will largely depend on your relationship with your boss and the overall culture of the company, but even still, the answer will be subjective. Some people wouldn't advise mentioned health issues to people in a work setting. Other people feel that it would be best to mention any personal issues that might affect your work to either your boss, HR or both.

The answer to this question will largely depend on your relationship with your boss and the culture of the company.

Some people don't recommend revealing health issues to anyone in the workplace.

Some people feel that honesty is the best policy and that it would always be beneficial to inform HR or your boss about any personal matters than might affect your performance at work.


Short answer: no .

The hiring manager will come in the next morning, have 3 new applications and won't care enough to look up the time-stamp when exactly they came in.

If you are in current employment you might have no opportunity to apply for other roles during the working day, so applying for jobs at night is pretty much what most people have to do.

For companies who perceive this as negative, they would have to make assumptions as to why you applied late at night, and if they do that

then you should ask yourself do you really want to work for them?

You will find that most don't even look at the time in which an application was received, a lot of HR departments deal with printed CV and cover letters and will never even know when you applied for a job.

Smaller companies might know, but are unlikely to care.

The biggest factor in terms of when to apply for a role should be making sure you apply for the role as soon as possible.

Absolutely not.

There are at least 10 reasons that I can imagine for why you would apply late at night, and none of them would be of any interest whatsoever to me as an employer.

I'd hazard a guess that the majority of the employers doesn't even look beyond the date portion of the timestamp, at all.

No.

few people, if any, look at the timestamp of an application.

I don't.

Even if I did I would simply assume that you were employing a tactic to submit as late as possible to be the first application I saw when I got in, so if anything I would think you were either clever or using every available moment to job hunt.

Generally I agree with what Agent L and Jonathon Cowley-Thom have said.

Given that so many hiring managers are inundated with applications nowadays

, I doubt they'd have the energy to consider the time you applied.

Depending on what kind of electronic application system the employer is using, they may not even be able to see the time that you applied.

In general I think it would take a lot for a hiring manager to consider that.

I'd also like to point out that when it comes to federal jobs, they're almost all posted on the USAjobs.gov website.

While some are posted at various times throughout the day, most are posted at midnight when their system updates.

I consider myself a very well versed applicant, and I'm very motivated about my career.

So depending on my schedule, I often stay up late into the night, or get up very early in the morning to check what jobs have posted.

Especially considering that many of the more desirable jobs will close after receiving a set # of applications.

The system is automated and my resume/transcripts/certifications are all uploaded, so I have applying down to a matter of minutes.

Question: Given my current schedule (including work) I am often up very late at night. I am looking for a new job and was wondering, does it look bad if a employer receives an application form at 3am or sometime where most people are sleeping? I am looking for more regular jobs (around 9-6) and expect to have to adjust my sleep schedule and am prepared for this.

Can it be seen as negative having applied for a job posting late at night?

No, the hiring manage will not consider this.

It is not generally considered a problem to send job applications late at night.