text:
#include "sles_allinclusive.h"
#include "android_prompts.h"
#include "channels.h"

#include <utils/String16.h>

#include <system/audio.h>
#include <SLES/OpenSLES_Android.h>

#if ENABLE_ANDROID_RT // M3E:
#include <android_runtime/AndroidRuntime.h>
#endif

#define KEY_RECORDING_SOURCE_PARAMSIZE  sizeof(SLuint32)
#define KEY_RECORDING_PRESET_PARAMSIZE  sizeof(SLuint32)
#define KEY_PERFORMANCE_MODE_PARAMSIZE  sizeof(SLuint32)

//-----------------------------------------------------------------------------
// Internal utility functions
//----------------------------

SLresult audioRecorder_setPreset(CAudioRecorder* ar, SLuint32 recordPreset) {
    SLresult result = SL_RESULT_SUCCESS;

    audio_source_t newRecordSource = AUDIO_SOURCE_DEFAULT;
    switch (recordPreset) {
    case SL_ANDROID_RECORDING_PRESET_GENERIC:
        newRecordSource = AUDIO_SOURCE_DEFAULT;
        break;
    case SL_ANDROID_RECORDING_PRESET_CAMCORDER:
        newRecordSource = AUDIO_SOURCE_CAMCORDER;
        break;
    case SL_ANDROID_RECORDING_PRESET_VOICE_RECOGNITION:
        newRecordSource = AUDIO_SOURCE_VOICE_RECOGNITION;
        break;
    case SL_ANDROID_RECORDING_PRESET_VOICE_COMMUNICATION:
        newRecordSource = AUDIO_SOURCE_VOICE_COMMUNICATION;
        break;
    case SL_ANDROID_RECORDING_PRESET_UNPROCESSED:
            newRecordSource = AUDIO_SOURCE_UNPROCESSED;
            break;
    case SL_ANDROID_RECORDING_PRESET_NONE:
        // it is an error to set preset "none"
    default:
        SL_LOGE(ERROR_RECORDERPRESET_SET_UNKNOWN_PRESET);
        result = SL_RESULT_PARAMETER_INVALID;
    }

    // recording preset needs to be set before the object is realized
    // (ap->mAudioRecord is supposed to be 0 until then)
    if (SL_OBJECT_STATE_UNREALIZED != ar->mObject.mState) {
        SL_LOGE(ERROR_RECORDERPRESET_REALIZED);
        result = SL_RESULT_PRECONDITIONS_VIOLATED;
    } else {
        ar->mRecordSource = newRecordSource;
    }

    return result;
}

//-----------------------------------------------------------------------------
SLresult audioRecorder_setPerformanceMode(CAudioRecorder* ar, SLuint32 mode) {
    SLresult result = SL_RESULT_SUCCESS;
    SL_LOGV("performance mode set to %d", mode);

    SLuint32 perfMode = ANDROID_PERFORMANCE_MODE_DEFAULT;
    switch (mode) {
    case SL_ANDROID_PERFORMANCE_LATENCY:
        perfMode = ANDROID_PERFORMANCE_MODE_LATENCY;
        break;
    case SL_ANDROID_PERFORMANCE_LATENCY_EFFECTS:
        perfMode = ANDROID_PERFORMANCE_MODE_LATENCY_EFFECTS;
        break;
    case SL_ANDROID_PERFORMANCE_NONE:
        perfMode = ANDROID_PERFORMANCE_MODE_NONE;
        break;
    case SL_ANDROID_PERFORMANCE_POWER_SAVING:
        perfMode = ANDROID_PERFORMANCE_MODE_POWER_SAVING;
        break;
    default:
        SL_LOGE(ERROR_CONFIG_PERF_MODE_UNKNOWN);
        result = SL_RESULT_PARAMETER_INVALID;
        break;
    }

    // performance mode needs to be set before the object is realized
    // (ar->mAudioRecord is supposed to be NULL until then)
    if (SL_OBJECT_STATE_UNREALIZED != ar->mObject.mState) {
        SL_LOGE(ERROR_CONFIG_PERF_MODE_REALIZED);
        result = SL_RESULT_PRECONDITIONS_VIOLATED;
    } else {
        ar->mPerformanceMode = perfMode;
    }

    return result;
}

SLresult audioRecorder_getPreset(CAudioRecorder* ar, SLuint32* pPreset) {
    SLresult result = SL_RESULT_SUCCESS;

    switch (ar->mRecordSource) {
    case AUDIO_SOURCE_DEFAULT:
    case AUDIO_SOURCE_MIC:
        *pPreset = SL_ANDROID_RECORDING_PRESET_GENERIC;
        break;
    case AUDIO_SOURCE_VOICE_UPLINK:
    case AUDIO_SOURCE_VOICE_DOWNLINK:
    case AUDIO_SOURCE_VOICE_CALL:
        *pPreset = SL_ANDROID_RECORDING_PRESET_NONE;
        break;
    case AUDIO_SOURCE_VOICE_RECOGNITION:
        *pPreset = SL_ANDROID_RECORDING_PRESET_VOICE_RECOGNITION;
        break;
    case AUDIO_SOURCE_CAMCORDER:
        *pPreset = SL_ANDROID_RECORDING_PRESET_CAMCORDER;
        break;
    case AUDIO_SOURCE_VOICE_COMMUNICATION:
        *pPreset = SL_ANDROID_RECORDING_PRESET_VOICE_COMMUNICATION;
        break;
    case AUDIO_SOURCE_UNPROCESSED:
        *pPreset = SL_ANDROID_RECORDING_PRESET_UNPROCESSED;
        break;
    default:
        *pPreset = SL_ANDROID_RECORDING_PRESET_NONE;
        result = SL_RESULT_INTERNAL_ERROR;
        break;
    }

    return result;
}

//-----------------------------------------------------------------------------
SLresult audioRecorder_getPerformanceMode(CAudioRecorder* ar, SLuint32 *pMode) {
    SLresult result = SL_RESULT_SUCCESS;

    switch (ar->mPerformanceMode) {
    case ANDROID_PERFORMANCE_MODE_LATENCY:
        *pMode = SL_ANDROID_PERFORMANCE_LATENCY;
        break;
    case ANDROID_PERFORMANCE_MODE_LATENCY_EFFECTS:
        *pMode = SL_ANDROID_PERFORMANCE_LATENCY_EFFECTS;
        break;
    case ANDROID_PERFORMANCE_MODE_NONE:
        *pMode = SL_ANDROID_PERFORMANCE_NONE;
        break;
    case ANDROID_PERFORMANCE_MODE_POWER_SAVING:
        *pMode = SL_ANDROID_PERFORMANCE_POWER_SAVING;
        break;
    default:
        result = SL_RESULT_INTERNAL_ERROR;
        *pMode = SL_ANDROID_PERFORMANCE_LATENCY;
        break;
    }

    return result;
}

void audioRecorder_handleNewPos_lockRecord(CAudioRecorder* ar) {
    //SL_LOGV("received event EVENT_NEW_POS from AudioRecord");
    slRecordCallback callback = NULL;
    void* callbackPContext = NULL;

    interface_lock_shared(&ar->mRecord);
    callback = ar->mRecord.mCallback;
    callbackPContext = ar->mRecord.mContext;
    interface_unlock_shared(&ar->mRecord);

    if (NULL != callback) {
        // getting this event implies SL_RECORDEVENT_HEADATNEWPOS was set in the event mask
        (*callback)(&ar->mRecord.mItf, callbackPContext, SL_RECORDEVENT_HEADATNEWPOS);
    }
}

void audioRecorder_handleMarker_lockRecord(CAudioRecorder* ar) {
    //SL_LOGV("received event EVENT_MARKER from AudioRecord");
    slRecordCallback callback = NULL;
    void* callbackPContext = NULL;

    interface_lock_shared(&ar->mRecord);
    callback = ar->mRecord.mCallback;
    callbackPContext = ar->mRecord.mContext;
    interface_unlock_shared(&ar->mRecord);

    if (NULL != callback) {
        // getting this event implies SL_RECORDEVENT_HEADATMARKER was set in the event mask
        (*callback)(&ar->mRecord.mItf, callbackPContext, SL_RECORDEVENT_HEADATMARKER);
    }
}

void audioRecorder_handleOverrun_lockRecord(CAudioRecorder* ar) {
    //SL_LOGV("received event EVENT_OVERRUN from AudioRecord");
    slRecordCallback callback = NULL;
    void* callbackPContext = NULL;

    interface_lock_shared(&ar->mRecord);
    if (ar->mRecord.mCallbackEventsMask & SL_RECORDEVENT_HEADSTALLED) {
        callback = ar->mRecord.mCallback;
        callbackPContext = ar->mRecord.mContext;
    }
    interface_unlock_shared(&ar->mRecord);

    if (NULL != callback) {
        (*callback)(&ar->mRecord.mItf, callbackPContext, SL_RECORDEVENT_HEADSTALLED);
    }
}

