text:
"""Internal helper files for user output."""

__author__ = "Luc Anselin luc.anselin@asu.edu, David C. Folch david.folch@asu.edu, Pedro V. Amaral pedro.amaral@asu.edu, Jing Yao jingyao@asu.edu"

import textwrap as TW
import numpy as np
import copy as COPY
import diagnostics as diagnostics
import diagnostics_tsls as diagnostics_tsls
import diagnostics_sp as diagnostics_sp
import pysal
import scipy
from scipy.sparse.csr import csr_matrix

__all__ = []

###############################################################################
############### Primary functions for running summary diagnostics #############
###############################################################################

"""
This section contains one function for each user level regression class. These
are called directly from the user class. Each one mixes and matches smaller
functions located later in this module.
"""

def OLS(reg, vm, w, nonspat_diag, spat_diag, moran, white_test, regimes=False):
    reg.__summary = {}
    # compute diagnostics and organize summary output
    beta_diag_ols(reg, reg.robust)
    if nonspat_diag:
        # compute diagnostics
        reg.sig2ML = reg.sig2n
        reg.f_stat = diagnostics.f_stat(reg)
        reg.logll = diagnostics.log_likelihood(reg)
        reg.aic = diagnostics.akaike(reg)
        reg.schwarz = diagnostics.schwarz(reg)
        reg.mulColli = diagnostics.condition_index(reg)
        reg.jarque_bera = diagnostics.jarque_bera(reg)
        reg.breusch_pagan = diagnostics.breusch_pagan(reg)
        reg.koenker_bassett = diagnostics.koenker_bassett(reg)
        if white_test:
            reg.white = diagnostics.white(reg)
        # organize summary output
        reg.__summary['summary_nonspat_diag_1'] = summary_nonspat_diag_1(reg)
        reg.__summary['summary_nonspat_diag_2'] = summary_nonspat_diag_2(reg)
    if spat_diag:
        # compute diagnostics and organize summary output
        spat_diag_ols(reg, w, moran)
    if regimes:
        summary_regimes(reg)
    summary_warning(reg)
    summary(reg=reg, vm=vm, instruments=False,
            nonspat_diag=nonspat_diag, spat_diag=spat_diag)

def OLS_multi(reg, multireg, vm, nonspat_diag, spat_diag, moran, white_test, regimes=False, sur=False, w=False):
    for m in multireg:
        mreg = multireg[m]
        mreg.__summary = {}
        # compute diagnostics and organize summary output
        beta_diag_ols(mreg, mreg.robust)
        if nonspat_diag:
            # compute diagnostics
            mreg.sig2ML = mreg.sig2n
            mreg.f_stat = diagnostics.f_stat(mreg)
            mreg.logll = diagnostics.log_likelihood(mreg)
            mreg.aic = diagnostics.akaike(mreg)
            mreg.schwarz = diagnostics.schwarz(mreg)
            mreg.mulColli = diagnostics.condition_index(mreg)
            mreg.jarque_bera = diagnostics.jarque_bera(mreg)
            mreg.breusch_pagan = diagnostics.breusch_pagan(mreg)
            mreg.koenker_bassett = diagnostics.koenker_bassett(mreg)
            if white_test:
                mreg.white = diagnostics.white(mreg)
            # organize summary output
            mreg.__summary[
                'summary_nonspat_diag_1'] = summary_nonspat_diag_1(mreg)
            mreg.__summary[
                'summary_nonspat_diag_2'] = summary_nonspat_diag_2(mreg)
        if spat_diag:
            # compute diagnostics and organize summary output
            spat_diag_ols(mreg, mreg.w, moran)
        if regimes:
            summary_regimes(mreg, chow=False)
        if sur:
            summary_sur(mreg)
        summary_warning(mreg)
        multireg[m].__summary = mreg.__summary
    reg.__summary = {}
    if regimes:
        summary_chow(reg)
    if sur:
        summary_sur(reg, u_cov=True)
    if spat_diag:
        # compute global diagnostics and organize summary output
        spat_diag_ols(reg, w, moran)
    summary_warning(reg)
    summary_multi(reg=reg, multireg=multireg, vm=vm, instruments=False,
                  nonspat_diag=nonspat_diag, spat_diag=spat_diag)

def TSLS(reg, vm, w, spat_diag, regimes=False):
    reg.__summary = {}
    # compute diagnostics and organize summary output
    beta_diag(reg, reg.robust)
    if spat_diag:
        # compute diagnostics and organize summary output
        spat_diag_instruments(reg, w)
    # build coefficients table body
    build_coefs_body_instruments(reg)
    if regimes:
        summary_regimes(reg)
    summary_warning(reg)
    summary(reg=reg, vm=vm, instruments=True,
            nonspat_diag=False, spat_diag=spat_diag)

def TSLS_multi(reg, multireg, vm, spat_diag, regimes=False, sur=False, w=False):
    for m in multireg:
        mreg = multireg[m]
        mreg.__summary = {}
        # compute diagnostics and organize summary output
        beta_diag(mreg, mreg.robust)
        if spat_diag:
            # compute diagnostics and organize summary output
            spat_diag_instruments(mreg, mreg.w)
        # build coefficients table body
        build_coefs_body_instruments(mreg)
        if regimes:
            summary_regimes(mreg, chow=False)
        if sur:
            summary_sur(mreg)
        summary_warning(mreg)
        multireg[m].__summary = mreg.__summary
    reg.__summary = {}
    if regimes:
        summary_chow(reg)
    if sur:
        summary_sur(reg, u_cov=True)
    if spat_diag:
        # compute global diagnostics and organize summary output
        spat_diag_instruments(reg, w)
    summary_warning(reg)
    summary_multi(reg=reg, multireg=multireg, vm=vm,
                  instruments=True, nonspat_diag=False, spat_diag=spat_diag)

def GM_Lag(reg, vm, w, spat_diag, regimes=False):
    reg.__summary = {}
    # compute diagnostics and organize summary output
    beta_diag_lag(reg, reg.robust, error=False)
    if spat_diag:
        # compute diagnostics and organize summary output
        spat_diag_instruments(reg, w)
    # build coefficients table body
    summary_coefs_allx(reg, reg.z_stat)
    summary_coefs_instruments(reg)
    if regimes:
        summary_regimes(reg)
    summary_warning(reg)
    summary(reg=reg, vm=vm, instruments=True,
            nonspat_diag=False, spat_diag=spat_diag)

def GM_Lag_multi(reg, multireg, vm, spat_diag, regimes=False, sur=False, w=False):
    for m in multireg:
        mreg = multireg[m]
        mreg.__summary = {}
        # compute diagnostics and organize summary output
        beta_diag_lag(mreg, mreg.robust, error=False)
        if spat_diag:
            # compute diagnostics and organize summary output
            spat_diag_instruments(mreg, mreg.w)
        # build coefficients table body
        summary_coefs_allx(mreg, mreg.z_stat)
        summary_coefs_instruments(mreg)
        if regimes:
            summary_regimes(mreg, chow=False)
        if sur:
            summary_sur(mreg)
        summary_warning(mreg)
        multireg[m].__summary = mreg.__summary
    reg.__summary = {}
    if regimes:
        summary_chow(reg)
    if spat_diag:
        pass
        # compute global diagnostics and organize summary output
        #spat_diag_instruments(reg, w)
    summary_warning(reg)
    summary_multi(reg=reg, multireg=multireg, vm=vm,
                  instruments=True, nonspat_diag=False, spat_diag=spat_diag)

def ML_Lag(reg, w, vm, spat_diag, regimes=False):  # extra space d
    reg.__summary = {}
    # compute diagnostics and organize summary output
    beta_diag_lag(reg, robust=None, error=False)
    reg.__summary['summary_r2'] += "%-20s:%12.3f                %-22s:%12.3f\n" % (
        'Sigma-square ML', reg.sig2, 'Log likelihood', reg.logll)
    reg.__summary['summary_r2'] += "%-20s:%12.3f                %-22s:%12.3f\n" % (
        'S.E of regression', np.sqrt(reg.sig2), 'Akaike info criterion', reg.aic)
    reg.__summary['summary_r2'] += "                                                 %-22s:%12.3f\n" % (
        'Schwarz criterion', reg.schwarz)
    # build coefficients table body
    summary_coefs_allx(reg, reg.z_stat)
    if regimes:
        summary_regimes(reg)
    summary_warning(reg)
    summary(reg=reg, vm=vm, instruments=False,
            nonspat_diag=False, spat_diag=spat_diag)

# extra space d
def ML_Lag_multi(reg, multireg, vm, spat_diag, regimes=False, sur=False, w=False):
    for m in multireg:
        mreg = multireg[m]
        mreg.__summary = {}
        # compute diagnostics and organize summary output
        beta_diag_lag(mreg, robust=None, error=False)
        mreg.__summary['summary_r2'] += "%-20s:%12.3f                %-22s:%12.3f\n" % (
            'Sigma-square ML', mreg.sig2, 'Log likelihood', mreg.logll)
        mreg.__summary['summary_r2'] += "%-20s:%12.3f                %-22s:%12.3f\n" % (
            'S.E of regression', np.sqrt(mreg.sig2), 'Akaike info criterion', mreg.aic)
        mreg.__summary['summary_r2'] += "                                                 %-22s:%12.3f\n" % (
            'Schwarz criterion', mreg.schwarz)
        # build coefficients table body
        summary_coefs_allx(mreg, mreg.z_stat)
        if regimes:
            summary_regimes(mreg, chow=False)
        summary_warning(mreg)
        multireg[m].__summary = mreg.__summary
    reg.__summary = {}
    if regimes:
        summary_chow(reg)
    summary_warning(reg)
    summary_multi(reg=reg, multireg=multireg, vm=vm,
                  instruments=False, nonspat_diag=False, spat_diag=spat_diag)

def ML_Error(reg, w, vm, spat_diag, regimes=False):   # extra space d
    reg.__summary = {}
    # compute diagnostics and organize summary output
    beta_diag(reg, robust=None)
    reg.__summary['summary_r2'] += "%-20s:%12.3f                %-22s:%12.3f\n" % (
        'Sigma-square ML', reg.sig2, 'Log likelihood', reg.logll)
    reg.__summary['summary_r2'] += "%-20s:%12.3f                %-22s:%12.3f\n" % (
        'S.E of regression', np.sqrt(reg.sig2), 'Akaike info criterion', reg.aic)
    reg.__summary['summary_r2'] += "                                                 %-22s:%12.3f\n" % (
        'Schwarz criterion', reg.schwarz)
    # build coefficients table body
    summary_coefs_allx(reg, reg.z_stat)
    if regimes:
        summary_regimes(reg)
    summary_warning(reg)
    summary(reg=reg, vm=vm, instruments=False,
            nonspat_diag=False, spat_diag=spat_diag)

