text:
using media_audio_pulse::kModulePulse;
using media_audio_pulse::InitializeStubs;
using media_audio_pulse::StubPathMap;
#endif  // defined(DLOPEN_PULSEAUDIO)

namespace media {

using pulse::AutoPulseLock;
using pulse::WaitForOperationCompletion;

// Maximum number of output streams that can be open simultaneously.
static const int kMaxOutputStreams = 50;

// Define bounds for the output buffer size.
static const int kMinimumOutputBufferSize = 512;
static const int kMaximumOutputBufferSize = 8192;

// Default input buffer size.
static const int kDefaultInputBufferSize = 1024;

#if defined(DLOPEN_PULSEAUDIO)
static const base::FilePath::CharType kPulseLib[] =
    FILE_PATH_LITERAL("libpulse.so.0");
#endif

AudioManagerPulse::AudioManagerPulse(
    scoped_refptr<base::SingleThreadTaskRunner> task_runner,
    scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner,
    AudioLogFactory* audio_log_factory)
    : AudioManagerBase(std::move(task_runner),
                       std::move(worker_task_runner),
                       audio_log_factory),
      input_mainloop_(NULL),
      input_context_(NULL),
      devices_(NULL),
      native_input_sample_rate_(0),
      native_channel_count_(0) {
  SetMaxOutputStreamsAllowed(kMaxOutputStreams);
}

AudioManagerPulse::~AudioManagerPulse() {
  Shutdown();
  // The Pulse objects are the last things to be destroyed since Shutdown()
  // needs them.
  DestroyPulse();
}

bool AudioManagerPulse::Init() {
  // TODO(alokp): Investigate if InitPulse can happen on the audio thread.
  // It currently needs to happen on the main thread so that is InitPulse fails,
  // we can fallback to ALSA implementation. Initializing it on audio thread
  // would unblock the main thread and make InitPulse consistent with
  // DestroyPulse which happens on the audio thread.
  return InitPulse();
}

// Implementation of AudioManager.
bool AudioManagerPulse::HasAudioOutputDevices() {
  AudioDeviceNames devices;
  GetAudioOutputDeviceNames(&devices);
  return !devices.empty();
}

bool AudioManagerPulse::HasAudioInputDevices() {
  AudioDeviceNames devices;
  GetAudioInputDeviceNames(&devices);
  return !devices.empty();
}

void AudioManagerPulse::ShowAudioInputSettings() {
#if defined(USE_ALSA)
  AudioManagerAlsa::ShowLinuxAudioInputSettings();
#endif
}

void AudioManagerPulse::GetAudioDeviceNames(
    bool input, media::AudioDeviceNames* device_names) {
  DCHECK(device_names->empty());
  DCHECK(input_mainloop_);
  DCHECK(input_context_);
  AutoPulseLock auto_lock(input_mainloop_);
  devices_ = device_names;
  pa_operation* operation = NULL;
  if (input) {
    operation = pa_context_get_source_info_list(
      input_context_, InputDevicesInfoCallback, this);
  } else {
    operation = pa_context_get_sink_info_list(
        input_context_, OutputDevicesInfoCallback, this);
  }
  WaitForOperationCompletion(input_mainloop_, operation);

  // Prepend the default device if the list is not empty.
  if (!device_names->empty())
    device_names->push_front(AudioDeviceName::CreateDefault());
}

void AudioManagerPulse::GetAudioInputDeviceNames(
    AudioDeviceNames* device_names) {
  GetAudioDeviceNames(true, device_names);
}

void AudioManagerPulse::GetAudioOutputDeviceNames(
    AudioDeviceNames* device_names) {
  GetAudioDeviceNames(false, device_names);
}

AudioParameters AudioManagerPulse::GetInputStreamParameters(
    const std::string& device_id) {
  int user_buffer_size = GetUserBufferSize();
  int buffer_size = user_buffer_size ?
      user_buffer_size : kDefaultInputBufferSize;

  // TODO(xians): add support for querying native channel layout for pulse.
  UpdateNativeAudioHardwareInfo();
  return AudioParameters(AudioParameters::AUDIO_PCM_LOW_LATENCY,
                         CHANNEL_LAYOUT_STEREO, native_input_sample_rate_, 16,
                         buffer_size);
}

AudioOutputStream* AudioManagerPulse::MakeLinearOutputStream(
    const AudioParameters& params,
    const LogCallback& log_callback) {
  DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format());
  return MakeOutputStream(params, AudioDeviceDescription::kDefaultDeviceId);
}