//-----------------------------------------------------------------------------
SLresult android_audioRecorder_checkSourceSink(CAudioRecorder* ar) {

    const SLDataSource *pAudioSrc = &ar->mDataSource.u.mSource;
    const SLDataSink   *pAudioSnk = &ar->mDataSink.u.mSink;

    const SLuint32 sinkLocatorType = *(SLuint32 *)pAudioSnk->pLocator;
    const SLuint32 sinkFormatType = *(SLuint32 *)pAudioSnk->pFormat;

    const SLuint32 *df_representation = NULL; // pointer to representation field, if it exists

    // sink must be an Android simple buffer queue with PCM data format
    switch (sinkLocatorType) {
    case SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE: {
        switch (sinkFormatType) {
        case SL_ANDROID_DATAFORMAT_PCM_EX: {
            const SLAndroidDataFormat_PCM_EX *df_pcm =
                    (SLAndroidDataFormat_PCM_EX *) pAudioSnk->pFormat;
            // checkDataFormat() already checked representation
            df_representation = &df_pcm->representation;
        } // SL_ANDROID_DATAFORMAT_PCM_EX - fall through to next test.
        case SL_DATAFORMAT_PCM: {
            const SLDataFormat_PCM *df_pcm = (const SLDataFormat_PCM *) pAudioSnk->pFormat;
            // checkDataFormat already checked sample rate, channels, and mask
            ar->mNumChannels = df_pcm->numChannels;

            if (df_pcm->endianness != ar->mObject.mEngine->mEngine.mNativeEndianness) {
                SL_LOGE("Cannot create audio recorder: unsupported byte order %u",
                        df_pcm->endianness);
                return SL_RESULT_CONTENT_UNSUPPORTED;
            }

            ar->mSampleRateMilliHz = df_pcm->samplesPerSec; // Note: bad field name in SL ES
            SL_LOGV("AudioRecorder requested sample rate = %u mHz, %u channel(s)",
                    ar->mSampleRateMilliHz, ar->mNumChannels);

            // we don't support container size != sample depth
            if (df_pcm->containerSize != df_pcm->bitsPerSample) {
                SL_LOGE("Cannot create audio recorder: unsupported container size %u bits for "
                        "sample depth %u bits",
                        df_pcm->containerSize, (SLuint32)df_pcm->bitsPerSample);
                return SL_RESULT_CONTENT_UNSUPPORTED;
            }

            } break;
        default:
            SL_LOGE(ERROR_RECORDER_SINK_FORMAT_MUST_BE_PCM);
            return SL_RESULT_PARAMETER_INVALID;
        }   // switch (sourceFormatType)
        } break;    // case SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE
    default:
        SL_LOGE(ERROR_RECORDER_SINK_MUST_BE_ANDROIDSIMPLEBUFFERQUEUE);
        return SL_RESULT_PARAMETER_INVALID;
    }   // switch (sourceLocatorType)

    // Source check:
    // only input device sources are supported
    // check it's an IO device
    if (SL_DATALOCATOR_IODEVICE != *(SLuint32 *)pAudioSrc->pLocator) {
        SL_LOGE(ERROR_RECORDER_SOURCE_MUST_BE_IODEVICE);
        return SL_RESULT_PARAMETER_INVALID;
    } else {

        // check it's an input device
        SLDataLocator_IODevice *dl_iod = (SLDataLocator_IODevice *) pAudioSrc->pLocator;
        if (SL_IODEVICE_AUDIOINPUT != dl_iod->deviceType) {
            SL_LOGE(ERROR_RECORDER_IODEVICE_MUST_BE_AUDIOINPUT);
            return SL_RESULT_PARAMETER_INVALID;
        }

        // check it's the default input device, others aren't supported here
        if (SL_DEFAULTDEVICEID_AUDIOINPUT != dl_iod->deviceID) {
            SL_LOGE(ERROR_RECORDER_INPUT_ID_MUST_BE_DEFAULT);
            return SL_RESULT_PARAMETER_INVALID;
        }
    }

    return SL_RESULT_SUCCESS;
}
//-----------------------------------------------------------------------------
static void audioRecorder_callback(int event, void* user, void *info) {
    //SL_LOGV("audioRecorder_callback(%d, %p, %p) entering", event, user, info);

    CAudioRecorder *ar = (CAudioRecorder *)user;

    if (!android::CallbackProtector::enterCbIfOk(ar->mCallbackProtector)) {
        // it is not safe to enter the callback (the track is about to go away)
        return;
    }

    void * callbackPContext = NULL;

    switch (event) {
    case android::AudioRecord::EVENT_MORE_DATA: {
        slBufferQueueCallback callback = NULL;
        android::AudioRecord::Buffer* pBuff = (android::AudioRecord::Buffer*)info;

        // push data to the buffer queue
        interface_lock_exclusive(&ar->mBufferQueue);

        if (ar->mBufferQueue.mState.count != 0) {
            assert(ar->mBufferQueue.mFront != ar->mBufferQueue.mRear);

            BufferHeader *oldFront = ar->mBufferQueue.mFront;
            BufferHeader *newFront = &oldFront[1];

            size_t availSink = oldFront->mSize - ar->mBufferQueue.mSizeConsumed;
            size_t availSource = pBuff->size;
            size_t bytesToCopy = availSink < availSource ? availSink : availSource;
            void *pDest = (char *)oldFront->mBuffer + ar->mBufferQueue.mSizeConsumed;
            memcpy(pDest, pBuff->raw, bytesToCopy);

            if (bytesToCopy < availSink) {
                // can't consume the whole or rest of the buffer in one shot
                ar->mBufferQueue.mSizeConsumed += availSource;
                // pBuff->size is already equal to bytesToCopy in this case
            } else {
                // finish pushing the buffer or push the buffer in one shot
                pBuff->size = bytesToCopy;
                ar->mBufferQueue.mSizeConsumed = 0;
                if (newFront == &ar->mBufferQueue.mArray[ar->mBufferQueue.mNumBuffers + 1]) {
                    newFront = ar->mBufferQueue.mArray;
                }
                ar->mBufferQueue.mFront = newFront;

                ar->mBufferQueue.mState.count--;
                ar->mBufferQueue.mState.playIndex++;

                // data has been copied to the buffer, and the buffer queue state has been updated
                // we will notify the client if applicable
                callback = ar->mBufferQueue.mCallback;
                // save callback data
                callbackPContext = ar->mBufferQueue.mContext;
            }
        } else { // empty queue
            // no destination to push the data
            pBuff->size = 0;
        }

        interface_unlock_exclusive(&ar->mBufferQueue);

        // notify client
        if (NULL != callback) {
            (*callback)(&ar->mBufferQueue.mItf, callbackPContext);
        }
        }
        break;

    case android::AudioRecord::EVENT_OVERRUN:
        audioRecorder_handleOverrun_lockRecord(ar);
        break;

    case android::AudioRecord::EVENT_MARKER:
        audioRecorder_handleMarker_lockRecord(ar);
        break;

    case android::AudioRecord::EVENT_NEW_POS:
        audioRecorder_handleNewPos_lockRecord(ar);
        break;

    case android::AudioRecord::EVENT_NEW_IAUDIORECORD:
        // ignore for now
        break;

    default:
        SL_LOGE("Encountered unknown AudioRecord event %d for CAudioRecord %p", event, ar);
        break;
    }

    ar->mCallbackProtector->exitCb();
}

//-----------------------------------------------------------------------------
SLresult android_audioRecorder_create(CAudioRecorder* ar) {
    SL_LOGV("android_audioRecorder_create(%p) entering", ar);

    const SLDataSource *pAudioSrc = &ar->mDataSource.u.mSource;
    const SLDataSink *pAudioSnk = &ar->mDataSink.u.mSink;
    SLresult result = SL_RESULT_SUCCESS;

    const SLuint32 sourceLocatorType = *(SLuint32 *)pAudioSrc->pLocator;
    const SLuint32 sinkLocatorType = *(SLuint32 *)pAudioSnk->pLocator;

    //  the following platform-independent fields have been initialized in CreateAudioRecorder()
    //    ar->mNumChannels
    //    ar->mSampleRateMilliHz

    if ((SL_DATALOCATOR_IODEVICE == sourceLocatorType) &&
            (SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE == sinkLocatorType)) {
        // microphone to simple buffer queue
        ar->mAndroidObjType = AUDIORECORDER_FROM_MIC_TO_PCM_BUFFERQUEUE;
        ar->mAudioRecord.clear();
        ar->mCallbackProtector = new android::CallbackProtector();
        ar->mRecordSource = AUDIO_SOURCE_DEFAULT;
        ar->mPerformanceMode = ANDROID_PERFORMANCE_MODE_DEFAULT;
    } else {
        result = SL_RESULT_CONTENT_UNSUPPORTED;
    }

    return result;
}

//-----------------------------------------------------------------------------
SLresult android_audioRecorder_setConfig(CAudioRecorder* ar, const SLchar *configKey,
        const void *pConfigValue, SLuint32 valueSize) {

    SLresult result;

    assert(NULL != ar && NULL != configKey && NULL != pConfigValue);
    if (strcmp((const char*)configKey, (const char*)SL_ANDROID_KEY_RECORDING_PRESET) == 0) {

        // recording preset
        if (KEY_RECORDING_PRESET_PARAMSIZE > valueSize) {
            SL_LOGE(ERROR_CONFIG_VALUESIZE_TOO_LOW);
            result = SL_RESULT_BUFFER_INSUFFICIENT;
        } else {
            result = audioRecorder_setPreset(ar, *(SLuint32*)pConfigValue);
        }

    } else if (strcmp((const char*)configKey, (const char*)SL_ANDROID_KEY_PERFORMANCE_MODE) == 0) {

        // performance mode
        if (KEY_PERFORMANCE_MODE_PARAMSIZE > valueSize) {
            SL_LOGE(ERROR_CONFIG_VALUESIZE_TOO_LOW);
            result = SL_RESULT_BUFFER_INSUFFICIENT;
        } else {
            result = audioRecorder_setPerformanceMode(ar, *(SLuint32*)pConfigValue);
        }
    } else {
        SL_LOGE(ERROR_CONFIG_UNKNOWN_KEY);
        result = SL_RESULT_PARAMETER_INVALID;
    }

    return result;
}

//-----------------------------------------------------------------------------
SLresult android_audioRecorder_getConfig(CAudioRecorder* ar, const SLchar *configKey,
        SLuint32* pValueSize, void *pConfigValue) {

    SLresult result;

    assert(NULL != ar && NULL != configKey && NULL != pValueSize);
    if (strcmp((const char*)configKey, (const char*)SL_ANDROID_KEY_RECORDING_PRESET) == 0) {

        // recording preset
        if (NULL == pConfigValue) {
            result = SL_RESULT_SUCCESS;
        } else if (KEY_RECORDING_PRESET_PARAMSIZE > *pValueSize) {
            SL_LOGE(ERROR_CONFIG_VALUESIZE_TOO_LOW);
            result = SL_RESULT_BUFFER_INSUFFICIENT;
        } else {
            result = audioRecorder_getPreset(ar, (SLuint32*)pConfigValue);
        }
        *pValueSize = KEY_RECORDING_PRESET_PARAMSIZE;

    } else if (strcmp((const char*)configKey, (const char*)SL_ANDROID_KEY_PERFORMANCE_MODE) == 0) {

        // performance mode
        if (NULL == pConfigValue) {
            result = SL_RESULT_SUCCESS;
        } else if (KEY_PERFORMANCE_MODE_PARAMSIZE > *pValueSize) {
            SL_LOGE(ERROR_CONFIG_VALUESIZE_TOO_LOW);
            result = SL_RESULT_BUFFER_INSUFFICIENT;
        } else {
            result = audioRecorder_getPerformanceMode(ar, (SLuint32*)pConfigValue);
        }
        *pValueSize = KEY_PERFORMANCE_MODE_PARAMSIZE;

    } else {
        SL_LOGE(ERROR_CONFIG_UNKNOWN_KEY);
        result = SL_RESULT_PARAMETER_INVALID;
    }

    return result;
}