# extra space d
def ML_Error_multi(reg, multireg, vm, spat_diag, regimes=False, sur=False, w=False):
    for m in multireg:
        mreg = multireg[m]
        mreg.__summary = {}
        # compute diagnostics and organize summary output
        beta_diag(mreg, robust=None)
        mreg.__summary['summary_r2'] += "%-20s:%12.3f                %-22s:%12.3f\n" % (
            'Sigma-square ML', mreg.sig2, 'Log likelihood', mreg.logll)
        mreg.__summary['summary_r2'] += "%-20s:%12.3f                %-22s:%12.3f\n" % (
            'S.E of regression', np.sqrt(mreg.sig2), 'Akaike info criterion', mreg.aic)
        mreg.__summary['summary_r2'] += "                                                 %-22s:%12.3f\n" % (
            'Schwarz criterion', mreg.schwarz)
        # build coefficients table body
        summary_coefs_allx(mreg, mreg.z_stat)
        if regimes:
            summary_regimes(mreg, chow=False)
        summary_warning(mreg)
        multireg[m].__summary = mreg.__summary
    reg.__summary = {}
    if regimes:
        summary_chow(reg, lambd=True)
    summary_warning(reg)
    summary_multi(reg=reg, multireg=multireg, vm=vm,
                  instruments=False, nonspat_diag=False, spat_diag=spat_diag)

def GM_Error(reg, vm, w, regimes=False):
    reg.__summary = {}
    # compute diagnostics and organize summary output
    beta_diag(reg, None)
    # build coefficients table body
    beta_position = summary_coefs_somex(reg, reg.z_stat)
    summary_coefs_lambda(reg, reg.z_stat)
    if regimes:
        summary_regimes(reg)
    summary_warning(reg)
    summary(reg=reg, vm=vm, instruments=False,
            nonspat_diag=False, spat_diag=False)

def GM_Error_multi(reg, multireg, vm, regimes=False):
    for m in multireg:
        mreg = multireg[m]
        mreg.__summary = {}
        # compute diagnostics and organize summary output
        beta_diag(mreg, None)
        # build coefficients table body
        beta_position = summary_coefs_somex(mreg, mreg.z_stat)
        summary_coefs_lambda(mreg, mreg.z_stat)
        if regimes:
            summary_regimes(mreg, chow=False)
        summary_warning(mreg)
        multireg[m].__summary = mreg.__summary
    reg.__summary = {}
    summary_chow(reg, lambd=False)
    summary_warning(reg)
    summary_multi(reg=reg, multireg=multireg, vm=vm,
                  instruments=False, nonspat_diag=False, spat_diag=False)

def GM_Endog_Error(reg, vm, w, regimes=False):
    reg.__summary = {}
    # compute diagnostics and organize summary output
    beta_diag(reg, None)
    # build coefficients table body
    summary_coefs_allx(reg, reg.z_stat, lambd=True)
    summary_coefs_lambda(reg, reg.z_stat)
    summary_coefs_instruments(reg)
    if regimes:
        summary_regimes(reg)
    summary_warning(reg)
    summary(reg=reg, vm=vm, instruments=True,
            nonspat_diag=False, spat_diag=False)

def GM_Endog_Error_multi(reg, multireg, vm, regimes=False):
    for m in multireg:
        mreg = multireg[m]
        mreg.__summary = {}
        # compute diagnostics and organize summary output
        beta_diag(mreg, None)
        # build coefficients table body
        summary_coefs_allx(mreg, mreg.z_stat, lambd=True)
        summary_coefs_lambda(mreg, mreg.z_stat)
        summary_coefs_instruments(mreg)
        if regimes:
            summary_regimes(mreg, chow=False)
        summary_warning(mreg)
        multireg[m].__summary = mreg.__summary
    reg.__summary = {}
    summary_chow(reg, lambd=False)
    summary_warning(reg)
    summary_multi(reg=reg, multireg=multireg, vm=vm,
                  instruments=True, nonspat_diag=False, spat_diag=False)

def GM_Error_Hom(reg, vm, w, regimes=False):
    reg.__summary = {}
    # compute diagnostics and organize summary output
    beta_diag(reg, None)
    summary_iteration(reg)
    # build coefficients table body
    beta_position = summary_coefs_somex(reg, reg.z_stat)
    summary_coefs_lambda(reg, reg.z_stat)
    if regimes:
        summary_regimes(reg)
    summary_warning(reg)
    summary(reg=reg, vm=vm, instruments=False,
            nonspat_diag=False, spat_diag=False)

def GM_Error_Hom_multi(reg, multireg, vm, regimes=False):
    for m in multireg:
        mreg = multireg[m]
        mreg.__summary = {}
        # compute diagnostics and organize summary output
        summary_iteration(mreg)
        beta_diag(mreg, None)
        # build coefficients table body
        beta_position = summary_coefs_somex(mreg, mreg.z_stat)
        summary_coefs_lambda(mreg, mreg.z_stat)
        if regimes:
            summary_regimes(mreg, chow=False)
        summary_warning(mreg)
        multireg[m].__summary = mreg.__summary
    reg.__summary = {}
    summary_chow(reg, lambd=True)
    summary_warning(reg)
    summary_multi(reg=reg, multireg=multireg, vm=vm,
                  instruments=False, nonspat_diag=False, spat_diag=False)

def GM_Endog_Error_Hom(reg, vm, w, regimes=False):
    reg.__summary = {}
    # compute diagnostics and organize summary output
    beta_diag(reg, None)
    summary_iteration(reg)
    # build coefficients table body
    summary_coefs_allx(reg, reg.z_stat, lambd=True)
    summary_coefs_lambda(reg, reg.z_stat)
    summary_coefs_instruments(reg)
    if regimes:
        summary_regimes(reg)
    summary_warning(reg)
    summary(reg=reg, vm=vm, instruments=True,
            nonspat_diag=False, spat_diag=False)

def GM_Endog_Error_Hom_multi(reg, multireg, vm, regimes=False):
    for m in multireg:
        mreg = multireg[m]
        mreg.__summary = {}
        # compute diagnostics and organize summary output
        beta_diag(mreg, None)
        summary_iteration(mreg)
        # build coefficients table body
        summary_coefs_allx(mreg, mreg.z_stat, lambd=True)
        summary_coefs_lambda(mreg, mreg.z_stat)
        summary_coefs_instruments(mreg)
        if regimes:
            summary_regimes(mreg, chow=False)
        summary_warning(mreg)
        multireg[m].__summary = mreg.__summary
    reg.__summary = {}
    summary_chow(reg, lambd=True)
    summary_warning(reg)
    summary_multi(reg=reg, multireg=multireg, vm=vm,
                  instruments=True, nonspat_diag=False, spat_diag=False)

def GM_Error_Het(reg, vm, w, regimes=False):
    reg.__summary = {}
    # compute diagnostics and organize summary output
    beta_diag(reg, 'het')
    summary_iteration(reg)
    # build coefficients table body
    beta_position = summary_coefs_somex(reg, reg.z_stat)
    summary_coefs_lambda(reg, reg.z_stat)
    if regimes:
        summary_regimes(reg)
    summary_warning(reg)
    summary(reg=reg, vm=vm, instruments=False,
            nonspat_diag=False, spat_diag=False)

def GM_Error_Het_multi(reg, multireg, vm, regimes=False):
    for m in multireg:
        mreg = multireg[m]
        mreg.__summary = {}
        # compute diagnostics and organize summary output
        beta_diag(mreg, 'het')
        summary_iteration(mreg)
        # build coefficients table body
        beta_position = summary_coefs_somex(mreg, mreg.z_stat)
        summary_coefs_lambda(mreg, mreg.z_stat)
        if regimes:
            summary_regimes(mreg, chow=False)
        summary_warning(mreg)
        multireg[m].__summary = mreg.__summary
    reg.__summary = {}
    summary_chow(reg, lambd=True)
    summary_warning(reg)
    summary_multi(reg=reg, multireg=multireg, vm=vm,
                  instruments=False, nonspat_diag=False, spat_diag=False)

def GM_Endog_Error_Het(reg, vm, w, regimes=False):
    reg.__summary = {}
    # compute diagnostics and organize summary output
    beta_diag(reg, 'het')
    summary_iteration(reg)
    # build coefficients table body
    summary_coefs_allx(reg, reg.z_stat, lambd=True)
    summary_coefs_lambda(reg, reg.z_stat)
    summary_coefs_instruments(reg)
    if regimes:
        summary_regimes(reg)
    summary_warning(reg)
    summary(reg=reg, vm=vm, instruments=True,
            nonspat_diag=False, spat_diag=False)

def GM_Endog_Error_Het_multi(reg, multireg, vm, regimes=False):
    for m in multireg:
        mreg = multireg[m]
        mreg.__summary = {}
        # compute diagnostics and organize summary output
        beta_diag(mreg, 'het')
        summary_iteration(mreg)
        # build coefficients table body
        summary_coefs_allx(mreg, mreg.z_stat, lambd=True)
        summary_coefs_lambda(mreg, mreg.z_stat)
        summary_coefs_instruments(mreg)
        if regimes:
            summary_regimes(mreg, chow=False)
        summary_warning(mreg)
        multireg[m].__summary = mreg.__summary
    reg.__summary = {}
    summary_chow(reg, lambd=True)
    summary_warning(reg)
    summary_multi(reg=reg, multireg=multireg, vm=vm,
                  instruments=True, nonspat_diag=False, spat_diag=False)

def GM_Combo(reg, vm, w, regimes=False):
    reg.__summary = {}
    # compute diagnostics and organize summary output
    beta_diag_lag(reg, None)
    # build coefficients table body
    summary_coefs_allx(reg, reg.z_stat, lambd=True)
    summary_coefs_lambda(reg, reg.z_stat)
    summary_coefs_instruments(reg)
    summary_warning(reg)
    if regimes:
        summary_regimes(reg)
    summary_warning(reg)
    summary(reg=reg, vm=vm, instruments=True,
            nonspat_diag=False, spat_diag=False)

