text:
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE CPP                        #-}
{-# LANGUAGE DeriveDataTypeable         #-}
{-# LANGUAGE DeriveGeneric              #-}
{-# LANGUAGE FlexibleInstances          #-}
{-# LANGUAGE ViewPatterns               #-}

{-# LANGUAGE MultiParamTypeClasses      #-}
{-# LANGUAGE OverloadedStrings          #-}
{-# LANGUAGE PatternGuards              #-}
{-# LANGUAGE ScopedTypeVariables        #-}
#if MIN_VERSION_base(4,8,0)
#define OVERLAPS {-# OVERLAPPING #-}
#else
{-# LANGUAGE OverlappingInstances       #-}
#define OVERLAPS
#endif
-----------------------------------------------------------------------------
-- |
-- Module      :  Text.CSL.Style
-- Copyright   :  (c) Andrea Rossato
-- License     :  BSD-style (see LICENSE)
--
-- Maintainer  :  Andrea Rossato <andrea.rossato@unitn.it>
-- Stability   :  unstable
-- Portability :  unportable
--
-- The Style types
--
-----------------------------------------------------------------------------

module Text.CSL.Style ( readCSLString
                      , writeCSLString
                      , Formatted(..)
                      , Style(..)
                      , Locale(..)
                      , mergeLocales
                      , CslTerm(..)
                      , newTerm
                      , findTerm
                      , findTerm'
                      , Abbreviations(..)
                      , MacroMap
                      , Citation(..)
                      , Bibliography(..)
                      , Option
                      , mergeOptions
                      , Layout(..)
                      , Element(..)
                      , IfThen(..)
                      , Condition(..)
                      , Delimiter
                      , Match(..)
                      , match
                      , DatePart(..)
                      , defaultDate
                      , Sort(..)
                      , Sorting(..)
                      , compare'
                      , Form(..)
                      , Gender(..)
                      , NumericForm(..)
                      , DateForm(..)
                      , Plural(..)
                      , Name(..)
                      , NameAttrs
                      , NamePart(..)
                      , isPlural
                      , isName
                      , isNames
                      , hasEtAl
                      , Formatting(..)
                      , emptyFormatting
                      , rmTitleCase
                      , rmTitleCase'
                      , Quote(..)
                      , mergeFM
                      , CSInfo(..)
                      , CSAuthor(..)
                      , CSCategory(..)
                      , CiteprocError(..)
                      , Output(..)
                      , Citations
                      , Cite(..)
                      , emptyCite
                      , CitationGroup(..)
                      , BiblioData(..)
                      , CiteData(..)
                      , NameData(..)
                      , isPunctuationInQuote
                      , object'
                      , Agent(..)
                      , emptyAgent
                      )
where

import Prelude
import           Control.Applicative    ((<|>), (<$>))
import           Control.Arrow          hiding (left, right)
import           Control.Monad          (mplus)
import           Data.Aeson             hiding (Number)
import qualified Data.Aeson             as Aeson
import           Data.Aeson.Types       (Pair)
import           Data.Char              (isLetter, isPunctuation, isUpper, isDigit)
import qualified Data.Char              as Char
import           Data.Generics          (Data, Typeable)
import           Data.List              (intercalate, intersperse, nubBy)
import           Data.List.Split        (wordsBy)
import qualified Data.Map               as M
import           Data.Maybe             (listToMaybe, isNothing)
import           Data.String
import           Data.Text              (Text)
import           Data.Yaml.Builder      (ToYaml (..))
import qualified Data.Yaml.Builder      as Y
import           GHC.Generics           (Generic)
import           Text.CSL.Compat.Pandoc (readHtml, writeMarkdown)
import           Text.CSL.Util          (headInline, initInline,
                                         lastInline, mapping', mb, parseBool,
                                         parseString, query, splitWhen,
                                         splitStrWhen, tailInline, trimr,
                                         (.#:), (.#?),
                                         AddYaml(..), addSpaceAfterPeriod)
import qualified Text.Pandoc.Builder    as B
import           Text.Pandoc.Definition hiding (Citation, Cite)
import qualified Text.Pandoc.Walk       as Walk
import           Text.Pandoc.XML        (fromEntities)

import qualified Data.Text              as T
#ifdef UNICODE_COLLATION
import qualified Data.Text.ICU          as T
#else
import           Data.RFC5051           (compareUnicode)
#endif
import qualified Data.Vector            as V

-- Note:  FromJSON reads HTML, ToJSON writes Markdown.
-- This means that they aren't proper inverses of each other, which
-- is odd, but it makes sense given the uses here.  FromJSON is used
-- for reading JSON citeproc bibliographies.  ToJSON is used to create
-- pandoc metadata bibliographies.

readCSLString :: Text -> [Inline]
readCSLString s = Walk.walk handleSmallCapsSpans
                $ case readHtml (adjustScTags s) of
                        Pandoc _ [Plain ils] -> ils
                        Pandoc _ [Para  ils] -> ils
                        Pandoc _ x           -> Walk.query (:[]) x
  -- this is needed for versions of pandoc that don't turn
  -- a span with font-variant:small-caps into a SmallCaps element:
  where handleSmallCapsSpans (Span ("",[],[("style",sty)]) ils)
            | T.filter (`notElem` (" \t;" :: String)) sty == "font-variant:small-caps" =
              SmallCaps ils
        handleSmallCapsSpans x = x

-- <sc> is not a real HTML tag, but a CSL convention.  So we
-- replace it with a real tag that the HTML reader will understand.
adjustScTags :: Text -> Text
adjustScTags zs
  | Just xs <- T.stripPrefix "<sc>" zs =
      "" <> adjustScTags xs
  | Just xs <- T.stripPrefix "</sc>" zs =
      "" <> adjustScTags xs
  | Just (x, xs) <- T.uncons zs =
    T.cons x (adjustScTags xs)
  | otherwise = ""

writeYAMLString :: [Inline] -> Text
writeYAMLString ils =
  trimr $ writeMarkdown
        $ Pandoc nullMeta
          [Plain $ Walk.walk (concatMap (adjustCSL False)) ils]

writeCSLString :: [Inline] -> Text
writeCSLString ils =
  trimr $ writeMarkdown
        $ Pandoc nullMeta
          [Plain $ Walk.walk (concatMap (adjustCSL True)) ils]

-- If the first param is True, we use special rich text conventions
-- for CSL JSON, described here:
-- http://docs.citationstyles.org/en/1.0/release-notes.html#rich-text-markup-within-fields
adjustCSL :: Bool -> Inline -> [Inline]
adjustCSL _ (Span ("",[],[]) xs) = xs
adjustCSL _ (Span ("",["citeproc-no-output"],[]) _) =
  [Str "[CSL STYLE ERROR: reference with no printed form.]"]
adjustCSL True (SmallCaps xs) =
  RawInline (Format "html") "<sc>" : xs
    ++ [RawInline (Format "html") "</sc>"]
adjustCSL True (Subscript xs) =
  RawInline (Format "html") "" : xs
    ++ [RawInline (Format "html") ""]
adjustCSL True (Superscript xs) =
  RawInline (Format "html") "" : xs
    ++ [RawInline (Format "html") ""]
adjustCSL True (Emph xs) =
  RawInline (Format "html") "" : xs
    ++ [RawInline (Format "html") ""]
adjustCSL True (Strong xs) =
  RawInline (Format "html") "" : xs
    ++ [RawInline (Format "html") ""]
adjustCSL _ x = [x]

-- We use a newtype wrapper so we can have custom ToJSON, FromJSON
-- instances.
newtype Formatted = Formatted { unFormatted :: [Inline] }
  deriving ( Show, Read, Eq, Ord, Data, Typeable, Generic )

instance FromJSON Formatted where
  parseJSON v@(Array _) =
   Formatted <$> (parseJSON v
             <|> ((query (:[]) :: [Block] -> [Inline]) <$> parseJSON v))
  parseJSON v           = (Formatted . readCSLString) Control.Applicative.<$> parseString v

instance ToJSON Formatted where
  toJSON = toJSON . writeCSLString . unFormatted

instance ToYaml Formatted where
  toYaml = Y.string . writeYAMLString . unFormatted

instance IsString Formatted where
  fromString = Formatted . toStr

instance AddYaml Formatted where
  x &= (Formatted y) =
           \acc -> if null y
                      then acc
                      else (x Y..= Formatted y) : acc

instance Semigroup Formatted where
  (<>) = appendWithPunct

instance Monoid Formatted where
  mempty = Formatted []
  mappend = (<>)
  mconcat = foldr mappend mempty

instance Walk.Walkable Inline Formatted where
  walk f  = Formatted . Walk.walk f . unFormatted
  walkM f = fmap Formatted . Walk.walkM f . unFormatted
  query f = Walk.query f . unFormatted

instance Walk.Walkable Formatted Formatted where
  walk f  = f
  walkM f = f
  query f = f

toStr :: String -> [Inline]
toStr = intercalate [Str "\n"] .
        map (B.toList . B.text . T.pack . tweak . T.unpack . fromEntities) .
        splitWhen (=='\n') . T.pack
    where
      tweak ('«':' ':xs) = "«\8239" ++ tweak xs
      tweak (' ':'»':xs) = "\8239»" ++ tweak xs
      tweak (' ':';':xs) = "\8239;" ++ tweak xs
      tweak (' ':':':xs) = "\8239:" ++ tweak xs
      tweak (' ':'!':xs) = "\8239!" ++ tweak xs
      tweak (' ':'?':xs) = "\8239?" ++ tweak xs
      tweak ( x :xs    ) = x : tweak xs
      tweak []           = []

appendWithPunct :: Formatted -> Formatted -> Formatted
appendWithPunct (Formatted left) (Formatted right) =
  Formatted $
  case (,) <$> lastleft <*> firstright of
    Just (' ', d) | d `elem` (",.:;" :: String) -> initInline left ++ right
    Just (c,d) | c `elem` (" ,.:;" :: String), d == c -> left ++ tailInline right
    Just (c,'.') | c `elem` (",.!:;?" :: String) -> left ++ tailInline right
    Just (c,':') | c `elem` (",!:;?" :: String) -> left ++ tailInline right  -- Mich.: 2005
    Just (c,'!') | c `elem` (",.!:;?" :: String) -> left ++ tailInline right
    Just (c,'?') | c `elem` (",.!:;?" :: String) -> left ++ tailInline right
    Just (c,';') | c `elem` (",:;" :: String) -> left ++ tailInline right -- et al.;
    Just (':',c) | c `elem` (",.!:;?" :: String) -> left ++ tailInline right
    Just (';',c) | c `elem` (",.!:;?" :: String) -> left ++ tailInline right
    -- ".;" -> right  -- e.g. et al.;
    _    -> left ++ right
  where lastleft     = lastInline left
        firstright   = headInline right

-- | The representation of a parsed CSL style.
data Style
    = Style
      { styleVersion       ::  Text
      , styleClass         ::  Text
      , styleInfo          ::  Maybe CSInfo
      , styleDefaultLocale ::  Text
      , styleLocale        :: [Locale]
      , styleAbbrevs       :: Abbreviations
      , csOptions          :: [Option]
      , csMacros           :: [MacroMap]
      , citation           ::  Citation
      , biblio             ::  Maybe Bibliography
      } deriving ( Show, Read, Typeable, Data, Generic )

data Locale
    = Locale
      { localeVersion :: Text
      , localeLang    :: Text
      , localeOptions :: [Option]
      , localeTerms   :: [CslTerm]
      , localeDate    :: [Element]
      } deriving ( Show, Read, Eq, Typeable, Data, Generic )

-- | With the 'defaultLocale', the locales-xx-XX.xml loaded file and
-- the parsed 'Style' cs:locale elements, produce the final 'Locale'
-- as the only element of a list, taking into account CSL locale
-- prioritization.
mergeLocales :: Text -> Locale -> [Locale] -> [Locale]
mergeLocales s l ls = doMerge list
    where
      list = filter ((==) s . localeLang) ls ++
             filter ((\x -> x /= "" && x `T.isPrefixOf` s) . localeLang) ls ++
             filter ((==) "" . localeLang) ls
      doMerge x = return l { localeOptions = newOpt     x
                           , localeTerms   = newTerms   x
                           , localeDate    = newDate    x
                           }
      cht          = cslTerm &&& termForm &&& termGenderForm
      checkedLoc   = if hasOrdinals ls then rmOrdinals (localeTerms l) else localeTerms l
      newTerms   x = nubBy (\a b -> cht a == cht b) (concatMap localeTerms   x ++ checkedLoc)
      newOpt     x = nubBy (\a b -> fst a == fst b) (concatMap localeOptions x ++ localeOptions l)
      newDate    x = nubBy (\(Date _ a _ _ _ _)
                             (Date _ b _ _ _ _) -> a == b) (concatMap localeDate x ++ localeDate l)

data CslTerm
    = CT
      { cslTerm        :: Text
      , termForm       :: Form
      , termGender     :: Gender
      , termGenderForm :: Gender
      , termSingular   :: Text
      , termPlural     :: Text
      , termMatch      :: Text
      } deriving ( Show, Read, Eq, Typeable, Data, Generic )

newTerm :: CslTerm
newTerm = CT "" Long Neuter Neuter "" "" ""

findTerm :: Text -> Form -> [CslTerm] -> Maybe CslTerm
findTerm s f = findTerm'' s f Nothing

findTerm' :: Text -> Form -> Gender -> [CslTerm] -> Maybe CslTerm
findTerm' s f g = findTerm'' s f (Just g)

findTerm'' :: Text -> Form -> Maybe Gender -> [CslTerm] -> Maybe CslTerm
findTerm'' s f mbg ts
  = listToMaybe [ t | t <- ts, cslTerm t == s, termForm t == f,
                         isNothing mbg || mbg == Just (termGenderForm t) ]
  `mplus`
  -- fallback: http://citationstyles.org/downloads/specification.html#terms
  case f of
       VerbShort -> findTerm'' s Verb Nothing ts
       Symbol    -> findTerm'' s Short Nothing ts
       Verb      -> findTerm'' s Long Nothing ts
       Short     -> findTerm'' s Long Nothing ts
       _         -> Nothing

hasOrdinals :: [Locale] -> Bool
hasOrdinals = any (any hasOrd . localeTerms)
    where
      hasOrd o
          | CT {cslTerm = t} <- o
          , "ordinal" `T.isInfixOf` t = True
          | otherwise                 = False

rmOrdinals :: [CslTerm] -> [CslTerm]
rmOrdinals [] = []
rmOrdinals (o:os)
  | CT {cslTerm = t} <- o
  , "ordinal" `T.isInfixOf` t =   rmOrdinals os
  | otherwise                 = o:rmOrdinals os

newtype Abbreviations = Abbreviations {
           unAbbreviations :: M.Map Text (M.Map Text (M.Map Text Text))
           } deriving ( Show, Read, Typeable, Data, Generic )

instance FromJSON Abbreviations where
  parseJSON (Object v)   = Abbreviations <$> parseJSON (Object v)
  parseJSON (Bool False) = return $ Abbreviations M.empty
  parseJSON _            = fail "Could not read Abbreviations"

type MacroMap
    = (Text,[Element])

data Citation
    = Citation
      { citOptions :: [Option]
      , citSort    :: [Sort]
      , citLayout  ::  Layout
      } deriving ( Show, Read, Typeable, Data, Generic )

data Bibliography
    = Bibliography
      { bibOptions :: [Option]
      , bibSort    :: [Sort]
      , bibLayout  ::  Layout
      } deriving ( Show, Read, Typeable, Data, Generic )

type Option = (Text,Text)

mergeOptions :: [Option] -> [Option] -> [Option]
mergeOptions os = nubBy (\x y -> fst x == fst y) . (++) os

data Layout
    = Layout
      { layFormat ::  Formatting
      , layDelim  ::  Delimiter
      , elements  :: [Element]
      } deriving ( Show, Read, Typeable, Data, Generic )

data Element
    = Choose       IfThen    [IfThen]    [Element]
    | Macro        Text                   Formatting
    | Const        Text                   Formatting
    | Variable    [Text]      Form        Formatting Delimiter
    | Term         Text       Form        Formatting Bool
    | Label        Text       Form        Formatting Plural
    | Number       Text       NumericForm Formatting
    | Names       [Text  ]   [Name]       Formatting Delimiter [Element]
    | Substitute  [Element]
    | Group        Formatting Delimiter  [Element]
    | Date        [Text  ]    DateForm    Formatting Delimiter [DatePart] Text
      deriving ( Show, Read, Eq, Typeable, Data, Generic )

data IfThen
    = IfThen Condition Match [Element]
      deriving ( Eq, Show, Read, Typeable, Data, Generic )

data Condition
    = Condition
      { isType          :: [Text]
      , isSet           :: [Text]
      , isNumeric       :: [Text]
      , isUncertainDate :: [Text]
      , isPosition      :: [Text]
      , disambiguation  :: [Text]
      , isLocator       :: [Text]
      } deriving ( Eq, Show, Read, Typeable, Data, Generic )

type Delimiter = Text

data Match
    = Any
    | All
    | None
      deriving ( Show, Read, Eq, Typeable, Data, Generic )

match :: Match -> [Bool] -> Bool
match All  = and
match Any  = or
match None = all not

data DatePart
    = DatePart
      { dpName       :: Text
      , dpForm       :: Text
      , dpRangeDelim :: Text
      , dpFormatting :: Formatting
      } deriving ( Show, Read, Eq, Typeable, Data, Generic )

defaultDate :: [DatePart]
defaultDate
    = [ DatePart "year"  "" "-" emptyFormatting
      , DatePart "month" "" "-" emptyFormatting
      , DatePart "day"   "" "-" emptyFormatting]

data Sort
    = SortVariable Text Sorting
    | SortMacro    Text Sorting Int Int Text
      deriving ( Eq, Show, Read, Typeable, Data, Generic )

data Sorting
    = Ascending  Text
    | Descending Text
      deriving ( Read, Show, Eq, Typeable, Data, Generic )

instance Ord Sorting where
    compare (Ascending  "") (Ascending  "") = EQ
    compare (Ascending  "") (Ascending   _) = GT
    compare (Ascending   _) (Ascending  "") = LT
    compare (Ascending   a) (Ascending   b) = compare' a b
    compare (Descending "") (Descending "") = EQ
    compare (Descending "") (Descending  _) = GT
    compare (Descending  _) (Descending "") = LT
    compare (Descending  a) (Descending  b) = compare' b a
    compare              _               _  = EQ

compare' :: Text -> Text -> Ordering
compare' x y
    = case (T.uncons x, T.uncons y) of
        (Just ('-',_), Just ('-',_)) -> comp (normalize y) (normalize x)
        (Just ('-',_), _)            -> LT
        (_  ,Just ('-',_))           -> GT
        _                            -> comp (normalize x) (normalize y)
      where
        -- we zero pad numbers so they're sorted numerically, see #399
        zeropad t = if T.all isDigit t
                       then T.replicate (10 - T.length t) "0" <> t
                       else t
        normalize = zeropad .
                    T.map (\c -> if c == ',' || c == '.' then ' ' else c) .
                    T.filter (\c -> c == ',' ||
                                  not (isPunctuation c || Char.isSpace c
                                      -- ayn/hamza in transliterated arabic:
                                       || c == 'ʾ' || c == 'ʿ'
                                       ))
#ifdef UNICODE_COLLATION
        comp a b = T.collate (T.collator T.Current) a b
#else
        comp a b = compareUnicode a b
#endif

data Form
    = Long
    | Short
    | Count
    | Verb
    | VerbShort
    | Symbol
    | NotSet
      deriving ( Eq, Show, Read, Typeable, Data, Generic )

data Gender
    = Feminine
    | Masculine
    | Neuter
      deriving ( Eq, Show, Read, Typeable, Data, Generic )

data NumericForm
    = Numeric
    | Ordinal
    | Roman
    | LongOrdinal
      deriving ( Eq, Show, Read, Typeable, Data, Generic )

data DateForm
    = TextDate
    | NumericDate
    | NoFormDate
      deriving ( Eq, Show, Read, Typeable, Data, Generic )

data Plural
    = Contextual
    | Always
    | Never
      deriving ( Eq, Show, Read, Typeable, Data, Generic )

data Name
    = Name      Form Formatting NameAttrs Delimiter [NamePart]
    | NameLabel Form Formatting Plural
    | EtAl           Formatting Text
      deriving ( Eq, Show, Read, Typeable, Data, Generic )

type NameAttrs = [(Text, Text)]

data NamePart
    = NamePart Text Formatting
      deriving ( Show, Read, Eq, Typeable, Data, Generic )

isPlural :: Plural -> Int -> Bool
isPlural p l
    = case p of
        Always     -> True
        Never      -> False
        Contextual -> l > 1

isName :: Name -> Bool
isName x = case x of Name {} -> True; _ -> False

isNames :: Element -> Bool
isNames x = case x of Names {} -> True; _ -> False

hasEtAl :: [Name] -> Bool
hasEtAl = any isEtAl
    where isEtAl (EtAl _ _) = True
          isEtAl _          = False

data Formatting
    = Formatting
      { prefix         :: Text
      , suffix         :: Text
      , fontFamily     :: Text
      , fontStyle      :: Text
      , fontVariant    :: Text
      , fontWeight     :: Text
      , textDecoration :: Text
      , verticalAlign  :: Text
      , textCase       :: Text
      , display        :: Text
      , quotes         :: Quote
      , stripPeriods   :: Bool
      , noCase         :: Bool
      , noDecor        :: Bool
      , hyperlink      :: Text  -- null for no link
      } deriving ( Read, Eq, Ord, Typeable, Data, Generic )

-- custom instance to make debugging output less busy
instance Show Formatting where
  show x
    | x == emptyFormatting = "emptyFormatting"
    | otherwise            = "emptyFormatting{"
        ++ intercalate ", "
           [ k ++ " = " ++ f x |
             (k, f) <- [("prefix", show . prefix)
                       ,("suffix", show . suffix)
                       ,("fontFamily", show . fontFamily)
                       ,("fontStyle", show . fontStyle)
                       ,("fontVariant", show . fontVariant)
                       ,("fontWeight", show . fontWeight)
                       ,("textDecoration", show . textDecoration)
                       ,("verticalAlign", show . verticalAlign)
                       ,("textCase", show . textCase)
                       ,("display", show . display)
                       ,("quotes", show . quotes)
                       ,("stripPeriods", show . stripPeriods)
                       ,("noCase", show . noCase)
                       ,("noDecor", show . noDecor)
                       ,("hyperlink", show . hyperlink)],
             f x /= f emptyFormatting ]
        ++ "}"

rmTitleCase :: Formatting -> Formatting
rmTitleCase f = f{ textCase = if textCase f == "title" then "" else textCase f  }

rmTitleCase' :: Output -> Output
rmTitleCase' o =
  case o of
       OStr s f    -> OStr s (rmTitleCase f)
       Output os f -> Output os (rmTitleCase f)
       _           -> o

data Quote
    = NativeQuote
    | ParsedQuote
    | NoQuote
    deriving ( Show, Read, Eq, Ord, Typeable, Data, Generic )

emptyFormatting :: Formatting
emptyFormatting
    = Formatting "" "" "" "" "" "" "" "" "" "" NoQuote False False False ""

mergeFM :: Formatting -> Formatting -> Formatting
mergeFM (Formatting aa ab ac ad ae af ag ah ai aj ak al am an ahl)
        (Formatting ba bb bc bd be bf bg bh bi bj bk bl bm bn bhl) =
                   Formatting (ba `orIfEmpty` aa)
                              (bb `orIfEmpty` ab)
                              (bc `orIfEmpty` ac)
                              (bd `orIfEmpty` ad)
                              (be `orIfEmpty` ae)
                              (bf `orIfEmpty` af)
                              (bg `orIfEmpty` ag)
                              (bh `orIfEmpty` ah)
                              (bi `orIfEmpty` ai)
                              (bj `orIfEmpty` aj)
                              (if bk == NoQuote then ak else bk)
                              (bl || al)
                              (bm || am)
                              (bn || an)
                              (bhl <> ahl)
 where orIfEmpty :: Text -> Text -> Text
       orIfEmpty "" fallback = fallback
       orIfEmpty t  _ = t

data CSInfo
    = CSInfo
      { csiTitle      :: Text
      , csiAuthor     :: CSAuthor
      , csiCategories :: [CSCategory]
      , csiId         :: Text
      , csiUpdated    :: Text
      } deriving ( Show, Read, Typeable, Data, Generic )

data CSAuthor   = CSAuthor   Text Text Text
                deriving ( Show, Read, Eq, Typeable, Data, Generic )
data CSCategory = CSCategory Text Text Text
                deriving ( Show, Read, Eq, Typeable, Data, Generic )

data CiteprocError
   = NoOutput
   | ReferenceNotFound Text
   deriving ( Eq, Ord, Show, Typeable, Data, Generic )

-- | The 'Output' generated by the evaluation of a style. Must be
-- further processed for disambiguation and collapsing.
data Output
    = ONull
    | OSpace
    | OPan    [Inline]
    | OStatus [Inline]
    | ODel     Text                                   -- ^ A delimiter string.
    | OStr     Text           Formatting            -- ^ A simple 'String'
    | OErr     CiteprocError                            -- ^ Warning message
    | OLabel   Text           Formatting            -- ^ A label used for roles
    | ONum     Int            Formatting            -- ^ A number (used to count contributors)
    | OCitNum  Int            Formatting            -- ^ The citation number
    | OCitLabel Text          Formatting            -- ^ The citation label
    | ODate   [Output]                                  -- ^ A (possibly) ranged date
    | OYear    Text    Text   Formatting            -- ^ The year and the citeId
    | OYearSuf Text    Text   [Output]   Formatting -- ^ The year suffix, the citeId and a holder for collision data
    | OName    Agent    [Output] [[Output]]  Formatting -- ^ A (family) name with the list of given names.
    | OContrib Text    Text   [Output] [Output] [[Output]] -- ^ The citation key, the role (author, editor, etc.), the contributor(s),
                                                        -- the output needed for year suf. disambiguation, and everything used for
                                                        -- name disambiguation.
    | OLoc    [Output]        Formatting            -- ^ The citation's locator
    | Output  [Output]        Formatting            -- ^ Some nested 'Output'
      deriving ( Eq, Ord, Show, Typeable, Data, Generic )

type Citations = [[Cite]]
data Cite
    = Cite
      { citeId         :: Text
      , citePrefix     :: Formatted
      , citeSuffix     :: Formatted
      , citeLabel      :: Text
      , citeLocator    :: Text
      , citeNoteNumber :: Text
      , citePosition   :: Text
      , nearNote       :: Bool
      , authorInText   :: Bool
      , suppressAuthor :: Bool
      , citeHash       :: Int
      } deriving ( Show, Eq, Typeable, Data, Generic )

instance FromJSON Cite where
  parseJSON (Object v) = Cite <$>
              v .#: "id" <*>
              v .:? "prefix" .!= mempty <*>
              v .:? "suffix" .!= mempty <*>
              v .#? "label" .!= "page" <*>
              v .#? "locator"  .!= "" <*>
              v .#? "note-number" .!= "" <*>
              v .#? "position" .!= "" <*>
              (v .:? "near-note" >>= mb parseBool) .!= False <*>
              (v .:? "author-in-text" >>= mb parseBool) .!= False <*>
              (v .:? "suppress-author" >>= mb parseBool) .!= False <*>
              v .:? "cite-hash" .!= 0
  parseJSON _ = fail "Could not parse Cite"

instance OVERLAPS
         FromJSON [[Cite]] where
  parseJSON (Array v) = mapM parseJSON $ V.toList v
  parseJSON _         = return []

emptyCite :: Cite
emptyCite  = Cite "" mempty mempty "" "" "" "" False False False 0

-- | A citation group: the first list has a single member when the
-- citation group starts with an "author-in-text" cite, the
-- 'Formatting' to be applied, the 'Delimiter' between individual
-- citations and the list of evaluated citations.
data CitationGroup = CG [(Cite, Output)] Formatting Delimiter [(Cite, Output)] deriving ( Show, Eq, Typeable, Data, Generic )

data BiblioData
    = BD
      { citations    :: [Formatted]
      , bibliography :: [Formatted]
      , citationIds  :: [Text]
      } deriving ( Show, Typeable, Data, Generic )

-- | A record with all the data to produce the 'Formatted' of a
-- citation: the citation key, the part of the formatted citation that
-- may be colliding with other citations, the form of the citation
-- when a year suffix is used for disambiguation , the data to
-- disambiguate it (all possible contributors and all possible given
-- names), and, after processing, the disambiguated citation and its
-- year, initially empty.
data CiteData
    = CD
      { key        ::   Text
      , collision  ::  [Output]
      , disambYS   ::  [Output]
      , disambData :: [[Output]]
      , disambed   ::  [Output]
      , sameAs     ::  [Text]
      , citYear    ::   Text
      } deriving ( Show, Typeable, Data, Generic )

instance Eq CiteData where
    (==) (CD ka ca _ _ _ _ _)
         (CD kb cb _ _ _ _ _) = ka == kb && ca == cb

data NameData
    = ND
      { nameKey        ::  Agent
      , nameCollision  ::  [Output]
      , nameDisambData :: [[Output]]
      , nameDataSolved ::  [Output]
      } deriving ( Show, Typeable, Data, Generic )

instance Eq NameData where
    (==) (ND ka ca _ _)
         (ND kb cb _ _) = ka == kb && ca == cb

isPunctuationInQuote :: Style -> Bool
isPunctuationInQuote sty =
  case styleLocale sty of
       (l:_) -> ("punctuation-in-quote","true") `elem` localeOptions l
       _     -> False

object' :: [Pair] -> Aeson.Value
object' = object . filter (not . isempty)
  where isempty (_, Array v)                                    = V.null v
        isempty (_, String t)                                   = T.null t
        isempty ("first-reference-note-number", Aeson.Number n) = n == 0
        isempty ("citation-number", Aeson.Number n)             = n == 0
        isempty (_, _)                                          = False

data Agent
    = Agent { givenName       :: [Formatted]
            , droppingPart    :: Formatted
            , nonDroppingPart :: Formatted
            , familyName      :: Formatted
            , nameSuffix      :: Formatted
            , literal         :: Formatted
            , commaSuffix     :: Bool
            , parseNames      :: Bool
            }
      deriving ( Show, Read, Eq, Ord, Typeable, Data, Generic )

emptyAgent :: Agent
emptyAgent = Agent [] mempty mempty mempty mempty mempty False False

-- CSL JSON uses quotes to protect capitalization
removeQuoted :: Formatted -> Formatted
removeQuoted (Formatted ils) = Formatted (go ils)
  where go []                             = []
        go (Quoted DoubleQuote ils' : xs) = ils' ++ go xs
        go (x:xs)                         = x : go xs

instance FromJSON Agent where
  parseJSON (Object v) = nameTransform <$> (Agent <$>
              (v .: "given" <|> ((map Formatted . wordsBy isSpace .
                                  addSpaceAfterPeriod . unFormatted) <$>
                                  v .: "given") <|> pure []) <*>
              v .:?  "dropping-particle" .!= mempty <*>
              v .:? "non-dropping-particle" .!= mempty <*>
              (removeQuoted <$> (v .:? "family" .!= mempty)) <*>
              v .:? "suffix" .!= mempty <*>
              v .:? "literal" .!= mempty <*>
              (v .:? "comma-suffix" >>= mb parseBool) .!= False <*>
              (v .:? "parse-names" >>= mb parseBool) .!= False)
  parseJSON _ = fail "Could not parse Agent"

instance ToYaml Agent where
  toYaml ag = mapping' [ "family" &= familyName ag
                       , case givenName ag of
                              []    -> id
                              xs    -> "given" &= Formatted
                                                  (intercalate [Space]
                                                    (map unFormatted xs))
                       , "non-dropping-particle" &= nonDroppingPart ag
                       , "dropping-particle" &= droppingPart ag
                       , "suffix" &= nameSuffix ag
                       , "literal" &= literal ag
                       , "comma-suffix" &= T.pack (if commaSuffix ag
                                                      then "true"
                                                      else "")
                       , "parse-names" &= T.pack (if parseNames ag
                                                     then "true"
                                                     else "")
                       ]

-- See http://gsl-nagoya-u.net/http/pub/citeproc-doc.html#id28
nameTransform :: Agent -> Agent
nameTransform ag
  | parseNames ag = nonDroppingPartTransform .
                    droppingPartTransform .
                    suffixTransform $ ag{ parseNames = False }
  | otherwise = ag

nonDroppingPartTransform :: Agent -> Agent
nonDroppingPartTransform ag
  | nonDroppingPart ag == mempty =
    case break startWithCapital'
         (splitStrWhen (\c -> isPunctuation c || isUpper c) $
          unFormatted $ familyName ag) of
         ([], _)  -> ag
         (xs, ys)
           | lastInline xs `elem` map Just (" -''" :: String) -> ag {
                          nonDroppingPart = Formatted $ trimSpace xs,
                          familyName = Formatted ys }
           | otherwise -> ag
  | otherwise = ag

trimSpace :: [Inline] -> [Inline]
trimSpace = reverse . dropWhile isSpace . reverse . dropWhile isSpace

isSpace :: Inline -> Bool
isSpace Space     = True
isSpace SoftBreak = True
isSpace _         = False

droppingPartTransform :: Agent -> Agent
droppingPartTransform ag
  | droppingPart ag == mempty =
    case break startWithCapital $ reverse $ givenName ag of
          ([],_)  -> ag
          (ys,zs) -> ag{ droppingPart = mconcat $
                                         intersperse (Formatted [Space]) $
                                         reverse ys
                       , givenName = reverse zs }
  | otherwise = ag

startWithCapital' :: Inline -> Bool
startWithCapital' (Str (T.uncons -> Just (c,_))) = isUpper c && isLetter c
startWithCapital' _           = False

startWithCapital :: Formatted -> Bool
startWithCapital (Formatted (x:_)) = startWithCapital' x
startWithCapital _                 = False

stripFinalComma :: Formatted -> (Text, Formatted)
stripFinalComma (Formatted ils) =
  case reverse $ splitStrWhen isPunctuation ils of
       Str ",":xs         -> (",", Formatted $ reverse xs)
       Str "!":Str ",":xs -> (",!", Formatted $ reverse xs)
       _                  -> ("", Formatted ils)

suffixTransform :: Agent -> Agent
suffixTransform ag
  | nameSuffix ag == mempty = fst $ foldl go
                              (ag{ givenName   = mempty
                                 , nameSuffix  = mempty
                                 , commaSuffix = False }, False)
                              (givenName ag)
  | otherwise = ag
  where go (ag', False) n =
               case stripFinalComma n of
                    ("", _)   -> (ag'{ givenName = givenName ag' ++ [n] }, False)
                    (",",n')  -> (ag'{ givenName = givenName ag' ++ [n'] }, True)
                    (",!",n') -> (ag'{ givenName = givenName ag' ++ [n']
                                     , commaSuffix = True }, True)
                    _         -> error "stripFinalComma returned unexpected value"
        go (ag', True) n = (ag'{ nameSuffix = if nameSuffix ag' == mempty
                                                 then n
                                                 else nameSuffix ag' <>
                                                      Formatted [Space] <> n }, True)

instance ToJSON Agent where
  toJSON agent = object' $ [
      "given" .= Formatted (intercalate [Space] $ map unFormatted
                                                $ givenName agent)
    , "dropping-particle" .= droppingPart agent
    , "non-dropping-particle" .= nonDroppingPart agent
    , "family" .= familyName agent
    , "suffix" .= nameSuffix agent
    , "literal" .= literal agent
    ] ++ ["comma-suffix" .= commaSuffix agent | nameSuffix agent /= mempty]
      ++ ["parse-names" .= True | parseNames agent ]

instance OVERLAPS
         FromJSON [Agent] where
  parseJSON (Array xs) = mapM parseJSON $ V.toList xs
  parseJSON (Object v) = (:[]) `fmap` parseJSON (Object v)
  parseJSON _          = fail "Could not parse [Agent]"

-- instance ToJSON [Agent] where
-- toJSON xs  = Array (V.fromList $ map toJSON xs)

redpajama_set_name: RedPajamaGithub


What Noam Chomsky is to linguistics, Princeton University's Bonnie Bassler is to bacterial conversations.
Anthropological science has made plain the myriad communication structures utilized by humans, as well as animals—albeit the latter at a less sophisticated level. Would it come as a surprise that bacteria can also communicate? Quorum sensing, one version of bacterial communication, has become an important tool for a deeper understanding of the living world.
Bassler is working to answer questions of bacteria's importance for cosmetics. The phenomenon called quorum sensing was first found in only a few examples, most notably Vibrio harveyi, but it is now known to be much more extensive.
When a person is infected by harmful bacteria, the body sends a few antibodies to destroy the invaders. As strange as it seems, bacteria know this. No organism could have survived a billion years without some common sense. The bacteria don't shout, "Here we are!"—they instead ask, "Anybody here?" and lay low. But as more and more bacteria show up, eventually a viable army is assembled and an attack commences. Your body is challenged to handle this invasion and you call in sick.
The questioning ("Anybody here?") is done by a quorum-sensing molecule. Bacteria are pretty smart little guys, and have developed one language to talk to each other and a different language to talk between species. Bacterial cell communication involves the exchange of chemical signal molecules called autoinducers. Figure 1 shows the V. Harveyi quorum-sensing circuit.
The V. harveyi attracted attention due to its bioluminescence. These bacteria have some basic chemistry similar to the firefly, discussed in a previous column4. The reaction involves luciferin catalyzed by luciferase with ATP as a cofactor. In different organisms, the genes and proteins involved in bioluminescence are unrelated. It may be confusing that the substrates and enzymes, though chemically different, are all referred to as luciferin and luciferase. To avoid confusion they should each be identified with the appropriate organism.
Bioluminescence is common in the marine environment. It is most prevalent at mid-ocean depths, where it may occur in more than 95% of the individual organisms, and the light emission of luminous organisms exerts a significant influence on marine ecology. Bioluminescence is rare in the terrestrial environment, though firefly displays are among the most spectacular demonstrations of this process.
Autoinducers regulate mRNA production for specific genes in response to population density. Operons are a set of adjacent structural genes in bacteria whose mRNA is synthesized in one piece. V. harveyi have autoinducers LuxN and LuxQ, both transduced with the aid of LuxO through the relay protein LuxU5.
Okay, the details of Lux proteins are complicated and well left to specialists. The important point is that it involves proteins that send and receive signals. The signals are a call to action through the triggering of gene synthesis. Through this process, a single bacterium amazingly becomes part of a large group acting in unison. The news coming from Princeton is that this is pervasive in the bacterial world, not a rare phenomenon, and that it promises great opportunities for medical science.
There's extensive knowledge of communication within and between cells beyond bacteria and bioluminescent organisms. If there is extensive damage to a cell's DNA or it needs more collagen, researchers and scientists understand the signaling. Modern treatment cosmetics use these cellular communications to make efficacious products—at least in theory.
The arachidonic cascade3 can be considered a form of communication, signalling irritation involving an acronym-rich region inhabited by IL-1, PGH2 and 15-HPETE. Since preventing or minimizing irritation is an essential goal of skin treatment, understanding the role of each component contributes a vital piece of the puzzle. Given the nature of a cascade, like a chain reaction setting off an atomic bomb, it is best to focus attention at the early components of the process.
The irritation cascade can be manipulated by inserting antagonists to select signaling molecules. Improvement can be measured in changes to mRNA and protein molecules. An efficacious treatment product could be defined as a signal modulator that encourages desired processes or interrupts an undesirable cascade.
Biofilms are perhaps the best known example of behavior by microorganisms that requires communication. A biofilm is held together by a matrix that protects the cells and facilitates communication through biochemical signals. Some biofilms contain water channels that help disperse signaling molecules. One benefit of this environment is increased resistance to detergents, as the dense matrix and outer layer of cells protects the interior of the community. It is also clear that communication in biofilms has importance for cosmetics.
Quorum sensing isn't going to result in new products for personal care, at least in the near term. But it vividly remind us that communication is a series of connections that begin with cells signaling their mRNA to respond to a need, illustrating that chemical communication evolves into something even more complex, such as human language. It is by recognizing these connections that we understand the living world, in turn fueling creativity in the lab and the marketplace.


text:
Malaysian PM gains political lifeline with budget approval
WORLD AP
Malaysia's Parliament approved the government's proposed 2021 budget on Thursday, throwing a political lifeline to embattled Prime Minister Muhyiddin Yassin amid strong resistance to his 9-month-old leadership.
Opposition lawmakers as well as members of his governing coalition had warned during three weeks of debate that they would reject the budget, citing insufficient funding to fight a surge in coronavirus cases and help those hit by the pandemic.
Finance Minister Zafrul Aziz made some minor revisions to the 322.5 billion ringgit ($79 billion) budget, the biggest ever, in his concluding speech Thursday in response to the complaints. He insisted that "this is a COVID-19 budget, a budget for survival and resilience."
In the end, the budget was approved despite the dissenting voices.
"A budget vote has always been a de facto vote of confidence or no-confidence in the government," said Ahmad Fauzi Abdul Hamid, a political science professor at Malaysia's University of Science.
Muhyiddin's "government is temporarily secure but it will continue to have to fight from bill to bill as it survives on a slender majority and on the goodwill of bigger parties in the (governing) coalition," he said.
Had Muhyiddin failed to obtain Parliament's support for the budget, it would have triggered new calls for him to resign or spur him to seek a general election, which is not favored during the surge in coronavirus cases. Malaysia's cases have jumped fivefold in two months to nearly 60,000.
Muhyiddin, 73, has only a slim two-seat majority in Parliament. He has been challenged by opposition leader Anwar Ibrahim, who last month said he has majority support to form a new government with defections from Muhyiddin's coalition.
The support reportedly comes from the United Malays National Organization, the biggest party in the unelected governing coalition, which was angry at being sidelined amid rivalry with Muhyiddin's own Malay party.
Lawmakers from both sides of the divide have also pushed for a vote of no-confidence in Muhyiddin, but the bids have been thwarted by the house speaker, appointed by the prime minister.
Muhyiddin last month proposed a coronavirus emergency that would have suspended Parliament and given him uncontested powers, but it sparked widespread anger. The king rejected the proposal, saying that existing laws were sufficient to tackle the pandemic, but urged lawmakers to back the budget.
"He got lucky again — until the next showdown, as his government remains a decidedly weak one," said Oh Ei Sun, a senior fellow at the Singapore Institute of International Affairs.
Muhyiddin took power in March after withdrawing his party from Anwar's ruling reformist alliance that won 2018 polls. He tied up with the corruption-tainted UMNO and other opposition parties to form a Malay-centric government, but his administration has been riven by infighting.
Azerbaijani parliament slams French senate's resolution
Brazil reports 37,614 new coronavirus cases, 691 deaths

redpajama_set_name: RedPajamaCommonCrawl


Matthew Sweet is one of the world's best known Power Pop artists, with classic albums like "Girlfriend", "Altered Beast" and "100% Fun". In 2002 Sweet teamed up with Pete Droge and Shawn Mullins to form the Alt. Country group The Thorns, and in 2005 he teamed up with Susanna Hoffs of The Bangles for "Under The Covers Vol.1:" a series of their favorite '60s covers. Now, after last year's "Sunshine Lies," his 11th album, Sweet has released a sequel with Hoffs, "Under The Covers Vol.2," which mines the pop and rock hits of the 1970's. I was honored to speak with him during his tour in support of the new release.
Q: Having already done a Vol.1 for Under the Covers, was anything different this time around (selecting the songs, the playlist)?
MS: No, even on the first one we actually never made a list […] I think we started to make a list and the first one on [it] was "She May Call You Up Tonight" by The Left Banke, and we thought, "This is awesome, let's come up with more as we go." On the 70's [Vol.2] there were a few things that were surprising about it. One was, we thought of the 60's as our bag, you know? And so we just weren't ready for all the feelings about the 70's. We think it comes from the ages we were at. I was 12 years old in 1976, [Susanna Hoffs] was 17 that year, so we were both in our teenage years and influenced by older brothers who listen to music and FM rock radio […] So a lot of music was in our consciousness from then. That wasn't our "banner," things that we go along saying "Oh these our our heroes," it was more haphazard. It was a very different musical movement.
I'm so glad The Raspberries ended up on it because, there's so much of that kind of music, we could do a whole album of it. You know, The Raspberries, Rundgren, Big Star, I'm glad those things got on it. Although I know that stuff a lot deeper than Susie does, so sometimes it's just about which songs we both click on […] I think they're different than a lot of other cover records. I thought of this recently, that it's almost like we cover the record, as much as we cover the song, and I think that's unusual. They usually try to do a cover and not be like the original or they don't pay attention to it really, and often times try to really reinvent something. For me, as fan of music, I never cared about covers by artists because of that. They weren't a great record like the one they're covering. The 60's record [vol.1] we're very true to the originals and then on the 70's [vol.2] too. To the extent of using ProTools in the box and me at home being the terrible engineer!
MS: Often times, we tried well known songs and didn't use them.
Q: That's what bonus tracks are for!
MS: Yeah exactly, and a lot of bonus tracks. For instance, we did a lot of new wave songs from the 70's, but it was hard to fit them with the classic rock. The Raspberries, Todd Rundgren, that stuff worked with it, but it seemed minimized to the late 70's punk songs […] I've realized so much stuff that I got into is more obscure stuff, [which] I got into in high school, which is 1980-83. So an 80's one [vol.3] will yield a lot more obscure things.
Q: How has making music changed for you since the early days (when you were first on a major label)?
MS: I think for starters, I'm a lot more confident. Back then I was so scared and freaked out by everything. Like a jumpy skittish cat or something. I wanted to make music, I was a music egghead and record at home with my own multi-track, and that's why I always loved people like Todd Rundgren or Lindsey Buckingham. People who would record on their own and multi-track, because that's how I got into music. I was too embarrassed to do stuff in front of people much when I was young […] I had a band of my own in high school, but it was like I wasn't really competent to go out and do that really. I felt that way inside anyway. For the first couple records I had no success, and it worked for me really well because I didn't have to tour that much.
MS: They started making me play on acoustic guitar then. Which was like, "You have to play acoustic guitar and sing your songs on the radio". That was early in my career, like the mid 80's. [The label] sent me out to do that and I was horrified. I never sat in a room with one person and played a song for them. I had done all my recording alone, in my room, with no one there. And that was how life was really different for me then. I was really afraid. And then I had some success, but I still had those weird feelings, except I had to tour all the time and fly all the time which brought more anxiety. There was an implied pressure that no matter how successful it was it still wasn't enough, you know? Which is always the thing with labels, they need to be excited when you sell Gold, but it's clear to you they want you to sell Platinum. That made me more uptight and less carefree to do music. But I managed to do some stuff and get through the nineties. Another couple successful records after "Girlfriend," which is more than some people can say. I feel really glad that that happened.
Now I feel so much more able to do music. More free to let things happen. I feel like I understand what it is a lot better. I felt back then all this guilt, like people thought it was something, but to me it was like so insubstantial, I felt like I didn't do anything. Now I understand what I do. I have some other hobbies, I learned to make pottery and throw clay on the wheel, fire it and glaze it. Those type of things do help me see music as a personal thing, and understand that the more personal it is for me the better. That was kind of a conflict with the idea that you should be the biggest star that you can, you know?
Q: "Girlfriend" was on Guitar Hero II, are there any plans to have "Divine Intervention" or "Time Capsule" or anything else on any future games?
Q: One last question before I leave the subject of "Under The Covers Vol.2" What was it like working with Dhani Harrison?
MS: It was awesome. Sue knows him a little better than I do. I've met him a couple times, including when he came over to record. First of all he's a extremely George-like, it's kind of amazing to see. He's got the vibe. In my opinion, more handsome than George. Really a good looking kid and he's really cool and friendly. His personality reminds me of what I think I know about his dad from reading books over the years. He loves his dad so much, he's proud of him and likes to talk about him. It's not like the weird thing where he's trying to separate himself or whatever.
Q: Is there anybody you wish you could have collaborated with, that you didn't get a chance to?
MS: Well the whole guest star thing wasn't ever something we thought of doing, and it was only when we recorded the song by YES, and started thinking about lead guitar players, one day we just had the idea – let's try to find Steve Howe and get him to play on it. His guitar playing was so cool, I thought, "If he's on it, we'll get away with it!" We were able to find Steve and he's a lovely guy and he recorded a bunch of stuff for us. That got our minds going, "Who else can we get?" But the problem is, on a lot of our song it would have taken us years and years to deal with getting the people, agreeing to do it, recording when they have a chance, and it would've been a lot of work and money that we didn't have. So we had to cool it on our ideas. In Lindsey Buckingham's case, we know Lindsey and his wife and ran into him a couple of times, so I was able to corner him about playing on our record.
And Dhani Harrison was the same. Sue had met him at a couple parties, they hung out a couple times, she asked him and he said "Sure". So if I had my dream team to check people out, the guys from The Raspberries, we would have loved to have Wally Bryson play guitar, Eric Carmen […] I would have gotten Richard Lloyd for our cover of "Marquee Moon." instead of having to play it myself. But part of the charm with our thing is to learn the parts myself. You know, our manager told us that Carly Simon was so excited 'cause she heard we were covering her song "You're So Vain," and offered to sing on it if we wanted, but it was already recorded and mastered.
Q: Susanna Hoffs has been on your solo albums too, is there a possibility you would work with her again?
MS: I think I would. I really like girl singers and I'm a huge fan of Sue's voice […] and the fact that I know her so well, she's like my sister 'cause we spend so much time together in home environments.
Q: As a long time Power Pop fan I have to give you full credit, you and Roger Manning Jr. of The Jellyfish, for the 90's revival of the genre.
MS: Oh man, their mind blowing studio approach was so much more intricate than mine. I always thought of myself as a lot scrappier than those kinds of people. I mean, Lenny Kravitz would go and make these amazing sonic things and "Girlfriend" was interesting sonically but I didn't think of it as being as crafted as that stuff. Some of that Jellyfish stuff was so cool, I got to meet those guys back in the day, we played this stadium in DC. It was cool we were there because we were not like most of what was going on.
Q: That's what made you guys unique. Power Pop may have been a badge of ridicule at one point, but it's great music and it's identified with great classic rock.
MS: Yeah, yeah. A lot of it is the heirs to the really great Beatles stuff. The thing is, I never thought it was embarrassing […] One of my first interviews I ever did for my record "Earth," I didn't know what Power Pop would be or that I was Power Pop, and I did the interview and someone said "Since you're Power Pop, how does it feel to be part of a genre that never sells historically?" It's like well, that's awesome if I'm part of that 'cause I loved those kind of bands. The cool thing about the nineties was we were discovering what Power Pop was. People were starting to categorize it and make lineages of it, it was fun to be part of that concept. And I love Power Pop stuff like Brian Wilson and John Lennon. They are the Godfathers of it to me because what I love is melody. I always wanted to hear melodies. I love Elvis Costello 'cause he has melodies. I love XTC 'cause they have melodies. I loved stuff that's weird or experimental, but I was always looking for a feeling of melody somewhere […] That's what's cool about it: Power Pop is fun and cool and has great melodies. It's memorable and can be a source of rebellion as well.
Q: So what's next for Matthew Sweet?
MS: I'm making a new solo album […] Since it's all new songs, I can start the record quick. It won't take me forever 'cause I'm not building it in batches over time. I want to get it out as quickly as I can, hopefully next year. And I'll go tour again 'cause I want to solidify my thing. Some crowds are small, some larger – they're all awesome. I just want to keep making records 'cause I'm in a good space to do it now.
And for some of the best in power pop make sure you check out Aaron's amazing music blog Powerpopaholic!


Welcome to the new year with Swordchomp! Nostradamus was right! We decided to start off the new year with thumbing through timeworn, sooty tomes filled with information on forthcoming games. After hours upon hours of straining our eyes towards the small text etched onto the worn parchment, we discuss the games that we are most excited to play in 2017. From Mass Effect: Andromeda to Destiny 2 to Red Dead Redemption 2, and to everything in between, this coming year promises to be one filled with excitement and satisfaction for gaming.


text:
Page: OK, boomers, welcome to the other side of the generation gap
By Clarence PageChicago Tribune
Back in 1965, only a couple of years after the term "baby boomer" caught on as a label for the generation born in the wake of World War II, one 17-year-old high school newspaper columnist tried to explain his generation to his skeptical elders:
"Although we still have to face our responsibilities someday," he wrote, "our first impulse is to turn our backs and form a second society of our own. Someday we shall know for whom the bells toll but, for now, their sound is covered by the sounds of our hot rods and Beatles records."
That young journalist was me. I wrote that bold, manifesto-like essay, "New Breed of Teen Creates Second Society," in the March 2 edition of the biweekly newspaper at Middletown High School in Middletown, Ohio. It even won an award from a high school journalism association for best feature story, which helped to make up for my failure to make the school's basketball team.
More than a half-century later, I find myself rereading that piece to reacquaint myself with my high school version of me, now that my generation faces a new cultural assault from post-boomers.
I'm referring to the odd internet meme "OK, boomer," which has gone viral globally as Generations X, Y and Z's all-purpose retort to older people, bless our hearts, who just don't get it.
Appropriately, this craze reportedly began on TikTok, a website still almost unknown to those of us who still are wondering why Snapchat is any better than Facebook. In one well-known clip on TikTok, a man of senior years grumbles, "The millennials and Generation Z have the Peter Pan syndrome, they don't ever want to grow up." That brought thousands of replies, most of which were "ok boomer," The New York Times reported.
A more recently viral variation satirized news that former New York Mayor Michael Bloomberg was preparing a bid for the Democratic presidential nomination: "Ok, Bloomer."
But some attempts can be a tweet too far. Conservative Rochester radio host Bob Lonsberry, 60, tweeted this clunker of a protest tweet last weekend: "'Boomer' is the n-word of ageism. Being hip and flip does not make bigotry ok, nor is a derisive epithet acceptable because it is new."
Tsk, tsk. Thanks, Mr. Lonsberry for adding to my examples of how you don't have to be a liberal to act like a PC "snowflake."
On the other hand, my own millennial son, Grady, age 30, tells me he is "extremely critical of the idea that there's anything new about a millennial identity."
Today's "OK, boomer," delivered with suitable eye-rolling condescension, is only a "repetition of the generation gap" that I was writing about in the 1960s. "Only it's worse," he said, "because at least in the '60s you had some sort of a real social critique that went along with that," like the anti-war movement, "war on poverty" and the civil rights movement.
"Now everybody's just seeking to identify with products and tastes for things like avocado toast," he said.
Hey, lay off the avocado toast. That's one of the Generation Z fads that I find to be pretty good.
More seriously, I think he's shortchanging the explosion of activism that we have seen around issues like climate change, gun safety and police brutality in his own generation, which has more reasons than mine to care about them.
Nevertheless, we agreed that if the "OK, boomer" meme encourages the generations to talk to each other more, it can be a force for good.
When I wrote my high school newspaper report (did I mention that it won a prize?), I focused on how my generation's youngsters were trying to construct a "second society" all their own. Decades later, I realize that every generation tries to do that. It's not a different society as much as it is an attempt to improve the old one.
I finished that essay with a line from a hit by the British rockers The Animals: "I'm just a soul whose intentions are good / Oh, Lord, please don't let me be misunderstood."
I think we're still trying to do that. But now that we have fewer days ahead of us than we have behind us, we boomers have to face an unavoidable reality. We tried our best, but the future increasingly belongs to new generations. OK, boomers?
Contact Chicago Tribune columnist Clarence Page at cpage@chicagotribune.com.


text:
Ben 10 Toon Creator
Watch the 5 second animation and create you own ending of Ben 10 alien force with the online Ben 10 Toon Creator. The cartoon with the most views will be open for public votes. Cartoon Network will then choose the overall winner. Prizes up for grabs are HP TouchSmart PC, 2 sets of HP desktop, and Cartoon Network Digital Pack
Ages 6 - 14 years old
Residents of Australia, China, Hong Kong, India, Indonesia, Japan, Korea, Malaysia, New Zealand, Philippines, Singapore, Taiwan, Thailand, and Vietnam
Watch a 5 second animation on Toon Creator (I think you can only watch it on Cartoon Network)
Log on to tooncreator.cartoonnetworkhq.com/contest
Create an account and create your very own 25 second animated ending using the software provided on the website
The animation who has the most views and highest ratings will be preselected and will be open for public votes
Cartoon Network will then choose the overall winners
View complete contest mechanics
Contest Period: July 13 - September 30, 2009
Grand Prize winner from the overall Asia Pacific region
1 HP TouchSmart PC, valued at approximately US$1,300
2 HP desktop PC+Monitor set(s), valued at approximately US$2,000
1 Cartoon Network Digital Pack valued at approximately US$200, containing
3D Echo Echo MP3 Player
Preloaded MP4 Player with video
Sculpted Digital Camera
MP3 Speaker - Echo Echo style
2GB Omnitrix Memory Stick
1 individual winner from Australia, India, Malaysia, Singapore, Taiwan and Thailand will each receive
1 HP TouchSmart PC, each valued at approximately US$1,300
1 winner from each of the participating schools in Australia, India, Malaysia, Singapore, Taiwan and Thailand will each recieve
3 HP TouchSmart PCs, valued at approximately US$3,900
Multiple submission allowed
No regional winners for Philippines
For more information, log on to tooncreator.cartoonnetworkhq.com


16.5 acre property, zoned R5, in the Meridian School District. Large 2200 sq ft building separated into an 800 sq ft residence and 1440 sq ft shop. Residence has living room, kitchen with eating space, 2 bathrooms and a Master Bedroom. Above the residence is an 800 sq ft loft. RV hook up, and large roll up door and vaulted ceilings are perfect for boat or RV. Awesome property for a private estate. 3 bedroom septic, water association; eligible for building permit. 5568 Boyer Rd Bellingham, WA 98226. MLS # 1139082.


text:
Mac & Win Products
PhotoMagic
Mac | Win
iGreetingCard
CollageFactory Pro
PicSketch
PicEdit
Color Splash Pro
iOS & Android Products
PicShow
iPhone | iPad
iPhone | | iPad
ProCollage
InstaPhotoFX
ScreenDIY
> Company
HOME > Review > PicSketch review - ideal for occasional use
PicSketch review - ideal for occasional use
Turn your photos into sketches on paper with just a few clicks
good results easily attainable
various paper backgrounds
some preset sketch effects
blending and colouring options
Control for brush size is a blunt instrument
surround scribblings in a separate mode
Preset mode doesn't turn photo into a sketch
not enough paper stocks
not enough control over process.
Drawing sketches takes no little time and a certain level of skill to avoid giving the impression that it was done by a schoolchild. Why take the trouble to master that skill when there's an app that can do it for you. Say hello to PicSketch which aims to give a fast rendition of a pencil drawing. Now, there's a number of Photoshop plug-in filters that will do this, from Akvis and Topaz Labs, but PicSketch has two advantages. The first is that it's a standalone app and the second is that it's only a few quid. The big test then is whether it can do enough and well enough to make it worth even downloading.
First of all, once the photo is loaded, there are two modes to consider. Classic and Preset, though both automate the sketching. There are controls for zooming in and toggling back and forth between the sketch and the original image, then it's over to the parameters. The first is the pen size. The bigger this is, the large the outlines, and the more detail you get inside. The problem with this can come when the outline is right, but the inside lacks enough detail, or the inside has the right level of detail, but in consequence, the outline is then too thick. Unfortunately there's no additional control to help. What can do though is the Moisture control. At the left end of the slider this adds dark detail. Slide it to the right and the result gets lighter and the extra detail is blended in more. There's also a Colourize option here to add some basic toning to the image and this can be very effective. It's also slider controlled and works well. Under that we have the paper stocks, of which there are six in total. These are good, but there's no way of making them have any variation or opacity, so they get repetitive very quickly. To finish the image off the brightness and contrast controls will also help define the sketched elements.
The Preset mode adds a scribbled effect around the image without actually turning the photo into a sketch at any point.
The alternative to the Classic mode is to go for the Presets. There are four sketch modes to this, which turn the image into mono and add pencil scribbling over the top and around the edges. This is combined with one of six paper stocks. It should be noted that five of the paper stocks are from the Classic mode, with one that is different, and that this mode doesn't turn the images into sketches at all. Also, clicking on the modes swaps between the two effects which are entirely separate with no way to combine the two, which is bizarre. Still, once finished, the sketch can be saved as a TIFF, JPEG or PNG.
PicSketch produces some good effects, but making the surrounding scribbling part of a separate mode that doesn't even turn the photo into a sketch is a little stupid. It's cheap but the sketch styles get repetitive too quickly, making this app one for the occasional conversion rather than if you need to do it all the time.
Mac & Windows
Photo Deluxe Bundle
Copyright ©2014 Softease Tech Co., Limited, All Rights Reserved.


Anyone taking a look at California's June 2018 state primary ballot would have plenty of evidence to suggest the Republican Party in that state is dead. For starters, California's GOP has two credible candidates for governor, businessman John Cox and State Assemblyman Travis Allen, which in a normal state might be a good thing. But California's Republicans are a super-minority party in an open "top-two primary" that pits them against at least two well-funded Democratic candidates, Lt. Governor Gavin Newsom and former Los Angeles Mayor Antonio Villaraigosa. Although Cox is polling better than Allen, they're both likely to be aced off the ticket in November.
There is not one higher state office in California where a Republican has a realistic chance of victory. Nearly every position—lieutenant governor, attorney general, treasurer, controller, and state superintendent of schools—Democratic candidates are likely to win. The lone exception is insurance commissioner, where the respected Steve Poizner, who has already held that office as a Republican from 2007 to 2011, is now running as an independent.
If you go to the California GOP website to view endorsements, you will see the party faithful failed to choose a gubernatorial candidate. This failure of leadership means that their two candidates, Allen and Cox, are likely to split the support of GOP voters, which increases the likelihood that neither Republican will advance to the general election. (Though current polling suggests Cox could squeak through.) Given the fierce determination of both these candidates, one might forgive the state GOP for not managing to make a selection.
But the state GOP's failure to make endorsements, which are critical in open primaries where only the top two candidates advance, continues down the ticket.
For state treasurer, there is "no endorsement," despite two Republican candidates on the ballot. For U.S. Senate, there is "no endorsement," despite 11 Republican candidates on the ballot. That lapse renders it likely that the top Republican vote-getter in the race for U.S. Senate will be the candidate with the most name recognition—you guessed it, the loathsome Patrick Little.
For insurance commissioner, the state GOP apparently didn't know what to do, since most of them realize former Republican Steve Poizner is a good choice. So instead of "no endorsement" showing up, they simply omitted that position from their list of endorsements. Why couldn't the state GOP recruit and promote top candidates? Is there really any excuse for this, when there are still tens of thousands of highly successful men and women who are registered Republicans in California and would be good candidates?
When you look for leadership in California's Republican party, you might consider the last candidate for governor who had a respectable showing: Meg Whitman. (The less said about Neel Kashkari, the better.) But Whitman just publicly endorsed a Democrat, Antonio Villaraigosa. With leadership like that, who needs enemies? Is Whitman a RINO? Is she a turncoat? Or, to be brutally honest, is she just recognizing the cold reality that California is a one-party state, so she wants to support the person she perceives to be the lesser evil?
If demographic trends and current voting patterns persist, California is going to be a one-party state for a very long time. According to the Public Policy Institute of California, among California's "likely voters," more whites are registered as Republicans, 39 percent, than Democrats, 38 percent. But "whites" are only 38 percent of California's population, and that percentage is dropping fast. Among residents under 18 years old, excluding illegal aliens, whites are now barely 25 percent of California's population. Why does this matter?
Because among likely voters, Latinos registered as Democrats (62 percent) far outnumber Latino Republicans (17 percent). Among blacks, the disparity is even greater—82 percent Democrat versus 6 percent Republican. Among Asians, where the disparity is less, the Democrats still have a nearly two-to-one advantage, 45 percent to 24 percent.
California's Democrats successfully have tainted Republicans as racist ever since Governor Pete Wilson supported Proposition 187 in 1994. That citizens' initiative, narrowly passed by voters then utterly decimated by liberal judges, would have—gasp!—denied taxpayer-funded public services to illegal immigrants. Ever since, any attempt to place realistic curbs on benefits for illegal aliens has been met with militant opposition by Democrats who control a supermajority in California's legislature. California's Democrats have played the race card with impunity.
In late 2016, when incoming President Trump proposed to deport criminal aliens, Democratic Assemblyman Ricardo Lara—now running for insurance commissioner—threatened to "fight in the streets" to preserve "the work we have done." Democratic State Senator Kevin de León—now running for U.S. Senate against long-time incumbent Democratic Dianne Feinstein—frequently refers to "President Trump's racist-driven deportation policies." California attorney general Xavier Becerra has been quoted stating that "Trump was showing himself to be a racist in every respect." Examples are endless. This November, California's Democrats are going to make Patrick Little and Donald Trump the running mate of every Republican on every ballot in the state.
But will this work forever? Does California's GOP have to stay dead? Will "people of color" continue to believe that California should be a one-party state?
Eventually, California's Democrats are going to go too far, because their policies are economically unsustainable. Gavin Newsom, the favorite to occupy the governor's mansion in 2019, proposes a single-payer health care system for the state, something that would cost at least $200 billion a year, in addition to sowing chaos throughout California's healthcare industry. Meanwhile, California's Democrats propose to offer full health insurance coverage to illegal immigrants, spend tens of millions to provide free college tuition to illegal immigrants, in a state where taxpayers already fund over $25 billion per year to provide public services to illegal immigrants.
Objecting to these costly programs may attract accusations of racism, but growing numbers of Latinos, blacks, and Asians, along with white liberals, may eventually decide that Democrats no longer have the answer. All it will take is one major stock correction, or one more downturn in the historically cyclical tech industry, and California's public finances will implode. All of a sudden, hundreds of billions in tax receipts necessary to sustain free health care, free tuition, and public-sector pensions, to say nothing of benefits for illegal aliens, will vaporize. Economic calamities that reach deep into the pocketbooks and tragically disrupt the lives of ordinary voters have a way of focusing the mind.
The GOP's case in such times, and to prevent such times, is not abstruse. It goes like this: For decades, Democrats have told you that the most important issue in the world was protecting yourselves from white racism. But while you were voting for the people who kept telling you this, their government unions, controlled by Democrats, were destroying the public schools that might have provided your children with a useful education.
Their government bureaucracies, controlled by Democrats, were driving small businesses out of business with ridiculous, punitive regulations, forcing many of them to flee the state, denying you jobs and entrepreneurial opportunities.
Instead of investing in transportation and water infrastructure to enable a reasonable quality of life to long-time residents and new arrivals alike, Democratic politicians used taxpayers' money to overpay the government employees, so that government unions would fund the Democratic Party.
The GOP's case doesn't end with exposing racism as a diversion from the real issues of economic growth. It also exposes extreme environmentalism, and the synergy between the environmental movement, the overbuilt public sector, and left-wing oligarchs.
For decades, these extreme environmentalists, all of them Democrats, prevented perfectly benign land development in a state literally sprawling with open space. They did this in the name of saving the earth, downplaying how the resulting real estate bubble pumped up government property tax receipts and goosed the returns for the real estate portfolios in government pension funds. They prevented private investment in cheap conventional energy—in particular, clean natural gas and nuclear power—so residents have to pay twice as much (or more) for electricity as people in other states. Democrats barred private investment in oil drilling and refining, and imposed automotive and fuel standards in conflict with the rest of the United States, so Californians pay substantially more at the gas pump.
Restore the balance in California's colleges and universities so that the ratio of faculty to administrators is 2-to-1, instead of the current ratio that allows administrators often to outnumber teachers.
End all discrimination and base college admissions purely on merit. Expand STEM curricula so it represents 50 percent of college majors instead of the current 20 percent.
Enforce the Vergara reforms so it is easier to retain quality public school teachers and easier to fire the incompetent ones. Eliminate barriers to charter schools.
Restructure the penal system to make it easier for prisoners to perform useful public services. For example. along with working the fire lines during fire season, they could work all year clearing dead trees out of California's forests. Use high-tech monitoring devices to reduce costs. Reserve current prisons only for the truly incorrigible.
Scrap the high-speed rail project and instead use the proceeds to add one lane to every major interstate in California, and upgrade and resurface all state highways.
Use additional high-speed rail funds to complete plant upgrades so that 100 percent of California's sewage is reused, even treated to potable quality.
Pass legislation to streamline approval of the proposed desalination plant in Huntington Beach, and fast-track applications for additional desalination plants, especially in Los Angeles.
Spend the entire proceeds of the $7 billion water bond, passed overwhelmingly by Californians in 2014, on storage. Build the Los Banos Grandes, Sites, and Temperance Flat reservoirs, adding over 5.0 million acre feet of storage to the California Water Project. Pass aggressive legislation and fund aggressive legal actions and counteractions, to lower costs and enable completion of these projects in under five years (which is all the time it used to take to complete similar projects).
Permit slant drilling to access 12 trillion cubic feet of natural gas deposits from land-based rigs along the Southern California coast. Build an LNG terminal off the coast in Ventura County to export California's natural gas to foreign markets. Permit development of the Monterey Shale formation to extract oil and gas.
Permit construction of "generation 3+" nuclear power plants in geologically stable areas of California's interior. Permit construction of new natural gas power plants.
Repeal the 2006 "Global Warming Solutions Act" and "Sustainable Communities and Climate Protection Act" of 2008 and make it easy for developers to build homes on the suburban and exurban fringes, instead of just "in-fill" that destroys existing neighborhoods.
Require California's public employee pension funds to invest a minimum of 10 percent of their assets in infrastructure projects as noted above. They could issue fixed rate bonds or take equity positions in the revenue-producing projects, or a combination of both. This would immediately unlock approximately $80 billion in construction financing to rebuild California's infrastructure. At the same time, save the pension systems by striking down the "California Rule" that prevents meaningful pension reform.
These reforms would lower the cost of living in California, at the same time as they would create resource abundance and hundreds of thousands of high-paying jobs.
Once you've debunked the narrative that Republicans are racists, it is easier for voters, regardless of their ethnicity, to see their virtues. To a startling degree, California's Republican legislators typically come from business backgrounds, whereas most Democratic legislators come from a government agency or a nonprofit background.
In 2016, an analysis of the biographies of California's state legislators showed that 69 percent of Republican legislators came from a business background, 19 percent of them had some business and some government or nonprofit experience, and only 11 percent of them came exclusively from a government or nonprofit background. By contrast, only 6 percent of Democrats came from a business background, only 18 percent of them came from a mixed business and government or nonprofit background, while a whopping 76 percent of them came exclusively from a government or nonprofit background. One can draw profound conclusions from this unambiguous data.
What is the result of California's Democratic lawmakers, in overwhelming numbers, lacking any experience in business? A state where financial realism is eclipsed by confrontational, utopian fantasy. A state where self-righteousness and self-deception are the currency of governance, instead of factual analysis and hard choices. A state where the infectious optimism that defines and is a prerequisite for business leadership is absent from a dismal capital.
Republicans can offer an irresistible alternative. They can promote abundance instead of scarcity; prosperity instead of an "era of limits;" hope and opportunity instead of resentment, retribution and redistribution; universal upward mobility instead of divisive scrapping for diminishing wealth.
They need to get busy.


text:
Q: Jquery-ui and animate bugs currently I'm facing some problems with jquery-ui and animate functions when running multiple of them together, I'm not sure whether I used it wrongly or what, but I just can't get the stop() working correctly.
For example when mouseover on a div, it will animate something, then mouseout it will animate something else, but when mouseover and out rapidly then it will have problem.. can anyone help me out on this?
and here is the full html+js:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jtest</title>
<link rel="Shortcut Icon" href="favicon.ico" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href="css/jquery-ui.css" rel="stylesheet" type="text/css"/>

Loading, please wait ...

Thanks!
=)

A: can you make a simpler example or describe exactly what should happen and what is happening please and I'll fix. I have seen it where, when spamming events, certain variables are not reset properly but until I cn see the shortened code its kind of difficult working out what you actually want to happen.
Thanks

redpajama_set_name: RedPajamaStackExchange


Honoring Those Who Have Served. | The|Coinologist.
This Memorial Day, the United States Mint honors the women and men who made the ultimate sacrifice in service to our country. Please join us in recognizing our active servicemembers, veterans, and patriots who gave their lives defending freedom, justice, and peace.


The organization upholds the philosophy of "Be No.1 in good quality, be rooted on credit history and trustworthiness for growth", will keep on to provide previous and new customers from home and overseas whole-heatedly for Fruits Dicer And Cutter , Fruits Dicer and Cutter , Multi Dicer Cutter , We'll do our greatest to satisfy your necessities and are sincerely hunting ahead to acquiring mutual advantageous company romance with you!
"Our concentrate on should be to consolidate and enhance the quality and service of present products, meanwhile consistently produce new products to meet unique customers' demands for Fruits Dicer And Cutter , Fruits Dicer and Cutter , Multi Dicer Cutter , We welcome you to visit our company & factory and our showroom displays various merchandise that will meet your expectations. Meanwhile it is convenient to visit our website. Our sales staff will try their best to offer you with the best services. If you will need more information be sure to do not hesitate to contact us via E-mail fax or telephone.


text:
Two ships of the Royal Navy have borne the name HMS Sea Nymph:

  was an 8-gun cutter in service in 1782.
  was an S-class submarine launched in 1942 and scrapped in 1948.

Royal Navy ship names

redpajama_set_name: RedPajamaWikipedia


You will be ready to dance the night away at your prom in this splendid Mac Duggal 64432L dress. The strapless sweetheart bodice is ruched and trimmed with a chain of crystals that wraps the waist as well. A layer of chiffon extends over the column skirt below the crystal belt. This evening dress will make you glow.


American actress and YouTube personality Anna Brisbin, a.k.a. Brizzy Voices, showed off the unique talent of her 1-year-old miniature dachshund, Remus, who is named after the wizard Remus Lupin in the J.K. Rowling series, via Twitter on Monday, Jan 7.
Her video, which had gone viral, has garnered over 5.3 million views, as of this writing.
The dog, who was wearing a knitted gray shirt as well as a red and gold tie — akin to the Hogwarts school uniform of students in house Gryffindor — readily followed the commands in the form of magic spells issued by his owner.
He even has a few cheeky tricks up his paw: He urinates to perform water-making spell "Aguamenti" and responds to snake-summoning spell "Serpensortia" by sticking his tongue out.
Pottermore, the global digital publisher of Harry Potter and the Wizarding World, took to Twitter to reward the dog on Tuesday, Jan 8. "10 points to Gryffin-paw!" the account said.


text:
ArtsEventFestivalLifeNewsNSW
Our local writers who'll feature at festival
The write stuff: From left, Jarrah Dundler, Paul Shields, Linda Woodrow, Odette Nettleton, Gwendolyn Gray, Hayley Katzen and Thor Phillips.
Only a few weeks until the Kyogle Writers Festival kicks off.
Venues include the Richmond River Independent Stage, The Business Hive, the Roxy Gallery, the Laneway Community Space, the Kyogle Library, the Garden Stage, and the Occasional Studio. A mud map of venues will be available.
Authors attending include Melissa Lucashenko, Stuart Rees, Daniel Browning, Ellen van Neerven, Nardi Simpson, Scott Bevan, Laura Elvery, Jessie Cole, Lisa Walker, Kristina Olsson and many more.
Here are the local authors at the festival:
Jarrah Dundler lives in his hometown Kyogle. His debut novel Hey Brother is set in and around Kyogle and was shortlisted for the Vogel award. He is currently working on a second novel, also set close to home, with the support of a Kyogle Writers Festival Residency.
Paul Shields is a writer who lives just outside Kyogle. His work has appeared in Meanjin, Headland, WOB, Spike, Underground Voices, UrinalMag and elsewhere. His audio work has appeared on ABC Radio National, Hack and ABC Local Radio. He is on the management committee for the Kyogle Writers Festival and was the recipient of a 2019 Early Career Writers Grant from Writing NSW.
Linda Woodrow's The Permaculture Home Garden was published by Penguin in 1996. It is still in print and has sold more than 30,000 copies. Her first novel, 470, was published in 2020 and has been nominated for the NSW Premier's Literary Award and the Christina Stead Prize for Fiction.
Kyogle's Odette Nettleton has been performing stand-up comedy for about 18 months. She has performed alongside Ellen Briggs and Ting Lim and has a weekly advice column in the Richmond River Independent. Odette was a contestant on Hard Quiz and will be bringing her Big Brass Mug to the festival.
Gwendolyn Gray is an artist and children's author from Casino. She has written and illustrated four children's books inspired by the daily antics of native waterfowl, particularly a black duck duckling on Horseshoe Lagoon where she lives. Gwendolyn donates all proceeds of her latest book to the Rotary Club of Casino to help those affected by the recent devastating fires.
Hayley Katzen lives at Ewingar and published her memoir Untethered last year. Her writing has won competitions, been published by ABC radio and Queerstories, and in Australian, American and Asian journals including Australian Book Review, Griffith Review, Southerly, Fourth Genre and Kenyon Review. Untethered is her debut memoir.
Andrew Johnston believes the story, or the telling of the story, is the foundation of ancient cultures – orally or pictorially – and the basis of cultural purpose where people find their place, obligations and relationships to this life and world. Andrew has been interested in Cultural Fire, the way this country was managed and cared for, for thousands of years. He is a director of the Bundjalung Jagun Firesticks Alliance. He conducts smoking ceremonies, is authorised for Welcome to Country, sits on the Gulibul council of elders and consults on cultural matters, especially cultural fire appraisal. He is a Bundjalung (mother's side) and Worramai (father's side) man.
Thor Phillips has been a professional musician for 14 years. He is an experienced sound engineer and producer, recording albums for several independent artists through his studio.
The Kyogle Writers Festival launch party is at the Roxy Gallery on Friday, May 14 from 5.30–8.30pm and is a free event.
Kyogle Writers Festival is a three-day event on May 14–16.
Find out more at kyoglewritersfestival.com
This article appeared in the Richmond River Independent, 21 April 2021.
Previous articleGallantry medal honours soldier too young for brutal death
Next articleWorld first Sheep Sustainability Framework launched


text:
Lady A, Zac Brown Band, Paisley join CMA lineup
Thursday, January 12, 2012 – Reigning CMA Vocal Group of the Year Lady Antebellum, Brad Paisley, Luke Bryan, Eric Church, Faith Hill, Rascal Flatts and Zac Brown Band have joined the performance lineup for the Nightly Concerts at LP Field during 2012 CMA Music Festival.
The event will take over downtown Nashville for four days this summer, Thursday-Sunday, June 7-10.
Jason Aldean, The Band Perry, and Carrie Underwood were previously announced as performing at the Festival. Additional artists will be announced in the coming weeks.
More news for Country Music Association
06/10/19: CMT Fest concludes
06/06/19: CMA Fest kicks off
05/13/19: Bradbery, Dawson head east
04/30/19: CMA Fest announces free shows
04/16/19: CMA Fest names headliners
04/10/19: Young, Janson added to CMA Fest concerts
03/04/19: CMA Fest announces initial line-up
02/20/19: CMA honors writers
Editorial: Walking the talk – When names like Hank Williams, Johnny Cash, Waylon and the Hag are invoked, you're talking hard core country. These are the touchstones of country , the guys who made country music what it was and still is (or maybe can be). When these folks would sing about being down-and-out and the rough-and-tumble, they knew of what they were singing about. Fast forward a few years to the country singers of today. »»»
Concert Review: Kiah heats up – Amythyst Kiah's music career has seemingly been a slow burn, but that well could be changing. She was part of the quartet that put out the very fine "Songs of Our Native Daughters" earlier this year and is about to launch a tour with CD-mates Rhiannon Giddens, Allison Russell of Birds of Chicago and Leyla McCalla to bring out songs about... »»»
Concert Review: Sweeney maintains her musical integrity – Sunny Sweeney has gone the big label route and even earned a hit with "From a Table Away," but truth be told, she's better off without the baggage of the bigs, especially given the consistent quality and musical vision that was so clearly and admirably on display on this evening. When the East Texas native started her career, she was... »»»
Follow Country Standard Time
Elsewhere in the news
Lambert releases new song
Gina Furtado Project forms
Alabama, Wariner set to join Nashville Musicians HOF
Russell Smith of Amazing Rhythm Aces dies
UMG signs Morgan
Knight announces first album in seven years
The Steel Wheels release new music
James Barker Band, Kissel top CCMA nominations
Currently at the CST blogs
A musical journey with George Strait
A unique show with The Trishas...
George Strait, country's greatest singer, to ride away in Houston
Like A Rose highlights Ashley Monroe as a solo artist
Raelynn's got a great sound!
Happy New Year, Country Music fans!
A Good Night for Country Music, past and present
Women of Texas Country
White embraces "The Hurting Kind"
John Paul White, to paraphrase a Steve Earle song, may just be one of the last of the hardcore troubadours. By 'troubadour,' we mean one of those guys that lives to write great songs - more specifically, great country songs - and then get these songs into the ears of folks that... »»»
Bingham gets personal with "American Love Song"...again
A lot of the early reviews for "American Love Song," Ryan Bingham's latest set of raucous and reflective Americana brilliance, have characterized it as the singer/ songwriter's most personal album to date.... »»»


text:
Steele Dossier
The Dirty Truth About the Steele Dossier
Abigail Tracy
Facebook's Info Wars
How Russia Secretly Orchestrated Dozens of U.S. Protests
Maya Kosoff
Colbert Scorches Trump Over Racist Tweets: "Racism Is Your Brand"
"It's All Great Theater": Does Netflix Really Need Friends or The Office?
Bodyguard Insists Trump Rejected Russian Offer to "Send Five Women"
The president's "loyal lieutenant" appeared to contest details recorded in the Steele dossier.
By Chip Somodevilla/Getty Images.
When Donald Trump left New York to take up residency in the White House, Keith Schiller, his longtime bodyguard, went with him. In Washington, the president's "loyal lieutenant" was reportedly tasked with everything from hand-delivering the letter firing former F.B.I. director James Comey, to catering to Trump's cravings for "a Quarter Pounder with cheese (no pickles, extra ketchup) and a fried apple pie," to serving, as he had for years, according to New York Times reporter Maggie Haberman, as the president's "ultimate emotional binky."
When Schiller quietly departed about eight months later, telling associates he wanted to make more money, the president was reportedly "crushed." But this week found Schiller sucked back into the Washington orbit when he was called before Congress to testify in the investigation into the Trump campaign's contacts with the Russian government. At issue: the controversial dossier compiled by ex-British spook Christopher Steele, which makes salacious allegations involving Trump, a hotel room in Moscow, several prostitutes, and a video tape.
Appearing before the House Intelligence Committee, Schiller, numerous sources told NBC on Thursday, described a 2013 incident that made such a scenario if not likely, then at least plausible. According to sources who were present for the interview, Schiller testified that after a meeting discussing the upcoming Miss Universe Pageant, which Trump owned, a Russian businessman told Schiller that he could "send five women" to Trump's hotel room, if Trump so wished.
At that time, the ex-N.Y.P.D. officer recalled, he turned down the invite on Trump's behalf, laughing and replying, "We don't do that type of stuff." He later discussed the offer with Trump as they were walking toward his hotel room, and recalled that Trump also appeared to take it as a joke. (According to one source in the room, Schiller and Trump were fully aware of the Russian habit of bugging hotel rooms to collect compromising material on V.I.P.s.) Schiller then dropped Trump off at his hotel room, stood outside the door for a while, and eventually left. Beyond that point he could not account for the goings-on in Trump's hotel room, but the sources told NBC that Schiller professed to be "confident" that nothing had happened. (Later, when reports emerged of the specific allegations, Schiller described his reaction as, "Oh my God, that's bullshit.")
While the tape itself has never surfaced, the dossier containing the tape's description re-entered the public consciousness when it was revealed that Hillary Clinton's campaign, through law firm Perkins Coie, paid Fusion GPS—an opposition research firm—to compile research that made its way into the dossier. But the scant evidence did not stop the Internet from jumping to conclusions.
https://twitter.com/brianbeutler/status/928701890749239296
In a statement, Schiller's lawyers said that "the versions of Mr. Schiller's testimony being leaked to the press are blatantly false and misleading," and that the leaks were motivated by "partisan insiders."


text:
Independent Schools Victoria
Our teens among the world's least active, smart guide to choosing tech gifts for kids, TED-ED's videos for family road trips, and more...
Our selection of thought-provoking and useful articles from around the web on educating and raising children.
Australian teens do the least physical activity in the world
(Brendon Hyndman, The Conversation)
How are our 1.6 million adolescent school students faring when it comes to physical activity? Pretty dismally, reports the author. The World Health Organisation recommends a minimum of one hour's worth of jogging-like activity. We only come in ahead of a handful of countries, such as Cambodia and South Korea. One problem is that secondary schools aren't geared towards encouraging students to get active in breaks. Among the solutions proposed is one-hour recess times, and providing students equipment such as climbing and fitness equipment.
Gift Guide: Be smart and secure when choosing tech gifts for children and young people
(Office of the eSafety Commissioner)
Do you know the minimum recommended age for using a drone? For most drones, it's over 12, but in some cases, it's 8. We can thank the Office of the eSafety Commissioner Julie Inman Grant for this important fact, contained in an informative guide to help you when it comes to choosing tech gifts. It's full of things you may not have considered. Robotic toys and their accompanying user accounts, for example, may store personal information, including a child's name, age, gender and, in some instances, location.
A car-trip video playlist: 8 great TED-Ed lessons to make a drive fly by
(Ideas.ted.com)
The holiday season means long road trips for many families, and an inevitable, regular chorus of, 'Are we there yet?' Distracting activities are the go-to for parents, and all the better if children end up smarter at the end of the trip. This is what this collection of TED-ED lessons promise. Topics include: why do we itch?, the history of chocolate, and why are sloths so slow. Each runs for four of five minutes of relative peace
Maths looks the same in the brains of boys and girls, study finds
(Jon Hamilton, npr)
There's a an idea that more boys than girls end up in STEM areas because boys are inherently better at the sort of thinking those fields require. Not so, says this report, which details the findings of new research that shows that girls start out with the same abilities in maths as boys. The experts ponder what's happening as male and female students grow up, and take different study and career paths.
Best of the Web: Why kids behave worse for you than their teacher, and more
Five ideas to help you and your kids with lockdown life and remote learning, little voices delivering big hope, and Round the Twist set for the stage.
Andrew Fuller: How to get your child's learning mojo back after this 'year of fear'
The leading adolescent psychologist inspired parents and carers during our latest webinar with his insights and ideas to help reignite our children's passion for learning. He summarises his main points in this article.
Remote learning 2.0 – how this time, we're doing better
The return to learning at home has been a big challenge, but as Peter Hanlon writes, the lessons learned are helping teachers and students, and opening up new ways of thinking about education.