// Called from android_audioRecorder_realize for a PCM buffer queue recorder before creating the
// AudioRecord to determine which performance modes are allowed based on effect interfaces present
static void checkAndSetPerformanceModePre(CAudioRecorder* ar)
{
    SLuint32 allowedModes = ANDROID_PERFORMANCE_MODE_ALL;
    assert(ar->mAndroidObjType == AUDIORECORDER_FROM_MIC_TO_PCM_BUFFERQUEUE);

    // no need to check the buffer queue size, application side
    // double-buffering (and more) is not a requirement for using fast tracks

    // Check a blacklist of interfaces that are incompatible with fast tracks.
    // The alternative, to check a whitelist of compatible interfaces, is
    // more maintainable but is too slow.  As a compromise, in a debug build
    // we use both methods and warn if they produce different results.
    // In release builds, we only use the blacklist method.
    // If a blacklisted interface is added after realization using
    // DynamicInterfaceManagement::AddInterface,
    // then this won't be detected but the interface will be ineffective.
    static const unsigned blacklist[] = {
        MPH_ANDROIDACOUSTICECHOCANCELLATION,
        MPH_ANDROIDAUTOMATICGAINCONTROL,
        MPH_ANDROIDNOISESUPPRESSION,
        MPH_ANDROIDEFFECT,
        // FIXME The problem with a blacklist is remembering to add new interfaces here
    };

    for (unsigned i = 0; i < sizeof(blacklist)/sizeof(blacklist[0]); ++i) {
        if (IsInterfaceInitialized(&ar->mObject, blacklist[i])) {
            uint32_t flags = 0;

            allowedModes &= ~ANDROID_PERFORMANCE_MODE_LATENCY;

            // if generic effect interface is used we don't know which effect will be used and
            // disable all low latency performance modes
            if (blacklist[i] != MPH_ANDROIDEFFECT) {
                switch (blacklist[i]) {
                case MPH_ANDROIDACOUSTICECHOCANCELLATION:
                    SL_LOGV("checkAndSetPerformanceModePre found AEC name %s",
                            ar->mAcousticEchoCancellation.mAECDescriptor.name);
                    flags = ar->mAcousticEchoCancellation.mAECDescriptor.flags;
                    break;
                case MPH_ANDROIDAUTOMATICGAINCONTROL:
                    SL_LOGV("checkAndSetPerformanceModePre found AGC name %s",
                            ar->mAutomaticGainControl.mAGCDescriptor.name);
                    flags = ar->mAutomaticGainControl.mAGCDescriptor.flags;
                    break;
                case MPH_ANDROIDNOISESUPPRESSION:
                    SL_LOGV("checkAndSetPerformanceModePre found NS name %s",
                            ar->mNoiseSuppression.mNSDescriptor.name);
                    flags = ar->mNoiseSuppression.mNSDescriptor.flags;
                    break;
                default:
                    break;
                }
            }
            if ((flags & EFFECT_FLAG_HW_ACC_TUNNEL) == 0) {
                allowedModes &= ~ANDROID_PERFORMANCE_MODE_LATENCY_EFFECTS;
                break;
            }
        }
    }
#if LOG_NDEBUG == 0
    bool blacklistResult = (
            (allowedModes &
                (ANDROID_PERFORMANCE_MODE_LATENCY|ANDROID_PERFORMANCE_MODE_LATENCY_EFFECTS)) != 0);
    bool whitelistResult = true;
    static const unsigned whitelist[] = {
        MPH_BUFFERQUEUE,
        MPH_DYNAMICINTERFACEMANAGEMENT,
        MPH_OBJECT,
        MPH_RECORD,
        MPH_ANDROIDCONFIGURATION,
        MPH_ANDROIDSIMPLEBUFFERQUEUE,
    };
    for (unsigned mph = MPH_MIN; mph < MPH_MAX; ++mph) {
        for (unsigned i = 0; i < sizeof(whitelist)/sizeof(whitelist[0]); ++i) {
            if (mph == whitelist[i]) {
                goto compatible;
            }
        }
        if (IsInterfaceInitialized(&ar->mObject, mph)) {
            whitelistResult = false;
            break;
        }
compatible: ;
    }
    if (whitelistResult != blacklistResult) {
        SL_LOGW("whitelistResult != blacklistResult");
    }
#endif
    if (ar->mPerformanceMode == ANDROID_PERFORMANCE_MODE_LATENCY) {
        if ((allowedModes & ANDROID_PERFORMANCE_MODE_LATENCY) == 0) {
            ar->mPerformanceMode = ANDROID_PERFORMANCE_MODE_LATENCY_EFFECTS;
        }
    }
    if (ar->mPerformanceMode == ANDROID_PERFORMANCE_MODE_LATENCY_EFFECTS) {
        if ((allowedModes & ANDROID_PERFORMANCE_MODE_LATENCY_EFFECTS) == 0) {
            ar->mPerformanceMode = ANDROID_PERFORMANCE_MODE_NONE;
        }
    }
}

// Called from android_audioRecorder_realize for a PCM buffer queue recorder after creating the
// AudioRecord to adjust performance mode based on actual input flags
static void checkAndSetPerformanceModePost(CAudioRecorder* ar)
{
    audio_input_flags_t flags = ar->mAudioRecord->getFlags();
    switch (ar->mPerformanceMode) {
    case ANDROID_PERFORMANCE_MODE_LATENCY:
        if ((flags & (AUDIO_INPUT_FLAG_FAST | AUDIO_INPUT_FLAG_RAW)) ==
                (AUDIO_INPUT_FLAG_FAST | AUDIO_INPUT_FLAG_RAW)) {
            break;
        }
        ar->mPerformanceMode = ANDROID_PERFORMANCE_MODE_LATENCY_EFFECTS;
        /* FALL THROUGH */
    case ANDROID_PERFORMANCE_MODE_LATENCY_EFFECTS:
        if ((flags & AUDIO_INPUT_FLAG_FAST) == 0) {
            ar->mPerformanceMode = ANDROID_PERFORMANCE_MODE_NONE;
        }
        break;
    case ANDROID_PERFORMANCE_MODE_NONE:
    default:
        break;
    }
}
//-----------------------------------------------------------------------------
SLresult android_audioRecorder_realize(CAudioRecorder* ar, SLboolean async) {
    SL_LOGV("android_audioRecorder_realize(%p) entering", ar);

    SLresult result = SL_RESULT_SUCCESS;

    // already checked in created and checkSourceSink
    assert(ar->mDataSink.mLocator.mLocatorType == SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE);

    const SLDataFormat_PCM *df_pcm = &ar->mDataSink.mFormat.mPCM;

    //  the following platform-independent fields have been initialized in CreateAudioRecorder()
    //    ar->mNumChannels
    //    ar->mSampleRateMilliHz

    uint32_t sampleRate = sles_to_android_sampleRate(df_pcm->samplesPerSec);

    checkAndSetPerformanceModePre(ar);

    audio_input_flags_t policy;
    switch (ar->mPerformanceMode) {
    case ANDROID_PERFORMANCE_MODE_NONE:
    case ANDROID_PERFORMANCE_MODE_POWER_SAVING:
        policy = AUDIO_INPUT_FLAG_NONE;
        break;
    case ANDROID_PERFORMANCE_MODE_LATENCY_EFFECTS:
        policy = AUDIO_INPUT_FLAG_FAST;
        break;
    case ANDROID_PERFORMANCE_MODE_LATENCY:
    default:
        policy = (audio_input_flags_t)(AUDIO_INPUT_FLAG_FAST | AUDIO_INPUT_FLAG_RAW);
        break;
    }

    SL_LOGV("Audio Record format: %dch(0x%x), %dbit, %dKHz",
            df_pcm->numChannels,
            df_pcm->channelMask,
            df_pcm->bitsPerSample,
            df_pcm->samplesPerSec / 1000000);

    // note that df_pcm->channelMask has already been validated during object creation.
    audio_channel_mask_t channelMask = sles_to_audio_input_channel_mask(df_pcm->channelMask);

    // To maintain backward compatibility with previous releases, ignore
    // channel masks that are not indexed.
    if (channelMask == AUDIO_CHANNEL_INVALID
            || audio_channel_mask_get_representation(channelMask)
                == AUDIO_CHANNEL_REPRESENTATION_POSITION) {
        channelMask = audio_channel_in_mask_from_count(df_pcm->numChannels);
        SL_LOGI("Emulating old channel mask behavior "
                "(ignoring positional mask %#x, using default mask %#x based on "
                "channel count of %d)", df_pcm->channelMask, channelMask,
                df_pcm->numChannels);
    }
    SL_LOGV("SLES channel mask %#x converted to Android mask %#x", df_pcm->channelMask,
            channelMask);

    // initialize platform-specific CAudioRecorder fields
    ar->mAudioRecord = new android::AudioRecord(
            ar->mRecordSource,     // source
            sampleRate,            // sample rate in Hertz
            sles_to_android_sampleFormat(df_pcm),               // format
            channelMask,           // channel mask
            android::String16(),   // app ops
            0,                     // frameCount
            audioRecorder_callback,// callback_t
            (void*)ar,             // user, callback data, here the AudioRecorder
            0,                     // notificationFrames
            AUDIO_SESSION_ALLOCATE,
            android::AudioRecord::TRANSFER_CALLBACK,
                                   // transfer type
            policy);               // audio_input_flags_t

    android::status_t status = ar->mAudioRecord->initCheck();
    if (android::NO_ERROR != status) {
        SL_LOGE("android_audioRecorder_realize(%p) error creating AudioRecord object; status %d",
                ar, status);
        // FIXME should return a more specific result depending on status
        result = SL_RESULT_CONTENT_UNSUPPORTED;
        ar->mAudioRecord.clear();
        return result;
    }

    // update performance mode according to actual flags granted to AudioRecord
    checkAndSetPerformanceModePost(ar);

#if ENABLE_ANDROD_RT // M3E:
    // If there is a JavaAudioRoutingProxy associated with this recorder, hook it up...
    JNIEnv* j_env = NULL;
    jclass clsAudioRecord = NULL;
    jmethodID midRoutingProxy_connect = NULL;
    if (ar->mAndroidConfiguration.mRoutingProxy != NULL &&
            (j_env = android::AndroidRuntime::getJNIEnv()) != NULL &&
            (clsAudioRecord = j_env->FindClass("android/media/AudioRecord")) != NULL &&
            (midRoutingProxy_connect =
                j_env->GetMethodID(clsAudioRecord, "deferred_connect", "(J)V")) != NULL) {
        j_env->ExceptionClear();
        j_env->CallVoidMethod(ar->mAndroidConfiguration.mRoutingProxy,
                              midRoutingProxy_connect,
                              ar->mAudioRecord.get());
        if (j_env->ExceptionCheck()) {
            SL_LOGE("Java exception releasing recorder routing object.");
            result = SL_RESULT_INTERNAL_ERROR;
            ar->mAudioRecord.clear();
            return result;
        }
   }
#endif

    if (ar->mPerformanceMode != ANDROID_PERFORMANCE_MODE_LATENCY) {
        audio_session_t sessionId = ar->mAudioRecord->getSessionId();
        // initialize AEC
        effect_descriptor_t *descriptor = &ar->mAcousticEchoCancellation.mAECDescriptor;
        if (memcmp(SL_IID_ANDROIDACOUSTICECHOCANCELLATION, &descriptor->type,
                   sizeof(effect_uuid_t)) == 0) {
            if ((ar->mPerformanceMode != ANDROID_PERFORMANCE_MODE_LATENCY_EFFECTS) ||
                    (descriptor->flags & EFFECT_FLAG_HW_ACC_TUNNEL)) {
                SL_LOGV("Need to initialize AEC for AudioRecorder=%p", ar);
                android_aec_init(sessionId, &ar->mAcousticEchoCancellation);
            }
        }

        // initialize AGC
        descriptor = &ar->mAutomaticGainControl.mAGCDescriptor;
        if (memcmp(SL_IID_ANDROIDAUTOMATICGAINCONTROL, &descriptor->type,
                   sizeof(effect_uuid_t)) == 0) {
            if ((ar->mPerformanceMode != ANDROID_PERFORMANCE_MODE_LATENCY_EFFECTS) ||
                    (descriptor->flags & EFFECT_FLAG_HW_ACC_TUNNEL)) {
                SL_LOGV("Need to initialize AGC for AudioRecorder=%p", ar);
                android_agc_init(sessionId, &ar->mAutomaticGainControl);
            }
        }

        // initialize NS
        descriptor = &ar->mNoiseSuppression.mNSDescriptor;
        if (memcmp(SL_IID_ANDROIDNOISESUPPRESSION, &descriptor->type,
                   sizeof(effect_uuid_t)) == 0) {
            if ((ar->mPerformanceMode != ANDROID_PERFORMANCE_MODE_LATENCY_EFFECTS) ||
                    (descriptor->flags & EFFECT_FLAG_HW_ACC_TUNNEL)) {
                SL_LOGV("Need to initialize NS for AudioRecorder=%p", ar);
                android_ns_init(sessionId, &ar->mNoiseSuppression);
            }
        }
    }

    return result;
}