def GM_Combo_multi(reg, multireg, vm, regimes=False):
    for m in multireg:
        mreg = multireg[m]
        mreg.__summary = {}
        # compute diagnostics and organize summary output
        beta_diag_lag(mreg, None)
        # build coefficients table body
        summary_coefs_allx(mreg, mreg.z_stat, lambd=True)
        summary_coefs_lambda(mreg, mreg.z_stat)
        summary_coefs_instruments(mreg)
        if regimes:
            summary_regimes(mreg, chow=False)
        summary_warning(mreg)
        multireg[m].__summary = mreg.__summary
    reg.__summary = {}
    if regimes:
        summary_chow(reg, lambd=False)
    summary_warning(reg)
    summary_multi(reg=reg, multireg=multireg, vm=vm,
                  instruments=True, nonspat_diag=False, spat_diag=False)

def GM_Combo_Hom(reg, vm, w, regimes=False):
    reg.__summary = {}
    # compute diagnostics and organize summary output
    beta_diag_lag(reg, None)
    summary_iteration(reg)
    # build coefficients table body
    summary_coefs_allx(reg, reg.z_stat, lambd=True)
    summary_coefs_lambda(reg, reg.z_stat)
    summary_coefs_instruments(reg)
    if regimes:
        summary_regimes(reg)
    summary_warning(reg)
    summary(reg=reg, vm=vm, instruments=True,
            nonspat_diag=False, spat_diag=False)

def GM_Combo_Hom_multi(reg, multireg, vm, regimes=False):
    for m in multireg:
        mreg = multireg[m]
        mreg.__summary = {}
        # compute diagnostics and organize summary output
        beta_diag_lag(mreg, None)
        summary_iteration(mreg)
        # build coefficients table body
        summary_coefs_allx(mreg, mreg.z_stat, lambd=True)
        summary_coefs_lambda(mreg, mreg.z_stat)
        summary_coefs_instruments(mreg)
        if regimes:
            summary_regimes(mreg, chow=False)
        summary_warning(mreg)
        multireg[m].__summary = mreg.__summary
    reg.__summary = {}
    if regimes:
        summary_chow(reg, lambd=True)
    summary_warning(reg)
    summary_multi(reg=reg, multireg=multireg, vm=vm,
                  instruments=True, nonspat_diag=False, spat_diag=False)

def GM_Combo_Het(reg, vm, w, regimes=False):
    reg.__summary = {}
    # compute diagnostics and organize summary output
    beta_diag_lag(reg, 'het')
    summary_iteration(reg)
    # build coefficients table body
    summary_coefs_allx(reg, reg.z_stat, lambd=True)
    summary_coefs_lambda(reg, reg.z_stat)
    summary_coefs_instruments(reg)
    if regimes:
        summary_regimes(reg)
    summary_warning(reg)
    summary(reg=reg, vm=vm, instruments=True,
            nonspat_diag=False, spat_diag=False)

def GM_Combo_Het_multi(reg, multireg, vm, regimes=False):
    for m in multireg:
        mreg = multireg[m]
        mreg.__summary = {}
        # compute diagnostics and organize summary output
        beta_diag_lag(mreg, 'het')
        summary_iteration(mreg)
        # build coefficients table body
        summary_coefs_allx(mreg, mreg.z_stat, lambd=True)
        summary_coefs_lambda(mreg, mreg.z_stat)
        summary_coefs_instruments(mreg)
        if regimes:
            summary_regimes(mreg, chow=False)
        summary_warning(mreg)
        multireg[m].__summary = mreg.__summary
    reg.__summary = {}
    if regimes:
        summary_chow(reg, lambd=True)
    summary_warning(reg)
    summary_multi(reg=reg, multireg=multireg, vm=vm,
                  instruments=True, nonspat_diag=False, spat_diag=False)

def Probit(reg, vm, w, spat_diag):
    reg.__summary = {}
    # compute diagnostics and organize summary output
    beta_diag(reg, None)
    # organize summary output
    if spat_diag:
        reg.__summary['summary_spat_diag'] = summary_spat_diag_probit(reg)
    reg.__summary[
        'summary_r2'] = "%-21s: %3.2f\n" % ('% correctly predicted', reg.predpc)
    reg.__summary[
        'summary_r2'] += "%-21s: %3.4f\n" % ('Log-Likelihood', reg.logl)
    reg.__summary['summary_r2'] += "%-21s: %3.4f\n" % ('LR test', reg.LR[0])
    reg.__summary[
        'summary_r2'] += "%-21s: %3.4f\n" % ('LR test (p-value)', reg.LR[1])
    if reg.warning:
        reg.__summary[
            'summary_r2'] += "\nMaximum number of iterations exceeded or gradient and/or function calls not changing\n"
    # build coefficients table body
    beta_position = summary_coefs_allx(reg, reg.z_stat)
    reg.__summary['summary_other_mid'] = summary_coefs_slopes(reg)
    summary(reg=reg, vm=vm, instruments=False,
            short_intro=True, spat_diag=spat_diag)

##############################################################################

##############################################################################
############### Helper functions for running summary diagnostics #############
##############################################################################

def beta_diag_ols(reg, robust):
    # compute diagnostics
    reg.std_err = diagnostics.se_betas(reg)
    reg.t_stat = diagnostics.t_stat(reg)
    reg.r2 = diagnostics.r2(reg)
    reg.ar2 = diagnostics.ar2(reg)
    # organize summary output
    reg.__summary['summary_std_err'] = robust
    reg.__summary['summary_zt'] = 't'
    reg.__summary['summary_r2'] = "%-20s:%12.4f\n%-20s:%12.4f\n" % (
        'R-squared', reg.r2, 'Adjusted R-squared', reg.ar2)
    # build coefficients table body
    position = summary_coefs_allx(reg, reg.t_stat)

def beta_diag(reg, robust):
    # compute diagnostics
    reg.std_err = diagnostics.se_betas(reg)
    reg.z_stat = diagnostics.t_stat(reg, z_stat=True)
    reg.pr2 = diagnostics_tsls.pr2_aspatial(reg)
    # organize summary output
    reg.__summary['summary_std_err'] = robust
    reg.__summary['summary_zt'] = 'z'
    reg.__summary[
        'summary_r2'] = "%-20s:%12.4f\n" % ('Pseudo R-squared', reg.pr2)

def beta_diag_lag(reg, robust, error=True):
    # compute diagnostics
    reg.std_err = diagnostics.se_betas(reg)
    reg.z_stat = diagnostics.t_stat(reg, z_stat=True)
    reg.pr2 = diagnostics_tsls.pr2_aspatial(reg)
    # organize summary output
    reg.__summary['summary_std_err'] = robust
    reg.__summary['summary_zt'] = 'z'
    reg.__summary[
        'summary_r2'] = "%-20s:      %5.4f\n" % ('Pseudo R-squared', reg.pr2)
    if np.abs(reg.rho) < 1:
        reg.pr2_e = diagnostics_tsls.pr2_spatial(reg)
        reg.__summary[
            'summary_r2'] += "%-20s:  %5.4f\n" % ('Spatial Pseudo R-squared', reg.pr2_e)
    else:
        reg.__summary[
            'summary_r2'] += "Spatial Pseudo R-squared: omitted due to rho outside the boundary (-1, 1)."

def build_coefs_body_instruments(reg):
    beta_position = summary_coefs_allx(reg, reg.z_stat)
    summary_coefs_allx(reg, reg.z_stat)
    summary_coefs_instruments(reg)

def spat_diag_ols(reg, w, moran):
    # compute diagnostics
    lm_tests = diagnostics_sp.LMtests(reg, w)
    reg.lm_error = lm_tests.lme
    reg.lm_lag = lm_tests.lml
    reg.rlm_error = lm_tests.rlme
    reg.rlm_lag = lm_tests.rlml
    reg.lm_sarma = lm_tests.sarma
    if moran:
        moran_res = diagnostics_sp.MoranRes(reg, w, z=True)
        reg.moran_res = moran_res.I, moran_res.zI, moran_res.p_norm
    # organize summary output
    reg.__summary['summary_spat_diag'] = summary_spat_diag_ols(reg, moran)

def spat_diag_instruments(reg, w):
    # compute diagnostics
    cache = diagnostics_sp.spDcache(reg, w)
    mi, ak, ak_p = diagnostics_sp.akTest(reg, w, cache)
    reg.ak_test = ak, ak_p
    # organize summary output
    reg.__summary['summary_spat_diag'] = "%-27s      %2d    %12.3f       %9.4f\n" % (
        "Anselin-Kelejian Test", 1, reg.ak_test[0], reg.ak_test[1])

def summary(reg, vm, instruments, short_intro=False, nonspat_diag=False, spat_diag=False, other_end=False):
    summary = summary_open()
    summary += summary_intro(reg, short_intro)
    summary += reg.__summary['summary_r2']
    if nonspat_diag:
        summary += reg.__summary['summary_nonspat_diag_1']
    try:
        summary += reg.__summary['summary_other_top']
    except:
        pass
    summary += summary_coefs_intro(reg)
    summary += reg.__summary['summary_coefs']
    summary += "------------------------------------------------------------------------------------\n"
    if instruments:
        summary += reg.__summary['summary_coefs_instruments']
    try:
        summary += reg.__summary['summary_other_mid']
    except:
        pass
    if nonspat_diag:
        summary += reg.__summary['summary_nonspat_diag_2']
    if spat_diag:
        summary += summary_spat_diag_intro()
        summary += reg.__summary['summary_spat_diag']
    if vm:
        summary += summary_vm(reg, instruments)
    try:
        summary += reg.__summary['summary_chow']
    except:
        pass
    if other_end:
        summary += reg.__summary['summary_other_end']
    summary += summary_close()
    reg.summary = summary

def summary_multi(reg, multireg, vm, instruments, short_intro=False, nonspat_diag=False, spat_diag=False, other_end=False):
    summary = summary_open(multi=True)
    for m in multireg:
        mreg = multireg[m]
        summary += "----------\n\n"
        summary += summary_intro(mreg, short_intro)
        summary += mreg.__summary['summary_r2']
        if nonspat_diag:
            summary += mreg.__summary['summary_nonspat_diag_1']
        try:
            summary += reg.__summary['summary_other_top']
        except:
            pass
        summary += summary_coefs_intro(mreg)
        summary += mreg.__summary['summary_coefs']
        summary += "------------------------------------------------------------------------------------\n"
        if instruments:
            summary += mreg.__summary['summary_coefs_instruments']
        try:
            summary += mreg.__summary['summary_other_mid']
        except:
            pass
        if m == multireg.keys()[-1]:
            try:
                summary += reg.__summary['summary_other_mid']
            except:
                pass
        if nonspat_diag:
            summary += mreg.__summary['summary_nonspat_diag_2']
        if spat_diag:
            summary += summary_spat_diag_intro()
            summary += mreg.__summary['summary_spat_diag']
        if vm:
            summary += summary_vm(mreg, instruments)
        if other_end:
            summary += mreg.__summary['summary_other_end']
        if m == multireg.keys()[-1]:
            try:
                summary += reg.__summary['summary_chow']
            except:
                pass
            if spat_diag:
                try:
                    spat_diag_str = reg.__summary['summary_spat_diag']
                    summary += summary_spat_diag_intro_global()
                    summary += spat_diag_str
                except:
                    pass
            try:
                summary += reg.__summary['summary_other_end']
            except:
                pass
    summary += summary_close()
    reg.summary = summary