AudioOutputStream* AudioManagerPulse::MakeLowLatencyOutputStream(
    const AudioParameters& params,
    const std::string& device_id,
    const LogCallback& log_callback) {
  DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format());
  return MakeOutputStream(params, device_id.empty()
                                      ? AudioDeviceDescription::kDefaultDeviceId
                                      : device_id);
}

AudioInputStream* AudioManagerPulse::MakeLinearInputStream(
    const AudioParameters& params,
    const std::string& device_id,
    const LogCallback& log_callback) {
  DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format());
  return MakeInputStream(params, device_id);
}

AudioInputStream* AudioManagerPulse::MakeLowLatencyInputStream(
    const AudioParameters& params,
    const std::string& device_id,
    const LogCallback& log_callback) {
  DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format());
  return MakeInputStream(params, device_id);
}

AudioParameters AudioManagerPulse::GetPreferredOutputStreamParameters(
    const std::string& output_device_id,
    const AudioParameters& input_params) {
  // TODO(tommi): Support |output_device_id|.
  VLOG_IF(0, !output_device_id.empty()) << "Not implemented!";

  int buffer_size = kMinimumOutputBufferSize;
  int bits_per_sample = 16;

  // Query native parameters where applicable; Pulse does not require these to
  // be respected though, so prefer the input parameters for channel count.
  UpdateNativeAudioHardwareInfo();
  int sample_rate = native_input_sample_rate_;
  ChannelLayout channel_layout = GuessChannelLayout(native_channel_count_);

  if (input_params.IsValid()) {
    bits_per_sample = input_params.bits_per_sample();
    channel_layout = input_params.channel_layout();
    buffer_size =
        std::min(kMaximumOutputBufferSize,
                 std::max(buffer_size, input_params.frames_per_buffer()));
  }

  int user_buffer_size = GetUserBufferSize();
  if (user_buffer_size)
    buffer_size = user_buffer_size;

  return AudioParameters(AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout,
                         sample_rate, bits_per_sample, buffer_size);
}

AudioOutputStream* AudioManagerPulse::MakeOutputStream(
    const AudioParameters& params,
    const std::string& device_id) {
  DCHECK(!device_id.empty());
  return new PulseAudioOutputStream(params, device_id, this);
}

AudioInputStream* AudioManagerPulse::MakeInputStream(
    const AudioParameters& params, const std::string& device_id) {
  return new PulseAudioInputStream(this, device_id, params,
                                   input_mainloop_, input_context_);
}

void AudioManagerPulse::UpdateNativeAudioHardwareInfo() {
  DCHECK(input_mainloop_);
  DCHECK(input_context_);
  AutoPulseLock auto_lock(input_mainloop_);
  pa_operation* operation = pa_context_get_server_info(
      input_context_, AudioHardwareInfoCallback, this);
  WaitForOperationCompletion(input_mainloop_, operation);
}

bool AudioManagerPulse::InitPulse() {
  DCHECK(!input_mainloop_);

#if defined(DLOPEN_PULSEAUDIO)
  StubPathMap paths;

  // Check if the pulse library is avialbale.
  paths[kModulePulse].push_back(kPulseLib);
  if (!InitializeStubs(paths)) {
    VLOG(1) << "Failed on loading the Pulse library and symbols";
    return false;
  }
#endif  // defined(DLOPEN_PULSEAUDIO)

  // Create a mainloop API and connect to the default server.
  // The mainloop is the internal asynchronous API event loop.
  input_mainloop_ = pa_threaded_mainloop_new();
  if (!input_mainloop_)
    return false;

  // Start the threaded mainloop.
  if (pa_threaded_mainloop_start(input_mainloop_))
    return false;

  // Lock the event loop object, effectively blocking the event loop thread
  // from processing events. This is necessary.
  AutoPulseLock auto_lock(input_mainloop_);

  pa_mainloop_api* pa_mainloop_api =
      pa_threaded_mainloop_get_api(input_mainloop_);
  input_context_ = pa_context_new(pa_mainloop_api, "Chrome input");
  if (!input_context_)
    return false;

  pa_context_set_state_callback(input_context_, &pulse::ContextStateCallback,
                                input_mainloop_);
  if (pa_context_connect(input_context_, NULL, PA_CONTEXT_NOAUTOSPAWN, NULL)) {
    VLOG(1) << "Failed to connect to the context.  Error: "
            << pa_strerror(pa_context_errno(input_context_));
    return false;
  }

  // Wait until |input_context_| is ready.  pa_threaded_mainloop_wait() must be
  // called after pa_context_get_state() in case the context is already ready,
  // otherwise pa_threaded_mainloop_wait() will hang indefinitely.
  while (true) {
    pa_context_state_t context_state = pa_context_get_state(input_context_);
    if (!PA_CONTEXT_IS_GOOD(context_state))
      return false;
    if (context_state == PA_CONTEXT_READY)
      break;
    pa_threaded_mainloop_wait(input_mainloop_);
  }

  return true;
}