//-----------------------------------------------------------------------------
/**
 * Called with a lock on AudioRecorder, and blocks until safe to destroy
 */
void android_audioRecorder_preDestroy(CAudioRecorder* ar) {
    object_unlock_exclusive(&ar->mObject);
    if (ar->mCallbackProtector != 0) {
        ar->mCallbackProtector->requestCbExitAndWait();
    }
    object_lock_exclusive(&ar->mObject);
}

//-----------------------------------------------------------------------------
void android_audioRecorder_destroy(CAudioRecorder* ar) {
    SL_LOGV("android_audioRecorder_destroy(%p) entering", ar);

    if (ar->mAudioRecord != 0) {
        ar->mAudioRecord->stop();
        ar->mAudioRecord.clear();
    }
    // explicit destructor
    ar->mAudioRecord.~sp();
    ar->mCallbackProtector.~sp();
}

//-----------------------------------------------------------------------------
void android_audioRecorder_setRecordState(CAudioRecorder* ar, SLuint32 state) {
    SL_LOGV("android_audioRecorder_setRecordState(%p, %u) entering", ar, state);

    if (ar->mAudioRecord == 0) {
        return;
    }

    switch (state) {
     case SL_RECORDSTATE_STOPPED:
         ar->mAudioRecord->stop();
         break;
     case SL_RECORDSTATE_PAUSED:
         // Note that pausing is treated like stop as this implementation only records to a buffer
         //  queue, so there is no notion of destination being "opened" or "closed" (See description
         //  of SL_RECORDSTATE in specification)
         ar->mAudioRecord->stop();
         break;
     case SL_RECORDSTATE_RECORDING:
         ar->mAudioRecord->start();
         break;
     default:
         break;
     }

}

//-----------------------------------------------------------------------------
void android_audioRecorder_useRecordEventMask(CAudioRecorder *ar) {
    IRecord *pRecordItf = &ar->mRecord;
    SLuint32 eventFlags = pRecordItf->mCallbackEventsMask;

    if (ar->mAudioRecord == 0) {
        return;
    }

    if ((eventFlags & SL_RECORDEVENT_HEADATMARKER) && (pRecordItf->mMarkerPosition != 0)) {
        ar->mAudioRecord->setMarkerPosition((uint32_t)((((int64_t)pRecordItf->mMarkerPosition
                * sles_to_android_sampleRate(ar->mSampleRateMilliHz)))/1000));
    } else {
        // clear marker
        ar->mAudioRecord->setMarkerPosition(0);
    }

    if (eventFlags & SL_RECORDEVENT_HEADATNEWPOS) {
        SL_LOGV("pos update period %d", pRecordItf->mPositionUpdatePeriod);
         ar->mAudioRecord->setPositionUpdatePeriod(
                (uint32_t)((((int64_t)pRecordItf->mPositionUpdatePeriod
                * sles_to_android_sampleRate(ar->mSampleRateMilliHz)))/1000));
    } else {
        // clear periodic update
        ar->mAudioRecord->setPositionUpdatePeriod(0);
    }

    if (eventFlags & SL_RECORDEVENT_HEADATLIMIT) {
        // FIXME support SL_RECORDEVENT_HEADATLIMIT
        SL_LOGD("[ FIXME: IRecord_SetCallbackEventsMask(SL_RECORDEVENT_HEADATLIMIT) on an "
                    "SL_OBJECTID_AUDIORECORDER to be implemented ]");
    }

    if (eventFlags & SL_RECORDEVENT_HEADMOVING) {
        // FIXME support SL_RECORDEVENT_HEADMOVING
        SL_LOGD("[ FIXME: IRecord_SetCallbackEventsMask(SL_RECORDEVENT_HEADMOVING) on an "
                "SL_OBJECTID_AUDIORECORDER to be implemented ]");
    }

    if (eventFlags & SL_RECORDEVENT_BUFFER_FULL) {
        // nothing to do for SL_RECORDEVENT_BUFFER_FULL since this will not be encountered on
        // recording to buffer queues
    }

    if (eventFlags & SL_RECORDEVENT_HEADSTALLED) {
        // nothing to do for SL_RECORDEVENT_HEADSTALLED, callback event will be checked against mask
        // when AudioRecord::EVENT_OVERRUN is encountered

    }

}

//-----------------------------------------------------------------------------
void android_audioRecorder_getPosition(CAudioRecorder *ar, SLmillisecond *pPosMsec) {
    if ((NULL == ar) || (ar->mAudioRecord == 0)) {
        *pPosMsec = 0;
    } else {
        uint32_t positionInFrames;
        ar->mAudioRecord->getPosition(&positionInFrames);
        if (ar->mSampleRateMilliHz == UNKNOWN_SAMPLERATE) {
            *pPosMsec = 0;
        } else {
            *pPosMsec = ((int64_t)positionInFrames * 1000) /
                    sles_to_android_sampleRate(ar->mSampleRateMilliHz);
        }
    }
}


GIVEAWAY + MY BLOG IS 4!
Yes, this blog is 4 years old! I've never celebrated a blogiversary before, but this is a pretty big milestone. It's amazing and yet totally crazy to think that I've been posting snippets of my life and beauty obsessions on this platform for such a long time.
This is a long post, I apologize! But there's a lot to say!
I think I've changed and learned a lot over the past 4 years. And yet, this blog is the one consistent thing that has remained. It's my creative outlet, journal and fun. When I started this blog, I was in a totally different place in my life. I really was a different person. My voice, my aesthetic, my confidence have grown in these 4 years, and I think my blog has definitely benefited from my personal growth. When I started this journey, honestly, I was feeling pretty confused. I felt alone, I was lost. I was constantly letting myself down, I felt like I kept making mistakes and wanted to create somewhere where only happy things lived and somewhere I could meet people with similar interests.
When this all began, blogging wasn't what it is now. I didn't know people made careers out of blogging, I didn't know I could get sent products for free to review or asked to attend events. I just knew I had to give myself somewhere to talk about anything at all. It really did start that way, as an outlet. And that's exactly how it remains today. It's never been about numbers, followers, stuff or money. It still isn't. I'm sure a lot of you think that's absurd, because blogging takes so much time and effort, but I do it because I genuinely love the process. From discovering products to talking to new people and product photography, I love every moment of blogging.
I remember being afraid when I first started. I thought What if I fail? What if people find out? What if I make a mistake? And I still feel that way, every day. But recently, I made a commitment to myself to preserve. I actually have started posting consistently on my YouTube channel. I made that account over 3 years ago, with the dreams of one day getting up the courage to post. I'm afraid to admit that I've filmed dozens of videos over the years and immediately deleted the footage. My voice sounded weird, I was awkward, my skin was too bad, no one would want to watch me. Even though I still think these things, I worry that one day I will look back and regret not trying. I already regret waiting as long as I have.
So yes, 4 years is a weird milestone to celebrate, but there is so much to be happy about! I've grown so much in 4 years, and I'm happy I have a space to look back on and see that change. I want to keep growing, there's so much I want to learn in terms of makeup techniques, web design and video editing. I can't wait to keep learning, growing and using this platform as a space to do that. I'm excited, curious and don't know where this will take me. And I love that part of the journey!
Whether you've been here all 4 years or have just discovered this blog, I really want to thank you! I know I've never been the best at blogging, but I love it regardless. With all that being said, I have made a commitment to myself to take this platform more seriously. I've been making a lot of effort over the last 6 months to create content I'm proud of! I've even started posting consistently on my YouTube channel and am having tons of fun with that platform.
To celebrate I have been collecting some of my current favourites giveaway! This is my way of saying THANK YOU! I've purchased all of these items in the hopes that one of you falls in love with them the same way I have. I've decided to make this giveaway open internationally! So ANYONE can win this bundle.
One winner will be awarded the prize pack. No items can be substituted and there is no cash value.
All entries will be double checked, and the winner will be drawn randomly.
The contest ends on April 30th. No entries may be submitted after that date.
The winner will be contacted by email on May 5th and will have 48 hours to respond. Another winner will be chosen at random in the event there is no follow up email from the winner.


By appearing to postpone the 2019 SOTU Address until some date after the Shutdown ends, – has Trump backed down, – or is he just giving Pelosi a little more rope?
CNN and the Left-Wing Media (Propaganda Ministry) will be calling this a Pelosi Victory…for years.
THE lame stream media continues to display a vacancy of thought, logic and reason! This is obviously a move by President Trump to show that he is open and above board in his willingness to bring the shut down to its rightful conclusion. On the other hand, Pelosi is fouling the US House of Representatives single handedly, using her hatred for the President as a reason to stop progress in legislation and tradition.
When Trump was dancing with Romney I thought he was out of his mind. Someone reminded me, "He always has a plan", and sure enough, he did. I'm thinking he did not do this without a strategy behind it.
I don't have a crystal ball, and I can't read minds, but I really believe Trump's a whole lot smarter than current Democrap leadership, and the whole Democrap Party for that matter, and I think he's feeding them enough rope to hang.
I don't pay much attention to polling, either. 2020's slowly approaching and I suspect the Dems aren't going to keep all those 2018 House gains in Red districts, as reasonable Americans are pissed all the way around. California, New York, New Jersey, etc. can allow all the non-citizens they want to vote. It won't matter. That's what our Electiral College protects us from….
I agree in spades with the Green Beret. I just hope the demorats are making such a mockery of our Constitution and system of GOVT that the voters who put the demorats back in the lead in the House wake up. 2020 is going to be a watershed year. Pray for our Nation.
President is a master at getting maximum TV ratings. By postponing the State of the Union he ensured that more people will be watching.
I would have spoke to the Senate, but that's why Trump is President, and I am not.
With all of the drama going on in Washington these days, it's easy to miss all that President Trump has accomplished in his short time in office. The Democrats have nothing, so they are constantly contriving anything that they can to vilify our President.
This arrogant, divisive Nancy Pelosi is working so hard to put down President Trump, and his agenda. In their negotiations, he tried to negotiate, their side remained defiant, angry and would not give an inch. I believe that the American people, are beginning to see where the anger, vitriol, and complete opposition to anything that the President wants for the good of our citizens and our country.
President Trump, and America will be the winners in this.