def _get_var_indices(reg, lambd=False):
    try:
        var_names = reg.name_z
    except:
        var_names = reg.name_x
    last_v = len(var_names)
    if lambd:
        last_v += -1
    indices = []
    try:
        kf = reg.kf
        if lambd:
            kf += -1
        krex = reg.kr - reg.kryd
        try:
            kfyd = reg.yend.shape[1] - reg.nr * reg.kryd
        except:
            kfyd = 0
        j_con = 0
        if reg.constant_regi == 'many':
            j_con = 1
        for i in range(reg.nr):
            j = i * krex
            jyd = krex * reg.nr + i * reg.kryd + kf - kfyd
            name_reg = var_names[j + j_con:j + krex] + \
                var_names[jyd:jyd + reg.kryd]
            name_reg.sort()
            if reg.constant_regi == 'many':
                indices += [j] + [var_names.index(ind) for ind in name_reg]
            else:
                indices += [var_names.index(ind) for ind in name_reg]
        if reg.constant_regi == 'one':
            indices += [krex * reg.nr]
        if len(indices) < last_v:
            name_reg = var_names[krex * reg.nr + 1 - j_con:krex * reg.nr + kf -
                                 kfyd] + var_names[reg.kr * reg.nr + kf - kfyd:reg.kr * reg.nr + kf]
            name_reg.sort()
            indices += [var_names.index(ind) for ind in name_reg]
    except:
        indices = [0] + (np.argsort(var_names[1:last_v]) + 1).tolist()
    return var_names, indices

##############################################################################

##############################################################################
############### Guts of the summary printout #################################
##############################################################################

"""
This section contains the pieces needed to put together the summary printout.
"""

def summary_open(multi=False):
    strSummary = ""
    strSummary += "REGRESSION\n"
    if not multi:
        strSummary += "----------\n"
    return strSummary

def summary_intro(reg, short):  # extra space d
    title = "SUMMARY OF OUTPUT: " + reg.title + "\n"
    strSummary = title
    strSummary += "-" * (len(title) - 1) + "\n"
    strSummary += "%-20s:%12s\n" % ('Data set', reg.name_ds)
    if reg.name_w:
        strSummary += "%-20s:%12s\n" % ('Weights matrix', reg.name_w)
    strSummary += "%-20s:%12s                %-22s:%12d\n" % (
        'Dependent Variable', reg.name_y, 'Number of Observations', reg.n)
    if not short:
        strSummary += "%-20s:%12.4f                %-22s:%12d\n" % (
            'Mean dependent var', reg.mean_y, 'Number of Variables', reg.k)
        strSummary += "%-20s:%12.4f                %-22s:%12d\n" % (
            'S.D. dependent var', reg.std_y, 'Degrees of Freedom', reg.n - reg.k)
    #strSummary += '\n'
    return strSummary

def summary_coefs_intro(reg):
    strSummary = "\n"
    if reg.__summary['summary_std_err']:
        if reg.__summary['summary_std_err'].lower() == 'white':
            strSummary += "White Standard Errors\n"
        elif reg.__summary['summary_std_err'].lower() == 'hac':
            strSummary += "HAC Standard Errors; Kernel Weights: " + \
                reg.name_gwk + "\n"
        # elif reg.__summary['summary_std_err'].lower() == 'het':
            #strSummary += "Heteroskedastic Corrected Standard Errors\n"
    strSummary += "------------------------------------------------------------------------------------\n"
    strSummary += "            Variable     Coefficient       Std.Error     %1s-Statistic     Probability\n" % (
        reg.__summary['summary_zt'])
    strSummary += "------------------------------------------------------------------------------------\n"
    return strSummary

def summary_coefs_allx(reg, zt_stat, lambd=False):
    strSummary = ""
    var_names, indices = _get_var_indices(reg, lambd)
    for i in indices:
        strSummary += "%20s    %12.7f    %12.7f    %12.7f    %12.7f\n"   \
            % (var_names[i], reg.betas[i][0], reg.std_err[i], zt_stat[i][0], zt_stat[i][1])
    reg.__summary['summary_coefs'] = strSummary
    return i

def summary_coefs_somex(reg, zt_stat):
    """This is a special case needed for models that do not have inference on
    the lambda term
    """
    strSummary = ""
    var_names, indices = _get_var_indices(reg, lambd=True)
    for i in indices:
        strSummary += "%20s    %12.7f    %12.7f    %12.7f    %12.7f\n"   \
            % (reg.name_x[i], reg.betas[i][0], reg.std_err[i], zt_stat[i][0], zt_stat[i][1])
    reg.__summary['summary_coefs'] = strSummary
    return i
"""
def summary_coefs_yend(reg, zt_stat, lambd=False):
    strSummary = ""
    indices = _get_var_indices(reg, lambd)
    for i in indices:
        strSummary += "%20s    %12.7f    %12.7f    %12.7f    %12.7f\n"   \
                     % (reg.name_z[i],reg.betas[i][0],reg.std_err[i],zt_stat[i][0],zt_stat[i][1])
    reg.__summary['summary_coefs'] = strSummary
"""

def summary_coefs_lambda(reg, zt_stat):
    try:
        name_var = reg.name_z
    except:
        name_var = reg.name_x
    if len(reg.betas) == len(zt_stat):
        reg.__summary['summary_coefs'] += "%20s    %12.7f    %12.7f    %12.7f    %12.7f\n"   \
            % (name_var[-1], reg.betas[-1][0], reg.std_err[-1], zt_stat[-1][0], zt_stat[-1][1])
    else:
        reg.__summary[
            'summary_coefs'] += "%20s    %12.7f    \n" % (name_var[-1], reg.betas[-1][0])

def summary_coefs_instruments(reg):
    """Generates a list of the instruments used.
    """
    insts = "Instruments: "
    for name in sorted(reg.name_q):
        insts += name + ", "
    text_wrapper = TW.TextWrapper(width=76, subsequent_indent="             ")
    insts = text_wrapper.fill(insts[:-2])
    insts += "\n"
    inst2 = "Instrumented: "
    for name in sorted(reg.name_yend):
        inst2 += name + ", "
    text_wrapper = TW.TextWrapper(width=76, subsequent_indent="             ")
    inst2 = text_wrapper.fill(inst2[:-2])
    inst2 += "\n"
    inst2 += insts
    reg.__summary['summary_coefs_instruments'] = inst2

def summary_iteration(reg):  # extra space d
    """Reports the number of iterations computed.
    """
    try:
        if reg.step1c:
            step1c = 'Yes'
        else:
            step1c = 'No'
        txt = "%-20s:%12s                %-22s:%12s\n" % (
            'N. of iterations', reg.iteration, 'Step1c computed', step1c)
    except:
        txt = "%-20s:%12s\n" % ('N. of iterations', reg.iteration)
    try:
        reg.__summary['summary_other_top'] += txt
    except:
        reg.__summary['summary_other_top'] = txt

def summary_regimes(reg, chow=True):
    """Lists the regimes variable used.
    """
    try:
        reg.__summary[
            'summary_other_mid'] += "Regimes variable: %s\n" % reg.name_regimes
    except:
        reg.__summary[
            'summary_other_mid'] = "Regimes variable: %s\n" % reg.name_regimes
    if chow:
        summary_chow(reg)

def summary_sur(reg, u_cov=False):
    """Lists the equation ID variable used.
    """
    if u_cov:
        str_ucv = "\nERROR COVARIANCE MATRIX\n"
        for i in range(reg.u_cov.shape[0]):
            for j in range(reg.u_cov.shape[1]):
                str_ucv += "%12.6f" % (reg.u_cov[i][j])
            str_ucv += "\n"
        try:
            reg.__summary['summary_other_end'] += str_ucv
        except:
            reg.__summary['summary_other_end'] = str_ucv
    else:
        try:
            reg.__summary[
                'summary_other_mid'] += "Equation ID: %s\n" % reg.name_multiID
        except:
            reg.__summary[
                'summary_other_mid'] = "Equation ID: %s\n" % reg.name_multiID
        try:
            reg.__summary[
                'summary_r2'] += "%-20s: %3.4f\n" % ('Log-Likelihood', reg.logl)
        except:
            pass

def summary_chow(reg, lambd=False):
    reg.__summary['summary_chow'] = "\nREGIMES DIAGNOSTICS - CHOW TEST\n"
    reg.__summary[
        'summary_chow'] += "                 VARIABLE        DF        VALUE           PROB\n"
    if reg.cols2regi == 'all':
        names_chow = reg.name_x_r[1:]
    else:
        names_chow = [reg.name_x_r[1:][i] for i in np.where(reg.cols2regi)[0]]
    if reg.constant_regi == 'many':
        indices = [0] + (np.argsort(names_chow) + 1).tolist()
        names_chow = ['CONSTANT'] + names_chow
    else:
        indices = (np.argsort(names_chow)).tolist()
    if lambd:
        indices += [-1]
        names_chow += ['lambda']
    for i in indices:
        reg.__summary['summary_chow'] += "%25s        %2d    %12.3f        %9.4f\n" % (
            names_chow[i], reg.nr - 1, reg.chow.regi[i, 0], reg.chow.regi[i, 1])
    reg.__summary['summary_chow'] += "%25s        %2d    %12.3f        %9.4f\n" % (
        'Global test', reg.kr * (reg.nr - 1), reg.chow.joint[0], reg.chow.joint[1])

def summary_warning(reg):
    try:
        if reg.warning:
            try:
                reg.__summary['summary_other_mid'] += reg.warning
            except:
                reg.__summary['summary_other_mid'] = reg.warning
    except:
        pass

def summary_coefs_slopes(reg):
    strSummary = "\nMARGINAL EFFECTS\n"
    if reg.scalem == 'phimean':
        strSummary += "Method: Mean of individual marginal effects\n"
    elif reg.scalem == 'xmean':
        strSummary += "Method: Marginal effects at variables mean\n"
    strSummary += "------------------------------------------------------------------------------------\n"
    strSummary += "            Variable           Slope       Std.Error     %1s-Statistic     Probability\n" % (
        reg.__summary['summary_zt'])
    strSummary += "------------------------------------------------------------------------------------\n"
    indices = np.argsort(reg.name_x[1:]).tolist()
    for i in indices:
        strSummary += "%20s    %12.7f    %12.7f    %12.7f    %12.7f\n"   \
            % (reg.name_x[i + 1], reg.slopes[i][0], reg.slopes_std_err[i], reg.slopes_z_stat[i][0], reg.slopes_z_stat[i][1])
    return strSummary + "\n\n"
