text:
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module      :  Distribution.Client.Sandbox
-- Maintainer  :  cabal-devel@haskell.org
-- Portability :  portable
--
-- UI for the sandboxing functionality.
-----------------------------------------------------------------------------

module Distribution.Client.Sandbox (
    sandboxInit,
    sandboxDelete,
    sandboxAddSource,
    sandboxAddSourceSnapshot,
    sandboxDeleteSource,
    sandboxListSources,
    sandboxHcPkg,
    dumpPackageEnvironment,
    withSandboxBinDirOnSearchPath,

    getSandboxConfigFilePath,
    loadConfigOrSandboxConfig,
    findSavedDistPref,
    initPackageDBIfNeeded,
    maybeWithSandboxDirOnSearchPath,

    WereDepsReinstalled(..),
    reinstallAddSourceDeps,
    maybeReinstallAddSourceDeps,

    SandboxPackageInfo(..),
    maybeWithSandboxPackageInfo,

    tryGetIndexFilePath,
    sandboxBuildDir,
    getInstalledPackagesInSandbox,
    updateSandboxConfigFileFlag,
    updateInstallDirs,

    -- FIXME: move somewhere else
    configPackageDB', configCompilerAux'
  ) where

import Distribution.Client.Setup
  ( SandboxFlags(..), ConfigFlags(..), ConfigExFlags(..), InstallFlags(..)
  , GlobalFlags(..), defaultConfigExFlags, defaultInstallFlags
  , defaultSandboxLocation, globalRepos )
import Distribution.Client.Sandbox.Timestamp  ( listModifiedDeps
                                              , maybeAddCompilerTimestampRecord
                                              , withAddTimestamps
                                              , withRemoveTimestamps )
import Distribution.Client.Config
  ( SavedConfig(..), defaultUserInstall, loadConfig )
import Distribution.Client.Dependency         ( foldProgress )
import Distribution.Client.IndexUtils         ( BuildTreeRefType(..) )
import Distribution.Client.Install            ( InstallArgs,
                                                makeInstallContext,
                                                makeInstallPlan,
                                                processInstallPlan )
import Distribution.Utils.NubList            ( fromNubList )

import Distribution.Client.Sandbox.PackageEnvironment
  ( PackageEnvironment(..), IncludeComments(..), PackageEnvironmentType(..)
  , createPackageEnvironmentFile, classifyPackageEnvironment
  , tryLoadSandboxPackageEnvironmentFile, loadUserConfig
  , commentPackageEnvironment, showPackageEnvironmentWithComments
  , sandboxPackageEnvironmentFile, userPackageEnvironmentFile )
import Distribution.Client.Sandbox.Types      ( SandboxPackageInfo(..)
                                              , UseSandbox(..) )
import Distribution.Client.SetupWrapper
  ( SetupScriptOptions(..), defaultSetupScriptOptions )
import Distribution.Client.Types              ( PackageLocation(..)
                                              , SourcePackage(..) )
import Distribution.Client.Utils              ( inDir, tryCanonicalizePath
                                              , tryFindAddSourcePackageDesc )
import Distribution.PackageDescription.Configuration
                                              ( flattenPackageDescription )
import Distribution.PackageDescription.Parse  ( readPackageDescription )
import Distribution.Simple.Compiler           ( Compiler(..), PackageDB(..)
                                              , PackageDBStack )
import Distribution.Simple.Configure          ( configCompilerAuxEx
                                              , interpretPackageDbFlags
                                              , getPackageDBContents
                                              , findDistPref )
import Distribution.Simple.PreProcess         ( knownSuffixHandlers )
import Distribution.Simple.Program            ( ProgramConfiguration )
import Distribution.Simple.Setup              ( Flag(..), HaddockFlags(..)
                                              , fromFlagOrDefault )
import Distribution.Simple.SrcDist            ( prepareTree )
import Distribution.Simple.Utils              ( die, debug, notice, info, warn
                                              , debugNoWrap, defaultPackageDesc
                                              , intercalate, topHandlerWith
                                              , createDirectoryIfMissingVerbose )