text:
"It's Not Fair the Way They Treat Us": Raise the Rates Poverty Reduction Submission
April 11, 2018 raisetherates
At the end of March, we submitted a report to the provincial government for their Poverty Reduction Consultations. After 10 years of organizing, and three weeks of outreach and surveys, we had a few things to say:
Raise the Rates' Poverty Reduction Plan Submission, March 2018
Raise the Rates is a coalition group made up of nearly fifty different activist and service provider groups concerned about the fatal levels of poverty and homelessness in the province of BC. We have been working since 2006 to push the government to raise welfare rates, amongst other policy changes to end poverty.
In the past decade that Raise the Rates has been organizing, we have seen homelessness levels soar, claw backs on income assistance devastate families, use of food banks and survival services increase drastically, rents spiral out of control and more violence and stigma (what we call poor-bashing) against poor people who live in neighbourhoods being gentrified at rapid fire pace. Through this, we have also seen and supported countless rallies, protests, actions and op-eds countering the mainstream idea that poor people 'deserve it', or simply need to 'budget better', as well as calling for real, concrete solutions to change the materials conditions of almost 600,000 peoples' lives. We have sponsored the annual Welfare Food Challenge to show government and the public that welfare rates are too low to live on.
The consequences of poverty are far-reaching, from the devastating realities of children growing up in poverty, low literacy rates, to cycles of violence being perpetuated against vulnerable communities, to billions of dollars spent (wasted) on incarcerating people for living outside/survival activities as well as crimes of desperation, higher hospital bills, lower life expectancy for low income people, and expensive fast fixes to issues of homelessness. The cost of poverty is too high. The cost of inaction is too high, clocked at around $8-9 billion per year. Comparatively, according to the CCPA's 2011 report "The Cost of Poverty in BC", a comprehensive poverty reduction plan is between $3-4 billion per year.
For us, the main demands for the BC government's Poverty Reduction Strategy absolutely must include:
Raising welfare rates to the federal market basket measure (about $1600 for a single person in a city); with disability rates about $300 a month higher;
Bringing in real rent control so landlords can't raise rents as much as they like between tenancies; if this is not done probably at least half on any extra money that low income people get through minimum wage increases or welfare increases will go to landlords;
Building about 10,000 units of social housing a year that low income people can afford; while the government has talked about social housing, they haven't committed to building enough to end homelessness and BC Housing wait lists;
Ending homelessness right away with modular housing; and
Restoring taxes on the rich to pay for these; Since the year 2000 the Liberals have been reducing taxes so that now government doesn't have the revenue to meet people's needs for services. Unless taxes are restored we can't get what we need.
These must be included in the legislation, in order to ensure action and funding to follow through on promises to 'reduce poverty'. Depth of poverty (i.e. how far below the poverty line people are) must be tackled through raising income assistance and disability rates, ending punitive claw-back measures on welfare, and raising the minimum wage for all workers. We support all of the recommendations put forward in the BC Poverty Reduction Coalition's submission, and strongly encourage the government to consider implementing their poverty reduction plan, with its strong and necessary targets and timelines for tackling major points that lead to ending poverty.
Speaking to the Community
Over the course of a few weeks, we spoke to over 80 people. Average age was around 50 years old, with around 33% of people living in social housing, 21% in single room occupancy hotels, 33% homeless or living in shelters, and the rest living in other housing (Native housing, with parents, or one person in a condo). The survey was conducted in a way that allowed folks to approach the volunteers to answer the questions. Women made up 33% of the people we talked to, with 65% being men, and one person who was transgender. These numbers don't reflect the adverse affects poverty has on women and gender minorities, likely a fault of our methodology. We didn't collect information on people's ethnic or racial make-up, but the diversity was fairly well reflective of much of the downtown eastside community.
The top issues that people said they wanted to see in a poverty reduction plan: raising welfare and disability rates (as well as concern for pension and seniors living on fixed income), building social housing for low-income people, raising the minimum wage and providing more support for finding and keeping jobs, and taxing the rich.
On Welfare: "It's Not Fair the Way They Treat Us"
When asked if they believed rates should be raised to the Market Basket Measure of $1600/mo for a single person in Vancouver on income assistance ($1900 for disability), 88% of people responded yes. The other 12% were not outright "no", but rather had concerns that if rates went up, then so would rent. This was such a resounding factor in the conversations we had, that rent control must be a (low-cost) move the province includes in a poverty reduction strategy. Folks living in subsidized housing found that disability was adequate for what they needed, but recognized that it would be impossible if you had to live in market rentals.
Asked if folks had applied for welfare before, 86% replied they were currently on assistance or PWD. There was a large number of people who had applied "a while ago", over 20 years, and they did not have issues with the application. Some of the issues that were raised around applying for assistance include:
-long wait-times, especially on the phone
-clawbacks of income from other sources (especially pension, and being forced onto an early pension) are extremely punitive and make it very difficult to live on
-long period before receiving first cheque
-a very difficult to understand application process, "It's like you have to be a lawyer to apply", and people saying that even with advocates it is hard
-crisis grants are too small and impossible to get, "you have to beg and cry"
-not being able to talk to a person; and the flip side of that, which is having to tell your story to too many workers
The biggest issue, on top of the totally inadequate rates, that people reported was the attitude they were met with in the office. Stigma, poor-bashing, discrimination, tone, lack of empathy: "the whole process is very degrading", "talking to the workers they make you feel like crap", "very rude and ignorant staff", being some of the comments we heard. This is not to be read as the worker's fault so much as it is the government's policies of diversion, and management culture, at fault. Vulnerable, marginalized people, carrying the weight of survival on their shoulders, deserve dignity, equity, to be treated like a human being and not a burden or a strain on the system. A robust social welfare net looks after people who are struggling, and does not cast them out on the street like that's all they deserve.
-guaranteed raise to income assistance and disability rates to meet $1600/month for a single person;
-end policies of diversion and stigmatizing work culture practices in ministry offices; engage in empathy training;
-bring back the system of "20 years ago", with individual case workers, well-funded crisis grants, and more supports and advocates available to help with applications;
-end punitive clawbacks on income assistance and disability cheques;
-work with community groups and clients to reform the entire ministry's service-delivery model to provide dignified service
On Housing: "Not Just Container Housing"!
Without fail, housing was the biggest concern people were facing. This emphasizes the necessity of having a robust, cross-ministerial poverty reduction plan, that cuts across government silos and looks at comprehensive solutions. When asked if the government needs to commit to more social housing for low-income people, 96% of people responded YES, and that it was a top priority for them. The 3 other people stressed it was important to have the housing be across neighbourhoods (i.e. not focused solely in the Downtown Eastside), and to be culturally relevant and at rents that would not strain a fixed income.
Again, the importance of rent control was brought up. This is a measure the government can implement immediately that would have profound effects on the stability and availability of housing options for people in poverty. Many people brought up concerns around supports for people struggling with mental health, and folks with addictions being able to access support should they want to. Raise the Rates supports the building of temporary modular housing as fast and efficiently as possible, in order to reduce BC Housing Waitlists, but we know that what people need are permanent homes, in good repair and in safe condition. The appalling comments of people living in SROs, and also in some social housing units (both non-profit and government run), about their housing conditions underlines the necessary measures needed to enforce maintenance by-laws and provide a standard of upkeep that allows people to live with dignity.
Concern was expressed for women, children, and families, and that having stable housing to allow families to "get back on their feet" to ensure their children aren't being apprehended was a major concern.
-invest in and immediately commit to building 10 000 units of social housing per year (at welfare and pension rates), to accommodate the massive need that has been gutted in the last 40 years of austerity policy
– implement vacancy control; that is, rent that is tied to a unit and not to a tenant, to protect what few remaining homes are available at affordable rates
-end homelessness right away by building temporary modular housing units
-end discriminatory rental policies, which disproportionately affect single mothers with children, racialized people, people with disabilities and LGBTQ2S people
Comments: "Everybody in this world counts"
When asked how governments can end poverty, a majority of respondents replied "they can't", "they won't", "they don't want to". One thing that was made clear in the weeks we did this survey, was how much distrust/mistrust has grown between people and the government. Years and years of hearing talk but no action has led to a very understandable level of cynicism. Homelessness has rampantly increased, cost of living is through the roof (if people can even afford to keep one over their head), the overdose crisis is killing thousands of valuable lives, police brutality is increasing against poor and racialized communities, and in all of this, the rich are getting richer.
Other issues that must be addressed include:
-free transit for low-income people, or a subsidized transit program
-training for people to take programs that will increase their employability, and more programs to support them into the workforce
-better paying and better quality jobs
-need better pharmacare for low-income people
-more education, and easier access to education
-less wait times for accessing all services (healthcare, detox, mental health supports, housing): "You can die waiting for help"
-end tax evasion, and push the federal government to close tax loopholes
-"government wants to keep people stupid"
-better support for, and less discrimination against, people with addictions
-crackdown on landlords/slumlords breaking laws and exploiting people
-an overhaul of police systems, and create more community accountability and less police on the streets
-end drug trafficking
-going to the "root cause" of problems, which different people defined as: capitalist system making real solutions impossible, dealing with people's trauma of residential schools and colonization, breaking cycles of poverty and violence in children's lives, "to make sure babies aren't being ripped from their families", "governments aren't supposed to raise kids", better care for mental illness
-charity and charitable businesses take advantage of the poor and make money off of them, instead of focusing on solutions that will end poverty
-tax the rich, and make them pay their fair share in progressive income taxes
-can't afford to build any pipelines, expand fish farms, build site C or engage in any damaging environmental project; support investment into green technology that doesn't violate Indigenous sovereignty
-higher earnings exemptions
-need more health clinics and overdose prevention sites, as well as counselling services and treatment centres on demand (not 6 months after someone wants to get clean)
-better coordination between municipal, provincial and federal governments
-need stronger unions and better jobs back
-housing as a human right, not a commodity
-control gentrification and provide more affordable services, especially food grocers, in poor neighbourhoods
-more drop-in centres
-more native housing for elders and families
-better public education on classism and poor-bashing
-support outreach centres and local groups doing community organizing
We strongly support and echo the calls of the community for self-determined solutions to poverty, and we urge the government to work hard, internally and externally, in policy, legislation and conduct, of commonly held belief that: "the government are the people making this problem, and they don't listen to us". Listen closely, and then take bold action to change business-as-usual. Give us something to thrive on.
Published by raisetherates
View all posts by raisetherates
Previous postStupid rules of welfare? Tell us about it!
Next postNot Surprised: Government Can (easily) Afford to End Deep Poverty.

redpajama_set_name: RedPajamaCommonCrawl


In the final analysis, the rich must not ignore the poor because both rich and poor are tied in a single garment of destiny. First and foremost, good communication between school staff and parents and guardians is essential. Do you stride in confidently or duck your head and race to a seat?
Immorality in youngsters has its roots in elders. Today, computers have touched the lives of several students living in the remotest part of our planet, be it directly or otherwise.
Unfortunately, in doing so, many colleges and companies demonstrate that they have not learned the fundamental lesson that not all Asian Americans are the same, and that not all are successful.
More of Your Faults. Their meaning can only be articulated by the inaudible language of the heart. We expect your attendance at all required meetings and school events.
Specifically, what will college life be like in ? It has meant, as I said, that we are no longer afraid and cowed.
Swerving would not be a safe maneuver for either the driver or other users on the road. Soon thereafter, many conservatives and opponents of affirmative action began to argue that these Asian American students were "victims" of affirmative action, just like Whites.
Sudden physical and social changes precipitate the crisis of identity; he seems to attribute indiscipline primarily to the failure to resolve role aspect of an identity. Then awaken at sunrise — or as close to it as you can muster.
In ten Thai women were arrested in India on prostitution charges for allegedly running two brothels masquerading as massage parlours.
What was left out that you now want to add? Gender differences play a role as well amongst teenagers, with a greater majority of male teens using illegal drugs There is no denying the fact that today many of our females in the senior secondary schools in an attempt to carter for their needs to into prostitutions, running after sugar daddies.
And what are the official school policies or unofficial arrangements enabling them to continue with their education? I will treat all members of the Success Academy team with respect.
Equality with whites will hardly solve the problems of either whites or Negroes if it means equality in a society under the spell of terror and a world doomed to extinction.
The card will reflect three areas of focus and highlight feedback on a green, yellow, and red scale. Is There A Middle Ground?Students, according to the Dean Students Affairs of University of Maiduguri, Ibrahirn (), suffer from physical and emotional pains of sexual assaults, most of which were not reported to school authorities for reasons only known to them.
The attitude of not reporting the acts further exposes other students to greater danger and health risks.
🔥Citing and more! Add citations directly into your paper, Check for unintentional plagiarism and check for writing mistakes. Extracurricular Activities If you aren't sure whether or not you should let your high school student get involved in extracurricular activities, you definitely need to consider all the benefits that come along with these activities.
Immoral Activities Among The School Student. equipped to play their part in society. It is in this wider sense that extra- curricular activities be considered along with education in developing the country. Obviously, for a country like Philippines, education is crucial since every aspect of our society reflects the failure to achieve a harmony between aspiration and performance or even between the existence of.