"""
def summary_r2(reg, ols, spatial_lag):
    if ols:
        strSummary = "%-20s:%12.4f\n%-20s:%12.4f\n" % ('R-squared',reg.r2,'Adjusted R-squared',reg.ar2)
    else:
        strSummary = "%-20s:%12.4f\n" % ('Pseudo R-squared',reg.pr2)
        if spatial_lag:
            if reg.pr2_e != None:
                strSummary += "%-20s:%12.4f\n" % ('Spatial Pseudo R-squared',reg.pr2_e)
    return strSummary
"""

def summary_nonspat_diag_1(reg):  # extra space d
    strSummary = ""
    strSummary += "%-20s:%12.3f                %-22s:%12.4f\n" % (
        'Sum squared residual', reg.utu, 'F-statistic', reg.f_stat[0])
    strSummary += "%-20s:%12.3f                %-22s:%12.4g\n" % (
        'Sigma-square', reg.sig2, 'Prob(F-statistic)', reg.f_stat[1])
    strSummary += "%-20s:%12.3f                %-22s:%12.3f\n" % (
        'S.E. of regression', np.sqrt(reg.sig2), 'Log likelihood', reg.logll)
    strSummary += "%-20s:%12.3f                %-22s:%12.3f\n" % (
        'Sigma-square ML', reg.sig2ML, 'Akaike info criterion', reg.aic)
    strSummary += "%-20s:%12.4f                %-22s:%12.3f\n" % (
        'S.E of regression ML', np.sqrt(reg.sig2ML), 'Schwarz criterion', reg.schwarz)
    return strSummary

def summary_nonspat_diag_2(reg):
    strSummary = ""
    strSummary += "\nREGRESSION DIAGNOSTICS\n"
    if reg.mulColli:
        strSummary += "MULTICOLLINEARITY CONDITION NUMBER %16.3f\n\n" % (
            reg.mulColli)
    strSummary += "TEST ON NORMALITY OF ERRORS\n"
    strSummary += "TEST                             DF        VALUE           PROB\n"
    strSummary += "%-27s      %2d  %14.3f        %9.4f\n\n" % (
        'Jarque-Bera', reg.jarque_bera['df'], reg.jarque_bera['jb'], reg.jarque_bera['pvalue'])
    strSummary += "DIAGNOSTICS FOR HETEROSKEDASTICITY\n"
    strSummary += "RANDOM COEFFICIENTS\n"
    strSummary += "TEST                             DF        VALUE           PROB\n"
    strSummary += "%-27s      %2d    %12.3f        %9.4f\n" % (
        'Breusch-Pagan test', reg.breusch_pagan['df'], reg.breusch_pagan['bp'], reg.breusch_pagan['pvalue'])
    strSummary += "%-27s      %2d    %12.3f        %9.4f\n" % (
        'Koenker-Bassett test', reg.koenker_bassett['df'], reg.koenker_bassett['kb'], reg.koenker_bassett['pvalue'])
    try:
        if reg.white:
            strSummary += "\nSPECIFICATION ROBUST TEST\n"
            if len(reg.white) > 3:
                strSummary += reg.white + '\n'
            else:
                strSummary += "TEST                             DF        VALUE           PROB\n"
                strSummary += "%-27s      %2d    %12.3f        %9.4f\n" % (
                    'White', reg.white['df'], reg.white['wh'], reg.white['pvalue'])
    except:
        pass
    return strSummary

def summary_spat_diag_intro():
    strSummary = ""
    strSummary += "\nDIAGNOSTICS FOR SPATIAL DEPENDENCE\n"
    strSummary += "TEST                           MI/DF       VALUE           PROB\n"
    return strSummary

def summary_spat_diag_intro_global():
    strSummary = ""
    strSummary += "\nDIAGNOSTICS FOR GLOBAL SPATIAL DEPENDENCE\n"
    strSummary += "Residuals are treated as homoskedastic for the purpose of these tests\n"
    strSummary += "TEST                           MI/DF       VALUE           PROB\n"
    return strSummary

def summary_spat_diag_ols(reg, moran):
    strSummary = ""
    if moran:
        strSummary += "%-27s  %8.4f     %9.3f        %9.4f\n" % (
            "Moran's I (error)", reg.moran_res[0], reg.moran_res[1], reg.moran_res[2])
    strSummary += "%-27s      %2d    %12.3f        %9.4f\n" % (
        "Lagrange Multiplier (lag)", 1, reg.lm_lag[0], reg.lm_lag[1])
    strSummary += "%-27s      %2d    %12.3f        %9.4f\n" % (
        "Robust LM (lag)", 1, reg.rlm_lag[0], reg.rlm_lag[1])
    strSummary += "%-27s      %2d    %12.3f        %9.4f\n" % (
        "Lagrange Multiplier (error)", 1, reg.lm_error[0], reg.lm_error[1])
    strSummary += "%-27s      %2d    %12.3f        %9.4f\n" % (
        "Robust LM (error)", 1, reg.rlm_error[0], reg.rlm_error[1])
    strSummary += "%-27s      %2d    %12.3f        %9.4f\n\n" % (
        "Lagrange Multiplier (SARMA)", 2, reg.lm_sarma[0], reg.lm_sarma[1])
    return strSummary

def summary_spat_diag_probit(reg):
    strSummary = ""
    strSummary += "%-27s      %2d    %12.3f       %9.4f\n" % (
        "Kelejian-Prucha (error)", 1, reg.KP_error[0], reg.KP_error[1])
    strSummary += "%-27s      %2d    %12.3f       %9.4f\n" % (
        "Pinkse (error)", 1, reg.Pinkse_error[0], reg.Pinkse_error[1])
    strSummary += "%-27s      %2d    %12.3f       %9.4f\n\n" % (
        "Pinkse-Slade (error)", 1, reg.PS_error[0], reg.PS_error[1])
    return strSummary

def summary_vm(reg, instruments):
    strVM = "\n"
    strVM += "COEFFICIENTS VARIANCE MATRIX\n"
    strVM += "----------------------------\n"
    if instruments:
        for name in reg.name_z:
            strVM += "%12s" % (name)
    else:
        for name in reg.name_x:
            strVM += "%12s" % (name)
    strVM += "\n"
    nrow = reg.vm.shape[0]
    ncol = reg.vm.shape[1]
    for i in range(nrow):
        for j in range(ncol):
            strVM += "%12.6f" % (reg.vm[i][j])
        strVM += "\n"
    return strVM

def summary_pred(reg):
    strPred = "\n\n"
    strPred += "%16s%16s%16s%16s\n" % ('OBS',
                                       reg.name_y, 'PREDICTED', 'RESIDUAL')
    for i in range(reg.n):
        strPred += "%16d%16.5f%16.5f%16.5f\n" % (
            i + 1, reg.y[i][0], reg.predy[i][0], reg.u[i][0])
    return strPred

def summary_close():
    return "================================ END OF REPORT ====================================="

##############################################################################

def _test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    _test()

redpajama_set_name: RedPajamaGithub


Childhood experts agree: Attending a high-quality program prepares kids for kindergarten and beyond. But finding the best option for your child takes time and research. To get you started, we've answered your biggest questions.
Statistics show that a majority of kids attend at least one year of preschool: According to the National Institute for Early Education Research (NIEER), more than two-thirds of 4-year-olds and more than 40 percent of 3-year-olds were enrolled in a preschool in 2005. "Children who attend high-quality preschool enter kindergarten with better pre-reading skills, richer vocabularies, and stronger basic math skills than those who do not," says NIEER director W. Steven Barnett, PhD.
"Every child should have some sort of group experience before he starts kindergarten," says Amy Flynn, director of New York City's Bank Street Family Center. Music and gymnastics classes are great, but what preschools do that less formal classes don't is teach kids how to be students. Your child will learn how to raise her hand, take turns, and share the teacher's attention. What's more, she'll learn how to separate from Mommy, who often stays in a music or gym class. All of this makes for an easier transition to kindergarten. "Kindergarten teachers will tell you that the students who are ready to learn are those who come into school with good social and behavior-management skills," Smith says.
In fact, educators have so recognized the importance of giving kids some form of quality early education that about 40 states now offer state-funded pre-K programs.
"Young children can certainly learn letters and numbers, but to sit kids down and 'teach' them is the wrong way to do it," says Smith. "They learn best through doing the kinds of activities they find interesting — storytime, talking to their teachers about stars, playing with blocks." To help kids learn language and strengthen pre-reading skills, for instance, teachers might play rhyming games and let kids tell stories. Keep in mind that for small children, school is all about having fun and acquiring social skills — not achieving academic milestones. "Kids need to be imaginative and to socialize — that's what fosters creative, well-rounded people. It's not whether they can read by age 4 or multiply by 5," says Flynn. An ideal curriculum? Parading around in dress-up clothes, building forts, and being read to.


Virginia's online voter registration portal faced technical difficulties on the last day to register to vote.
The Virginia Department of Elections' online voter registration system slowed down Monday and at times became completely unresponsive.
Virginia Department of Elections Commissioner Edgardo Cortes says the department was overwhelmed by the record number of people trying to register by the Monday night deadline.
The department said in an online statement that it made changes to the website to allow voters to meet the deadline. People who were having trouble registering were encouraged to wait a few minutes and try again.


Casago.com is a leasing and vacation rental company based in Arizona which has several properties across the U.S. and Mexico including Puerto Vallarta where company staff was holding a retreat meeting as Hurricane Willa hit. This video is from nearby Boca de Tomatlan before Hurricane Willa reached land but after more than 30 straight hours of rain. The flooding is of water coming down the mountain. Instead of meetings, the Casago staff spent their time offering/helping renters in their facilities to safer locations more inland, and by sandbagging homes to help protect against flooding.
Previous Previous post: 2018 Report: Here is when the Real Estate Bubble will BURST AGAIN.