void AudioManagerPulse::DestroyPulse() {
  if (!input_mainloop_) {
    DCHECK(!input_context_);
    return;
  }

  {
    AutoPulseLock auto_lock(input_mainloop_);
    if (input_context_) {
      // Clear our state callback.
      pa_context_set_state_callback(input_context_, NULL, NULL);
      pa_context_disconnect(input_context_);
      pa_context_unref(input_context_);
      input_context_ = NULL;
    }
  }

  pa_threaded_mainloop_stop(input_mainloop_);
  pa_threaded_mainloop_free(input_mainloop_);
  input_mainloop_ = NULL;
}

void AudioManagerPulse::InputDevicesInfoCallback(pa_context* context,
                                                 const pa_source_info* info,
                                                 int error, void *user_data) {
  AudioManagerPulse* manager = reinterpret_cast<AudioManagerPulse*>(user_data);

  if (error) {
    // Signal the pulse object that it is done.
    pa_threaded_mainloop_signal(manager->input_mainloop_, 0);
    return;
  }

  // Exclude the output devices.
  if (info->monitor_of_sink == PA_INVALID_INDEX) {
    manager->devices_->push_back(AudioDeviceName(info->description,
                                                 info->name));
  }
}

void AudioManagerPulse::OutputDevicesInfoCallback(pa_context* context,
                                                  const pa_sink_info* info,
                                                  int error, void *user_data) {
  AudioManagerPulse* manager = reinterpret_cast<AudioManagerPulse*>(user_data);

  if (error) {
    // Signal the pulse object that it is done.
    pa_threaded_mainloop_signal(manager->input_mainloop_, 0);
    return;
  }

  manager->devices_->push_back(AudioDeviceName(info->description,
                                               info->name));
}

void AudioManagerPulse::AudioHardwareInfoCallback(pa_context* context,
                                                  const pa_server_info* info,
                                                  void* user_data) {
  AudioManagerPulse* manager = reinterpret_cast<AudioManagerPulse*>(user_data);

  manager->native_input_sample_rate_ = info->sample_spec.rate;
  manager->native_channel_count_ = info->sample_spec.channels;
  pa_threaded_mainloop_signal(manager->input_mainloop_, 0);
}

}  // namespace media


text:
<?php

/**
 * @namespace
 */
namespace Solarium\Core\Event;

use Symfony\Component\EventDispatcher\Event;
use Solarium\Core\Query\QueryInterface;
use Solarium\Core\Client\Response;
use Solarium\Core\Query\Result\ResultInterface;

/**
 * PreCreateResult event, see Events for details
 */
class PreCreateResult extends Event
{
    /**
     * @var QueryInterface
     */
    protected $query;

    /**
     * @var Response
     */
    protected $response;

    /**
     * @var ResultInterface
     */
    protected $result;

    /**
     * Event constructor
     *
     * @param QueryInterface $query
     * @param Response       $response
     */
    public function __construct(QueryInterface $query, Response $response)
    {
        $this->query = $query;
        $this->response = $response;
    }

    /**
     * Get the query object for this event
     *
     * @return QueryInterface
     */
    public function getQuery()
    {
        return $this->query;
    }

    /**
     * Get the response object for this event
     *
     * @return Response
     */
    public function getResponse()
    {
        return $this->response;
    }

    /**
     * Get the result object for this event
     *
     * @return ResultInterface
     */
    public function getResult()
    {
        return $this->result;
    }

    /**
     * Set the result object for this event, overrides default execution
     *
     * @param  ResultInterface $result
     * @return void
     */
    public function setResult($result)
    {
        $this->result = $result;
    }
}

redpajama_set_name: RedPajamaGithub


text:
<!doctype html>

	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="robots" content="noindex, nofollow">

  <title>Book club favourites #1 – Suffolk Libraries</title>

  <link rel="stylesheet" href="/css/style.css">
	<link rel="preload" as="font" type="font/woff2" href="/fonts/source-sans-pro-v11-latin-regular.woff2">
	<link rel="preload" as="font" type="font/woff2" href="/fonts/source-sans-pro-v11-latin-italic.woff2">
	<link rel="preload" as="font" type="font/woff2" href="/fonts/source-sans-pro-v11-latin-700.woff2">

Skip to content

Skip to navigation menu

💳 You can now pay online.
	Pay charges now →

Donate

Join

Login

Search

Home