import Distribution.Package                   ( Package(..) )
import Distribution.System                    ( Platform )
import Distribution.Text                      ( display )
import Distribution.Verbosity                 ( Verbosity, lessVerbose )
import Distribution.Compat.Environment        ( lookupEnv, setEnv )
import Distribution.Client.Compat.FilePerms   ( setFileHidden )
import qualified Distribution.Client.Sandbox.Index as Index
import Distribution.Simple.PackageIndex       ( InstalledPackageIndex )
import qualified Distribution.Simple.PackageIndex  as InstalledPackageIndex
import qualified Distribution.Simple.Register      as Register
import qualified Data.Map                          as M
import qualified Data.Set                          as S
import Control.Exception                      ( assert, bracket_ )
import Control.Monad                          ( forM, liftM2, unless, when )
import Data.Bits                              ( shiftL, shiftR, xor )
import Data.Char                              ( ord )
import Data.Foldable                          ( forM_ )
import Data.IORef                             ( newIORef, writeIORef, readIORef )
import Data.List                              ( delete, foldl' )
import Data.Maybe                             ( fromJust )
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid                            ( mempty, mappend )
#endif
import Data.Word                              ( Word32 )
import Numeric                                ( showHex )
import System.Directory                       ( createDirectory
                                              , doesDirectoryExist
                                              , doesFileExist
                                              , getCurrentDirectory
                                              , removeDirectoryRecursive
                                              , removeFile
                                              , renameDirectory )
import System.FilePath                        ( (</>), equalFilePath
                                              , getSearchPath
                                              , searchPathSeparator
                                              , takeDirectory )

--
-- * Constants
--

-- | The name of the sandbox subdirectory where we keep snapshots of add-source
-- dependencies.
snapshotDirectoryName :: FilePath
snapshotDirectoryName = "snapshots"

-- | Non-standard build dir that is used for building add-source deps instead of
-- "dist". Fixes surprising behaviour in some cases (see issue #1281).
sandboxBuildDir :: FilePath -> FilePath
sandboxBuildDir sandboxDir = "dist/dist-sandbox-" ++ showHex sandboxDirHash ""
  where
    sandboxDirHash = jenkins sandboxDir

    -- See http://en.wikipedia.org/wiki/Jenkins_hash_function
    jenkins :: String -> Word32
    jenkins str = loop_finish $ foldl' loop 0 str
      where
        loop :: Word32 -> Char -> Word32
        loop hash key_i' = hash'''
          where
            key_i   = toEnum . ord $ key_i'
            hash'   = hash + key_i
            hash''  = hash' + (shiftL hash' 10)
            hash''' = hash'' `xor` (shiftR hash'' 6)

        loop_finish :: Word32 -> Word32
        loop_finish hash = hash'''
          where
            hash'   = hash + (shiftL hash 3)
            hash''  = hash' `xor` (shiftR hash' 11)
            hash''' = hash'' + (shiftL hash'' 15)

--
-- * Basic sandbox functions.
--

-- | If @--sandbox-config-file@ wasn't given on the command-line, set it to the
-- value of the @CABAL_SANDBOX_CONFIG@ environment variable, or else to
-- 'NoFlag'.
updateSandboxConfigFileFlag :: GlobalFlags -> IO GlobalFlags
updateSandboxConfigFileFlag globalFlags =
  case globalSandboxConfigFile globalFlags of
    Flag _ -> return globalFlags
    NoFlag -> do
      fp <- lookupEnv "CABAL_SANDBOX_CONFIG"
      forM_ fp $ \fp' -> do      -- Check for existence if environment variable set
        exists <- doesFileExist fp'
        unless exists $ die $ "Cabal sandbox file in $CABAL_SANDBOX_CONFIG does not exist: " ++ fp'
      let f' = maybe NoFlag Flag fp
      return globalFlags { globalSandboxConfigFile = f' }

-- | Return the path to the sandbox config file - either the default or the one
-- specified with @--sandbox-config-file@.
getSandboxConfigFilePath :: GlobalFlags -> IO FilePath
getSandboxConfigFilePath globalFlags = do
  let sandboxConfigFileFlag = globalSandboxConfigFile globalFlags
  case sandboxConfigFileFlag of
    NoFlag -> do pkgEnvDir <- getCurrentDirectory
                 return (pkgEnvDir </> sandboxPackageEnvironmentFile)
    Flag path -> return path

-- | Load the @cabal.sandbox.config@ file (and possibly the optional
-- @cabal.config@). In addition to a @PackageEnvironment@, also return a
-- canonical path to the sandbox. Exit with error if the sandbox directory or
-- the package environment file do not exist.
tryLoadSandboxConfig :: Verbosity -> GlobalFlags
                        -> IO (FilePath, PackageEnvironment)
tryLoadSandboxConfig verbosity globalFlags = do
  path <- getSandboxConfigFilePath globalFlags
  tryLoadSandboxPackageEnvironmentFile verbosity path
    (globalConfigFile globalFlags)

-- | Return the name of the package index file for this package environment.
tryGetIndexFilePath :: SavedConfig -> IO FilePath
tryGetIndexFilePath config = tryGetIndexFilePath' (savedGlobalFlags config)

-- | The same as 'tryGetIndexFilePath', but takes 'GlobalFlags' instead of
-- 'SavedConfig'.
tryGetIndexFilePath' :: GlobalFlags -> IO FilePath
tryGetIndexFilePath' globalFlags = do
  let paths = fromNubList $ globalLocalRepos globalFlags
  case paths of
    []  -> die $ "Distribution.Client.Sandbox.tryGetIndexFilePath: " ++
           "no local repos found. " ++ checkConfiguration
    _   -> return $ (last paths) </> Index.defaultIndexFileName
  where
    checkConfiguration = "Please check your configuration ('"
                         ++ userPackageEnvironmentFile ++ "')."

-- | Try to extract a 'PackageDB' from 'ConfigFlags'. Gives a better error
-- message than just pattern-matching.
getSandboxPackageDB :: ConfigFlags -> IO PackageDB
getSandboxPackageDB configFlags = do
  case configPackageDBs configFlags of
    [Just sandboxDB@(SpecificPackageDB _)] -> return sandboxDB
    -- TODO: should we allow multiple package DBs (e.g. with 'inherit')?

    []                                     ->
      die $ "Sandbox package DB is not specified. " ++ sandboxConfigCorrupt
    [_]                                    ->
      die $ "Unexpected contents of the 'package-db' field. "
            ++ sandboxConfigCorrupt
    _                                      ->
      die $ "Too many package DBs provided. " ++ sandboxConfigCorrupt

  where
    sandboxConfigCorrupt = "Your 'cabal.sandbox.config' is probably corrupt."

-- | Which packages are installed in the sandbox package DB?
getInstalledPackagesInSandbox :: Verbosity -> ConfigFlags
                                 -> Compiler -> ProgramConfiguration
                                 -> IO InstalledPackageIndex
getInstalledPackagesInSandbox verbosity configFlags comp conf = do
    sandboxDB <- getSandboxPackageDB configFlags
    getPackageDBContents verbosity comp sandboxDB conf

-- | Temporarily add $SANDBOX_DIR/bin to $PATH.
withSandboxBinDirOnSearchPath :: FilePath -> IO a -> IO a
withSandboxBinDirOnSearchPath sandboxDir = bracket_ addBinDir rmBinDir
  where
    -- TODO: Instead of modifying the global process state, it'd be better to
    -- set the environment individually for each subprocess invocation. This
    -- will have to wait until the Shell monad is implemented; without it the
    -- required changes are too intrusive.
    addBinDir :: IO ()
    addBinDir = do
      mbOldPath <- lookupEnv "PATH"
      let newPath = maybe sandboxBin ((++) sandboxBin . (:) searchPathSeparator)
                    mbOldPath
      setEnv "PATH" newPath

    rmBinDir :: IO ()
    rmBinDir = do
      oldPath <- getSearchPath
      let newPath = intercalate [searchPathSeparator]
                    (delete sandboxBin oldPath)
      setEnv "PATH" newPath

    sandboxBin = sandboxDir </> "bin"

-- | Initialise a package DB for this compiler if it doesn't exist.
initPackageDBIfNeeded :: Verbosity -> ConfigFlags
                         -> Compiler -> ProgramConfiguration
                         -> IO ()
initPackageDBIfNeeded verbosity configFlags comp conf = do
  SpecificPackageDB dbPath <- getSandboxPackageDB configFlags
  packageDBExists <- doesDirectoryExist dbPath
  unless packageDBExists $
    Register.initPackageDB verbosity comp conf dbPath
  when packageDBExists $
    debug verbosity $ "The package database already exists: " ++ dbPath

-- | Entry point for the 'cabal sandbox dump-pkgenv' command.
dumpPackageEnvironment :: Verbosity -> SandboxFlags -> GlobalFlags -> IO ()
dumpPackageEnvironment verbosity _sandboxFlags globalFlags = do
  (sandboxDir, pkgEnv) <- tryLoadSandboxConfig verbosity globalFlags
  commentPkgEnv        <- commentPackageEnvironment sandboxDir
  putStrLn . showPackageEnvironmentWithComments (Just commentPkgEnv) $ pkgEnv

-- | Entry point for the 'cabal sandbox init' command.
sandboxInit :: Verbosity -> SandboxFlags  -> GlobalFlags -> IO ()
sandboxInit verbosity sandboxFlags globalFlags = do
  -- Warn if there's a 'cabal-dev' sandbox.
  isCabalDevSandbox <- liftM2 (&&) (doesDirectoryExist "cabal-dev")
                       (doesFileExist $ "cabal-dev" </> "cabal.config")
  when isCabalDevSandbox $
    warn verbosity $
    "You are apparently using a legacy (cabal-dev) sandbox. "
    ++ "Legacy sandboxes may interact badly with native Cabal sandboxes. "
    ++ "You may want to delete the 'cabal-dev' directory to prevent issues."

  -- Create the sandbox directory.
  let sandboxDir' = fromFlagOrDefault defaultSandboxLocation
                    (sandboxLocation sandboxFlags)
  createDirectoryIfMissingVerbose verbosity True sandboxDir'
  sandboxDir <- tryCanonicalizePath sandboxDir'
  setFileHidden sandboxDir

  -- Determine which compiler to use (using the value from ~/.cabal/config).
  userConfig <- loadConfig verbosity (globalConfigFile globalFlags)
  (comp, platform, conf) <- configCompilerAuxEx (savedConfigureFlags userConfig)

  -- Create the package environment file.
  pkgEnvFile <- getSandboxConfigFilePath globalFlags
  createPackageEnvironmentFile verbosity sandboxDir pkgEnvFile
    NoComments comp platform
  (_sandboxDir, pkgEnv) <- tryLoadSandboxConfig verbosity globalFlags
  let config      = pkgEnvSavedConfig pkgEnv
      configFlags = savedConfigureFlags config

  -- Create the index file if it doesn't exist.
  indexFile <- tryGetIndexFilePath config
  indexFileExists <- doesFileExist indexFile
  if indexFileExists
    then notice verbosity $ "Using an existing sandbox located at " ++ sandboxDir
    else notice verbosity $ "Creating a new sandbox at " ++ sandboxDir
  Index.createEmpty verbosity indexFile

  -- Create the package DB for the default compiler.
  initPackageDBIfNeeded verbosity configFlags comp conf
  maybeAddCompilerTimestampRecord verbosity sandboxDir indexFile
    (compilerId comp) platform

-- | Entry point for the 'cabal sandbox delete' command.
sandboxDelete :: Verbosity -> SandboxFlags -> GlobalFlags -> IO ()
sandboxDelete verbosity _sandboxFlags globalFlags = do
  (useSandbox, _) <- loadConfigOrSandboxConfig
                       verbosity
                       globalFlags { globalRequireSandbox = Flag False }
  case useSandbox of
    NoSandbox -> warn verbosity "Not in a sandbox."
    UseSandbox sandboxDir -> do
      curDir     <- getCurrentDirectory
      pkgEnvFile <- getSandboxConfigFilePath globalFlags

      -- Remove the @cabal.sandbox.config@ file, unless it's in a non-standard
      -- location.
      let isNonDefaultConfigLocation = not $ equalFilePath pkgEnvFile $
                                       curDir </> sandboxPackageEnvironmentFile

      if isNonDefaultConfigLocation
        then warn verbosity $ "Sandbox config file is in non-default location: '"
                    ++ pkgEnvFile ++ "'.\n Please delete manually."
        else removeFile pkgEnvFile

      -- Remove the sandbox directory, unless we're using a shared sandbox.
      let isNonDefaultSandboxLocation = not $ equalFilePath sandboxDir $
                                        curDir </> defaultSandboxLocation

      when isNonDefaultSandboxLocation $
        die $ "Non-default sandbox location used: '" ++ sandboxDir
        ++ "'.\nAssuming a shared sandbox. Please delete '"
        ++ sandboxDir ++ "' manually."

      notice verbosity $ "Deleting the sandbox located at " ++ sandboxDir
      removeDirectoryRecursive sandboxDir

-- Common implementation of 'sandboxAddSource' and 'sandboxAddSourceSnapshot'.
doAddSource :: Verbosity -> [FilePath] -> FilePath -> PackageEnvironment
               -> BuildTreeRefType
               -> IO ()
doAddSource verbosity buildTreeRefs sandboxDir pkgEnv refType = do
  let savedConfig       = pkgEnvSavedConfig pkgEnv
  indexFile            <- tryGetIndexFilePath savedConfig

  -- If we're running 'sandbox add-source' for the first time for this compiler,
  -- we need to create an initial timestamp record.
  (comp, platform, _) <- configCompilerAuxEx . savedConfigureFlags $ savedConfig
  maybeAddCompilerTimestampRecord verbosity sandboxDir indexFile
    (compilerId comp) platform

  withAddTimestamps sandboxDir $ do
    -- FIXME: path canonicalisation is done in addBuildTreeRefs, but we do it
    -- twice because of the timestamps file.
    buildTreeRefs' <- mapM tryCanonicalizePath buildTreeRefs
    Index.addBuildTreeRefs verbosity indexFile buildTreeRefs' refType
    return buildTreeRefs'

-- | Entry point for the 'cabal sandbox add-source' command.
sandboxAddSource :: Verbosity -> [FilePath] -> SandboxFlags -> GlobalFlags
                    -> IO ()
sandboxAddSource verbosity buildTreeRefs sandboxFlags globalFlags = do
  (sandboxDir, pkgEnv) <- tryLoadSandboxConfig verbosity globalFlags

  if fromFlagOrDefault False (sandboxSnapshot sandboxFlags)
    then sandboxAddSourceSnapshot verbosity buildTreeRefs sandboxDir pkgEnv
    else doAddSource verbosity buildTreeRefs sandboxDir pkgEnv LinkRef

-- | Entry point for the 'cabal sandbox add-source --snapshot' command.
sandboxAddSourceSnapshot :: Verbosity -> [FilePath] -> FilePath
                            -> PackageEnvironment
                            -> IO ()
sandboxAddSourceSnapshot verbosity buildTreeRefs sandboxDir pkgEnv = do
  let snapshotDir = sandboxDir </> snapshotDirectoryName

  -- Use 'D.S.SrcDist.prepareTree' to copy each package's files to our private
  -- location.
  createDirectoryIfMissingVerbose verbosity True snapshotDir

  -- Collect the package descriptions first, so that if some path does not refer
  -- to a cabal package, we fail immediately.
  pkgs      <- forM buildTreeRefs $ \buildTreeRef ->
    inDir (Just buildTreeRef) $
    return . flattenPackageDescription
            =<< readPackageDescription verbosity
            =<< defaultPackageDesc     verbosity

  -- Copy the package sources to "snapshots/$PKGNAME-$VERSION-tmp". If
  -- 'prepareTree' throws an error at any point, the old snapshots will still be
  -- in consistent state.
  tmpDirs <- forM (zip buildTreeRefs pkgs) $ \(buildTreeRef, pkg) ->
    inDir (Just buildTreeRef) $ do
      let targetDir    = snapshotDir </> (display . packageId $ pkg)
          targetTmpDir = targetDir ++ "-tmp"
      dirExists <- doesDirectoryExist targetTmpDir
      when dirExists $
        removeDirectoryRecursive targetDir
      createDirectory targetTmpDir
      prepareTree verbosity pkg Nothing targetTmpDir knownSuffixHandlers
      return (targetTmpDir, targetDir)

  -- Now rename the "snapshots/$PKGNAME-$VERSION-tmp" dirs to
  -- "snapshots/$PKGNAME-$VERSION".
  snapshots <- forM tmpDirs $ \(targetTmpDir, targetDir) -> do
    dirExists <- doesDirectoryExist targetDir
    when dirExists $
      removeDirectoryRecursive targetDir
    renameDirectory targetTmpDir targetDir
    return targetDir

  -- Once the packages are copied, just 'add-source' them as usual.
  doAddSource verbosity snapshots sandboxDir pkgEnv SnapshotRef

-- | Entry point for the 'cabal sandbox delete-source' command.
sandboxDeleteSource :: Verbosity -> [FilePath] -> SandboxFlags -> GlobalFlags
                       -> IO ()
sandboxDeleteSource verbosity buildTreeRefs _sandboxFlags globalFlags = do
  (sandboxDir, pkgEnv) <- tryLoadSandboxConfig verbosity globalFlags
  indexFile            <- tryGetIndexFilePath (pkgEnvSavedConfig pkgEnv)

  withRemoveTimestamps sandboxDir $ do
    Index.removeBuildTreeRefs verbosity indexFile buildTreeRefs

  notice verbosity $ "Note: 'sandbox delete-source' only unregisters the " ++
    "source dependency, but does not remove the package " ++
    "from the sandbox package DB.\n\n" ++
    "Use 'sandbox hc-pkg -- unregister' to do that."

-- | Entry point for the 'cabal sandbox list-sources' command.
sandboxListSources :: Verbosity -> SandboxFlags -> GlobalFlags
                      -> IO ()
sandboxListSources verbosity _sandboxFlags globalFlags = do
  (sandboxDir, pkgEnv) <- tryLoadSandboxConfig verbosity globalFlags
  indexFile            <- tryGetIndexFilePath (pkgEnvSavedConfig pkgEnv)

  refs <- Index.listBuildTreeRefs verbosity
          Index.ListIgnored Index.LinksAndSnapshots indexFile
  when (null refs) $
    notice verbosity $ "Index file '" ++ indexFile
    ++ "' has no references to local build trees."
  when (not . null $ refs) $ do
    notice verbosity $ "Source dependencies registered "
      ++ "in the current sandbox ('" ++ sandboxDir ++ "'):\n\n"
    mapM_ putStrLn refs
    notice verbosity $ "\nTo unregister source dependencies, "
                       ++ "use the 'sandbox delete-source' command."

-- | Entry point for the 'cabal sandbox hc-pkg' command. Invokes the @hc-pkg@
-- tool with provided arguments, restricted to the sandbox.
sandboxHcPkg :: Verbosity -> SandboxFlags -> GlobalFlags -> [String] -> IO ()
sandboxHcPkg verbosity _sandboxFlags globalFlags extraArgs = do
  (_sandboxDir, pkgEnv) <- tryLoadSandboxConfig verbosity globalFlags
  let configFlags = savedConfigureFlags . pkgEnvSavedConfig $ pkgEnv
      dbStack     = configPackageDB' configFlags
  (comp, _platform, conf) <- configCompilerAux' configFlags

  Register.invokeHcPkg verbosity comp conf dbStack extraArgs

updateInstallDirs :: Flag Bool
                  -> (UseSandbox, SavedConfig) -> (UseSandbox, SavedConfig)
updateInstallDirs userInstallFlag (useSandbox, savedConfig) =
  case useSandbox of
    NoSandbox ->
      let savedConfig' = savedConfig {
            savedConfigureFlags = configureFlags {
                configInstallDirs = installDirs
            }
          }
      in (useSandbox, savedConfig')
    _ -> (useSandbox, savedConfig)
  where
    configureFlags = savedConfigureFlags savedConfig
    userInstallDirs = savedUserInstallDirs savedConfig
    globalInstallDirs = savedGlobalInstallDirs savedConfig
    installDirs | userInstall = userInstallDirs
                | otherwise   = globalInstallDirs
    userInstall = fromFlagOrDefault defaultUserInstall
                  (configUserInstall configureFlags `mappend` userInstallFlag)

-- | Check which type of package environment we're in and return a
-- correctly-initialised @SavedConfig@ and a @UseSandbox@ value that indicates
-- whether we're working in a sandbox.
loadConfigOrSandboxConfig :: Verbosity
                          -> GlobalFlags  -- ^ For @--config-file@ and
                                          -- @--sandbox-config-file@.
                          -> IO (UseSandbox, SavedConfig)
loadConfigOrSandboxConfig verbosity globalFlags = do
  let configFileFlag        = globalConfigFile        globalFlags
      sandboxConfigFileFlag = globalSandboxConfigFile globalFlags
      ignoreSandboxFlag     = globalIgnoreSandbox globalFlags

  pkgEnvDir  <- getPkgEnvDir sandboxConfigFileFlag
  pkgEnvType <- classifyPackageEnvironment pkgEnvDir sandboxConfigFileFlag
                                           ignoreSandboxFlag
  case pkgEnvType of
    -- A @cabal.sandbox.config@ file (and possibly @cabal.config@) is present.
    SandboxPackageEnvironment -> do
      (sandboxDir, pkgEnv) <- tryLoadSandboxConfig verbosity globalFlags
                              -- ^ Prints an error message and exits on error.
      let config = pkgEnvSavedConfig pkgEnv
      return (UseSandbox sandboxDir, config)

    -- Only @cabal.config@ is present.
    UserPackageEnvironment    -> do
      config <- loadConfig verbosity configFileFlag
      userConfig <- loadUserConfig verbosity pkgEnvDir
      let config' = config `mappend` userConfig
      dieIfSandboxRequired config'
      return (NoSandbox, config')

    -- Neither @cabal.sandbox.config@ nor @cabal.config@ are present.
    AmbientPackageEnvironment -> do
      config <- loadConfig verbosity configFileFlag
      dieIfSandboxRequired config
      return (NoSandbox, config)

  where
    -- Return the path to the package environment directory - either the
    -- current directory or the one that @--sandbox-config-file@ resides in.
    getPkgEnvDir :: (Flag FilePath) -> IO FilePath
    getPkgEnvDir sandboxConfigFileFlag = do
      case sandboxConfigFileFlag of
        NoFlag    -> getCurrentDirectory
        Flag path -> tryCanonicalizePath . takeDirectory $ path

    -- Die if @--require-sandbox@ was specified and we're not inside a sandbox.
    dieIfSandboxRequired :: SavedConfig -> IO ()
    dieIfSandboxRequired config = checkFlag flag
      where
        flag = (globalRequireSandbox . savedGlobalFlags $ config)
               `mappend` (globalRequireSandbox globalFlags)
        checkFlag (Flag True)  =
          die $ "'require-sandbox' is set to True, but no sandbox is present. "
             ++ "Use '--no-require-sandbox' if you want to override "
             ++ "'require-sandbox' temporarily."
        checkFlag (Flag False) = return ()
        checkFlag (NoFlag)     = return ()

-- | Return the saved \"dist/\" prefix, or the default prefix.
findSavedDistPref :: SavedConfig -> Flag FilePath -> IO FilePath
findSavedDistPref config flagDistPref = do
    let defDistPref = useDistPref defaultSetupScriptOptions
        flagDistPref' = configDistPref (savedConfigureFlags config)
                        `mappend` flagDistPref
    findDistPref defDistPref flagDistPref'

-- | If we're in a sandbox, call @withSandboxBinDirOnSearchPath@, otherwise do
-- nothing.
maybeWithSandboxDirOnSearchPath :: UseSandbox -> IO a -> IO a
maybeWithSandboxDirOnSearchPath NoSandbox               act = act
maybeWithSandboxDirOnSearchPath (UseSandbox sandboxDir) act =
  withSandboxBinDirOnSearchPath sandboxDir $ act

-- | Had reinstallAddSourceDeps actually reinstalled any dependencies?
data WereDepsReinstalled = ReinstalledSomeDeps | NoDepsReinstalled

-- | Reinstall those add-source dependencies that have been modified since
-- we've last installed them. Assumes that we're working inside a sandbox.
reinstallAddSourceDeps :: Verbosity
                          -> ConfigFlags  -> ConfigExFlags
                          -> InstallFlags -> GlobalFlags
                          -> FilePath
                          -> IO WereDepsReinstalled
reinstallAddSourceDeps verbosity configFlags' configExFlags
                       installFlags globalFlags sandboxDir = topHandler' $ do
  let sandboxDistPref     = sandboxBuildDir sandboxDir
      configFlags         = configFlags'
                            { configDistPref  = Flag sandboxDistPref }
      haddockFlags        = mempty
                            { haddockDistPref = Flag sandboxDistPref }
  (comp, platform, conf) <- configCompilerAux' configFlags
  retVal                 <- newIORef NoDepsReinstalled

  withSandboxPackageInfo verbosity configFlags globalFlags
                         comp platform conf sandboxDir $ \sandboxPkgInfo ->
    unless (null $ modifiedAddSourceDependencies sandboxPkgInfo) $ do

      let args :: InstallArgs
          args = ((configPackageDB' configFlags)
                 ,(globalRepos globalFlags)
                 ,comp, platform, conf
                 ,UseSandbox sandboxDir, Just sandboxPkgInfo
                 ,globalFlags, configFlags, configExFlags, installFlags
                 ,haddockFlags)

      -- This can actually be replaced by a call to 'install', but we use a
      -- lower-level API because of layer separation reasons. Additionally, we
      -- might want to use some lower-level features this in the future.
      withSandboxBinDirOnSearchPath sandboxDir $ do
        installContext <- makeInstallContext verbosity args Nothing
        installPlan    <- foldProgress logMsg die' return =<<
                          makeInstallPlan verbosity args installContext

        processInstallPlan verbosity args installContext installPlan
        writeIORef retVal ReinstalledSomeDeps

  readIORef retVal

    where
      die' message = die (message ++ installFailedInSandbox)
      -- TODO: use a better error message, remove duplication.
      installFailedInSandbox =
        "Note: when using a sandbox, all packages are required to have consistent dependencies. Try reinstalling/unregistering the offending packages or recreating the sandbox."
      logMsg message rest = debugNoWrap verbosity message >> rest

      topHandler' = topHandlerWith $ \_ -> do
        warn verbosity "Couldn't reinstall some add-source dependencies."
        -- Here we can't know whether any deps have been reinstalled, so we have
        -- to be conservative.
        return ReinstalledSomeDeps

-- | Produce a 'SandboxPackageInfo' and feed it to the given action. Note that
-- we don't update the timestamp file here - this is done in
-- 'postInstallActions'.
withSandboxPackageInfo :: Verbosity -> ConfigFlags -> GlobalFlags
                          -> Compiler -> Platform -> ProgramConfiguration
                          -> FilePath
                          -> (SandboxPackageInfo -> IO ())
                          -> IO ()
withSandboxPackageInfo verbosity configFlags globalFlags
                       comp platform conf sandboxDir cont = do
  -- List all add-source deps.
  indexFile              <- tryGetIndexFilePath' globalFlags
  buildTreeRefs          <- Index.listBuildTreeRefs verbosity
                            Index.DontListIgnored Index.OnlyLinks indexFile
  let allAddSourceDepsSet = S.fromList buildTreeRefs

  -- List all packages installed in the sandbox.
  installedPkgIndex <- getInstalledPackagesInSandbox verbosity
                       configFlags comp conf
  let err = "Error reading sandbox package information."
  -- Get the package descriptions for all add-source deps.
  depsCabalFiles <- mapM (flip tryFindAddSourcePackageDesc err) buildTreeRefs
  depsPkgDescs   <- mapM (readPackageDescription verbosity) depsCabalFiles
  let depsMap           = M.fromList (zip buildTreeRefs depsPkgDescs)
      isInstalled pkgid = not . null
        . InstalledPackageIndex.lookupSourcePackageId installedPkgIndex $ pkgid
      installedDepsMap  = M.filter (isInstalled . packageId) depsMap

  -- Get the package ids of modified (and installed) add-source deps.
  modifiedAddSourceDeps <- listModifiedDeps verbosity sandboxDir
                           (compilerId comp) platform installedDepsMap
  -- 'fromJust' here is safe because 'modifiedAddSourceDeps' are guaranteed to
  -- be a subset of the keys of 'depsMap'.
  let modifiedDeps    = [ (modDepPath, fromJust $ M.lookup modDepPath depsMap)
                        | modDepPath <- modifiedAddSourceDeps ]
      modifiedDepsMap = M.fromList modifiedDeps

  assert (all (`S.member` allAddSourceDepsSet) modifiedAddSourceDeps) (return ())
  if (null modifiedDeps)
    then info   verbosity $ "Found no modified add-source deps."
    else notice verbosity $ "Some add-source dependencies have been modified. "
                            ++ "They will be reinstalled..."

  -- Get the package ids of the remaining add-source deps (some are possibly not
  -- installed).
  let otherDeps = M.assocs (depsMap `M.difference` modifiedDepsMap)

  -- Finally, assemble a 'SandboxPackageInfo'.
  cont $ SandboxPackageInfo (map toSourcePackage modifiedDeps)
    (map toSourcePackage otherDeps) installedPkgIndex allAddSourceDepsSet

  where
    toSourcePackage (path, pkgDesc) = SourcePackage
      (packageId pkgDesc) pkgDesc (LocalUnpackedPackage path) Nothing

-- | Same as 'withSandboxPackageInfo' if we're inside a sandbox and a no-op
-- otherwise.
maybeWithSandboxPackageInfo :: Verbosity -> ConfigFlags -> GlobalFlags
                               -> Compiler -> Platform -> ProgramConfiguration
                               -> UseSandbox
                               -> (Maybe SandboxPackageInfo -> IO ())
                               -> IO ()
maybeWithSandboxPackageInfo verbosity configFlags globalFlags
                            comp platform conf useSandbox cont =
  case useSandbox of
    NoSandbox             -> cont Nothing
    UseSandbox sandboxDir -> withSandboxPackageInfo verbosity
                             configFlags globalFlags
                             comp platform conf sandboxDir
                             (\spi -> cont (Just spi))

-- | Check if a sandbox is present and call @reinstallAddSourceDeps@ in that
-- case.
maybeReinstallAddSourceDeps :: Verbosity
                               -> Flag (Maybe Int) -- ^ The '-j' flag
                               -> ConfigFlags      -- ^ Saved configure flags
                                                   -- (from dist/setup-config)
                               -> GlobalFlags
                               -> (UseSandbox, SavedConfig)
                               -> IO WereDepsReinstalled
maybeReinstallAddSourceDeps verbosity numJobsFlag configFlags'
                            globalFlags' (useSandbox, config) = do
  case useSandbox of
    NoSandbox             -> return NoDepsReinstalled
    UseSandbox sandboxDir -> do
      -- Reinstall the modified add-source deps.
      let configFlags    = savedConfigureFlags config
                           `mappendSomeSavedFlags`
                           configFlags'
          configExFlags  = defaultConfigExFlags
                           `mappend` savedConfigureExFlags config
          installFlags'  = defaultInstallFlags
                           `mappend` savedInstallFlags config
          installFlags   = installFlags' {
            installNumJobs    = installNumJobs installFlags'
                                `mappend` numJobsFlag
            }
          globalFlags    = savedGlobalFlags config
          -- This makes it possible to override things like 'remote-repo-cache'
          -- from the command line. These options are hidden, and are only
          -- useful for debugging, so this should be fine.
                           `mappend` globalFlags'
      reinstallAddSourceDeps
        verbosity configFlags configExFlags
        installFlags globalFlags sandboxDir

  where

    -- NOTE: we can't simply do @sandboxConfigFlags `mappend` savedFlags@
    -- because we don't want to auto-enable things like 'library-profiling' for
    -- all add-source dependencies even if the user has passed
    -- '--enable-library-profiling' to 'cabal configure'. These options are
    -- supposed to be set in 'cabal.config'.
    mappendSomeSavedFlags :: ConfigFlags -> ConfigFlags -> ConfigFlags
    mappendSomeSavedFlags sandboxConfigFlags savedFlags =
      sandboxConfigFlags {
        configHcFlavor     = configHcFlavor sandboxConfigFlags
                             `mappend` configHcFlavor savedFlags,
        configHcPath       = configHcPath sandboxConfigFlags
                             `mappend` configHcPath savedFlags,
        configHcPkg        = configHcPkg sandboxConfigFlags
                             `mappend` configHcPkg savedFlags,
        configProgramPaths = configProgramPaths sandboxConfigFlags
                             `mappend` configProgramPaths savedFlags,
        configProgramArgs  = configProgramArgs sandboxConfigFlags
                             `mappend` configProgramArgs savedFlags,
        -- NOTE: Unconditionally choosing the value from
        -- 'dist/setup-config'. Sandbox package DB location may have been
        -- changed by 'configure -w'.
        configPackageDBs   = configPackageDBs savedFlags
        -- FIXME: Is this compatible with the 'inherit' feature?
        }

--
-- Utils (transitionary)
--
-- FIXME: configPackageDB' and configCompilerAux' don't really belong in this
-- module
--

configPackageDB' :: ConfigFlags -> PackageDBStack
configPackageDB' cfg =
    interpretPackageDbFlags userInstall (configPackageDBs cfg)
  where
    userInstall = fromFlagOrDefault True (configUserInstall cfg)

configCompilerAux' :: ConfigFlags
                   -> IO (Compiler, Platform, ProgramConfiguration)
configCompilerAux' configFlags =
  configCompilerAuxEx configFlags
    --FIXME: make configCompilerAux use a sensible verbosity
    { configVerbosity = fmap lessVerbose (configVerbosity configFlags) }

redpajama_set_name: RedPajamaGithub


text:
Q: Get the last 10 objects in arraylist I'm trying to obtain the last 10 objects within an arraylist.
Case: Arraylist full of objects[ChartObjectsInt] and [ChartObjectsReal] with indexes from 0-N, i want to obtain the last 10 persons (N-10), and with these last 10 objects I want to call functions from that object; like ChartObjectsInt.getLabelName();
Can anyone help?
Code I've reached so far:
private void getLastTenObjects()
{
    foreach (ChartObjectsInt chartRecords in arraylistMonitor)
    {
        for (int i = 0; i < 10; i++)
        {
            arraylistMonitor.IndexOf(i);
        }
    }
}

A: Why don't you use List rather than ArrayList, if you do so it will be more easy to get last 10 element from list.
example:
var lastTenProducts = products.OrderByDescending(p => p.ProductDate).Take(10);
//here products is the List

A: As others have already said, I would use List<T> as ArrayList is effectively deprecated for that as it exists from a time when C# didn't have generics.
With that said, you could write a function that would work for a list of any size and take however many like so
 public List<T> GetLastX<T>(List<T> list, int amountToTake)
 {
     return list.Skip(list.Count - amountToTake).ToList();
 }

A: If you don't want to use LINQ at all
for (var i = Math.Max(arraylistMonitor.Count - 10, 0); i < arraylistMonitor.Count; i++)
{
    YourFunctionCallHere(arraylistMonitor[i]);
}

The above code will loop through the last 10 items of the ArrayList by setting i to the appropriate starting index - the Math.Max call there is in case the ArrayList has 9 or fewer elements in it.
If you are willing to use LINQ
var last10 = arraylistMonitor.Cast<object>().Reverse().Take(10);

will do what you want. You may also wish to add ToList after Take(10), depending on how you wish to consume last10.
Firstly it casts it to an IEnumerable<object> then goes through the IEnumerable backwards until it has (up to) 10 items.
If you specifically want last10 to be an ArrayList (which I wouldn't recommend) then use:
var last10 = new ArrayList(arraylistMonitor.Cast<object>().Reverse().Take(10).ToList());

redpajama_set_name: RedPajamaStackExchange


Public Transportation to JFK: Take the quick and easy AirTrain. Consult the New York City Subway Map to determine the best connections to get to your destination and pay the $2.75 subway fare. If you choose to return to JFK via subway, make sure to take the A train marked Far Rockaway or Rockaway Park, NOT Lefferts Blvd.
Taxis: $52 flat fare (plus tolls) to any Manhattan location. Taxis are available outside of every terminal, and there is typically a taxi stand where you will be directed to a cab. You may also want to familiarize yourself with the Taxi Rider's Bill of Rights. There is no additional charge for luggage and rates are based per car, not per passenger (up to four passengers).
Car Services: Prearrange for a car service to meet you at the airport, or call one when your flight touches down. That is a great option if you want to avoid waiting in line for a taxi or if you have a group larger than four people and want to arrange for a van or limousine.
Go Airlink NYC: Go Airlink NYC offers shared transfers from JFK (starting at $18/person), as well as private transfers via sedan or van for groups. Rides are available 24 hours a day.
NYC Airporter: The official bus service of NYC area airports, NYC Airporter offers transportation between Penn Station, Port Authority and Grand Central and JFK for $16 ($29 round-trip). Every 30 minutes from 5 a.m. to 11:30 p.m. daily.
Rental Cars: Consult this list of rental car companies serving JFK if you need to rent a car. I discourage visitors to New York City from renting cars, unless they're planning extensive travel outside of the major metropolitan area. Parking is both expensive and difficult to find, and you will find your money better spent on mass transit and taxis.
For other transit options, including suburban areas, inter-airport transfers, and the five boroughs, consult JFK Transportation Options.


text:
Barclays, and bank nationalisation
http://www.guardian.co.uk/business/2008/oct/31/barclay-sovereignwealthfunds
Barclays bosses are paying 16% interest to Middle Eastern sovereign wealth funds to hang onto their bonuses - disgraceful high-risk behaviour (high-risk, because it may commit them to unrepayable debt) strengthening the case for nationalising the banks, as this blog has consistently argued for some time now. Why should Barclays customers -- and the banking system that we all depend on, and that could hardly take another bank tottering -- have to put up with this kind of high-risk profiteering?
posted by Rupert at Friday, October 31, 2008 1 Comments
Caroline Lucas on growth, capitalism & manmade climate change
Caroline Lucas, Green Party Leader, appeared on BBC World Service's One
Planet programme yesterday
alongside psychologist Oliver James and US economist Peter Morici. The
debate centred on capitalism and dangerous climate change, and looked in
detail at
steady state economics.
You can listen again to the programme online at BBC iPlayer at
http://www.bbc.co.uk/iplayer/episode/w0bv189y.
The credit crunch and the climate crunch
http://www.forumforthefuture.org/greenfutures/articles/Zero_hour_for_a_new_capitalism
This piece by Jonathon Porritt does a powerful job of bringing together the climate and credit crunches.
Road deaths scandal: Greens back Parliamentary Report that calls for an end to the "Scandal of Complacency" on road deaths [Media Release]
Eastern Region Green Party is backing a report issued this week by the Parliamentary Transport Select Committee entitled "Ending the Scandal of Complacency: Road Safety beyond 2010".
The Report calls for a much bolder strategy to address road safety calling it the "major public health problem of our age."
As well as the human tragedies involved, the Committee found that the total cost of road crashes in the UK was a staggering £18 billion a year.
Green Party Councillors in Eastern Region and across the country have been active in calling for much better road safety to cut the annual toll of death and injury on the roads and to make roads and pavements much safer for walking and cycling. Greens believe that a safer road environment will encourage and enable people to walk and cycle more who are currently intimidated by traffic volumes and speeds.
Green Councillors in Norwich successfully won backing for a city wide 20mph zone that is to be trialled in three zones of the city from early 2009. In Essex, Green Party Councillors have helped to secure reductions in speed limits on rural roads below the default 60mph limit and are calling for a county wide reduction on all rural roads as part of a review that is currently underway.
Department for Transport figures for 2007 show that 3178 people in Eastern Region were involved in "KSI" road crashes - Killed or Seriously Injured. Of these, 335 people died - an average of almost a death every day on the roads of Eastern Region.
The Transport Committee recommended that local authorities be given more powers to introduce 20mph speed limits, increased enforcement to tackle drink-driving and the creation of a road safety commission.
Cllr. Rupert Read, Prospective Green Party MEP for Eastern Region said:
"We very much agree with the Transport Committee findings. Whilst the number of people killed or seriously injured is reducing, it is totally unacceptable that thousands of people are killed every year, and many more seriously injured.
The MPs are absolutely right to refer to this ongoing car-nage as a scandal. The number of deaths and injuries on our roads far outweighs those in all other transport modes or in other work-related accidents put together. It is not just a failure of transport policy that this continues, but the major public health problem of our age.
"Road crashes affect the poor and the young most and are the largest single cause of death for people between the ages of 5 and 35 in Britain. Not only do we need much higher standards of road safety, we need the Green Party policy of integrated public transport to encourage people to make more use of safer means of transport, including trains and buses."
A Democratic landslide?
People are asking me whether I am still backing McKinney (the Green Party candidate) rather than Obama, for the U.S. Presidency. Here is the answer: I am still much keener on McKinney. But, due to the media etc., her campaign hasn't taken wing as one would hope. And Obama has been rather better over the past couple of months -- the betrayals [detailed in earlier posts ] that occured a little earlier this year seem to have stopped. So:
I wish Obama luck. In a choice between him and McCain (e.g. in 'swing states'), I would now strongly be tempted to vote for him -- and, between the two, I very much hope he wins.
I am going to a 'Election Night' Party next Tuesday night with a bunch of Obamamaniacs: should be fun!
My latest prediction for the U.S Presidency: it will not be close. This will be a Democratic landslide. The biggest Democrat victory since 1964.
The really interesting and important question now is what happens in the Senate. The Democrats could well now squeeze complete control -- i.e. a 60-40 state of play, or better. This would be good news, as it would mean that the Republicans would be thrown into real opposition, unable to sabotage Obama's legislative programme by themselves. An Obama with a relatively free hand and with a mass movement behind him driving him to do the right thing MIGHT just avoid being the enormous disappointment that I have warned previously he is on balance likely to be. . . Perhaps then we might dare to hope, after all...
p.s. The fact that I still like McKinney doesn't of course mean that I am keen on her dalliance with the September 11th conspiracy-theory people. The '9-11 truth movement' has always struck me as a strange and profoundly disappointing phenomenon: its (in my experience generally aggressive and impossible-to-talk-with) advocates think of themselves as radicals and subversives: but what is radical about believing that no group of Arab non-state terrorists could possibly bring off a stunt as extraordinary as the destruction of the World Trade Centre? Sorry to have to say it, but there seems to be not just an embarrassing paranoid belief in the absolute power and competence of states, but also more than a whiff of covert anti-Arab racism about the denial that September 11th was anything other than what it appeared to be: an audacious and terrible coup de theatre pulled off by al-Qaida.
Herman Daly Points The Way Beyond The Credit Crunch...
Check out this brilliant piece by the world's premier green/ecological economist, Herman Daly, commissioned by the Sustainable Development Commission earlier this year: points the way beyond the credit crunch to an economy that actually works for us...
Do spread this word!
http://www.sd-commission.org.uk/publications/downloads/Herman_Daly_thinkpiece.pdf
posted by Rupert at Wednesday, October 29, 2008 0 Comments
Climate Skeptics at large in Parliament
This blog has previously pointed out some of the unbelievably ostrich-like Tories in Parliament, who still don't believe in manmade climate change, even as we get New Orleans re-devastated, and the risk of human civilisational collapse from runaway climate change grows with the melting of the Arctic and the beginnings, terrifyingly, of large-scale methane release.
Check this out: here is a gentleman from the DUP, one Sammy Wilson, making the same garbage arguments, holding up progress on this most vital of all issues:
http://www.theyworkforyou.com/debates/?id=2008-10-28a.733.3#g774.2
In a future post, I will set out some of the appalling UKIP nonsense against manmade climate change. Watch this space...
All these right-wing Parties are alike: you just cannot trust them, to have any climate-sanity...
GREENS POINT OUT OBVIOUS FLAWS TO SHORTSIGHTED REGIONAL PLANNING AUTHORITY, EERA [Media release]
Green Party councillors in the Eastern region have challenged the East of England Regional Assembly (EERA), as it extended its key planning strategy review to 2031. The Green Party are challenging the assumptions and objectives put forward by the EERA that astonishingly ignore the critical advent of diminishing oil reserves, the dramatic loss of current economic confidence, and the onset of dangerous climate change, when forming their forecasts for the region.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
"Regional planning has for too long conformed with wholly unrealistic assumptions handed down by central Government and its agencies. The dramatic economic changes and heightened awareness of the imminence of dangerous climate change afford an opportunity for a radically different perspective on the possible futures for our region", said Suffolk Green Party Councillor John Matthissen, a member of EERA's Housing and Sustainable Communities Panel.
Cllr. Matthissen continued: "The oil does not exist to fuel everlasting growth in road traffic, which the Highways Agency still assumes, nor to power vessels bringing ever more containers into the Haven Ports. Who now believes that house-building projections for this region will be fulfilled, rather than regenerating the communities where houses are decaying as people move to <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />London and the S.E.?"
Cllr. Dr Rupert Read, the Eastern Region Green Party Lead Candidate for the 2009 European elections added:
"The Green Party fully supports the ambitious renewable energy assumptions of the 2021 Plan, and urges that higher percentages of renewable energy are projected for 2031. Recent climate change forecasts imply the loss of farmland and settlements in the region as the sea rises, and a review will need to take this contingency into account, while striving to cut our own emissions and contribution to the problem so as to minimise these losses. The Green New Deal proposed by Caroline Lucas, Green Party Leader, that puts forward a radical but achievable manifesto on how to tackle both the economic and ecological crisis together, can play an essential part in this."
posted by Rupert at Tuesday, October 28, 2008 0 Comments
New Green Councillor in Mid Beds District Council
The Green Party is celebrating gaining another councillor on Mid Beds District Council.
On Saturday, (25th October) Councillor Ken Lynch (Sandy Pinnacle ward) went public with his decision to join the Green Party. He was joined by both local Greens and those from right across the eastern region. They spent the day helping Cllr Lynch let the people of Sandy be the first to hear that their local councillor had become a Green further increasing Green Party representation on Mid Beds District Council.
In the local Green Party's biggest day of campaigning for months thousands of leaflets were delivered to local residents explaining Kens change of party and hundreds of voters were given the chance to talk to Ken about it.
Dr Rupert Read, Lead Green Party Candidate for the Eastern Region European Elections said:
"Greens from across Eastern Region came to Sandy on Saturday, to welcome Ken to the Green Party and help him communicate his reasons for supporting the existing Green Councillor already on Mid-Beds District Council (Gareth Ellis, who became Bedfordshire's first Green Councillor in 2007), and build on the support for the Green Party in Bedfordshire. Greens will be visiting many other parts of the region as the Green Party builds up to the Euro Elections in June 2009, now only a little over 7 months away.
"Spreading the Green message is vital at a time when the society and the planet we live on faces so many threats; not only environmentally but also politically and economically. A bigger Green voice in Europe will be another step towards securing the radical Social and Environmental policies needed to help us navigate our way through the crisis in this century and beyond.
New Green councillor Ken Lynch said:
"Seeing the excellent work of councillor Gareth Ellis, I realise that for the Greens, politics isn't about petty point scoring, it's seeing what's needed and working the political system to get it done."
"Despite the change it will business as usual delivering a personal service to the people of Sandy."
Ken is the voluntary community project worker for both the Biggleswade Monday Youth Club and the Sandy Tuesday Youth Club, he's work on the Skate School has made it a reality. He is chair of the Biggleswade and District Pensioners Association.
Green Cllr Gareth Ellis commented:
"Ken is a very welcome addition to our team, he's not afraid to loudly speak up for those that need it, a persistent fighter who won't ever give up until he's won."
Pictured above: Rupert Read, Ken Lynch, Marc Sheimann (local Euro Election list candidate)
posted by Rupert at Monday, October 27, 2008 2 Comments
RR on THE POLITICS SHOW on BBC1 after noon on Sunday (tomorrow)
I'll be debating dangerous climate change and regional 'development' with Norman Lamb M.P. live on Beeb1, tomorrow lunchtime.
posted by Rupert at Saturday, October 25, 2008 0 Comments
Safeguarding future generations: a tentative suggestion
George Monbiot, writing in the _Guardian_ yesterday, proposes the idea of a '100-year Parliamentary committee' to speak up for the interests of future generations. This idea to end the short-termism of too much politics is helpful, but not [I fear] robust enough to actually safeguard the interests of generations as yet unborn. Here is a tentative suggestion of a more robust alternative: That every major decision made at any level of government should be subject to potential veto by an individual or small group charged exclusively with having regard to the interests of the future inhabitants of this, our one and only planetary home. The name I think it natural to invest these proposed guarantors of the future with would perhaps be congenial to the newspaper that Monbiot writes in: I think that they should be called guardians...
I would welcome comment on this idea. Is it a good one? Or is it too 'out there'?
Let's see what Rupert's readers think...
A more radical and political environmentalism
http://www.guardian.co.uk/environment/2008/oct/21/network
This is a great article. The prescription it seeks is simple. It's called the Green Party...
Victory in Spa Common struggle!
I have just heard the news that the Spa Common planning application that I have blogged about previously has been defeated.
I have been helping out residents with their campaign against this planning application in the North Walsham area -- see http://rupertsread.blogspot.com/2008/08/councillor-read-vows-to-fight-for.html . My assistance has focussed on the transport aspect, which is my expertise -- and which, I am pleased to say, proved the undoing of this application for all those lorries to go down those country lanes.. I spoke about all this at the massive public meeting in North Walsham last month.
Norfolk Highways have made absolutely the right decision in turning down this application from HFS, which would have devastated the lives of those living in Spa Common in particular and much of North Walsham in general. The quality of life of local people has trumped the crude profit motive that lay behind this plan to move so many lorries in and out of this utterly-unsuitable site. This is a good day for local government in Norfolk!
Tackling Climate Change is Route to Creating Jobs in Economic Downturn [Press release]
"This is the wrong time to be watering down climate change agreements"
Rupert Read, Prospective Green Party MEP for Eastern Region, has hit out at European Council attempts to use the financial crisis to water down climate agreements and jeopardise thousands of potential jobs in East Anglia as well as potentially denying people lower fuel bills and cleaner air.
Dr. Read, who is a Norwich City Councillor said
"Efforts by Member States to deliberately dilute proposed EU climate legislation, in terms of both targets and mechanisms, are utterly unacceptable and could harm the future prosperity and energy security of East Anglia.
In March 2007 Ministers agreed that the EU must unilaterally reduce its greenhouse gas emissions by 30% on 1990 levels if a future global climate agreement is reached. They are now calling this commitment into question, as well as trying to undermine EU emissions reductions still further by allowing for a maximum of whatever targets they do agree to be met by offsetting abroad. The British Government is one of the most active on this - further evidence of its double standards on climate change.
As for the precise policies, among many other worrying moves it seems the Council is rowing back on the "polluter pays" principle that's supposed to underpin and incentivise emissions reductions via the Emissions Trading System; and to oppose the idea of ringfencing money raised through emissions trading for climate related purposes both at home and abroad.
This is the wrong time to be watering down climate change agreements. Attempting to use the financial crisis as an excuse to avoid tougher action on climate change is completely misguided.
The Stern report showed clearly the price of not taking action on climate change. The climate crisis is potentially more devastating than even the economic crisis - and ironically, the measures needed to address it are precisely those which could also help avoid a global recession. Strong policies which incentivise wind power, for example, could result in an avoided fuel cost of €20.5 billion across the EU alone by 2020, and provide over 500,000 jobs. East Anglia could be a leading region within Europe on developing renewable energy."
The Green Party is proposing a "Green New Deal", following in the footsteps of Roosevelt's New Deal of the 1930s. The Green New Deal would re-regulate international finance and bring an end to subsidies for polluting energy sources such as coal and nuclear. It would herald a major programme of public and private investments in renewable energy and energy efficiency, generating thousands of green-collar jobs in the process. The Green New Deal is a route to make the transition away from declining fossil fuels and avoid a huge economic downturn at the same time.
__,_._,___
Worst EU Lobbying Awards 2008 -- Vote now!
Worst EU Lobbying Award 2008 – Vote Now at www.worstlobby.eu!
The Green Party is proud of our MEPs' absolutely solid record on exposing dubious lobbying practices. I plan to follow in their footsteps. So, we strongly welcome the chance to vote in the '2008 Worst EU Lobbying Awards' – the annual award for deceptive, manipulative or unethical lobbying.
This year you can vote in two categories:
1. The 'Worst EU Lobbying' Award for the lobbyist, company or lobby group that in 2008 has employed the most deceptive, misleading, or otherwise problematic lobbying tactics in their attempts to influence EU decision-making.
2. The special 'Worst Conflict of Interest' Award for the MEP, Commissioner or Commission official whose background, side-jobs or other liaisons with special interests raise the most serious concerns about their ability to act in public interest.
Select your winners now in both categories and cast your vote at http://www.worstlobby.eu/2008
The nominees for the 2008 Worst EU Lobbying Award are:
* the Agrofuels lobby (MPOC, Unica and Abengoa) – for greenwashing agrofuels;
* European Alliance for Access to Safe Medicine – for hiding the involvement of big pharma;
* European Business and Parliament Scheme – for EP indoors lobbying;
* Gplus and Aspect Consulting – for spreading war propaganda;
* the airline lobby IATA – for deceptions to avoid CO2 reduction obligations.
The nominees for the Worst Conflict of Interest Award are:
* Dr Caroline Jackson MEP – appointed advisor to a waste company;
* Piia-Noora Kauppi MEP – lobbies for her future employer;
* Klaus-Heiner Lehne MEP – doubles as a lawyer;
* Ex-Commission officials Petite, Klotz and Kjølbye – now lobbying for industry;
* DG Trade Director Wenig – slips inside informations to lobbyists.
The candidates were selected out of 54 nominations by citizens and groups from around Europe after thorough scrutiny by the organisers. For more background on the individual candidates, check out http://www.worstlobby.eu. The voting website is available in English and German.
Help us expose the worst lobbying in Brussels and cast your vote at at http://www.worstlobby.eu/2008!
Please spread the news about the awards! Tell your friends via our website or put banners on your websites. Banners can be found here: http://www.foeeurope.org/corporates/banner/wla.html
Online voting closes November 30. The winners will be announced at a ceremony in Brussels on December 9. The Worst EU Lobbying Awards are organised by Corporate Europe Observatory, Friends of the Earth Europe, LobbyControl and Spinwatch.
Earlham families save trees from the axe
Story From Norwich Evening News
Concerned people who live near a new housing development in Earlham have been victorious in safeguarding trees.
Persimmon Homes is currently building a development of 42 three-storey houses on land between Gipsy Lane and Earlham Road.
But the work has already caused controversy after the housing developer felled about 17 trees, angering people living nearby.
Neighbouring families have since been keeping a close eye on progression at the site and recently discovered workers were building what they believed to be a garage close to trees that were subject to a tree preservation order.
Their concerns were initially put to one side but following a series of emails and a meeting with the site manager, the housing developer has vowed it will not do anything to harm these trees.
Gerard Crook, 52, who lives with his partner Denise Denis on Gipsy Lane, said: "I was being a nosy neighbour on the behalf of other residents and what we discovered was that a structure was being set out what appeared to be rather close to our boundary and very close to the trees.
"The site manager said the structure was set out according to the plans but there were no trees on the plans.
"The Green Party then drew my attention to a document that was in the planning agreement that storage of materials was not permitted and that building structure should be at least one metre away from the tree canopies.
"Anyway, the site manager has since told us that there are considering alternative plans for this structure and I'm very pleased that the company is not doing anything that might be harmful to the trees.
"Trees are attractive, natural feature that of looked after and for, can be part of our daily lives. Trees make a contribution to our world and environment and shouldn't be removed unnecessarily."
Rupert Read, Green Party city councillor, said: "I am really glad that I was able to help Gerry and Denise in their successful effort to safeguard these trees, but the real credit must go to them: without their vigilance, I fear that we would have lost these trees."
The property developer got the go ahead to build the houses at the end of July 2007.
Last October, residents claimed that 17 out of the 20 trees that had tree preservation orders (TPOs) on them were chopped down to make way for the development.
However, Persimmon Homes argued that the trees removed from the site had been agreed with city council officers and the city council confirmed that the trees were not protected.
The housing developer was contacted by the Evening News on the latest matter but no one was available to comment.
Bank nationalisation now!
As shares drop further today, and (despite the bail-outs and buy-outs) the banks still won't lend to each other ('LIBOR remains 2% above central bank rates, an unprecedented 'spread') isn't it becoming clearer that, as I've said before on this blog, there is only one real answer: the commercial banks have to be NATIONALISED and/or remutualised (Roughly, my suggestion would be: permanent nationalisations of the 'big four' etc., and permanent remutualisations of the former building-societies). This combined with a new strict and long-term regulatory regime to be introduced soon, might actually do the trick (of preventing a vast financial and economic meltdown). Banks need to be forced to lend, for the public good. There should be more inter-bank lending; more lending to small businesses etc.; and we need to fund a 'Green New Deal' to 'pump-prime' to escape a depression while saving rather than trashing our ecosystems. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
At present, by contrast, money is being destroyed by bank 'hoarding' of bail-out etc. money; there is still, therefore, and incredibly, a liquidity crisis; there is still therefore risk of good sound institutions in both the real and the money economies being taken down. And there is ongoing pressure to trash our ecosystems – look for instance at the looser rules that E.U. member-state governments have this week pressed for on emissions reductions, specifically citing the economic downturn as their reason/justification for this.
The amount we are investing in the banks requires them to be owned by us, as a matter of natural justice and fairness. The amount that they have profiteered by over recent years (vast dividends, bonuses, etc) must never be repeated. The need to have them work in the public good, for the good of the real economy, requires them to be controlled by us.
How long will it be before the world's Governments realise that they need to abandon the remnants of laissez-faire ideology and the fantasy that finance can continue be run on a globalised, privatised, virtually rule-free basis, and actually grab this problem by the scruff of its neck, and take ownership and control of it? This needs to happen soon, or we may never know the answer – because the entire system may collapse completely.
posted by Rupert at Thursday, October 16, 2008 0 Comments
Leading banker explains how the private banks create and destroy money
http://news.bbc.co.uk/today/hi/today/newsid_7673000/7673260.stm
The top-of-the-hour interview on TODAY this morning is essential listening for anyone wishing to understand why the current crisis requires monetary reform (http://www.jamesrobertson.com/book/monetaryreform.pdf ), in order to be truly solved. One of the world's leading bankers tells us how banks create money through lending -- and destroy it (as is happening at present) through not lending. Listen again, and goto just under 5 minutes in.
(I do hope sceptics of monetary reform will be among those who listen to this. When the bankers themselves tell you that what we are saying is true, then you really need to listen...)
UNANSWERED QUESTIONS OVER COUNTY'S PLANS FOR 'GENOME ANALYSIS CENTRE'
[[Media release:]]
UNANSWERED QUESTIONS REMAIN SURROUNDING COUNTY'S PLANS FOR 'GENOME ANALYSIS CENTRE'
After the Norfolk County Council Cabinet's decision on Monday of this week to go ahead with giving £1million to help create a 'Genome Analysis Centre' at the edge of Norwich (although the actual provision of the money is to be delayed, because of the County Council having £32million tied up in shut-down Icelandic banks…), Norfolk Green Party Councillors are asking a whole series of probing questions about the project.
Councillor Rupert Read, 2009 Green Party Euro candidate for the East, questioned whether the scheme represented good value for money for Norfolk Norfolk Council Tax payers:
"Has anyone asked Council Taxpayers whether they want their
council to spend £1 million to support this initiative? Has the Council looked seriously into what other good uses there could be for that money? Has the Council's Economic Development Unit ever consulted with <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />Norfolk taxpayers on which sectors and locations large-value economic investments should be made with by this Council?
"Furthermore, the proposed location is far from most of the new housing that is being built in Norwich; has this plan really been thought through? Is there joined-up thinking going on at the Council over this, or not?"
Green Party County Councillor Andrew Boswell was at the County Council Cabinet meeting yesterday. The following were among the questions that he asked yesterday, to which he did not receive satisfactory replies:
"Other industry sectors and other regions of the County will rightly want to see how this £1million capital expenditure by the Council has been evaluated and prioritised before coming to this meeting today for final sign-off. They will ask 'does this really deliver jobs?', and 'are they the jobs that Norfolk people want?'.
For instance, if Norfolk County Council are funding this, why are they not also funding research into sustainable agriculture, local food supply, organic production, and green jobs in marine/solar/wind sectors which East Anglia is particularly suited to exploit?
"Our information suggests that the record of similar enterprises elsewhere is poor. Has Norfolk County Council researched whether centres like this have actually worked to attract new business and new employment, when they have been created elsewhere?
Green Party Councillors are also asking questions about the Genetic Modification science involved with the GAC project. Cllr. Read asked: "How much of the likely 'spin-off' companies that the Council hopes that this will attract will be doing G.M. science? Has the Council checked with the citizens of Norfolk to see if we are willing to, let along keen on, funding research that may involve the creation of genetically-modified food, 'synthetic biology', crop trials, and so on?"
Norfolk Green Party will be continuing to press for answers to these questions.
The return of state regulation for the public good:My latest piece on Open Democracy
http://www.opendemocracy.net/blog/ourkingdom-theme/rupert-read/2008/10/13/an-epochal-change-on-our-political-culture
The end of the age of 'conservatism'
As Lord Skidelsky has just said on 'The world at one' (listen again at http://www.bbc.co.uk/radio4/news/wato/ ), we are witnessing in short shrift the end of the 'neo-classical' domination of economics, and the end of a 'conservative' (i.e. neo-liberal) domination of economies. Gordon Brown has even called today for a new Bretton Woods!
From the wreckage of the world's financial system, a newly-invigorated visionary green state-led system could arise... That is what we must make happen.
Vindication for those of us who called for nationalisation and taxpayer-representation on bank Boards -- at last, the Government follows our lead
http://www.telegraph.co.uk/finance/financetopics/financialcrisis/3184842/Bank-nationalisation-How-a-bail-out-became-a-buy-out.html
Check out the sub-head to this piece: "October 13, 2008 will go down in history as the day the capitalist system in the UK finally admitted defeat." These are extraordinary days (in fact, the crisis is so fast-moving now, that it would be more accurate to say: 'These are extraordinary hours'...): this blogger's call and then the Green Party's call for the banks to be nationalised -- for no taxation without representation -- have been dramatically vindicated. At last, we the taxpayers are going to get seats on the Boards of banks. At last, banks will be forced to lend to each other, and to their customers, especially small businesses, who are at the moment being either gouged or stonewalled by commercial banks. At last, the obscene profiteering of the banks will be reined in, including dividends and executive bonuses.
I would have preferred a bigger, fuller, more pro-active, earlier nationalisation. As detailed here http://www.independent.co.uk/news/business/analysis-and-features/at-dawn-the-banks-were-back-from-the-brink-958346.html, the 'preference shares' move last week was totally inadequate. If we are to put our money into banks, then we need to be able to exert real control over banks. That is the path that the Government, albeit too tentatively, too piecemeal, and much later than they should have done, has at last embarked upon. I hope that the Government (i.e. us taxpayers) are not over-paying even now for the shares of HBoS and RBS; we may yet rue that a more dramatic total nationalisation has not yet been countenanced.
But what is clear today is: The Thatcherite experiment of finance deregulation has utterly failed. When the _Daily Telegraph_ says, as above, that it is the dawn of a new era of state regulation and control, then you know that something profound has changed in our world...
Face to faith
An important piece by Ann Pettifor of Jubilee 2000, about the spiritual crisis underlying the financial crisis...
http://www.guardian.co.uk/commentisfree/2008/oct/11/globalrecession-marketturmoil
posted by Rupert at Sunday, October 12, 2008 0 Comments
'Green new deal' goes global!
http://www.independent.co.uk/environment/green-living/a-green-new-deal-can-save-the-worlds-economy-says-un-958696.html
This from the IoS today (page 4). A very exciting development -- it appears that Caroline Lucas (one of the 9-strong 'Green New Deal' team http://www.guardian.co.uk/commentisfree/2008/apr/09/wantedagreennewdeal ) has helped initiate a vitally-needed proposal that has now gone global! Could it be that eco-sanity is about to dawn upon the world?
(Though initial impressions suggest that the 'Green Economy Initiative' is somewhat watered-down, compared to the 'Green New Deal' proper that Caroline has proposed.)
A 'Green New Deal' can save the world's economy, says UN
By Geoffrey Lean, Environment Editor
Top economists and United Nations leaders are working on a "Green New Deal" to create millions of jobs, revive the world economy, slash poverty and avert environmental disaster, as the financial markets plunge into their deepest crisis since the Great Depression.
The ambitious plan – the start of which will be formally launched in London next week - will call on world leaders, including the new US President, to promote a massive redirection of investment away from the speculation that has caused the bursting "financial and housing bubbles" and into job-creating programmes to restore the natural systems that underpin the world economy.
It aims to convince them that, far from restricting growth, healing the global environment will be a desperately -needed driving force behind it.
The Green Economy Initiative - which will be spearheaded by the United Nations Environment Programme (UNEP), headquartered here, and is already being backed by governments – draws its inspiration from Franklin Roosevelt's New Deal, which ended the 1930s depression and helped set up the world economy for the unprecedented growth of the second half of the 20th century.
It, too, envisages basing recovery on providing work for the poor, as well as reform of financial practices, after a crash brought on by unregulated excesses of the free market and the banking system.
The new multimillion dollar initiative – which is being already funded by the German and Norwegian Governments and the European Commission – arises out of a study commissioned by world leaders at the 2006 G8 summit into the economic value of ecosystems. It argues that the world is caught up in not one, but three interlinked crises, with the food and fuel crunches accompanying and intensifying the financial one.
Soaring prices of grain and oil, it stresses, have stemmed from outdated economic priorities that have concentrated on short term exploitation of the world's resources, without considering how they can be used to sustain prosperity in the long term. Over the last quarter of a century, says UNEP, world growth has doubled, but 60 per cent of the natural resources that provide food, water, energy and clean air have been seriously degraded.
Achim Steiner, UNEP's Executive Director, adds that new research shows that every year, for example the felling of forests deprives the world of over $2.5 trillion worth of such services in supplying water, generating rainfall, stopping soil erosion, cleaning the air and reducing global warming . By comparison, he points out, the global financial crisis is so far estimated to have cost the world the smaller one-off sum of $1.5 trillion.
"We are pushing, if not pushing past, the limits of what the planet can sustain," he says. "If we go on as we are today's crisis will seem mild indeed compared to the crises of tomorrow".
Switching direction and concentrating on 'green growth', he says, will not only prevent such catastrophes, but rescue the world's finances. "The new, green economy would provide a new engine of growth, putting the world on the road to prosperity again. This is about growing the world economy in a more intelligent, sustainable way.
"The 20th century economy, now in such crisis, was driven by financial capital. The 21st century one is going to have to be based on developing the world's natural capital to provide the lasting jobs and wealth that are needed, particularly for the poorest people on the planet"
He says for example, that it makes more sense to invest in preserving forests, peatlands and soils, which naturally absorb carbon dioxide, than destroying them and then developing expensive technology to do the job.
He points out that the world market for environmental goods and service already stands at $1.3 trillion and is expected to double over the next 12 years even on present trends, and adds. "There is an enormous opportunity to ride on this increasing global demand for environmental improvement and turn it into the driver of economic growth, job creation and poverty reduction that is now so desperately needed. And in some places it is already beginning to happen."
Mr Steiner will launch the initiative in London a week on Wednesday, October 22nd, with the announcement of three projects, concentrating on how investing in the world's natural systems, in renewable energy and in other green technologies would stimulate growth and provide jobs, and giving examples of where it is already taking place.
He will describe, for example, how Mexico is now employing 1.5 million people to plant and manage forests, how China has created the world's biggest solar energy industries from scratch in just a few years, and how Germany has leapt from being a laggard to a leader in renewable energy by giving people attractive incentives to install it in their home.
Pavan Sukhdev, the chair of Deutschbank's Global Market Centre, who is leading the initiative, says: "Hundreds of millions of jobs can be created, there is no question that traditional industries like steel and cars cannot provide them. But this is a really huge business opportunity."
Cllr. Rupert Read, prospective Green Party MEP for Eastern Region...
Check my GUARDIAN articles: http://commentisfree.guardian.co.uk/rupert_read/index.html
Goto www.oneworldcolumn.org to read my regular columns in the EASTERN DAILY PRESS newspaper, East Anglia's leading regional daily.
Support my campaign to become an MEP? Then please JOIN MY FACEBOOK GROUP for this!: http://www.facebook.com/pages/Rupert-Read/9128762052
I MICRO-BLOG at: http://twitter.com/RupertRead
[My blogs, http://www.opendemocracy.net/blog/rupert_read & http://rupertsread.blogspot.com/ ]
The Rooseveltian moment
The Darling rescue plan is a half-baked start, probably better than nothing, although not a lot. Its proposal of an option of part-nationalisation of any and all commercial banks is an attempt by the Government to step in the right direction, although it is absurd that vast amounts more of taxpayers' money should be potentially going into the banks without giving us any control over them. Without such control, there is absolutely no guarantee that they will start lending to businesses or to each other.
And so this begs the further crucial question: Why should such a nationalisation be only temporary? Why should we allow commercial banks to profit rampantly in the good times, and sooner or later start speculating again, pushing the envelope, ramping up the risks and precipitating fresh bubbles or crises?
We need fundamental reform of the banking system, to stop crises like this from ever re-occuring. The current proposals alone will never be long-term safe, because after a while a privatised banking system will start agitating and pushing to strip away and circumvent the protections and regulations.
So isn't what we really need to seize the moment to permanently eliminate the spectre of private banking profiteering and excessive risk-taking? The only sustainable banking system is a banking system that strips out the private commercial profit motive. We should, it now seems to me, have a banking system consisting of a huge public sector that is democratically directed toward a sustainable economy, with low interest-rates, plus a network of co-ops, mutuals and credit unions, to ensure diversity in the banking system.
Truly, it is time for a new Rooseveltian moment, and more. Or else the prognosis will be grim. I am angry about the casino-mentality which has got us into this hole; and the massive scale and truly fundamental nature of the shift needed to get us out of it is clear... This is the new era of strong government regulation and of public ownership and control. The New Labour and Tory light-touch deregulatory neoliberal approaches are, by contrast, LITERALLY bankrupt...
The U.S. conservatives get desperate
http://www.guardian.co.uk/world/2008/oct/11/uselections2008-johnmccain1
Check out this article by the excellent Michael Tomasky, on just how bad and nasty things are now getting in the lower echelons of the McCain-Palin campaign...
Caroline Lucas on the Darling Plan
Please read the following excellent article by the Green Leader, Caroline Lucas MEP. Her message is 100% correct - NO TAXATION WITHOUT REPRESENTATION (ON THE BOARD)..!
BAILOUT: TAXPAYERS' MONEY SHOULD MEAN TAXPAYERS' CONTROL
The Green Party has criticised Alistair Darling's £50bn bailout for offering public funds to banking giants without demanding any public control in return. The preference shares the Treasury will receive in the deal confer no voting rights, and the Green leader, Caroline Lucas MEP, argues that taxpayers should not be expected to provide a cash bailout without receiving in return the voting power to alter those banking practices that are the cause of the crisis......(continues)
GREEN EURO CANDIDATE EXTENDS LOCAL BUSINESS SUPPORT AT 'FEDERATION OF SMALL BUSINESSES' DINNER IN CAMBRIDGE
NEWS RELEASE: GREEN EURO CANDIDATE EXTENDS LOCAL BUSINESSES SUPPORT AT 'FEDERATION OF SMALL BUSINESSES' DINNER
Norwich Councillor Rupert Read, prospective Green Party MEP for the East, will be attending a dinner this Thursday evening hosted in Cambridge by the Federation of Small Businesses, continuing the Green Party's strong support of local businesses throughout the region and around the country. The FSB represents 18,500 small business owners across the East of England, supporting local trade in the face of local-economy crippling giant multinational corporations and supermarkets. The FSB invitation is a sign of how seriously small businesses take Cllr. Read's chances of being elected next summer.
Councillor Read said
"I'm especially happy to have been invited along to the FSB dinner, an organisation that I support wholeheartedly. Local businesses strengthen the economy of a community by creating jobs, recycling money back into the area, providing consumer choice and competition and investing in local infrastructure.
"The Green Party are the only political Party that opposes the multinational takeover of our towns and cities and actively supports local businesses from European to the council level. Green Party leader Caroline Lucas MEP is forcing the EU to investigate unfair supermarket domination of our streets and demanding tough new rules to protect producers, small businesses and rural economies (1), while 2008 London Mayoral candidate Siån Berry was endorsed and supported by the London branch of the FSB during the Mayoral campaign (2).
"If elected next June, I will join Caroline Lucas and the European Greens in the EU in fighting to support local business around the region and standing up to giant, bullying supermarkets."
1. http://www.greenparty.org.uk/news/2657
2. http://london.greenparty.org.uk/news/682
Green Party letters in yesterday's IoS
Start off with Jenny Jones's, and then scroll down a few for mine...
24 Hours to green Europe's future...
THIS FROM THE SPLENDID PEOPLE AT AVAAZ -- DO FOLLOW THEIR LEAD HERE!
It is crucial that this vote goes the right way -- I want to be an MEP in a Europe that is leading on the prevention of manmade climate change, not lagging behind!...
...Far from the eyes of the media, elected representatives in the European Parliament are writing a climate and energy plan for our continent. As citizens, we've campaigned hard for a global deal to stop catastrophic global warming, and Europe's negotiators have driven progress in international talks -- but if big polluters succeed in watering down Europe's own climate action plan, all our momentum will be lost.[1] And that's just what's happening right now.
This Tuesday afternoon -- that's tomorrow! --, European parliamentarians are gathering to finalise their proposals -- but the whole plan is being undermined by industry lobbyists demanding they lock in massive "permits to pollute", which would put emissions targets completely out of reach for 2020 and beyond.[2] Before it's too late, in the next 24 hours, let's deluge representatives from our own countries with emails and phone calls -- urging them not to give in to the lobbyists, and instead to put forward strong plans to build a sustainable future for our societies, showing the world the way forward.
Just click the link below to see the names and phone numbers of the representatives from your own country -- we've added a few "talking points" you can use in your emails and phone calls.
Palin's incoherence on dangerous climate change
Sarah Palin's answer here is terrifying in its ineptitude and in its mumbo-jumbo quasi-denial of anthropogenic climate change. Biden's answer is of course better, but hardly inspirational: note his backing for 'clean' coal, 'safe' nuclear and 'renewable' biofuels -- pass the sick-bag, please...
Palin's come-back line is perhaps even more terrifying: "Drill baby drill", she says. If only she could see the future children whose faces she stamps on, in gleefully saying this...
The McGarahan murder - a reflection
Those who perpetrated this violent act are of course to be condemned thoroughly and the police to be encouraged in their ongoing work of bringing the perpetrators to justice.
Mr. McGarahan's murder is symptomatic of a society which has in some cases grown selfish and materialistic in its prosperity. The greatest honour we could pay the courageous Mr. McGarahan is to prevent similar tragedies ever happening again.
To prevent incidents like this re-occurring we need to examine just why a group of adults in a reasonably wealthy society should feel the need to quasi-randomly beat another man to death. This awful event makes plain how strong is the need for a change from a selfish, materialistic, Thatcherite society to one that is more caring, compassionate and peaceful, and where we treat each other as neighbours and not as a competitive threat. We surely need to look at how to change our society itself so that events like this no longer blight the towns and streets of East Anglia.
The roots of the B&B fiasco...
I can't get over the fact that Bradford and Bingley were still this week parading the bowler-hatted advertising icons around on TV, even while it was obvious to all that they had quite shamefully shredded their supposed reputation for sobriety and reliability...
How about this conversation 'from the archives'...:
"Let's demutualise, Mr. Bradford."
"A capital idea, Mr. Bingley. It will deliver us lots of cash and an exciting new business-plan..."
"And with our solid and bankable reputation, how can it possibly go wrong, Mr. Bradford..."
Green Politics and Green Philosophy
The first in this year's series of Philosophy Public Lectures, on the theme of PHILOSOPHERS AND PUBLIC LIFE
Rupert Read
'Green Politics and Green Philosophy'
7pm, Thursday 16 October 2008
UEA Norwich Lecture Theatre 3
Free admission. All are welcome. Spread the word!
D J Taylor in the _Indy_: 'All roads lead to the A11'
A nice piece here by the Sage of Norwich on the A11 lobby and on Norwich 'Growth Area' housing:
http://www.independent.co.uk/opinion/commentators/d-j-taylor-all-roads-lead-to-the-a11-944647.html
INDEPENDENT ON <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />SUNDAY 28 SEPTEMBER 2008
D J Taylor: 'All roads lead to the A11'<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
The Bottom Line: Our commentator scours the world of news, entertainment and sport to answer the question: what was that all about? His conclusion – we're all being used
* The pageant of vested interests, pundits and ginger-group spokesmen that habitually comes together to promote social or economic change is particularly noticeable at a local level, where the levers of power are more accessible and the policy forums more direct. Here in the Norfolk boondocks, the newspapers have been in a tremendous lather about the long-standing campaign to dual-carriage the A11, the principal conduit between East Anglia and the Home Counties. Politicians have signed up, a hundred businessmen had their names printed in the 'Eastern Daily Press', and the general implication was that anyone not keen on the inevitable "economic benefits" the scheme would bring was a sort of futile half-wit. Doubtless at some point – a very remote point, you imagine – and at vast public and environmental expense, the A11 will be dualled, but it will not be because anyone asked the local people if they wanted it done.
It is the same with the Norfolk Development Plan, the subtext of whose literature might be interpreted as: we are going to build a lot of houses, but we are obliged to pretend to consult with you first. The houses will be built, of course, for there is no box to tick for those who don't want them.
Just occasionally, the public strikes back. I remember watching the results of the general election of 2001 come through in the two Oldham constituencies and seeing the expression of horror on the face of Michael Meacher MP when it was revealed that 10,000 people had voted for the BNP candidates. It was a scandal, Meacher declared. The real scandal was that 10,000 people had so little confidence in the democratic system that they ended up voting for some fascist goblin.
But the expression of a genuinely popular opinion – whether from electors, football fans or American taxpayers – tends to scare those in authority stiff, to the point where you begin to question how the authority came to be there in the first place, and how it might be taken away.
BBC Blog: Will the Green Party ever be taken seriously? Of course!
This is quite interesting:
http://blog.bbcgreen.com/2008/09/29/will-the-green-party-ever-be-taken-seriously
Remember that once upon a time the Labour Party were a single-issue Party
(they were only 'for the workers'; they had 'nothing to say' about foreign
issues, about the land, about the family; etc.); and it took just one
generation for them to go from having no MPs to forming their first
We are already taken very seriously in the Brussels Parliament, where I aim
to represent Eastern Region next year; for there, we are a major political
And we are taken dead seriously in places like Norwich City Council, where
we will soon be the largest Party (if they don't abolish it...). When people
get the chance to vote for a Green Party that is going places, they go with
Next stop (for the Party): Westminster!
Another reflection on last night's Council meeting
Anyone interested in the realities of what being a LibDem, Labour or Conservative tends to boil down to in contemporary Britain should have sat in Norwich City Council Chamber last night, as Councillors from these Parties formed a mutual admiration society and wallowed in negative rhetoric against us for daring to oppose one of their pet road-building projects. See my previous post on this, here:
http://rupertsread.blogspot.com/2008/10/dont-be-dinosaur-beyond-main-3-parties.html
All the three grey Parties are tacitly committed to the same ideology, of endless industrial growth, of worshipping at the shrine of big business and big money -- of neoliberal globalisation. I wish they understood that this was / is an ideology, rather than being under the silly illusion that they are 'pragmatic', 'sensible', etc.
I feel sadness that these dinosaurs are leading the world into perdition and oblivion. But I hope and believe that the people will have the good sense to move their allegiance away from them, in time.
Don't be a dinosaur: beyond the 'main 3' Parties...
Last night's sad debate at Norwich City Council between the Dinosaur Party
(the 'Conservatives'), the Sub-Dinosaur Party (the 'Liberal Democrats') and
the New-Dinosaurs Party ('New Labour') on the one side and the Green Party
on the other, over the dualling of the A11, brought home to me how very far
the various out-of-date grey Parties, dinosaurs that they are to a person, have
to go before they realise that sustainability and being green is more than a
fad or a coat of paint or a minor add-on. None of these Parties understand
the _big_ changes that need to be made if we are to have a liveable planet
for our grandchildren. None of them realise either how the things that they
are championing are actively making things worse in terms of quality of
life, now: making us hyper-mobile and more stressed, less rooted in a real community,
living amidst more noise and pollution, less healthy, with fewer vibrant small businesses and more
Tesco-isation and 'clone towns'...
The dualling of the A11 is being pushed by big business interests. By
various varieties of dinosaurs. And most tragically of all (and this is
directly relevant to the Party Conference that, as I write, is preparing to
wind down): 'Conservatism' is simply incoherent. One must choose between
conserving good things as they are and simply letting the 'free market' rip.
One must choose between conservation and road-building. One must choose
between spending one's money on good planning and localisation and public
transport on the one hand and creating a virtual motorway between London and
Norwich on the other.
It is the height of immaturity to pretend otherwise. Kids love dinosaurs,
but eventually they grow out of it...
Green Party lead candidate helps hand in 14k petition this Friday, to save Fritton Wood!
I will be among a substantial group presenting a petition of about 14,000 signatures to officials at County Hall, this Friday afternoon, to save Fritton Woods:
Entrance to COUNTY HALL,
Martineau Lane,
Norwich, United Kingdom.
Fritton Wood is far too precious to lose to quarrying for aggregates, which is what the County is potentially planning for it. This is a superb landscape in the Broads area -- there is no way that Fritton should be used up and thrown away in this way. I am proud to be one of the huge number of petitioners who are standing firm against this plan.
Come and join me!
Green Euro Candidate says, 'keep Hinchingbrooke public!'
'Keep Hinchingbrooke Hospital public,' was the message from the Green Party's prospective MEP for this region on a visit to Huntingdon.
Rupert Read backed calls to stop the hospital being made into a Foundation Trust as he joined local party members leafleting homes in Hartford on Sunday (28.9.08).
He said: "Foundation Trusts are simply privatisation under a prettier name. 'New Labour' has continued and accelerated the Conservative betrayal of our National Health Service, privatising it bit by bit while pretending to support it.
"Only the Green Party can be trusted to stop this. If I am elected to the European Parliament next June, to represent this area, you can be confident that I will do all in my powers to keep our hospitals in public hands, free and open to all.
"The Greens say: Keep public services public!"
Members of the Hunts Green Party will be joining a Keep Our NHS Public, rally and march on October 4th, called to protest against the possible privatisation of Hinchingbrooke Hospital.
posted by Pablo at Wednesday, October 01, 2008 1 Comments
1. 2. 3. Rupert's Read: October 2008 4. 12. 15. 18. 19.

redpajama_set_name: RedPajamaCommonCrawl