text:
Justia › US Law › US Case Law › US Supreme Court › Volume 543 › San Diego v. Roe
San Diego v. Roe, 543 U.S. 77 (2004)
SAN DIEGO V. ROE
543 U. S. ____ (2004)
CITY OF SAN DIEGO, CALIFORNIA et al. v. JOHN ROE
on petition for writ of certiorari to the united states court of appeals for the ninth circuit
No. 03–1669.Decided December 6, 2004
The city of San Diego (City), a petitioner here, terminated a police officer, respondent, for selling videotapes he made and for related activity. The tapes showed the respondent engaging in sexually explicit acts. Respondent brought suit alleging, among other things, that the termination violated his First and Fourteenth Amendment rights to freedom of speech. The United States District Court for the Southern District of California granted summary judgment to the City. The Court of Appeals for the Ninth Circuit reversed.
The petition for a writ of certiorari is granted, and the judgment of the Court of Appeals is reversed.
Respondent John Roe, a San Diego police officer, made a video showing himself stripping off a police uniform and masturbating. He sold the video on the adults-only section of eBay, the popular online auction site. His user name was "Codestud3@aol.com," a word play on a high priority police radio call. 356 F. 3d 1108, 1110 (CA9 2004). The uniform apparently was not the specific uniform worn by the San Diego police, but it was clearly identifiable as a police uniform. Roe also sold custom videos, as well as police equipment, including official uniforms of the San Diego Police Department (SDPD), and various other items such as men's underwear. Roe's eBay user profile identified him as employed in the field of law enforcement.
Roe's supervisor, a police sergeant, discovered Roe's activities when, while on eBay, he came across an official SDPD police uniform for sale offered by an individual with the username "Codestud3@aol.com." He searched for other items Codestud3 offered and discovered listings for Roe's videos depicting the objectionable material. Recognizing Roe's picture, the sergeant printed images of certain of Roe's offerings and shared them with others in Roe's chain of command, including a police captain. The captain notified the SDPD's internal affairs department, which began an investigation. In response to a request by an undercover officer, Roe produced a custom video. It showed Roe, again in police uniform, issuing a traffic citation but revoking it after undoing the uniform and masturbating.
The investigation revealed that Roe's conduct violated specific SDPD policies, including conduct unbecoming of an officer, outside employment, and immoral conduct. When confronted, Roe admitted to selling the videos and police paraphernalia. The SDPD ordered Roe to "cease displaying, manufacturing, distributing or selling any sexually explicit materials or engaging in any similar behaviors, via the internet, U. S. Mail, commercial vendors or distributors, or any other medium available to the public." 356 F. 3d, at 1111 (internal quotation marks omitted). Although Roe removed some of the items he had offered for sale, he did not change his seller's profile, which described the first two videos he had produced and listed their prices as well as the prices for custom videos. After discovering Roe's failure to follow its orders, the SDPD—citing Roe for the added violation of disobedience of lawful orders—began termination proceedings. The proceedings resulted in Roe's dismissal from the police force.
Roe brought suit in the District Court pursuant to Rev. Stat. §1979, 42 U. S. C. §1983, alleging that the employment termination violated his First Amendment right to free speech. In granting summary judgment to the City, the District Court decided that Roe had not demonstrated that selling official police uniforms and producing, marketing, and selling sexually explicit videos for profit qualified as expression relating to a matter of "public concern" under this Court's decision in Connick v. Myers, 461 U. S. 138 (1983).
In reversing, the Court of Appeals held Roe's conduct fell within the protected category of citizen commentary on matters of public concern. Central to the Court of Appeals' conclusion was that Roe's expression was not an internal workplace grievance, took place while he was off-duty and away from his employer's premises, and was unrelated to his employment. 356 F. 3d, at 1110, 1113–1114.
A government employee does not relinquish all First Amendment rights otherwise enjoyed by citizens just by reason of his or her employment. See, e.g., Keyishian v. Board of Regents of Univ. of State of N. Y., 385 U. S. 589, 605–606 (1967). On the other hand, a governmental employer may impose certain restraints on the speech of its employees, restraints that would be unconstitutional if applied to the general public. The Court has recognized the right of employees to speak on matters of public concern, typically matters concerning government policies that are of interest to the public at large, a subject on which public employees are uniquely qualified to comment. See Connick, supra; Pickering v. Board of Ed. of Township High School Dist. 205, Will Cty., 391 U. S. 563 (1968). Outside of this category, the Court has held that when government employees speak or write on their own time on topics unrelated to their employment, the speech can have First Amendment protection, absent some governmental justification "far stronger than mere speculation" in regulating it. United States v. Treasury Employees, 513 U. S. 454, 465, 475 (1995) (NTEU). We have little difficulty in concluding that the City was not barred from terminating Roe under either line of cases.
In concluding that Roe's activities qualified as a matter of public concern, the Court of Appeals relied heavily on the Court's decision in NTEU. 356 F. 3d, at 1117. In NTEU it was established that the speech was unrelated to the employment and had no effect on the mission and purpose of the employer. The question was whether the Federal Government could impose certain monetary limitations on outside earnings from speaking or writing on a class of federal employees. The Court held that, within the particular classification of employment, the Government had shown no justification for the outside salary limitations. The First Amendment right of the employees sufficed to invalidate the restrictions on the outside earnings for such activities. The Court noted that throughout history public employees who undertook to write or to speak in their spare time had made substantial contributions to literature and art, NTEU, supra, at 465, and observed that none of the speech at issue "even arguably [had] any adverse impact" on the employer. Ibid.
The Court of Appeals' reliance on NTEU was seriously misplaced. Although Roe's activities took place outside the workplace and purported to be about subjects not related to his employment, the SDPD demonstrated legitimate and substantial interests of its own that were compromised by his speech. Far from confining his activities to speech unrelated to his employment, Roe took deliberate steps to link his videos and other wares to his police work, all in a way injurious to his employer. The use of the uniform, the law enforcement reference in the Web site, the listing of the speaker as "in the field of law enforcement," and the debased parody of an officer performing indecent acts while in the course of official duties brought the mission of the employer and the professionalism of its officers into serious disrepute. 356 F. 3d, at 1111 (internal quotation marks omitted).
The Court of Appeals noted the City conceded Roe's activities were "unrelated" to his employment. Id., at 1112, n. 4. In the context of the pleadings and arguments, the proper interpretation of the City's statement is simply to underscore the obvious proposition that Roe's speech was not a comment on the workings or functioning of the SDPD. It is quite a different question whether the speech was detrimental to the SDPD. On that score the City's consistent position has been that the speech is contrary to its regulations and harmful to the proper functioning of the police force. The present case falls outside the protection afforded in NTEU. The authorities that instead control, and which are considered below, are this Court's decisions in Pickering, supra, Connick, supra, and the decisions which follow them.
To reconcile the employee's right to engage in speech and the government employer's right to protect its own legitimate interests in performing its mission, the Pickering Court adopted a balancing test. It requires a court evaluating restraints on a public employee's speech to balance "the interests of the [employee], as a citizen, in commenting upon matters of public concern and the interest of the State, as an employer, in promoting the efficiency of the public services it performs through its employees." 391 U. S., at 568; see also Connick, supra, at 142.
Underlying the decision in Pickering is the recognition that public employees are often the members of the community who are likely to have informed opinions as to the operations of their public employers, operations which are of substantial concern to the public. Were they not able to speak on these matters, the community would be deprived of informed opinions on important public issues. See 391 U. S., at 572. The interest at stake is as much the public's interest in receiving informed opinion as it is the employee's own right to disseminate it.
Pickering did not hold that any and all statements by a public employee are entitled to balancing. To require Pickering balancing in every case where speech by a public employee is at issue, no matter the content of the speech, could compromise the proper functioning of government offices. See Connick, 461 U. S., at 143. This concern prompted the Court in Connick to explain a threshold inquiry (implicit in Pickering itself) that in order to merit Pickering balancing, a public employee's speech must touch on a matter of "public concern." 461 U. S., at 143 (internal quotation marks omitted).
In Connick, an assistant district attorney, unhappy with her supervisor's decision to transfer her to another division, circulated an intraoffice questionnaire. The document solicited her co-workers' views on, inter alia, office transfer policy, office morale, the need for grievance committees, the level of confidence in supervisors, and whether employees felt pressured to work in political campaigns. See id., at 141.
Finding that—with the exception of the final question—the questionnaire touched not on matters of public concern but on internal workplace grievances, the Court held no Pickering balancing was required. 461 U. S., at 141. To conclude otherwise would ignore the "common-sense realization that government offices could not function if every employment decision became a constitutional matter." Id., at 143. Connick held that a public employee's speech is entitled to Pickering balancing only when the employee speaks "as a citizen upon matters of public concern" rather than "as an employee upon matters only of personal interest." 461 U. S., at 147.
Although the boundaries of the public concern test are not well-defined, Connick provides some guidance. It directs courts to examine the "content, form, and context of a given statement, as revealed by the whole record" in assessing whether an employee's speech addresses a matter of public concern. Id., at 146–147. In addition, it notes that the standard for determining whether expression is of public concern is the same standard used to determine whether a common-law action for invasion of privacy is present. Id., at 143, n. 5. That standard is established by our decisions in Cox Broadcasting Corp. v. Cohn, 420 U. S. 469 (1975), and Time, Inc. v. Hill, 385 U. S. 374, 387–388 (1967). These cases make clear that public concern is something that is a subject of legitimate news interest; that is, a subject of general interest and of value and concern to the public at the time of publication. The Court has also recognized that certain private remarks, such as negative comments about the President of the United States, touch on matters of public concern and should thus be subject to Pickering balancing. See Rankin v. McPherson, 483 U. S. 378 (1987).
Applying these principles to the instant case, there is no difficulty in concluding that Roe's expression does not qualify as a matter of public concern under any view of the public concern test. He fails the threshold test and Pickering balancing does not come into play.
Connick is controlling precedent, but to show why this is not a close case it is instructive to note that even under the view expressed by the dissent in Connick from four Members of the Court, the speech here would not come within the definition of a matter of public concern. The dissent in Connick would have held that the entirety of the questionnaire circulated by the employee "discussed subjects that could reasonably be expected to be of interest to persons seeking to develop informed opinions about the manner in which . . . an elected official charged with managing a vital governmental agency, discharges his responsibilities." 461 U. S., at 163 (opinion of Brennan, J.). No similar purpose could be attributed to the employee's speech in the present case. Roe's activities did nothing to inform the public about any aspect of the SDPD's functioning or operation. Nor were Roe's activities anything like the private remarks at issue in Rankin, where one co-worker commented to another co-worker on an item of political news. Roe's expression was widely broadcast, linked to his official status as a police officer, and designed to exploit his employer's image.
The speech in question was detrimental to the mission and functions of the employer. There is no basis for finding that it was of concern to the community as the Court's cases have understood that term in the context of restrictions by governmental entities on the speech of their employees.
City of San Diego, California
John Roe