"The great marabout told us that Djantavi the prince could only cure if he drank turtle blood.
"My dear friends, I should like to tell his majesty that the hare has said the truth in his speech. But he forgot to mention that the great marabout was categorical on one point; For the blood of the turtle to be effective, it must be spread over a heart freshly plucked from the hare. That is why I give my blood.
The tortoise made a small notch in one of its legs and collected a little blood in a small calabash which it gave to the guards of the king. A few seconds later, the same guards seized the hare, which they sacrificed in a fraction of a second. The minute after, his heart was ripped and smeared with tortoise blood. The remedy thus concocted was administered to the Prince.
The association exhibits at the fair of the three days of the city of la Ferté-bernard African art objects, followed by a sale whose revenues allow the artists who made them to live from their craft. .


For serving at tea: Sift flour, baking soda, salt into mixing bowl. Add honey, enough buttermilk to make batter into pancake consistency. Heat griddle and grease lightly. Drop batter on griddle by spoonfuls. When bubbles appear all over surface, turn and brown other side. Butter pancakes as they are done. Serve pancakes with sugar sprinkled on top.
For serving at breakfast: Omit honey from batter. Fry on griddle greased with bacon drippings.


text:
Dorothy Parrish Hill
January 19, 1927 ~ July 3, 2019 (age 92)
Dorothy Parrish Hill, 92, of Newport, passed away Wednesday, July 3, 2019, at the Crystal Coast Hospice House.
Her funeral service will be held at 2 p.m. on Tuesday, July 9, 2019, at Holly Springs Original Free Will Baptist Church in Newport, officiated by Pastor Mitchell Parker and Pastor Jerry Linebarger. Interment will follow at Ameriah Garner Cemetery in Newport.
Dot, as she was known to all, was born and raised in Nashville, NC and moved to Newport where she and her husband, Wallace, raised four boys. She was a longtime member of Holly Springs Original Free Will Baptist Church and her life was a living example of one of her favorite Bible verses, Ephesians 4:32, "And be kind and compassionate to one another, forgiving one another, just as God also forgave you in Christ."
She is survived by her sons, David Hill and wife Mary and Gary Hill and fiancé Vicky Smith, Randy Hill all of Newport; daughter-in-law, Janet Hill of Newport; sister, Barbara Hyde and husband Al of Nashville; brother, Lewie Parrish and wife Mary of Newport News, VA; loving granddaughter, Tina Marie Hill Coffelt and fiancé Tony, Suzanne Bennett and husband Michael, Adam Cannon and wife Shanna; and all 7 great-grandchildren that she said made her "great". All of these she loved and touched deeply.
Preceding her in death was her devoted husband, Wallace B. Hill, Sr.; parents, Louis and Kate Parrish; and her son, Wallace "Wally" B. Hill, Jr.
In lieu of flowers, memorial donations can be made to the Crystal Coast Hospice House at P.O. Box 640, Newport, NC 28570 or to the Holly Springs Original Free Will Baptist Church at 182 Holly Springs Rd., Newport, NC 28570.
Crystal Coast Hospice House
PO Box 640, Newport NC 28570
Web: https://www.crystalcoasthospicehouse.org/donate-now/
Holly Springs Free Will Baptist Church
182 Holly Springs Rd., Newport NC 28570
Web: https://www.hollyspringsofwb.com/


The following was written by Gretchen Coyle, Beach Haven resident and docent of the Museum of NJ Maritime History.
In 2003 my mother died at the age of 100. While close-mouthed and proper to the extreme most of her life, she told me in her last decade that she saw the "Morro Castle" on fire from the Atlantic City Boardwalk. Could this be true?
Nothing could have been more terrifying than being a passenger or crew member aboard the "Morro Castle" in the early morning hours of September 7, 1934 when fire erupted in two places on the 508' long, 11,250 gross tons of elegant ship. Just hours after Captain Robert Willmott had been found dead in his stateroom of strange circumstances. "Acute indigestion" according to the ship's doctor Dr. DeWitt Van Zile.
Adding to the disaster was the fact that the ship was facing into the wind – a Northeasterly 30 mph blow – with a number of officers and crew bordering on incompetent. Starting in the First Class Writing Room, the midship flames were fanned by the wind and a temporary ship's captain who froze under the tragedy, never leaving the bridge to assess the damage. Probably the "Morro Castle" was doomed at the first sign of smoke.
During the Great Depression it was a rare luxury for people to afford a cruise on luxury liners, yet over 72,000 people took cruises in 1934. Built in 1929 – 1930 at the Newport News Shipbuilding and Dry Dock Company in Virginia, the "Morro Castle" and her sister ship "Oriente" were part of a congressional bill that loaned $250 million to American ship builders. Taking advantage of such an opportunity was the Ward Line, a mail and cargo line whose main route was back and forth to Cuba.
Costing $5 million, the "Morro Castle" was named after the fortress and lighthouse in Havana. For four years the ship made its way back and forth from Cuba usually half to completely full of passengers. While it was routinely maintained, and glossed over, the "Morro Castle" had never been pulled.
Paint covered everything (a detail that would only compound the tragedy), and drills and safety instructions were largely ignored. The crew changed hands routinely. Most were paid less that the government Civilian Conservation Corps workers, surly and inefficient. With a government contract to deliver mail and other goods between the U.S. and Cuba, punctuality was first and foremost in the Ward Line officials' minds.
Unhappiness and major grievances cast a pall on the last few months of the ship's existence. Agitators, Communists, discontents, and maybe even murderers, were part of the general mix. George Alagna was a radio operator who vocally expressed opposition over how most of the crew was treated to all who would listen. His fellow radio operator George Rogers turned out to be even more mysterious and sinister. Captain Willmott had major problems with his officers as well as the crew.
Moving ten miles off the coast of Delaware Bay "The ship looked like a photograph from a travel agent's brochure come to life … an outpost of paradise, an oasis at sea," Brian Hicks visualized. Dodging both the northeaster and a hurricane coming up the coast, the officers of the "Morro Castle" just wanted to get inside the safety of Sandy Hook, the entrance to New York Harbor by early the next morning.
A last night fancy ball was cancelled after Captain Willmott's demise. Passengers and crew became on edge. At 3:00am a fire erupted in a closet off from the Writing Room. Almost simultaneously another erupted elsewhere. Flames quickly engulfed the ship. A small number of the crew tried to put out the fire, while at the same time telling two young ladies who wanted to sound the alarm to be quiet lest they wake other passengers up.
Both officers and crew were paralyzed with fear and indecision, the result being a fire that quickly engulfed the ship. No order was given to stop or turn the "Morro Castle" around. Consequently, the blaze burned everything back through the stern in quick order. Although only a few fire hydrants were used, water pressure became extremely low.
In flames the ship proceeded out of control up the coast a few miles off shore. Panic ensued among passengers and crew. Many of the crew looked out for themselves as they dropped lifeboats and filled them. They did not direct terrified passengers who had received no life vest and lifeboat drills at sea. Although the ship had more than enough lifeboats – a rule enacted after the "Titanic" disaster – they were not filled. Some of the lifeboats were literally painted in place and could not be lowered.
More afraid of being burned to death than being in the water, many people jumped into the Atlantic Ocean. No one was told that cork life preservers needed to be held upon descent or they could cause injury such as broken necks or unconsciousness. No doubt this added to the fatalities.
The ornate wooden interior on the ship just added to an out of control raging fire. Cleaning fluid exploded, as did the Lyle Gun stored over the Writing Room, designed to attach its line to another ship to start evacuation. A SOS was oddly enough first heard by radio station WCS in Tuckerton, NJ. After a questionable sequence of events and time enacted by the radio operators, the word was spread.
Ships and local boats from the coastal Asbury Park area headed to the scene, rescuing a number of people in the water. Others had died from their fall, being crushed by the ship's propellers, or drowned during a night of high seas and bad weather.
The final tally was disastrous: six out of twelve lifeboats only were lowered, a total of 137 people died. Investigations took place after the ship had beached itself off the oceanfront Convention Hall at the summer resort of Asbury Park. Lawyers, passengers, crew, the FBI under the direction of J. Edgar Hoover and his brother, and the Ward Line all conducted inquiries into the tragedy. Testimony was conflicted and self-serving in cases.
The "Morro Caste" became an attraction seen by thousands over the ensuing months – first a smoldering hull, later a charred remains. Summer businesses extended their season well into the fall, making for the best season they had in years. Souvenirs were sold; hotels, boarding houses and restaurants did a brisk business.
Brian Hicks puts together now unclassified testimony and numerous information on radio operator George Rogers, who at first emerged as the hero of the "Morro Castle." Now revealed as a psychopath, liar, and murderer, Rogers is clearly shown for what he was – not the dependable radio operator who stayed by his post trying to raise a signal from another ship. He was a pyromaniac who, through his extraordinary knowledge of explosives and radio devices, managed to take down a large liner.
While hindsight draws many conclusions, one young seventeen year old on board as the third purser spent years telling groups of people that not all the crew was negligent. Some helped passengers and their fellow crew members. Tom Torresson testified, "When I first saw the beautiful 'Morro Castle' I fell in love with it." He went on to graduate from Norte Dame, the Army Air Corps, and became a flight instructor.
According to Hicks book, Torresson "had indefatigable energy … For most of his life he kept alive the notion of a grand cruise ship in its final glory days." "It's all baloney," Hicks quotes Torresson as saying after finding out the rumor for the high death toll was largely due to the crew. Tom Torresson died in 2005 at the age of eighty-nine, close to the seventy-first anniversary of the disaster.
The "Morro Castle" remained on the beach off Asbury Park for a few months in the fall of 1934. It was then towed to Baltimore, taken apart, and sold as scrap.
Neither the circumstances of Captain Robert Willmott's death nor the actual cause of the sinking of the "Morro Castle" have ever been officially determined.
To answer the question of whether my mother saw this ship burning from the Atlantic City Boardwalk: After a night of partying might she have seen a red glow in the distance and not known what it was? Or maybe she meant she saw the hull of the "Morro Castle" from the boardwalk in Asbury Park?
Could she have made up the whole thing? I will never know.
When the Dancing Stopped: The Real Story of the 'Morro Castle' Disaster and Its Deadly Wake by Brian Hicks.