eLibrary

Online events

Help

Contact

    Home

      → New suggestions

      → Book club

      → Book club favourites #1

Book club favourites #1

  Written by Brandon King · Published Mar 14, 2014

Caleb's crossing by Geraldine Brooks

Martha's Vineyard, 1650s: Bethia Mayfield is a young girl growing up in the tiny settlement of Great Harbor, amid a small band of pioneers and Puritans. Restless, bright and curious, but denied the education that her brothers receive, she slips away as often as she can to explore the island's wild landscapes and observe its native Wampanoag inhabitants. At the age of twelve, she encounters Caleb, the young son of a chieftain, and the children form a secret friendship that gradually draws each into the alien world of the other.

The death of the heart by Elizabeth Bowen

Set amongst London's fashionable high society in the late 1930's, Bowen's admired novel is a haunting depiction of innocence lost and a subtle blend of comedy and tragedy.

The Rosie project by Graeme Simsion

Meet Don Tillman. Don is getting married. He just doesn't know who to yet. But he has designed a very detailed questionnaire to help him find the perfect woman. One thing he already knows, though, is that it's not Rosie. Absolutely, completely, definitely not.

Stoner by John Williams

The son of a midwestern farmer, William Stoner comes to the University of Missouri in 1910 to study agriculture. Stoner tells of love and conflict, passion and responsibility against the backdrop of academic life in the early 20th century.

The secret history by Donna Tartt

Under the influence of their charismatic classics professor, a group of clever, eccentric misfits at an elite New England college discover a way of thinking and living that is a world away from the humdrum existence of their contemporaries. But when they go beyond the boundaries of normal morality their lives are changed profoundly and for ever.

Wonder by R J Palacio

Born with a terrible facial abnormality, Auggie has been home-schooled by his parents his whole life. Now, for the first time, he's being sent to a real school – and he's dreading it. All he wants is to be accepted – but can he convince his new classmates that he's just like them, underneath it all?

The light between oceans by M L Stedman

A boat washes up on the shore of a remote lighthouse keeper's island. It holds a dead man and a crying baby. The two islanders, Tom and his wife Izzy are about to make a devastating decision.

The interestings by Meg Wolitzer

On a warm July night in 1974, six teenagers play at being cool. The friendships they make this summer will be the most important of their lives. But decades later not everyone can sustain in adulthood what had seemed so special in adolescence. As their fortunes tilt precipitously over the years, some of them dealing with great struggle, others enjoying wealth and success, friendships are put under the strain of envy and crushing disappointment against the backdrop of a changing America.

The Burgess boys by Elizabeth Strout

Haunted by the freak accident that killed their father when they were children, Jim and Bob Burgess escaped from their hometown for New York City as soon as they possibly could. Jim, a sleek, successful corporate lawyer, has belittled his bighearted brother their whole lives, and Bob, a legal aid attorney who idolises Jim, has always taken it in his stride. But their long-standing dynamic is upended when their sister, Susan – the sibling who stayed behind – urgently calls them home.

Defending Jacob by William Landay

When a boy is discovered dead in the woods, a wave of shock ripples through the community of Newton, outside of Boston. Assistant DA Andy Barber is used to dealing with murder, but when evidence emerges that ties his son Jacob to the crime, Andy faces a very different challenge: preventing his son from being convicted of murder.

The art of falling by Kathryn Craft

Penelope Sparrow, a 28-year-old dancer, has spent her entire life focusing on the perfection of her body. But when she wakes up in a Philadelphia hospital unable to move after a near-fatal accident, she can't remember the events leading up to her crushing 14-story fall. Now, with a second chance at life, Penny must find a way to reconnect with her past and come to terms with the limitations of her body.

Ammonites and leaping fish: a life in time by Penelope Lively

Taking in old age, the context of one's life and times, memory, reading and writing, and the identifying cargo of possessions – two ammonites, a cat, a pair of American ducks and a leaping fish sherd, amongst others – this is an elegant, moving and deeply enjoyable memoir by one of our most loved writers.

The round house by Louise Erdrich

One Sunday in the spring of 1988, wife and mother Geraldine Coutts is brutally attacked on her North Dakota reservation. Traumatised and afraid in the aftermath, she shuts herself in her bedroom, and shuts everyone out, including her 13-year-old son Joe. While Geraldine's husband, a tribal judge, endeavours to wrest justice from a situation that defies his keenest efforts, Joe becomes frustrated with his father's official investigation and sets out with his best friends Cappy, Zack and Angus, to seek answers of his own.

The shadow of the wind by Carlos Ruiz Zafon