redpajama_set_name: RedPajamaCommonCrawl


text:
Mit Rote-Augen-Effekt oder Rotaugeneffekt bezeichnet man das Auftreten von roten Pupillen bei Bildern von Lebewesen, die mit Blitzlicht fotografiert wurden.

Ursache

Der Effekt tritt dann auf, wenn das Blitzgerät fast achsengleich mit dem  Objektiv montiert ist, sich also in Nähe der optischen Achse befindet. Er wird durch die Reflexion des Blitzes durch die stark durchblutete, rote Netzhaut des Auges hervorgerufen. Wenn die Person direkt in das Objektiv blickt, ist der Effekt besonders hervorstechend, tritt aber allgemein immer dann auf, wenn das an der Netzhaut reflektierte Blitzlicht in gerader Linie ins Objektiv zurückfällt.

Vermeidung
Der Effekt kann mit Hilfe verschiedener Blitzmethoden beeinflusst werden. Abhilfe schafft es, das Blitzgerät möglichst weit aus der optischen Achse heraus zu bewegen. Das ermöglicht beispielsweise die Verwendung eines seitlich neben dem Fotoapparat angebrachten Stabblitzes oder Techniken wie der entfesselte Blitz, bei denen die Blitzgeräte frei im Raum platziert werden; nachteilig sind hierbei vergrößerte Schlagschatten. Alternativ kann der Blitz auch "umgelenkt" werden, so dass er nicht direkt auf das Auge des Fotomotivs fällt. Das erreicht man beispielsweise, indem man den Blitz gegen die Decke dreht. Eine weitere Möglichkeit, mehr Licht dem Objekt bzw. der Person zuführen, ist das Benutzen von weiteren Lichtquellen.

Das Problem tritt in der professionellen Blitzlichtfotografie oder bei Verwendung einer Studioblitzanlage normalerweise nicht auf, da hier die Lichtquellen in der Regel weit entfernt von der optischen Achse platziert werden. In der Amateurfotografie ist der Effekt dagegen häufiger, etwa bei Verwendung des eingebauten Mini-Blitzgeräts einer Kompaktkamera oder beim Aufstecken eines Kompaktblitzgeräts auf den Blitzschuh einer Kamera.

Moderne Kameras und Blitzgeräte versuchen häufig, den Rote-Augen-Effekt durch einen Vorblitz zu verringern. Durch diesen wird die Pupillenöffnung des Auges verkleinert und die Reflexion des Blitzlichtes auf der Netzhaut verringert. Die verkleinerte Pupille ist jedoch im Interesse der Erzielung eines ansprechenden Porträts unerwünscht, da aus der Verhaltensbiologie und der Wahrnehmungspsychologie bekannt ist, dass Bilder von Menschen mit kleinen Pupillen als weniger sympathisch und freundlich wahrgenommen werden. Ein Vorblitz kann rote Augen nur dann wirksam verhindern, wenn die Person nicht direkt in das Objektiv oder auf den Blitz blickt.

Beseitigung des Rote-Augen-Effekts
Bei der Bildbearbeitung kann sowohl im Fotolabor durch Abdunkeln als auch durch Hilfsmittel der digitalen Bildbearbeitung der Rotaugeneffekt relativ unkompliziert umgefärbt werden.

Die Abbildung demonstriert vier Phasen einer Bearbeitung mit Photoshop:
 Auf der Abbildung ist zuoberst das Originalbild zu sehen.
 Eine neue Einstellungsebene wird über dem Ausgangsbild erstellt. Als Einstellungsart wird der Kanalmixer gewählt, mit dem die Farbkanäle wie folgt eingestellt werden: Rotkanal=0 %, Grünkanal=50 %, Blaukanal=50 %.
 Bild drei zeigt die Wirkung einer in die Einstellungsebene eingelegten schwarz gefüllten Ebenenmaske: Der Effekt der Einstellungsebene ist wegmaskiert, damit entspricht dieses Bild dem ersten.
 Bei Bild vier wurde die Pupille, wie sie in der Einstellungsebene aussieht, freigelegt, indem sie in der Ebenenmaske mit dem Pinselwerkzeug weiß übermalt wurde. (Weiße Bereiche in der Ebenenmaske machen die ihnen entsprechenden Teile der Ebene voll sichtbar.)

Anmerkung
Tritt vor allem bei einem Neugeborenen, Baby oder Kleinkind der Rote-Augen-Effekt ein- oder beidseits nicht auf, sondern ist stattdessen eine weiß leuchtende Pupille zu sehen, kann das ein Hinweis auf das Vorliegen eines Retinoblastoms (ein bösartiger Augentumor) oder eines Grauen Stars des Neugeborenen sein. Nur durch ein schnelles Handeln bleibt dann eine Chance auf Erhalt der Sehfähigkeit des betroffenen Auges.

Tiere

Bei einer Reihe von Tierarten tritt ein ähnlicher Effekt auf. Bei Tieren, die in der Dunkelheit gut sehen müssen, befindet sich hinter der Netzhaut des Auges das Tapetum lucidum, das eintreffendes Licht reflektiert damit dies auf dem Rückweg eine zweite Chance hat, in den Sehzellen einen Nervenimpuls auszulösen. Das restliche Licht tritt durch die Pupille wieder aus und führt zu stark leuchtenden Augen. Besonders bekannt ist das Phänomen von Katzen, deshalb werden Lichtreflektoren auch Katzenaugen genannt.

Weblinks

 http://www.ovalnets.de/bildbearbeitung-spezial-rote-augen-effekt-entfernen

Blitzlichtfotografie
Fotopraxis
Bildfehler

redpajama_set_name: RedPajamaWikipedia


text:
Top Lobbyist Says Trump, Presidential Race Create Uncertainties for PE
The industry stands to draw a fresh round of public scrutiny as the presidential race heats up and candidates take aim at the tax treatment of the investment profits private equity firms
Dawn Lim
Thursday June 16, 2016 2:01 pm
A top private equity lobbyist rebuked Donald Trump for missing chances to alter his tone for the general election, saying the Republican presidential candidate could cost supporters of the industry congressional seats and influence.
Mike Sommers, president and chief executive of the trade group American Investment Council, said Mr. Trump "wasted" opportunities to shift his message, and "reinforced the American people's view that he is temperamentally unfit to be president." He spoke during Private Equity International's Investor...


text:
Iced Jamb
Nebraska's Tommie Frazier taking College Hall of Fame snub in stride
by iced jamb
Tommie Frazier was one of the best players on one of the best teams in college football history, but according to the College Football Hall of Fame he is not one of the best players of all time.
The College Football Hall of Fame announced the Class of 2011 on Tuesday, and the former Nebraska quarterback Frazier was on the outside looking in. Frazier says he wasn't paying much attention to the news.
"Other people paid attention for me," he said in an Associated Press report. "I didn't really worry. I just got a couple texts from my wife. It's just one of those deals, out of my control."
Frazier was one of two Nebraska players on this year's ballot, joined by Will Shields. Shields was selected to the Hall of Fame along with 13 other players including Ohio State's Eddie George and Florida State's Deion Sanders. But for Frazier, the wait continues.
Frazier rushed for a career total of 1,955 yards and 36 touchdowns and passed for 3,521 yards and 43 touchdowns. Known more as a dual-threat type of quarterback and one that excelled in the Nebraska option-based offense, his passing numbers may leave something to be desired by voters when reviewing quarterbacks. But his overall impact on Nebraska's offense should speak for itself.
Despite not being voted in to the College Hall of Fame, Frazier's list of accomplishments during his collegiate career is impressive. The Big 8 Freshman of the Year in 1992 later went on to be named the conference's offensive player of the year in 1995. He was twice named the Orange Bowl MVP (1994 and 1995) and he picked up a third bowl game MVP honor with his performance in the 1996 Fiesta Bowl. The 1995 Orange Bowl and 1996 Fiesta Bowl games capped undefeated national championship seasons for Nebraska, and Frazier was the starting quarterback for each. He finished second in the 1995 Heisman Trophy voting to Ohio State's George.
The accolades do not stop there.
Sports Illustrated named Frazier as one of the back-ups on their all-century team behind starter Sammy Baugh. Frazier was joined by Roger Staubach, Doug Flutie, and John Lujack. College Football News also included Frazier in their Top 100 Greatest College Football Players of All Time in 2004. Frazier was #33 on the list.
So why was Frazier not selected to the College Football Hall of Fame?
That is the question Nebraska fans want to know. There is a feeling that the fact that Frazier did not play in the NFL may have ultimately cost him in the voting, although playing in the NFL is not necessary to be voted in to the College Football Hall of Fame. Frazier was well on his way to the NFL with an MVP performance in the East-West Shrine Game in 1996 but an average showing at best in the NFL Scouting Combine an his continuing battle with blood clots led every NFL franchise to pass on him in the 1996 NFL Draft.
Frazier did play a brief stint with the Montreal Alouettes of the Canadian Football League, but his professional career was cut short by a case of pneumonia. As a result Frazier decided to pass on a chance to play professional football and pursue other options. Frazier's decision led to an assistant coaching role at Baylor and assistant athletic director position at Nebraska. In 2005 Frazier took the head coaching position at Doane College in Nebraska, where he went 3-17 in two seasons.
By all accounts, it seems the only thing Frazier is missing is an NFL career. Is that what kept him from being elected? Or is there a sense of bias against Frazier because he played at a time a number of Nebraska players were creating negative headlines for their actions off the field, most notably running back Lawrence Phillips? Frazier's name never made those kinds of headlines, but some Nebraska fans feel that could have something to do with it.
Whatever it is, Frazier is not letting it bother him.
"When I can control something and it doesn't happen, then I get upset," he said. "When you have others doing the voting, you can't control it. It was an honor being on the list."
College Football Hall of Fame Criteria
Here are the criteria for college football players to be considered for the College Football Hall of Fame, followed by a notation on where Frazier stands on that eligibility requirement (in italics).
1. First and foremost, a player must have received First Team All-America recognition by a selector organization that is recognized by the NCAA and utilized to comprise their consensus All-America teams.
The Associated Press, Football Writers, Walter Camp, United Press International, and AFCA named Frazier First Team All-American in 1995.
2. A player becomes eligible for consideration by the Foundation's Honors Courts ten years after his final year of intercollegiate football played.
Frazier's last college football game was the 1996 Fiesta Bowl.
3. While each nominee's football achievements in college are of prime consideration, his post football record as a citizen is also weighed. He must have proven himself worthy as a citizen, carrying the ideals of football forward into his relations with his community and fellow man. Consideration may also be given for academic honors and whether or not the candidate earned a college degree.
Frazier is currently the director of development for Alegent Health in Omaha. He played one season in the Canadian Football League in Montreal after the NFL passed on him due to his battle with blood clots.
4. Players must have played their last year of intercollegiate football within the last 50 years.* For example, to be eligible for the 2010 ballot, the player must have played his last year in 1960 or thereafter. In addition, players who are playing professionally and coaches who are coaching on the professional level are not eligible until after they retire.
Follow Kevin's college football updates and conversation on Twitter and on Facebook.
1996 Olympic silver medalist Dennis Hall joins Nat. Wrestling Hall of Fame
Clendon Thomas named to College Football Hall of Fame
UGA Football: Bulldog great Jake Scott selected to College Football Hall of Fame
Frazier spoke with Rice in April, and he remains a Vikings priority now
Coconut Grove Gallery Walk hits its stride
Monmouth baseball hitting their stride
© 2020 Iced Jamb · Contact · Privacy