Meet Mike Wood; our Technical Lead. Mike has been a huge contributor to the success of our ever-growing Motion team, in terms of skill and growth. Get to know Mike on a personal level and the exclusive story behind the vest… the best Affari office prank yet.
Affari actually found me! I began working at Affari half way through my last year at Nottingham Trent University where I studied Digital Media Design. It was a bit risky, but luckily my course curriculum was inverted. This meant most of the time consuming work had been completed at the beginning of the year. Don't get me wrong, it was quite difficult trying to find the balance between my studies and working, but being offered a job whilst still being a student is a rarity – so I couldn't pass on the opportunity!
1 – I'm committed to creating the best work I can and pushing others to do the same.
2 – Passionate; I think everyone would probably agree with me on this one!
3 – Honesty; I think constructive criticism is key in order to develop.
My best experience was when I was 18 years old and I went on my first lads holiday to Cyprus. It was the realisation of being independent and having that freedom, whilst in the company of your best mates – you can't beat it!
So… I spend a lot of time on my computer, which benefits the company I guess! But to try and balance it out, I go to the gym because I believe in keeping active. I also take a huge interest in boxing and actually used to box for 4 years myself. However, I just watch it from the sofa now.
I also have this weird habit when I'm watching a TV programme or film, I always google the celebrities net worth!
I can't say I have a favourite quote as there's too many to choose from! I do like the quotes about subjective design and how everyone sees design differently, or the ones that emphasise the importance of good design!
I really want to go to America, I know it's really lame but I've never been! I'd like to visit New York (obviously) and see all the tourist locations like the Statue of Liberty. I'd also like to visit the Breaking Bad film set, I think that'd be really interesting!
'Shots Mike' is somebody who hasn't been out in a while… but he is ultimately the reason why Mike (myself) stays away from alcoholic shots! The story behind this persona was when myself, Maria and Jake attended a concert at Rock City and I ended up having one too many because we were dreading the gig and I managed to bag myself the nickname of 'Shots Mike'!
What is the story behind the vest?
I can remember it like it was yesterday! So back in the early days, I was fairly new to Affari and had only been working there for around three weeks. Ben, our Creative Director, was taking some pictures in front of the green screen in the media suite to see how far we could push the use of this technology and was trying to get us all involved.
Jake was moaning, refusing to take part and I was the same. But then, Jordan and Korie somehow managed to convince me to get behind the camera. So I'm in this photoshoot, getting really into it, pulling all kinds of poses and next thing you know, they tell me to take my t-shirt off (knowing I had a vest on underneath) and so I did. So there are photos of me striking a pose in my vest floating around somewhere on the server… 3 years later and I'm still not hearing the end of it.
How would you describe your role 'Technical Lead' job to a child?
You know "Pixar" and how they make fancy moving pictures for films. I do that, but not as high budget!


The Hala Atcha 86 is the most stable and responsive whitewater inflatable SUP in its category. Stability's a given for any whitewater board, but responsiveness is where the Atcha sets itself apart. Whether upping your whitewater game, or starting out and ready to go from zero-to-hero, the Atcha stomps your favorite river run – and it LOVES yoga!


[PDF] The Tel Aviv Dossier | Free eBooks Download - EBOOKEE!
Description: A potent mixture of biblical allusions, Lovecraftian echoes, and contemporary culture, The Tel Aviv Dossier is part supernatural thriller, part meditation on the nature of belief, an original and involving novel painted on a vast canvas in which, beneath the despair, humour is never absent.
No comments for "[PDF] The Tel Aviv Dossier".


If is mision critical you could just buy a very cheap/small hd and make a new boot. Or partition the hd to do the same. On osx I just create a new user with admin priv and install there the new cura, to avoid losing stuff, and is easy to remove without affecting my main user. But I haven't do that since 2.3 was final, I suppose it should work. Also just a new boot hd or even better a vmware machine to have all contained to test?
I agree. Having two versions of Cura on the same machine would be great.
Then you can just switch users to switch Cura versions.
Not an elegant solution, but perhaps a patch until multiple versions are supported under the same User account.
Can I just add my request to the list to sort out the implementation process so that different versions of Cura can co-exist on the same laptop.
You're not the first. This is something we're looking into. Our current focus is improving the speed & improving automated testing.
Funny thing: a switch for versions is already done for cache!
...but what happens if you accidentally start 2.4.0 while 2.3.1 is already running...(and vice versa)?
I just saw this. @fma: I like your script idea!
Much better than my setup. I have 15.x in an chroot jail, 2.3.1 on my main install, and 2.4 is setup in my Windows dual-boot. It is a total mess.
I've done symlink manipulations for Minecraft before, I do not know why I did not think of it for Cura.
One nice thing about chrooted environments is that this is not an issue. But they are not exactly trivial to set up right.
One could put in a check in the script to see if a Cura process is already running and if so, abort with a message saying so. Then 2 instances would not be able to run simultaneously.
Posted February 1, 2017 · Cura 2.4 beta is here!
Nice one DaHai8 . I have just installed 2.4 Beta2 under Win10 and as you say it seems to be separated perfectly. I can switch between users and load the relevant version of Cura. Strangely I had some issue with finding the Appdata folder for the new user account but resolved now and it has its own custom printer and settings files created by myself and my original ones remain in Appdata under my main user account. So everything looks great!
Sure not 100% perfect, I have a large number of files and folders I would need to move to Public data so the new account can see them (or maybe if I make them shareable that would work too) and make it seamless. But for looking at 2.4 in earnest and testing it that will not be a hassle.
Another hour and I think I will be confident to go to the 3D printing laptop and load 2.4 on there!
Posted February 7, 2017 · Cura 2.4 beta is here!
Has anyone noticed support interfaces behaving oddly? Specifically, support interfaces on the top of support structures seem to be giving me one layer less of interface material than specified, and give me a skipped layer instead.
Posted February 10, 2017 · Cura 2.4 beta is here!
Hi @nallath well I have been running 2.4Beta 2 for the past week and very pleased with it - although at least once and I think twice, it has lost my custom printer definition.
Now, I normally just set the laptop to Sleep when I have finished so 2.4 has not really been loaded since it was installed - maybe once but not sure. Anyway I needed a reboot so I had to close 2.4. Now it will not load. I uninstalled and reinstalled but it will still not reload.
So I have gone back to 2.3.1 and will try again when the 2.4 release proper is made - hopefully it will load then!!
Posted February 21, 2017 · Cura 2.4 beta is here!
Cura 2.4 seems to be quite...uh...clumsy when it comes to prefs. It stomped on 2.3 prefs when installing. And it seems to nuke it's preferences & custom printer definition every time it freezes...which is very frequently. :( I've resorted to creating a zip of my cura prefs folder, and I've got a batch file to kill cura and restore settings. from the zip.
I have to use the batch file a LOT some days.
Uh. That definately should not happen. Could you post the log files?
Hi @nallath, sorry no can do. As I said in a few posts above 2.4b2 died on me and during the process of reinstalling then deleting and installing 2.3 I lost the log files.
As it happens on Sunday Windows 10 died on me and after 10 hours or so I gave up and today had to spend eu500 on a new laptop :angry: So I now have 2.4 installed and running again. If the problem with the customised printer defn. happens again I WILL send the log file.
Posted February 28, 2017 · Cura 2.4 beta is here!
In the help file there is a show local folder option. At the very least i need the cura.log file there. The entire folder is better, as i can see better what's going on.


Stereotypies in animals are thought to arise from an interaction between genetic predisposition and sub-optimal housing conditions. In domestic horses, a well-studied stereotypy is crib-biting, an abnormal behaviour that appears to help individuals to cope with stressful situations. One prominent hypothesis states that animals affected by stereotypies are cognitively less flexible compared to healthy controls, due to sensitization of a specific brain area, the basal ganglia. The aim of this study was to test this hypothesis in crib-biting and healthy controls, using a cognitive task, reversal learning, which has been used as a diagnostic for basal ganglia dysfunction. The procedure consisted of exposing subjects to four learning tasks; first and second acquisition, and their reversals. For each task, we measured the number of trials to reach criterion and heart rate and heart-rate variability. Importantly, we did not try to prevent crib-biters from executing their stereotypic behaviour. We found that the first reversal learning task required the largest number of trials, confirming its challenging nature. Interestingly, the second reversal learning task required significantly fewer trials to reach criterion, suggesting generalisation learning. However, we did not find any performance differences across groups; both stereotypic and control animals required a similar numbers of trials and did not differ in their physiological responses. Our results thus challenge the widely held belief that crib-biting horses, and stereotypic animals more generally, are cognitively impaired. We conclude that cognitive underperformance may occur in stereotypic horses if they are prevented from crib-biting to cope with experienced stress.
We are grateful to all the owners of the horses who offered to participate in this study. We are also grateful to Matthew Parker, who gave us the idea to perform this study and helped us with the design of the experiment.
The experimental procedure for the horses was approved by the Federal Veterinary Office (approval number VD 26777 bis; Switzerland).


If you are considering a proposal to develop or subdivide land, or change what you currently do with your land, you may require planning permission.
Below you will find information on planning matters within Banyule. We recommend that you read the relevant information and become familiar with this information that is relevant to your planning matter.
Banyule City Council's planning officers can also assist you to establish if you require a planning permit.
If a more detailed response is required - including written advice and/or appraisal of a proposal - please use our Specific Planning Advice and Pre-application service.