Hidden in the heart of the old city of Barcelona is a labyrinthine library of obscure & forgotten titles that have long gone out of print. A man brings his 10-year-old son to the library & allows him to choose one book to keep. But as he grows up, several people seem inordinately interested in his find.

Brandon King

I work in the Suffolk Libraries Stock Team

More Book club favourites

Book club favourites #21

Book club favourites #20

Book club favourites #19

Book club favourites #18

Book club favourites #17

Book club favourites #16

Book club favourites #15

Book club favourites #14

Book club favourites #13

Book club favourites #12

More suggestions

Fiction

Audiobooks

Films & DVDs

eLibrary picks

Children's books

Young adult

Non-fiction

Music

Meet the Author interviews

Articles

 Health and wellbeing

Reviews

Book club favourites

Keep updated

Get the latest suggestions, releases and reviews delivered straight to you.

Email newsletter

Facebook

Twitter

Instagram

Do it online

Search & reserve

Login & renew

eLibrary

Get a library card

Support your library

We're a charity that makes life in Suffolk better for thousands of people.

Donate

Contact us

01473 351249

help@suffolklibraries.co.uk

Social media

Facebook

YouTube

Twitter

Instagram

LinkedIn

Email newsletter

Sections

eLibrary

Libraries

Mobile & home service

Help using the service

Recommendations & reviews

Events & activities

Research & reference

Parents, carers & children

Teachers & home educators

Health & wellbeing

Help with reading & literacy

Work & benefits

Business & room hire

BLOC

Music & Drama Library

News

Jobs

Volunteering

About us

Privacy & cookies

Find out what cookies we use and how we use your data: our privacy policies.

Privacy notice for job applicants

Suffolk Libraries HMRC charity number XT34476. Registered company number IP031542.


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Overview (Limberest API)</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Limberest API

Packages

Package
Description

io.limberest.api

io.limberest.api.codegen

io.limberest.api.validate

io.limberest.api.validate.params

io.limberest.api.validate.props

io.limberest.config

io.limberest.jackson

io.limberest.json

io.limberest.provider

io.limberest.service

io.limberest.service.http

io.limberest.service.registry

io.limberest.util

io.limberest.validate

io.limberest.yaml

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2018


text:
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
// local imports
import { AuthService } from '../../core/services/auth.service';
import { IUserLogin } from '../../shared/interfaces';
import {of} from 'rxjs';

@Component({
  selector: 'app-login',
  templateUrl: './login.component.html',
  styleUrls: ['./login.component.scss']
})
export class LoginComponent implements OnInit {
  loginForm: FormGroup;
  errorMessage: string;
  authName: string;
  activeTab: string;
  authenticationProviders: Array<string>;

  constructor(private formBuilder: FormBuilder,
              private router: Router,
              private authService: AuthService) {}

  ngOnInit() {
    this.authService.logout();
    this.buildForm();
    this.getAuthProviders();
  }
  getAuthProviders(): void {
    this.authService.getAuthenticationProviders().subscribe( data => {
      this.setActiveTab(data[0]);
      this.authenticationProviders = data;
    });
  }
  isStandLogin(): boolean {
    return this.activeTab === 'STANDARD';
  }
  isLdapLogin(): boolean {
    return this.activeTab === 'LDAP';
  }
  isSsoLogin(): boolean {
    return this.activeTab === 'SSO';
  }
  setActiveTab(tab: string) {
    if ( tab ) {
      this.activeTab = tab;
      this.authName = tab;
    }
  }
  buildForm() {
    this.loginForm = this.formBuilder.group({
      username:      ['', [ Validators.required ]],
      password:   ['', [ Validators.required ]]
    });
  }

  submit({ value }: { value: IUserLogin }) {
    let login;
    if (this.isStandLogin()) {
      login = this.authService.login(value);
    } else if (this.isLdapLogin()) {
      login = this.authService.loginLdap(value);
    } else if (this.isSsoLogin()) {
      login = this.routeToSso();
    } else {
      login = of(false);
    }
    login.subscribe((status: boolean) => {
          if (status) {
            if (this.authService.redirectUrl) {
              const redirectUrl = this.authService.redirectUrl;
              this.authService.redirectUrl = '';
              this.router.navigate([redirectUrl]);
            } else {
              this.router.navigate(['/']);
            }
          }
        },
        (err: any) => {
          this.errorMessage = err.error.message;
        });
  }
  signUp() {
    this.router.navigate(['/user/signup']);
  }

  loginBtnName(): string {
    return this.isSsoLogin() ? 'Single Sign On' : 'Login';
  }

  routeToSso(): Promise<boolean> {
    return this.router.navigate(['/user/sso']);
  }
}