text:
Home Blog Page 371
Check Out the $350 Microsoft Headphones that Took 3 Years to...
Chris Rossiter - October 3, 2018
Microsoft is one of the world's biggest tech companies and it has the resources to work on secret projects. However, no one expected Microsoft...
Nokia 7.1 Full Specs and Price Leaked by Amazon
We reported yesterday that Nokia announced the first smartphone from its lineup that will be eligible to receive Android 9.0 Pie. However, it looks...
Google Leaks Red Hydrogen One Specs One Week Before Launch
Red Hydrogen One is one of the most highly anticipated smartphones of the year because of the impressive camera features that it will have...
World of Ether to Offer $250,000 Monster Mainnet Bounty?
World of Ether appeared back on our radar at the beginning of September when they proclaimed they had "big news." They proceeded to launch...
New Leak: Sony Xperia A3 Official Press Renders (Video)
This year is shaping up to be a great one for smartphone fans. Every big company such as Apple and Samsung, for example, have...
New Harry Potter RPG Game Leaked On Reddit (Video)
Do you miss the old days when you used to play Harry Potter games and lose yourself in the fantasy world created by J.K. Rowling?...
Nokia 7 Plus is First in Line to Receive Android 9.0...
Ever since HMD Global acquired Nokia, the Finnish tech giant has kept on launching high-end smartphones that more than often end up selling better...
New TubeMate 3.1.9 Update is Now Available
Did you ever wish you could simply download online videos and not have to wait for them to buffer through Wi-Fi or mobile data?...
Google Pixel 2-in-1 Hybrid Tablet Spotted with Intel Core i7-8500Y in...
Many rumors have pointed towards the fact that Google is working on a secret device codenamed "Nocturne". This device is none other than the...
Play Assassin's Creed: Odyssey for Free via Google Chrome
Assassin's Creed Odyssey is launching on all platforms on October 5th and Google has decided to make a big announcement regarding this news. Google...
1...370371372373Page 371 of 373


text:
processAll :: [[Int]] -> Int
processAll = head. head . scanr processRow (repeat 0)

processRow :: [Int] -> [Int] -> [Int]
processRow row lowerLvl = foldr (\(n, val) partRow -> (maxChoice val (lowerLvl !! n) (lowerLvl !! (n+1))) : partRow) [] (zip [0..] row)
  where
    maxChoice v l r = if (v + l) < (v + r) then (v + r) else (v + l)

main18 :: [[Int]] -> IO ()
main18 nss = putStrLn $ show . processAll $ nss

runTest :: Int -> [String] -> IO ()
runTest 0 _ = return ()
runTest n ss = do
  let nlines = read . head $ ss
      nss    = map (map read . words) . take nlines . tail $ ss
  main18 nss
  runTest (n-1) (drop (nlines + 1) ss)

main :: IO ()
main = do
  alllines <- getContents
  let tc       = read . head . lines $ alllines
      allInput = tail . lines $ alllines
  runTest tc allInput


if you are looking for an excellent stand builder we are capable of providing you with the best quality stands to the people. We offer amazing quality stand builders which will support all of your display in the exhibition. Display banners are the best way to let others know about what you are offering in an exhibition or another public event. Not only that, but we can also help in arranging and setting up the stall that you are going to open it. Our designers and builders take care of everything on your behalf at the exhibition. We offer flooring and furniture of stellar quality. They provide maximum comfort and convenience to all your guests.


I know rule "00201 deny log ip from any to any" is going to deny packets. But I really don't know , how rule 201 deny it and why did logs appear? Please help me.
I am not an ipfw user but I know that it operates on a "first match wins" methodology. Based upon that observation, it would make sense that rule 201 is snagging that traffic because nothing preceding 201 was matched.
A deny "any/any" is quite a club to be swinging there so looks like you need to get a bit more granular with your allow statements.
FreeBSD 10.0 has been End-of-Life since Februari 2015 and is not supported any more.
FreeBSD 10.0 has been End-of-Life ..


This Friday night will have Phish's very own Mike Gordon making a stop at the Park West. This marks the second time that Gordon has brought his 5 piece band through Chicago, last time in support of his album The Sparrow.
One thing that Gordon has attempted with this new ensemble was to step away from long spewing jams (which may or may not have been hard since he spent most of the summer doing it with Phish) and concentrate on a more locked in funk sound. Four on the floor for the most part, it is refreshing to hear coming from this seasoned bassist. You don't need to be a math nerd to enjoy it.
His last time around was a "concept" show, meaning the whole night was based on the story of him being on the road away from his wife as told through each song he played. It was the only time on his tour that a show was done this way, so he may have a few tricks up his sleeve again.
The four other musicians he's bringing with him (Scott Murawski on guitar, Tom Cleary on keyboards, Todd Islen on drums, and Craig Myers on percussion) add more than most musicians do when playing in another man's side project. They all stand out on their own, in their own varying ways, and don't serve as a platform just to showcase Gordon's own talents. They are actually a band that plays together. The only thing reminiscent of a one man show is the fact that Gordon wrote all the material.
The Park West is an ideal place for the show. Part of the floor is open to dancing, while the other half is seated with waitresses for those that would like to just sit, drink and enjoy. Show starts at 7:30.


Are you currently reaching the right customer with the right message at the right time? RetailSonar maps the DNA of your existing customers for you and defines who and where are your perfect target audiences. We can also increase the ROI of your flyer and direct mail campaigns with our selection and targeting models for flyer distribution and direct mailing. Analyse the results after every campaign yourself and make changes where necessary.
Map the complete DNA of your existing customers based on behaviour, social-demographics, psychographics and geography.
Split your heterogeneous customer group into several homogeneous subsegments and target audiences.
Determine the relevance of your product range and promotions for your various potential target audiences.
Increase the efficiency of your campaigns by 10 to 15% by targeting the right target audience.
Increase the efficiency of your campaigns by 50% to 100% by sending the right message to the right target audience.
Select the right distribution zones. Determine the theoretical customer potential and overall distribution cost for every neighbourhood, taking into account municipal taxes. Where necessary, apply local exceptions (e.g., in case of works in the neighbourhood).
Divide the distribution cost fairly between all of your points of sale.
Gain an insight into which messages and which promotional items would score best with which target audiences. Also determine how aggressively you will promote this.
Select those customers with a high expected level of response for a next campaign.
Measure the impact of every campaign in an accurate and automated way.
Establish the level of response of newly-selected customers and the churn of customers that were not selected. Adapt where necessary.
Differentiate your customer selections for every campaign, depending on seasonal effects.
Test the impact of new media channels or new messages in a controlled manner.
"We saved 14% on our flyer distribution"


Below are the nutrition facts and Weight Watchers points for Mini Peanut Butter Caramel Pie Malt from Sonic Drive-In .
There are 840 calories in a Mini Peanut Butter Caramel Pie Malt from Sonic. Most of those calories come from fat (50%) and carbohydrates (45%).
Is the Mini Peanut Butter Caramel Pie Malt good for you?
Does the Mini Peanut Butter Caramel Pie Malt taste good?


text:
package com.bebopx.coltrane.view.main.components;

import com.bebopx.coltrane.sys.LocalNavigator;
import com.bebopx.coltrane.util.ComponentTool;
import com.vaadin.ui.Button;
import com.vaadin.ui.CssLayout;
import com.vaadin.ui.NativeButton;

/**
 *
 * @author thiago
 */
public final class ViewAccessButtonTool {

    private ViewAccessButtonTool() {
    }

    public static Button buildViewAccessButton(final String view, final String icon,
            final CssLayout menu, final LocalNavigator nav) {

        Button localButton;
        localButton = new NativeButton(view); //constructor takes caption as arg
        localButton.addStyleName(icon);

        localButton.addClickListener(new Button.ClickListener() {
            @Override
            public void buttonClick(final Button.ClickEvent event) {

                String navView;
                navView = "/".concat(view);

                ComponentTool.removeChildrenComponentStyleName(
                        menu, "selected");
                event.getButton().addStyleName("selected");

                if (!nav.getState().equals(navView)) {
                    nav.navigateTo(view);
                }
            }
        });

        return localButton;
    }
}


Guide to Formatting. In: DiTullio D, Dell'Angelica EC. DiTullio D, Dell'Angelica E.C. Eds. David DiTullio, and Esteban C. Dell'Angelica.eds. Fundamentals of Biochemistry: Medical Course & Step 1 Review New York, NY: McGraw-Hill; . http://accesspharmacy.mhmedical.com/content.aspx?bookid=2492&sectionid=204925833. Accessed April 26, 2019.
. "Guide to Formatting." Fundamentals of Biochemistry: Medical Course & Step 1 Review DiTullio D, Dell'Angelica EC. DiTullio D, Dell'Angelica E.C. Eds. David DiTullio, and Esteban C. Dell'Angelica. New York, NY: McGraw-Hill, , http://accesspharmacy.mhmedical.com/content.aspx?bookid=2492&sectionid=204925833.
In this book, we highlight key terms using a few different formats, to help identify the most important facts to learn for the Step 1.
Blue bold text is used for key biochemistry terms, such as microtubules, histones, and so on. These are topics that are often tested on Step 1 and are worth paying extra attention to.
Red bold text is used for clinical correlates and disease, such as Kartagener syndrome or aminoglycoside antibiotics. These relate directly to the Biochemistry topics discussed in that section and often help connect Biochemistry to other topics across the Step 1 exam.
Regular bold text is also used to help emphasize high-yield facts, such as key symptoms of diseases, to help you quickly review sections or read through more efficiently.
We have tried to use this consistent structure so that whenever you use this book, whether the first time or for review later on, you can easily find what you're looking for and quickly identify high-yield information.