text:
China's retaliation against new Trump tariffs will send U.S. hog farmers into a tailspin
libadmin May 17, 2019
Hogs are raised on the farm of Ted Fox near Osage, Iowa. (Scott Olson/Getty Images)
Chinese buyers canceled a major order for American pork, the U.S. Department of Agriculture said Thursday, heightening fears that the U.S.-China trade dispute was set to inflict even more pain on American farmers who have taken a series of hits in Trump's trade wars.
As of April 18 there were export commitments of American pork to China of 150,000 metric tons, only 50,000 of which had been shipped, leaving others in the balance.
The uncertainty is unsettling farmers like Randy Spronk who raises 250,000 pigs a year at his farm in Pipestone County, Minn., and sells to giant food processing companies like JBS, Tyson and Hormel.
The U.S. withdrawal from the Trans-Pacific Partnership Agreement in 2017 cost American farmers market share in Japan. Spronk says 20 percent tariffs in Mexico have cost hog farmers an additional $12 per animal and that an earlier round of Chinese retaliatory tariffs cost $8 per animal.
"American pork is a $6.4 billion export market, but we've been hit more than any other sector," Spronk says. "Our highest value markets are the ones that are impacted by these tariffs. We got side swiped. The additive effects of these tariffs come out of my back pocket."
Hog farmers saw a small financial uptick in March, attributed to the prospect of selling into China after that country's pig industry was decimated by African swine fever.
That seems unlikely to happen now. The latest escalation of tariffs means that American pork will not be economically competitive in China.
Still, Joe Brusuelas, chief economist at RSM, thinks pork is an important negotiating tool with China.
"If the administration is serious about seeking a deal, that is clearly the path of least resistance," he said. "Because of African swine fever and their own domestic situation, China doesn't really have a choice and they will have to fulfill their needs by global supply."
With the imminent release of the U.S. Department of Agriculture's new trade relief program for farmers and ranchers, a battle has begun among agricultural sectors about who should get what, how much and in what form, and exactly who has suffered the worst losses due to trade disputes.
[US farmers who sell to China feel pain of Beijing's tariffs]
President Trump has promised at least $15 billion, a number he says corresponds to Chinese purchases of American agricultural products. This is on top of $12 billion distributed as relief to farmers last year to offset losses associated with Chinese retaliatory duties.
With that $12 billion, there were winners (soy) and losers (corn and wheat), specialty crops that were singled out for assistance (cherries and almonds) and other parts of the American food system that received no aid at all despite discernible losses due to tariffs (the seafood industry).
Spronk's hogs have been part of the export market for years. Japan has historically been No. 1 by price and volume, buying high-value loins; Mexico is No. 2 by price, buying mostly hams. China has been the No. 3 export country, using up organs, feet and other lower-value cuts; Korea is in fourth place, prizing shoulder cuts, and Canada represents the fifth market by volume.
What Spronk wants to see is the removal of tariffs from Mexican and Canadian steel and aluminum (and thus retaliatory tariffs from Mexico), free trade agreements with Japan and China, and the ratification of the United States-Mexico-Canada Agreement.
"I don't want the check from the government, I want to take pride in what I do. I want to compete," he said.
[Perdue says farmer aid package still a work in progress]
Even within his own industry, there is dissent on what relief should look like.
Nick Giordano, vice president and counsel for the National Pork Producers Council, says the pork industry will ask the USDA to purchase pork for food aid. He says food banks and noncommercial channels represent a win for consumers and those in need without driving down pork prices with a glut on the market.
Senator Charles E. Grassley (R-Iowa) and others have indicated that purchasing farmers' excess for international food relief would be subject to World Trade Organization violations.
"Unless the food is used for humanitarian reasons we'd be subject to WTO violation," Grassley told The Washington Post early this week. "If (President Trump) buys up $15 billion and he can't ship it overseas because he doesn't want to violate the WTO . . . then it's a depressant on the market because people know that the government holds so much grain."
"Trump has opened the door to helping needy people outside the U.S.," Giordano says, "And that's the door we want to walk through. Most of our producers are going to say, 'So what if there's a WTO issue? We've got a five-alarm fire on our hands.' I defy anybody to look my producers in the eye and tell them the government shouldn't work with them on pork as food aid."
Although pork is just one of many sectors of American agriculture that have been injured by the trade wars, it is likely the hardest hit of the animal agriculture categories. The U.S. accounts for a relatively small share of beef and poultry sold into China because of other non-tariff barriers.
But there's one American protein that has been welcomed with open arms in recent years in China: Maine lobster.
[The first round of China tariffs already stifled U.S. exports]
In the early 1990s there were 30 to 40 million pounds caught annually; by 2011 that number had grown to 100 million pounds. Producers like Tom Adams of Maine Coast, a lobster wholesaler, had to find new customers who weren't going to drive down the domestic price.
"We started shipping to China in 2013 and it was our fastest growth area. Asia accounted for 40 percent of our sales in 2016 and 2017, and China accounted for half of that, $10 million a year in revenue from China."
He had three weeks' notice about the last round of retaliatory Chinese tariffs, which went into effect July 6, 2018. He had to make a fast pivot to find additional domestic sales, and he says the Canadian lobster industry has swooped in to sell to China.
"We were already at a trade disadvantage in the E.U. with Canada. In 2018 we had 35 percent of our market affected negatively by a trade agreement or trade war."
Of the upcoming trade relief program, Adams isn't hopeful.
"Grains play a much bigger role in our economy, but it bothers us as seafood industry members that we've never really been represented. We fall under agriculture but not in these relief programs. Our net income has been affected much like soy. These tariffs have affected by employees, my family and my industry."
Trump wants his border barrier to be painted black with spikes. He has other ideas, too.
#MeToo backlash: More male managers avoid mentoring women or meeting alone with them
China's commerce minister, joining trade talks, says there's need to 'uphold our warrior spirit'
SpaceX blames faulty valve for Dragon spacecraft explosion
libadmin May 17


Tom McNeill from Galgorm Resort & Spa, Joe Gallagher from Douglas Wallace Architects, Alastair Martin from Martin & Hamilton, David Hamilton from Martin & Hamilton with the Tourism & Leisure award, Neil McClintock from McClintock Consulting (Project Manager), Gerard Graham from Martin & Hamilton and Gerry Hand from Douglas Wallace Architects pictured at the at the Royal Institution of Chartered Surveyors Northern Ireland awards. (Submitted Picture).
Ballymena-based chartered construction company Martin & Hamilton has won a presitigious RICS award.
The company recently won the Tourism & Leisure category at the Royal Institution of Chartered Surveyors (RICS) Northern Ireland awards event for its work on the recent expansion project at Galgorm Resort & Spa.
Martin & Hamilton was the main-contractor for the 18-month project, which involved the construction of a four storey extension to the hotel including 45 deluxe guest rooms, three luxurious suites, a new indoor swimming pool, associated spa facilities, and an outdoor thermal spa village.
The judges praised the construction methodology and sustainability features of the building.
Commenting on the project, David Hamilton, Managing Director of Martin & Hamilton said: "We are delighted to have won this award. Along with some key subcontractors, we have a dedicated team who deserve credit for their work on the project. We prioritised the use of local supply chain members and craftsmen with traditional building skills. The standard of finish is particularly high and clear for all to see. We wish the hotel every success for the future".


text:
Donald Trump & Jared Kushner's Companies Benefitted From PPP Loans, Report Says
Drew Angerer / Getty Images
Tyler MacDonald
The Small Business Administration released data on Tuesday that revealed how companies owned by Donald Trump and Jared Kushner profited from the Paycheck Protection Program (PPP) program.
As reported by NBC News, over 25 PPP loans worth more than $3.65 million were funneled to real estate properties owned by Trump and Kushner. However, the publication noted that the majority of the money was not used to sustain employment.
"Fifteen of the properties self-reported that they only kept one job, zero jobs or did not report a number at all."
According to NBC News, the money provided to Trump and Kushner's properties included close to $2.2 million to the Triomphe Restaurant Corp. located at the Trump International Hotel & Tower in New York City. The company allegedly did not use the funds to keep jobs and closed after receiving the money.
Elsewhere, two tenants at 725 5th Avenue, Trump Tower, received over $100,000, and four tenants at the Kushner-owned 666 5th Avenue collected over $204,000. Across both operations, only nine jobs were kept. In addition, Kushner's Bungalow Hotel in Long Branch received $505,552.50 and kept 155 jobs.
Per Fast Company, a spokesperson for Kushner Companies pushed back on claims that some of its businesses "somehow improperly benefited" from the PPP loans. According to the spokesperson, such claims are "politically motivated nonsense."
Win McNamee / Getty Images
According to NBC News, the data showed various signs of troubled management, including over 100 loans that were provided to companies that did not provide their business name. In addition, some operations appeared to have collected more than $10 million per entity — an amount that was reserved for establishments in the hospitality, food, and hotel industries.
"The PPP programs' original stated intent by officials was to help with payroll for small businesses struggling under the effects of coronavirus lockdown measures," the publication reported.
"The loans aimed to provide a bridge through the summer for what was hoped to be an improved economic and health climate in the fall."
Progressive commentator David Pakman commented on the benefits Trump and Kushner received from the PPP loans and contrasted it to the Republican Party's purported opposition to socialism.
"Trump and Jared Kushner grifted the hell out of the coronavirus stimulus money, but Joe Biden is the socialist."
As The Inquisitr reported, the first round of PPP loans ran out quickly, and one factor was the significant amount of funding that went to large businesses as opposed to the small operations that the program was intended to keep afloat. Although large companies technically still qualified under the second round, the Trump administration discouraged them from applying.


text:
TAQA CFO to return to Canada; Successor Appointed
Abu Dhabi, UAE – The Abu Dhabi National Energy Company PJSC ("TAQA"), a publicly listed company on the Abu Dhabi Securities Exchange (ADX: TAQA), would like to announce that Doug Fraser, Chief Finance Officer (CFO), is leaving the company to return to Canada. Doug announced his intentions earlier this year and the company has used its time to identify the right successor.Stephen Kersley has been appointed as the CFO, and will take up his duties from 22 May 2011. Stephen's appointment as CFO comes after many years of wide-ranging experience at Shell. He brings more than 20 years of corporate finance, strategic planning and management experience to TAQA, having recently served as Vice President – Finance. Stephen will be based in the company's corporate headquarters in Abu Dhabi, United Arab Emirates and will provide input and financial leadership to the company and have responsibility for the development and execution of the financial strategy.H.E. Abdulla Saif Al Nuaimi, Chief Executive Officer and Managing Director of TAQA, said:"Over the past three years, Doug has made a significant contribution to TAQA's financial management and investor relations. For some time, Doug has made clear his wish to return to Canada, to spend more time with his family. We are grateful to Doug for his service and wish him well in all his future endeavours."Carl Sheldon, General Manager, commented:"We are very appreciative of Doug's contribution to TAQA and we wish him well for the future. We have taken the time to find the right replacement and are pleased to have found someone with Stephen's knowledge and experience. His expertise and track record at Shell will be a significant asset to TAQA as we continue to deliver the company's strategy and realise our full potential."Doug Fraser, outgoing Chief Financial Officer, commented:"It was a very difficult decision to leave and I have enjoyed my time at TAQA, particularly working with my colleagues. My plan is to return home to Canada to be closer to my family, which is a better fit for my goals and aspirations at this stage in my life. I believe TAQA has a bright future and I wish my colleagues all the best."Stephen Kersley, incoming Chief Financial Officer, commented:"TAQA has grown tremendously over the last few years, building a robust global energy business. I look forward to working with the team to help take the business through the next stage of its development."Doug will remain with the company until 30 June 2011 allowing sufficient time for a seamless transition.- END -NOTES TO EDITORSAbu Dhabi National Energy Company (TAQA)Abu Dhabi National Energy Company (TAQA) is a global energy company majority owned by the Abu Dhabi Government and listed on the Abu Dhabi Securities Exchange. Our main activities include our oil and gas business, power generation and water desalination across four continents.We are the sixth-largest independent power producer in the world and the majority owner of the facilities that provide 98% of the water and electricity requirements in the Emirate of Abu Dhabi. Our power plants are located in the United Arab Emirates, Morocco, Saudi Arabia, Ghana, India, and the United States.With operations in the UK, the Netherlands, the United States and Canada, our oil and gas business includes exploration and production, gas storage and pipeline transportation.In the Netherlands our established gas storage business includes operating the Alkmaar Peak Gas Installation (PGI). With our partner EBN, an independent company with the Dutch State as its sole shareholder, we are also developing the Bergermeer Gas Storage facility. This will make a major contribution to the security of gas supply to Northwest Europe, and provide a strong base for the Northwest European Gas Hub.Our entrepreneurial culture, along with a commitment to people, safety and the environment, has created strong foundations for the long-term sustainable growth of our business.Contact Information for Media:Allan Virtanen
TAQA Media Relations, Abu Dhabi
Tel +971 2 691 4894; Mob +971 56 685 2717
Allan.Virtanen@taqaglobal.com