text:
package com.dseuss.deskclock.alarms;

import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.PowerManager;
import android.preference.PreferenceManager;
import android.widget.Toast;

import com.dseuss.deskclock.AlarmAlertWakeLock;
import com.dseuss.deskclock.AlarmClockFragment;
import com.dseuss.deskclock.AlarmUtils;
import com.dseuss.deskclock.AsyncHandler;
import com.dseuss.deskclock.DeskClock;
import com.dseuss.deskclock.Log;
import com.dseuss.deskclock.R;
import com.dseuss.deskclock.SettingsActivity;
import com.dseuss.deskclock.Utils;
import com.dseuss.deskclock.provider.Alarm;
import com.dseuss.deskclock.provider.AlarmInstance;

import java.util.Calendar;
import java.util.List;

/**
 * This class handles all the state changes for alarm instances. You need to
 * register all alarm instances with the state manager if you want them to
 * be activated. If a major time change has occurred (ie. TIMEZONE_CHANGE, TIMESET_CHANGE),
 * then you must also re-register instances to fix their states.
 *
 * Please see {@link #registerInstance) for special transitions when major time changes
 * occur.
 *
 * Following states:
 *
 * SILENT_STATE:
 * This state is used when the alarm is activated, but doesn't need to display anything. It
 * is in charge of changing the alarm instance state to a LOW_NOTIFICATION_STATE.
 *
 * LOW_NOTIFICATION_STATE:
 * This state is used to notify the user that the alarm will go off
 * {@link AlarmInstance.LOW_NOTIFICATION_HOUR_OFFSET}. This
 * state handles the state changes to HIGH_NOTIFICATION_STATE, HIDE_NOTIFICATION_STATE and
 * DISMISS_STATE.
 *
 * HIDE_NOTIFICATION_STATE:
 * This is a transient state of the LOW_NOTIFICATION_STATE, where the user wants to hide the
 * notification. This will sit and wait until the HIGH_PRIORITY_NOTIFICATION should go off.
 *
 * HIGH_NOTIFICATION_STATE:
 * This state behaves like the LOW_NOTIFICATION_STATE, but doesn't allow the user to hide it.
 * This state is in charge of triggering a FIRED_STATE or DISMISS_STATE.
 *
 * SNOOZED_STATE:
 * The SNOOZED_STATE behaves like a HIGH_NOTIFICATION_STATE, but with a different message. It
 * also increments the alarm time in the instance to reflect the new snooze time.
 *
 * FIRED_STATE:
 * The FIRED_STATE is used when the alarm is firing. It will start the AlarmService, and wait
 * until the user interacts with the alarm via SNOOZED_STATE or DISMISS_STATE change. If the user
 * doesn't then it might be change to MISSED_STATE if auto-silenced was enabled.
 *
 * MISSED_STATE:
 * The MISSED_STATE is used when the alarm already fired, but the user could not interact with
 * it. At this point the alarm instance is dead and we check the parent alarm to see if we need
 * to disable or schedule a new alarm_instance. There is also a notification shown to the user
 * that he/she missed the alarm and that stays for
 * {@link AlarmInstance.MISSED_TIME_TO_LIVE_HOUR_OFFSET} or until the user acknownledges it.
 *
 * DISMISS_STATE:
 * This is really a transient state that will properly delete the alarm instance. Use this state,
 * whenever you want to get rid of the alarm instance. This state will also check the alarm
 * parent to see if it should disable or schedule a new alarm instance.
 */
public final class AlarmStateManager extends BroadcastReceiver {
    // These defaults must match the values in res/xml/settings.xml
    private static final String DEFAULT_SNOOZE_MINUTES = "10";

    // Intent action to trigger an instance state change.
    public static final String CHANGE_STATE_ACTION = "change_state";

    // Intent action to show the alarm and dismiss the instance
    public static final String SHOW_AND_DISMISS_ALARM_ACTION = "show_and_dismiss_alarm";

    // Extra key to set the desired state change.
    public static final String ALARM_STATE_EXTRA = "intent.extra.alarm.state";

    // Extra key to set the global broadcast id.
    private static final String ALARM_GLOBAL_ID_EXTRA = "intent.extra.alarm.global.id";

    // Intent category tag used when schedule state change intents in alarm manager.
    public static final String ALARM_MANAGER_TAG = "ALARM_MANAGER";

    // Buffer time in seconds to fire alarm instead of marking it missed.
    public static final int ALARM_FIRE_BUFFER = 15;

    public static int getGlobalIntentId(Context context) {
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
        return prefs.getInt(ALARM_GLOBAL_ID_EXTRA, -1);
    }

    public static void updateGloablIntentId(Context context) {
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
        int globalId = prefs.getInt(ALARM_GLOBAL_ID_EXTRA, -1) + 1;
        prefs.edit().putInt(ALARM_GLOBAL_ID_EXTRA, globalId).commit();
    }

    /**
     * Find and notify system what the next alarm that will fire. This is used
     * to update text in the system and widgets.
     *
     * @param context application context
     */
    public static void updateNextAlarm(Context context) {
        AlarmInstance nextAlarm = null;
        ContentResolver cr = context.getContentResolver();
        String activeAlarmQuery = AlarmInstance.ALARM_STATE + "<" + AlarmInstance.FIRED_STATE;
        for (AlarmInstance instance : AlarmInstance.getInstances(cr, activeAlarmQuery)) {
            if (nextAlarm == null || instance.getAlarmTime().before(nextAlarm.getAlarmTime())) {
                nextAlarm = instance;
            }
        }
        AlarmNotifications.broadcastNextAlarm(context, nextAlarm);
    }

    /**
     * Used by dismissed and missed states, to update parent alarm. This will either
     * disable, delete or reschedule parent alarm.
     *
     * @param context application context
     * @param instance to update parent for
     */
    private static void updateParentAlarm(Context context, AlarmInstance instance) {
        ContentResolver cr = context.getContentResolver();
        Alarm alarm = Alarm.getAlarm(cr, instance.mAlarmId);
        if (alarm == null) {
            Log.e("Parent has been deleted with instance: " + instance.toString());
            return;
        }

        if (!alarm.daysOfWeek.isRepeating()) {
            if (alarm.deleteAfterUse) {
                Log.i("Deleting parent alarm: " + alarm.id);
                Alarm.deleteAlarm(cr, alarm.id);
            } else {
                Log.i("Disabling parent alarm: " + alarm.id);
                alarm.enabled = false;
                Alarm.updateAlarm(cr, alarm);
            }
        } else {
            // This is a optimization for really old alarm instances. This prevent us
            // from scheduling and dismissing alarms up to current time.
            Calendar currentTime = Calendar.getInstance();
            Calendar alarmTime = instance.getAlarmTime();
            if (currentTime.after(alarmTime)) {
                alarmTime = currentTime;
            }
            AlarmInstance nextRepeatedInstance = alarm.createInstanceAfter(alarmTime);
            Log.i("Creating new instance for repeating alarm " + alarm.id + " at "  +
                    AlarmUtils.getFormattedTime(context, nextRepeatedInstance.getAlarmTime()));
            AlarmInstance.addInstance(cr, nextRepeatedInstance);
            registerInstance(context, nextRepeatedInstance, true);
        }
    }

    /**
     * Utility method to create a proper change state intent.
     *
     * @param context application context
     * @param tag used to make intent differ from other state change intents.
     * @param instance to change state to
     * @param state to change to.
     * @return intent that can be used to change an alarm instance state
     */
    public static Intent createStateChangeIntent(Context context, String tag,
            AlarmInstance instance, Integer state) {
        Intent intent = AlarmInstance.createIntent(context, AlarmStateManager.class, instance.mId);
        intent.setAction(CHANGE_STATE_ACTION);
        intent.addCategory(tag);
        intent.putExtra(ALARM_GLOBAL_ID_EXTRA, getGlobalIntentId(context));
        if (state != null) {
            intent.putExtra(ALARM_STATE_EXTRA, state.intValue());
        }
        return intent;
    }

    /**
     * Schedule alarm instance state changes with {@link AlarmManager}.
     *
     * @param context application context
     * @param time to trigger state change
     * @param instance to change state to
     * @param newState to change to
     */
    private static void scheduleInstanceStateChange(Context context, Calendar time,
            AlarmInstance instance, int newState) {
        long timeInMillis = time.getTimeInMillis();
        Log.v("Scheduling state change " + newState + " to instance " + instance.mId +
                " at " + AlarmUtils.getFormattedTime(context, time) + " (" + timeInMillis + ")");
        Intent stateChangeIntent = createStateChangeIntent(context, ALARM_MANAGER_TAG, instance,
                newState);
        PendingIntent pendingIntent = PendingIntent.getBroadcast(context, instance.hashCode(),
                stateChangeIntent, PendingIntent.FLAG_UPDATE_CURRENT);

        AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
        if (Utils.isKitKatOrLater()) {
            am.setExact(AlarmManager.RTC_WAKEUP, timeInMillis, pendingIntent);
        } else {
            am.set(AlarmManager.RTC_WAKEUP, timeInMillis, pendingIntent);
        }
    }

    /**
     * Cancel all {@link AlarmManager} timers for instance.
     *
     * @param context application context
     * @param instance to disable all {@link AlarmManager} timers
     */
    private static void cancelScheduledInstance(Context context, AlarmInstance instance) {
        Log.v("Canceling instance " + instance.mId + " timers");

        // Create a PendingIntent that will match any one set for this instance
        PendingIntent pendingIntent = PendingIntent.getBroadcast(context, instance.hashCode(),
                createStateChangeIntent(context, ALARM_MANAGER_TAG, instance, null),
                PendingIntent.FLAG_UPDATE_CURRENT);

        AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
        am.cancel(pendingIntent);
    }

    /**
     * This will set the alarm instance to the SILENT_STATE and update
     * the application notifications and schedule any state changes that need
     * to occur in the future.
     *
     * @param context application context
     * @param instance to set state to
     */
    public static void setSilentState(Context context, AlarmInstance instance) {
        Log.v("Setting silent state to instance " + instance.mId);

        // Update alarm in db
        ContentResolver contentResolver = context.getContentResolver();
        instance.mAlarmState = AlarmInstance.SILENT_STATE;
        AlarmInstance.updateInstance(contentResolver, instance);

        // Setup instance notification and scheduling timers
        AlarmNotifications.clearNotification(context, instance);
        scheduleInstanceStateChange(context, instance.getLowNotificationTime(),
                instance, AlarmInstance.LOW_NOTIFICATION_STATE);
    }

    /**
     * This will set the alarm instance to the LOW_NOTIFICATION_STATE and update
     * the application notifications and schedule any state changes that need
     * to occur in the future.
     *
     * @param context application context
     * @param instance to set state to
     */
    public static void setLowNotificationState(Context context, AlarmInstance instance) {
        Log.v("Setting low notification state to instance " + instance.mId);

        // Update alarm state in db
        ContentResolver contentResolver = context.getContentResolver();
        instance.mAlarmState = AlarmInstance.LOW_NOTIFICATION_STATE;
        AlarmInstance.updateInstance(contentResolver, instance);

        // Setup instance notification and scheduling timers
        AlarmNotifications.showLowPriorityNotification(context, instance);
        scheduleInstanceStateChange(context, instance.getHighNotificationTime(),
                instance, AlarmInstance.HIGH_NOTIFICATION_STATE);
    }

    /**
     * This will set the alarm instance to the HIDE_NOTIFICATION_STATE and update
     * the application notifications and schedule any state changes that need
     * to occur in the future.
     *
     * @param context application context
     * @param instance to set state to
     */
    public static void setHideNotificationState(Context context, AlarmInstance instance) {
        Log.v("Setting hide notification state to instance " + instance.mId);

        // Update alarm state in db
        ContentResolver contentResolver = context.getContentResolver();
        instance.mAlarmState = AlarmInstance.HIDE_NOTIFICATION_STATE;
        AlarmInstance.updateInstance(contentResolver, instance);

        // Setup instance notification and scheduling timers
        AlarmNotifications.clearNotification(context, instance);
        scheduleInstanceStateChange(context, instance.getHighNotificationTime(),
                instance, AlarmInstance.HIGH_NOTIFICATION_STATE);
    }

    /**
     * This will set the alarm instance to the HIGH_NOTIFICATION_STATE and update
     * the application notifications and schedule any state changes that need
     * to occur in the future.
     *
     * @param context application context
     * @param instance to set state to
     */
    public static void setHighNotificationState(Context context, AlarmInstance instance) {
        Log.v("Setting high notification state to instance " + instance.mId);

        // Update alarm state in db
        ContentResolver contentResolver = context.getContentResolver();
        instance.mAlarmState = AlarmInstance.HIGH_NOTIFICATION_STATE;
        AlarmInstance.updateInstance(contentResolver, instance);

        // Setup instance notification and scheduling timers
        AlarmNotifications.showHighPriorityNotification(context, instance);
        scheduleInstanceStateChange(context, instance.getAlarmTime(),
                instance, AlarmInstance.FIRED_STATE);
    }

    /**
     * This will set the alarm instance to the FIRED_STATE and update
     * the application notifications and schedule any state changes that need
     * to occur in the future.
     *
     * @param context application context
     * @param instance to set state to
     */
    public static void setFiredState(Context context, AlarmInstance instance) {
        Log.v("Setting fire state to instance " + instance.mId);

        // Update alarm state in db
        ContentResolver contentResolver = context.getContentResolver();
        instance.mAlarmState = AlarmInstance.FIRED_STATE;
        AlarmInstance.updateInstance(contentResolver, instance);

        // Start the alarm and schedule timeout timer for it
        AlarmService.startAlarm(context, instance);

        Calendar timeout = instance.getTimeout(context);
        if (timeout != null) {
            scheduleInstanceStateChange(context, timeout, instance, AlarmInstance.MISSED_STATE);
        }

        // Instance not valid anymore, so find next alarm that will fire and notify system
        updateNextAlarm(context);
    }

    /**
     * This will set the alarm instance to the SNOOZE_STATE and update
     * the application notifications and schedule any state changes that need
     * to occur in the future.
     *
     * @param context application context
     * @param instance to set state to
     */
    public static void setSnoozeState(Context context, AlarmInstance instance) {
        // Stop alarm if this instance is firing it
        AlarmService.stopAlarm(context, instance);

        // Calculate the new snooze alarm time
        String snoozeMinutesStr = PreferenceManager.getDefaultSharedPreferences(context)
                .getString(SettingsActivity.KEY_ALARM_SNOOZE, DEFAULT_SNOOZE_MINUTES);
        int snoozeMinutes = Integer.parseInt(snoozeMinutesStr);
        Calendar newAlarmTime = Calendar.getInstance();
        newAlarmTime.add(Calendar.MINUTE, snoozeMinutes);

        // Update alarm state and new alarm time in db.
        Log.v("Setting snoozed state to instance " + instance.mId + " for "
                + AlarmUtils.getFormattedTime(context, newAlarmTime));
        instance.setAlarmTime(newAlarmTime);
        instance.mAlarmState = AlarmInstance.SNOOZE_STATE;
        AlarmInstance.updateInstance(context.getContentResolver(), instance);

        // Setup instance notification and scheduling timers
        AlarmNotifications.showSnoozeNotification(context, instance);
        scheduleInstanceStateChange(context, instance.getAlarmTime(),
                instance, AlarmInstance.FIRED_STATE);

        // Display the snooze minutes in a toast.
        String displayTime = String.format(context.getResources().getQuantityText
                (R.plurals.alarm_alert_snooze_set, snoozeMinutes).toString(), snoozeMinutes);
        Toast.makeText(context, displayTime, Toast.LENGTH_LONG).show();

        // Instance time changed, so find next alarm that will fire and notify system
        updateNextAlarm(context);

    }

    /**
     * This will set the alarm instance to the MISSED_STATE and update
     * the application notifications and schedule any state changes that need
     * to occur in the future.
     *
     * @param context application context
     * @param instance to set state to
     */
    public static void setMissedState(Context context, AlarmInstance instance) {
        Log.v("Setting missed state to instance " + instance.mId);
        // Stop alarm if this instance is firing it
        AlarmService.stopAlarm(context, instance);

        // Check parent if it needs to reschedule, disable or delete itself
        if (instance.mAlarmId != null) {
            updateParentAlarm(context, instance);
        }

        // Update alarm state
        ContentResolver contentResolver = context.getContentResolver();
        instance.mAlarmState = AlarmInstance.MISSED_STATE;
        AlarmInstance.updateInstance(contentResolver, instance);

        // Setup instance notification and scheduling timers
        AlarmNotifications.showMissedNotification(context, instance);
        scheduleInstanceStateChange(context, instance.getMissedTimeToLive(),
                instance, AlarmInstance.DISMISSED_STATE);

        // Instance is not valid anymore, so find next alarm that will fire and notify system
        updateNextAlarm(context);

    }

    /**
     * This will set the alarm instance to the SILENT_STATE and update
     * the application notifications and schedule any state changes that need
     * to occur in the future.
     *
     * @param context application context
     * @param instance to set state to
     */
    public static void setDismissState(Context context, AlarmInstance instance) {
        Log.v("Setting dismissed state to instance " + instance.mId);

        // Remove all other timers and notifications associated to it
        unregisterInstance(context, instance);

        // Check parent if it needs to reschedule, disable or delete itself
        if (instance.mAlarmId != null) {
            updateParentAlarm(context, instance);
        }

        // Delete instance as it is not needed anymore
        AlarmInstance.deleteInstance(context.getContentResolver(), instance.mId);

        // Instance is not valid anymore, so find next alarm that will fire and notify system
        updateNextAlarm(context);
    }

    /**
     * This will not change the state of instance, but remove it's notifications and
     * alarm timers.
     *
     * @param context application context
     * @param instance to unregister
     */
    public static void unregisterInstance(Context context, AlarmInstance instance) {
        // Stop alarm if this instance is firing it
        AlarmService.stopAlarm(context, instance);
        AlarmNotifications.clearNotification(context, instance);
        cancelScheduledInstance(context, instance);
    }

    /**
     * This registers the AlarmInstance to the state manager. This will look at the instance
     * and choose the most appropriate state to put it in. This is primarily used by new
     * alarms, but it can also be called when the system time changes.
     *
     * Most state changes are handled by the states themselves, but during major time changes we
     * have to correct the alarm instance state. This means we have to handle special cases as
     * describe below:
     *
     * <ul>
     *     <li>Make sure all dismissed alarms are never re-activated</li>
     *     <li>Make sure firing alarms stayed fired unless they should be auto-silenced</li>
     *     <li>Missed instance that have parents should be re-enabled if we went back in time</li>
     *     <li>If alarm was SNOOZED, then show the notification but don't update time</li>
     *     <li>If low priority notification was hidden, then make sure it stays hidden</li>
     * </ul>
     *
     * If none of these special case are found, then we just check the time and see what is the
     * proper state for the instance.
     *
     * @param context application context
     * @param instance to register
     */
    public static void registerInstance(Context context, AlarmInstance instance,
            boolean updateNextAlarm) {
        Calendar currentTime = Calendar.getInstance();
        Calendar alarmTime = instance.getAlarmTime();
        Calendar timeoutTime = instance.getTimeout(context);
        Calendar lowNotificationTime = instance.getLowNotificationTime();
        Calendar highNotificationTime = instance.getHighNotificationTime();
        Calendar missedTTL = instance.getMissedTimeToLive();

        // Handle special use cases here
        if (instance.mAlarmState == AlarmInstance.DISMISSED_STATE) {
            // This should never happen, but add a quick check here
            Log.e("Alarm Instance is dismissed, but never deleted");
            setDismissState(context, instance);
            return;
        } else if (instance.mAlarmState == AlarmInstance.FIRED_STATE) {
            // Keep alarm firing, unless it should be timed out
            boolean hasTimeout = timeoutTime != null && currentTime.after(timeoutTime);
            if (!hasTimeout) {
                setFiredState(context, instance);
                return;
            }
        } else if (instance.mAlarmState == AlarmInstance.MISSED_STATE) {
            if (currentTime.before(alarmTime)) {
                if (instance.mAlarmId == null) {
                    // This instance parent got deleted (ie. deleteAfterUse), so
                    // we should not re-activate it.-
                    setDismissState(context, instance);
                    return;
                }

                // TODO: This will re-activate missed snoozed alarms, but will
                // use our normal notifications. This is not ideal, but very rare use-case.
                // We should look into fixing this in the future.

                // Make sure we re-enable the parent alarm of the instance
                // because it will get activated by by the below code
                ContentResolver cr = context.getContentResolver();
                Alarm alarm = Alarm.getAlarm(cr, instance.mAlarmId);
                alarm.enabled = true;
                Alarm.updateAlarm(cr, alarm);
            }
        }

        // Fix states that are time sensitive
        if (currentTime.after(missedTTL)) {
            // Alarm is so old, just dismiss it
            setDismissState(context, instance);
        } else if (currentTime.after(alarmTime)) {
            // There is a chance that the TIME_SET occurred right when the alarm should go off, so
            // we need to add a check to see if we should fire the alarm instead of marking it
            // missed.
            Calendar alarmBuffer = Calendar.getInstance();
            alarmBuffer.setTime(alarmTime.getTime());
            alarmBuffer.add(Calendar.SECOND, ALARM_FIRE_BUFFER);
            if (currentTime.before(alarmBuffer)) {
                setFiredState(context, instance);
            } else {
                setMissedState(context, instance);
            }
        } else if (instance.mAlarmState == AlarmInstance.SNOOZE_STATE) {
            // We only want to display snooze notification and not update the time,
            // so handle showing the notification directly
            AlarmNotifications.showSnoozeNotification(context, instance);
            scheduleInstanceStateChange(context, instance.getAlarmTime(),
                    instance, AlarmInstance.FIRED_STATE);
        } else if (currentTime.after(highNotificationTime)) {
            setHighNotificationState(context, instance);
        } else if (currentTime.after(lowNotificationTime)) {
            // Only show low notification if it wasn't hidden in the past
            if (instance.mAlarmState == AlarmInstance.HIDE_NOTIFICATION_STATE) {
                setHideNotificationState(context, instance);
            } else {
                setLowNotificationState(context, instance);
            }
        } else {
          // Alarm is still active, so initialize as a silent alarm
          setSilentState(context, instance);
        }

        // The caller prefers to handle updateNextAlarm for optimization
        if (updateNextAlarm) {
            updateNextAlarm(context);
        }
    }

    /**
     * This will delete and unregister all instances associated with alarmId, without affect
     * the alarm itself. This should be used whenever modifying or deleting an alarm.
     *
     * @param context application context
     * @param alarmId to find instances to delete.
     */
    public static void deleteAllInstances(Context context, long alarmId) {
        ContentResolver cr = context.getContentResolver();
        List<AlarmInstance> instances = AlarmInstance.getInstancesByAlarmId(cr, alarmId);
        for (AlarmInstance instance : instances) {
            unregisterInstance(context, instance);
            AlarmInstance.deleteInstance(context.getContentResolver(), instance.mId);
        }
        updateNextAlarm(context);
    }

    /**
     * Fix and update all alarm instance when a time change event occurs.
     *
     * @param context application context
     */
    public static void fixAlarmInstances(Context context) {
        // Register all instances after major time changes or when phone restarts
        // TODO: Refactor this code to not use the overloaded registerInstance method.
        ContentResolver contentResolver = context.getContentResolver();
        for (AlarmInstance instance : AlarmInstance.getInstances(contentResolver, null)) {
            AlarmStateManager.registerInstance(context, instance, false);
        }
        AlarmStateManager.updateNextAlarm(context);
    }

    /**
     * Utility method to set alarm instance state via constants.
     *
     * @param context application context
     * @param instance to change state on
     * @param state to change to
     */
    public void setAlarmState(Context context, AlarmInstance instance, int state) {
        switch(state) {
            case AlarmInstance.SILENT_STATE:
                setSilentState(context, instance);
                break;
            case AlarmInstance.LOW_NOTIFICATION_STATE:
                setLowNotificationState(context, instance);
                break;
            case AlarmInstance.HIDE_NOTIFICATION_STATE:
                setHideNotificationState(context, instance);
                break;
            case AlarmInstance.HIGH_NOTIFICATION_STATE:
                setHighNotificationState(context, instance);
                break;
            case AlarmInstance.FIRED_STATE:
                setFiredState(context, instance);
                break;
            case AlarmInstance.SNOOZE_STATE:
                setSnoozeState(context, instance);
                break;
            case AlarmInstance.MISSED_STATE:
                setMissedState(context, instance);
                break;
            case AlarmInstance.DISMISSED_STATE:
                setDismissState(context, instance);
                break;
            default:
                Log.e("Trying to change to unknown alarm state: " + state);
        }
    }

    @Override
    public void onReceive(final Context context, final Intent intent) {
        final PendingResult result = goAsync();
        final PowerManager.WakeLock wl = AlarmAlertWakeLock.createPartialWakeLock(context);
        wl.acquire();
        AsyncHandler.post(new Runnable() {
            @Override
            public void run() {
                handleIntent(context, intent);
                result.finish();
                wl.release();
            }
        });
    }

    private void handleIntent(Context context, Intent intent) {
        final String action = intent.getAction();
        Log.v("AlarmStateManager received intent " + intent);
        if (CHANGE_STATE_ACTION.equals(action)) {
            Uri uri = intent.getData();
            AlarmInstance instance = AlarmInstance.getInstance(context.getContentResolver(),
                    AlarmInstance.getId(uri));
            if (instance == null) {
                // Not a big deal, but it shouldn't happen
                Log.e("Can not change state for unknown instance: " + uri);
                return;
            }

            int globalId = getGlobalIntentId(context);
            int intentId = intent.getIntExtra(ALARM_GLOBAL_ID_EXTRA, -1);
            int alarmState = intent.getIntExtra(ALARM_STATE_EXTRA, -1);
            if (intentId != globalId) {
                Log.i("Ignoring old Intent. IntentId: " + intentId + " GlobalId: " + globalId +
                        " AlarmState: " + alarmState);
                return;
            }

            if (alarmState >= 0) {
                setAlarmState(context, instance, alarmState);
            } else {
                registerInstance(context, instance, true);
            }
        } else if (SHOW_AND_DISMISS_ALARM_ACTION.equals(action)) {
            Uri uri = intent.getData();
            AlarmInstance instance = AlarmInstance.getInstance(context.getContentResolver(),
                    AlarmInstance.getId(uri));

            long alarmId = instance.mAlarmId == null ? Alarm.INVALID_ID : instance.mAlarmId;
            Intent viewAlarmIntent = Alarm.createIntent(context, DeskClock.class, alarmId);
            viewAlarmIntent.putExtra(DeskClock.SELECT_TAB_INTENT_EXTRA, DeskClock.ALARM_TAB_INDEX);
            viewAlarmIntent.putExtra(AlarmClockFragment.SCROLL_TO_ALARM_INTENT_EXTRA, alarmId);
            viewAlarmIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(viewAlarmIntent);
            setDismissState(context, instance);
        }
    }
}


In September 1769, three thousand people descended on Stratford-Upon-Avon to celebrate the legacy of the town's most famous son.
For three days, attendees paraded through garlanded streets, listened to songs and oratorios, and enjoyed masked balls.
It was a unique cultural moment-a coronation elevating William Shakespeare to the throne of genius.
It was also a disaster as the poorly planned Jubilee imposed an army of Londoners on an ill-equipped backwater town. Told from the perspectives of David Garrick, who masterminded the Jubilee, and James Boswell, who attended it, What Blest Genius? is rich with humour, gossip and intrigue. Recounting the absurd and chaotic glory of those three days, Andrew McConnell Stott illuminates the circumstances in which Shakespeare became a transcendent global icon.


text:
namespace mojo {
namespace embedder {

namespace internal {

// Declared in embedder_internal.h.
PlatformSupport* g_platform_support = nullptr;
system::Core* g_core = nullptr;
system::IPCSupport* g_ipc_support = nullptr;

}  // namespace internal

namespace {

// TODO(vtl): For now, we need this to be thread-safe (since theoretically we
// currently support multiple channel creation threads -- possibly one per
// channel). Eventually, we won't need it to be thread-safe (we'll require a
// single I/O thread), and eventually we won't need it at all. Remember to
// remove the base/atomicops.h include.
system::ChannelId MakeChannelId() {
  // Note that |AtomicWord| is signed.
  static base::subtle::AtomicWord counter = 0;

  base::subtle::AtomicWord new_counter_value =
      base::subtle::NoBarrier_AtomicIncrement(&counter, 1);
  // Don't allow the counter to wrap. Note that any (strictly) positive value is
  // a valid |ChannelId| (and |NoBarrier_AtomicIncrement()| returns the value
  // post-increment).
  CHECK_GT(new_counter_value, 0);
  // Use "negative" values for these IDs, so that we'll also be able to use
  // "positive" "process identifiers" (see connection_manager.h) as IDs (and
  // they won't conflict).
  return static_cast<system::ChannelId>(-new_counter_value);
}

// Note: Called on the I/O thread.
void ShutdownIPCSupportHelper() {
  // Save these before they get nuked by |ShutdownChannelOnIOThread()|.
  scoped_refptr<base::TaskRunner> delegate_thread_task_runner(
      internal::g_ipc_support->delegate_thread_task_runner());
  ProcessDelegate* process_delegate =
      internal::g_ipc_support->process_delegate();

  ShutdownIPCSupportOnIOThread();

  bool ok = delegate_thread_task_runner->PostTask(
      FROM_HERE, base::Bind(&ProcessDelegate::OnShutdownComplete,
                            base::Unretained(process_delegate)));
  DCHECK(ok);
}

}  // namespace

Configuration* GetConfiguration() {
  return system::GetMutableConfiguration();
}

void Init(scoped_ptr<PlatformSupport> platform_support) {
  DCHECK(platform_support);

  DCHECK(!internal::g_platform_support);
  internal::g_platform_support = platform_support.release();

  DCHECK(!internal::g_core);
  internal::g_core = new system::Core(internal::g_platform_support);
}

MojoResult AsyncWait(MojoHandle handle,
                     MojoHandleSignals signals,
                     const base::Callback<void(MojoResult)>& callback) {
  return internal::g_core->AsyncWait(handle, signals, callback);
}

MojoResult CreatePlatformHandleWrapper(
    ScopedPlatformHandle platform_handle,
    MojoHandle* platform_handle_wrapper_handle) {
  DCHECK(platform_handle_wrapper_handle);

  scoped_refptr<system::Dispatcher> dispatcher =
      system::PlatformHandleDispatcher::Create(platform_handle.Pass());

  DCHECK(internal::g_core);
  MojoHandle h = internal::g_core->AddDispatcher(dispatcher);
  if (h == MOJO_HANDLE_INVALID) {
    LOG(ERROR) << "Handle table full";
    dispatcher->Close();
    return MOJO_RESULT_RESOURCE_EXHAUSTED;
  }

  *platform_handle_wrapper_handle = h;
  return MOJO_RESULT_OK;
}

MojoResult PassWrappedPlatformHandle(MojoHandle platform_handle_wrapper_handle,
                                     ScopedPlatformHandle* platform_handle) {
  DCHECK(platform_handle);

  DCHECK(internal::g_core);
  scoped_refptr<system::Dispatcher> dispatcher(
      internal::g_core->GetDispatcher(platform_handle_wrapper_handle));
  if (!dispatcher)
    return MOJO_RESULT_INVALID_ARGUMENT;

  if (dispatcher->GetType() != system::Dispatcher::Type::PLATFORM_HANDLE)
    return MOJO_RESULT_INVALID_ARGUMENT;

  *platform_handle =
      static_cast<system::PlatformHandleDispatcher*>(dispatcher.get())
          ->PassPlatformHandle()
          .Pass();
  return MOJO_RESULT_OK;
}

void InitIPCSupport(ProcessType process_type,
                    scoped_refptr<base::TaskRunner> delegate_thread_task_runner,
                    ProcessDelegate* process_delegate,
                    scoped_refptr<base::TaskRunner> io_thread_task_runner,
                    ScopedPlatformHandle platform_handle) {
  // |Init()| must have already been called.
  DCHECK(internal::g_core);
  // And not |InitIPCSupport()| (without |ShutdownIPCSupport()|).
  DCHECK(!internal::g_ipc_support);

  internal::g_ipc_support = new system::IPCSupport(
      internal::g_platform_support, process_type,
      delegate_thread_task_runner.Pass(), process_delegate,
      io_thread_task_runner.Pass(), platform_handle.Pass());
}

void ShutdownIPCSupportOnIOThread() {
  DCHECK(internal::g_ipc_support);

  internal::g_ipc_support->ShutdownOnIOThread();
  delete internal::g_ipc_support;
  internal::g_ipc_support = nullptr;
}

void ShutdownIPCSupport() {
  DCHECK(internal::g_ipc_support);

  bool ok = internal::g_ipc_support->io_thread_task_runner()->PostTask(
      FROM_HERE, base::Bind(&ShutdownIPCSupportHelper));
  DCHECK(ok);
}

ScopedMessagePipeHandle ConnectToSlave(
    SlaveInfo slave_info,
    ScopedPlatformHandle platform_handle,
    const base::Closure& did_connect_to_slave_callback,
    scoped_refptr<base::TaskRunner> did_connect_to_slave_runner,
    std::string* platform_connection_id,
    ChannelInfo** channel_info) {
  DCHECK(platform_connection_id);
  DCHECK(channel_info);
  DCHECK(internal::g_ipc_support);

  system::ConnectionIdentifier connection_id =
      internal::g_ipc_support->GenerateConnectionIdentifier();
  *platform_connection_id = connection_id.ToString();
  system::ChannelId channel_id = system::kInvalidChannelId;
  scoped_refptr<system::MessagePipeDispatcher> dispatcher =
      internal::g_ipc_support->ConnectToSlave(
          connection_id, slave_info, platform_handle.Pass(),
          did_connect_to_slave_callback, did_connect_to_slave_runner.Pass(),
          &channel_id);
  *channel_info = new ChannelInfo(channel_id);

  ScopedMessagePipeHandle rv(
      MessagePipeHandle(internal::g_core->AddDispatcher(dispatcher)));
  CHECK(rv.is_valid());
  // TODO(vtl): The |.Pass()| below is only needed due to an MSVS bug; remove it
  // once that's fixed.
  return rv.Pass();
}

ScopedMessagePipeHandle ConnectToMaster(
    const std::string& platform_connection_id,
    const base::Closure& did_connect_to_master_callback,
    scoped_refptr<base::TaskRunner> did_connect_to_master_runner,
    ChannelInfo** channel_info) {
  DCHECK(channel_info);
  DCHECK(internal::g_ipc_support);

  bool ok = false;
  system::ConnectionIdentifier connection_id =
      system::ConnectionIdentifier::FromString(platform_connection_id, &ok);
  CHECK(ok);

  system::ChannelId channel_id = system::kInvalidChannelId;
  scoped_refptr<system::MessagePipeDispatcher> dispatcher =
      internal::g_ipc_support->ConnectToMaster(
          connection_id, did_connect_to_master_callback,
          did_connect_to_master_runner.Pass(), &channel_id);
  *channel_info = new ChannelInfo(channel_id);

  ScopedMessagePipeHandle rv(
      MessagePipeHandle(internal::g_core->AddDispatcher(dispatcher)));
  CHECK(rv.is_valid());
  // TODO(vtl): The |.Pass()| below is only needed due to an MSVS bug; remove it
  // once that's fixed.
  return rv.Pass();
}

// TODO(vtl): Write tests for this.
ScopedMessagePipeHandle CreateChannelOnIOThread(
    ScopedPlatformHandle platform_handle,
    ChannelInfo** channel_info) {
  DCHECK(platform_handle.is_valid());
  DCHECK(channel_info);
  DCHECK(internal::g_ipc_support);

  system::ChannelManager* channel_manager =
      internal::g_ipc_support->channel_manager();

  *channel_info = new ChannelInfo(MakeChannelId());
  scoped_refptr<system::MessagePipeDispatcher> dispatcher =
      channel_manager->CreateChannelOnIOThread((*channel_info)->channel_id,
                                               platform_handle.Pass());

  ScopedMessagePipeHandle rv(
      MessagePipeHandle(internal::g_core->AddDispatcher(dispatcher)));
  CHECK(rv.is_valid());
  // TODO(vtl): The |.Pass()| below is only needed due to an MSVS bug; remove it
  // once that's fixed.
  return rv.Pass();
}

ScopedMessagePipeHandle CreateChannel(
    ScopedPlatformHandle platform_handle,
    const base::Callback<void(ChannelInfo*)>& did_create_channel_callback,
    scoped_refptr<base::TaskRunner> did_create_channel_runner) {
  DCHECK(platform_handle.is_valid());
  DCHECK(!did_create_channel_callback.is_null());
  DCHECK(internal::g_ipc_support);

  system::ChannelManager* channel_manager =
      internal::g_ipc_support->channel_manager();

  system::ChannelId channel_id = MakeChannelId();
  scoped_ptr<ChannelInfo> channel_info(new ChannelInfo(channel_id));
  scoped_refptr<system::MessagePipeDispatcher> dispatcher =
      channel_manager->CreateChannel(
          channel_id, platform_handle.Pass(),
          base::Bind(did_create_channel_callback,
                     base::Unretained(channel_info.release())),
          did_create_channel_runner);

  ScopedMessagePipeHandle rv(
      MessagePipeHandle(internal::g_core->AddDispatcher(dispatcher)));
  CHECK(rv.is_valid());
  // TODO(vtl): The |.Pass()| below is only needed due to an MSVS bug; remove it
  // once that's fixed.
  return rv.Pass();
}

// TODO(vtl): Write tests for this.
void DestroyChannelOnIOThread(ChannelInfo* channel_info) {
  DCHECK(channel_info);
  DCHECK(channel_info->channel_id);
  DCHECK(internal::g_ipc_support);

  system::ChannelManager* channel_manager =
      internal::g_ipc_support->channel_manager();
  channel_manager->ShutdownChannelOnIOThread(channel_info->channel_id);
  delete channel_info;
}

// TODO(vtl): Write tests for this.
void DestroyChannel(
    ChannelInfo* channel_info,
    const base::Closure& did_destroy_channel_callback,
    scoped_refptr<base::TaskRunner> did_destroy_channel_runner) {
  DCHECK(channel_info);
  DCHECK(channel_info->channel_id);
  DCHECK(!did_destroy_channel_callback.is_null());
  DCHECK(internal::g_ipc_support);

  system::ChannelManager* channel_manager =
      internal::g_ipc_support->channel_manager();
  channel_manager->ShutdownChannel(channel_info->channel_id,
                                   did_destroy_channel_callback,
                                   did_destroy_channel_runner);
  delete channel_info;
}

void WillDestroyChannelSoon(ChannelInfo* channel_info) {
  DCHECK(channel_info);
  DCHECK(internal::g_ipc_support);

  system::ChannelManager* channel_manager =
      internal::g_ipc_support->channel_manager();
  channel_manager->WillShutdownChannel(channel_info->channel_id);
}

}  // namespace embedder
}  // namespace mojo

redpajama_set_name: RedPajamaGithub


text:
Sam Kelly, född 19 december 1943 i Manchester, död 14 juni 2014 i Esher i Surrey, var en brittisk skådespelare. Han är bland annat känd för rollen som kapten Hans Geering i komediserien 'Allå, 'allå, 'emliga armén. Han medverkade även i Bleak House och Morden i Midsomer.

Källor

Externa länkar

Brittiska skådespelare under 1900-talet
Brittiska TV-skådespelare
Skådespelare från Manchester
Födda 1943
Avlidna 2014
Män

redpajama_set_name: RedPajamaWikipedia


text:
Corporate Branding on Chinese Social Media
Corporate Branding on Western Social Media
Personal Branding on Chinese Social Media
Marcello Lippi: The Mastermind's Personal Brand
by Brizzo | May 17, 2019 | Personal Branding | 0 comments
Artist Name: Marcello Lippi
Job: football coach
Career duration: 37 years (coaching career)
Net Worth: $30.2 million
"There should be no prima donnas on a team; everyone should feel important, from the oldest player to the youngest." – Marcello Lippi
Marcello Lippi, one of the world's greatest and highest-paid coaches, is a great mastermind behind numerous monumental records in the football history, who knows how to get into the players' heads.
As an excellent tactician with astonishingly astute man-management, he has won five Series A titles, the Champions League, the Asian Champions League and the 2006 World Cup. He was named the world's best football manager by the International Federation of Football History and Statistics (IFFHS) both in 1996 and 1998, and world's best national coach in 2006. He also coached the Chinese national soccer team from October 2016 to January this year, with his annual salary of as much as 20 million euros (22 million dollars).
Wearing a leather coat and smoking a small cigar in his iconic calm face, Lippi is unquestionably one of the few football coaches who could successfully lead his players to operate as a cohesive and harmonized unit. And this is something that can be done only by a person who has a good man-management tactics and more importantly, a solid personal brand.
Unique values that differentiate Lippi from other coaches
Lippi clearly stands out among numerous elite football coaches throughout the world.
We don't have to go far to confirm this. His CV speaks for itself. Having made it to 4 Champions League finals, 5 Serie A titles, a UEFA cup final with Juventus before leading Italy to World Cup glory, and the Asian Champions League in 2013 with Guangzhou Evergrande, he is the first coach to have won the most prestigious international competitions both for clubs in different continents, and for national teams. He is the living legend of world football, which dare not be questioned by anyone.
On top of his glittering achievements, there's one feature that clearly differentiates him from other coaches: man-management. I wouldn't go as far to say he's the best tactician who can make the best performance out of team players. But it seems fair to say he's one of the most legendary tacticians who always places emphasis on cohesion, togetherness, unity and harmony of the team, which has actually worked successfully as proven by actual outcomes as well as many testimonies of his players.
Lippi's coaching philosophy
In Lippi's book <Il Gioco delle Idee: Pensieri e Passioni da Bordo Campo (A Game of Ideas: Thoughts and Passions from the Sidelines)>, Lippi outlined his coaching philosophy. Lippi likened a psychologically well integrated football team to the functioning of a psychologically healthy 'family', which means all team members need to function smoothly to operate as a cohesive unit. Thus, Lippi's focus has always been placed on team spirit, team unity and togetherness, rather than individual capabilities.
The individuals may have been excellent, but Lippi believed "a group of the best players do not necessarily make for the best team". While there are some football coaches who prefer to stick to one specific formation, Lippi valued the team more than anything else. In terms of formation, Lippi was adaptable, as long as the team can maintain the harmony, mentally and tactically.
This is clearly different from another notoriously tactical (and controversial) football coach, Jose Mourinho. Mourinho had his players follow the formation he decided tactically based on his calculation and experience during his coaching career. However, Lippi's choice of formation was constrained by the qualities of the players available, as selecting the best possible team not only requires finding the right combination of players for the chosen formation, but also finding the right formation for the chosen players. It must also be relevant to the reason why Mourinho is often criticized to be too strong and uncompromising that the harmony of the club is jeopardized due to him unlike Lippi.
Read more about Jose Mourinho
https://www.aicy-create.com/jose-mourinho-personal-brand/
Lippi's coaching psychology
Once a firm coaching philosophy is settled, there is a job of putting such faith into the team players, so that the team can be built around his core beliefs and ideals, which Lippi has been proved to be so great at.
For Lippi, football is psychology where "the winning coach is the one who manages to get into the players' heads, especially if they're champions". While having talented champions in the team is important, they cannot go with the team, if they don't understand, follow and relay the coach's instruction. His job is to grow the sense of 'team' in every player's mind, and then bind the group of individual players altogether under his harmonious philosophy.
Lippi said, "you can teach them to deal with the diagonals better, double-up in marking, possession of the ball, but if you can't find harmony in the group and you're not credible then you won't win". He must have worked hard to effectively 'get into the players' heads' to make the team united, and many brilliant performances achieved by fantastic teamwork of his team have proven that his psychological methods actually worked.
Cannavaro's statement about the experience of winning the 2006 World Cup implies how Lippi's philosophy was understood and executed by players. "To truly understand you need to be part of it," Cannavaro told FourFourTwo. "The 2006 group took two years to build – enough time to understand that when one of you is in trouble you can always get support from team-mates, and when you need someone you'll always have them at your side. And you might not believe it, but in those 40 days [at the 2006 World Cup] we had a lot of fun too."
Lippi is the man who proved that the whole is greater than the sum of its parts, and the collective always trumps the individual. And it would have not been possible, unless he didn't have a personal brand which was strong and credible enough to manage individual players to head towards the same goal and same direction.
Personal branding traits of Lippi that made him influential
It's always intriguing to analyze personal branding traits of a great football coach. From formation selection, training regiments, tactical approach, squad building to man-management skills, there are many factors, intertwined each other, that influence performance of a football coach. And it is the coach's personal brand that decides how all these factors are manifested, and eventually how competent the coach is.
Let's take a deep dive into the personal branding traits of Lippi, which made Lippi the legendary coach that we know.
Lippi is always in command of himself.
Lippi is an astonishingly respected figure, and for good reason: Lippi is a coach who always seemed to exude utter command and control. Probably the most accurate description of Lippi's such aspect came from Sir Alex Ferguson, who has always rated him as one of the best managers of his generation. Ferguson wrote in his book <Managing My Life> as below.
"Marcello Lippi is one impressive man. Looking into his eyes is enough to tell you that you are dealing with somebody who is in command of himself and his professional domain. Those eyes are sometimes burning with seriousness, sometimes twinkling, sometimes warily assessing you – and always they are alive with intelligence. Nobody could make the mistake of taking Lippi lightly"
To add a note, as mentioned by Ferguson, Lippi possesses an ability to convey sentences with a look. It is his eyes that tell a strong message and disarm the players.
Lippi has never loses calmness.
Have you ever seen Lippi pumping his chest and demanding noise from the crowd? Lippi never loses his calmness nor never vexed, which makes him charismatic and reliable.
Not only frustration but victory is also not something which can make him loosen his extraordinary calmness. Generally speaking, it's easy to become slack after achieving certain level of success. People tend to get lazy and stay where they are, without putting additional efforts to make further progress. However, Lippi goes against this human nature. He doesn't let any success soften his resolve, no matter how great that is. He told that "I'm not a big fan of celebrations anyway. I prefer the day before the game to the evening after."
In the aftermath of Juventus' victory over River Plate at the 1996 Intercontinental Cup, rather than celebrating the triumph with everyone, he turned to the bench and told the assistant coach Narciso Pezzotti and other staff members that a new cycle starts now.
Even after the dramatic triumph of Italian national soccer team in the 2006 World Cup final, unlike any other players partying hard, Lippi grabbed something to eat, went to his room, and watched the entire game including the penalty shoot-out over and over again with his cigar in his mouth, which he later told is his way of celebration.
Lippi is not afraid of making big decisions.
Lippi was never afraid of taking any risk, any challenge, any possible conflict. He goes directly in the core of every issue and he forces any situation to the maximum. Otherwise, he would have not been able to bring about the legendary resurgence of Juventus.
When Lippi arrived at Juventus, he had to shake up the order of things that were there so still during the mighty Giovanni Trapattoni's stint for 10 years. But Lippi was not afraid to stroll into the Juventus boardroom and demand that things be done his way. He first convinced Ciro Ferrara to depart his hometown and come to Juventus. Lippi added further defensive reinforcements in the shape of combative midfielder Paulo Sousa. His such decisive measures started to produce results very soon, which reversed Juventus' disappointing fortunes almost instantaneously. That season, the team could regain the Champions League for the first time in 11 years.
But one of the most remarkable big decisions that Lippi has ever made must be dropping Sousa from the team. Despite Sousa having established himself in the first him, Lippi felt the need to inject youth like Zidane or Christian Vieri to the team in order to freshen things up. He's the man who sold Robert Baggio, The Divine Ponytail, to rivals AC Milan. He wasn't afraid of restructuring the team, if it's necessary, even though it involved change of the important personnel.
Lippi is open for conversation with players
Lippi is known for maintaining close relationships with his players. He wanted all players to be involved at all times, while maintaining balance as a whole team. And, in order to achieve the true team cohesion, he had to put faith in his players, which requires constant communication and interaction with every player of the team. Fortunately, Lippi understands it really well. "With football being the way it is today, having an open dialogue with your players is crucial," he said.
Of course there were some players who didn't take well to Lippi's proximity. One example is Christian Vieri, who, susceptible to criticism, almost came to blows with Lippi in the dressing room only to be separated by other players, due to angers by negative feedback. However, they later became friends after seeing eye to eye each other after their clash.
AICY, your Marketing Agency in China.
Our Services: Branding, Personal Branding, E-Commerce, Search Engine Optimization, Advertising, Weibo, WeChat, WeChat Store, Little Red Book, Facebook, Linkedin and Twitter.
AICY, Artists on Social Media Contact us Today
Lippi is a motivational leader
Lippi is also famous for his motivational techniques of trusting his players. It especially shone through when the situation was unfavorable to the team. Even with extra-time beckoning and, ultimately, penalties looming, Lippi opted not to overload his players' tired minds with more information. That's why Lippi's Juventus team seems to always possess a mental edge over their opponents, acting with great aplomb when receiving penalties, and hoisting the Champions League trophy in the end.
This forms a striking contrast to Mourinho's ruthless coaching style. While both Lippi and Mourinho have their own solid coaching philosophy, it is almost impossible for Mourinho to peacefully get along with others who have a different point of view from his by dialogue or motivational ways. As a side note, Mourinho has accused some of his players of lacking desire, and had numerous controversial clashes not only with his players but also with directives of the team.
He's hard working and goal-oriented.
Lippi looks like a gifted man who has possessed great coaching ability from the beginning. However, he's the one who really goes well with the much cliched line "Hard work pays". During his playing career at the beginning, he never had a brilliant performance, and even after he took a turn to become a football coach, he was fired three times in his first decade of management. However, he didn't give up an kept work hard, knowing that if he could learn how to command the respect of those around him and work that into his knowledge of the game, the trophies would come. And they did.
One of his great achievements as a coach was the resurgence of Juventus. Juventus wanted to win the Champions League, and things had worked well under Lippi's management up to the final, but there was one thing that stood in their way: Louis van Gaal's Ajax. Ajax's glittering success records seemed enough to imply that they were the immovable object taking hold of the European crown.
After going through all video footages of Ajax and studying Van Gaal's style for months, Lippi found out that Van Gaal was wary of his players overlapping and potentially exposing their defenders. Lippi, in response, devised a game plan featuring his own iteration of a 4-3-3, not one designed on dominating possession. And in the match, after Ajax's threatening play, loss of great opportunities for making goals and looming penalties, Lippi's Juventus finally succeeded in hoisting the Champions League trophy aloft. It was the moment when Lippi's hard work focusing on the defeat of Ajax paid off.
Lippi admits his failures.
It's not correct that if you believed Lippi was always on the road to success. He had many ups and downs. After he returned to the head coach of the Italian national team for the 2010 World Cup campaign, the team ended up ranking at the bottom of their group that featured New Zealand, Paraguay and Slovakia. The team looked disjoint and their failure was probably one of those rare moments that Lippi's man-management tactics failed. Lippi resigned after the tournament taking full blame for the team's poor showing.
"I take full responsibility," Lippi said. "If I was part of the success in 2006, I have to take the blame for this failure too. If a team shows up at an important game with terror in its heart and head and legs, it must mean the coach did not train them as he should have done. I thought the men I chose would have been able to deliver something different but obviously I was wrong"
Admitting one's mistakes or failures is always very hard, but it is what makes one professional and reliable. Lippi doesn't shy away from admitting his failures in his strategy, which gives people an impression that he's the man who takes responsibility for what he has done.
All of the above traits have influenced him gaining the strong personal brand as a coach who's respected, reliable, professional and open to communication. His personal brand has been built through his entire career, where there were both ups and downs. While his personal brand could cement its credibility from his great achievements, it could become even stronger while overcoming hardships. And when it comes to the most disastrous hardship which however made him the achieve most dramatic progress, it would be the famous Calciopoli match-fixing scandal which smashed the Italian football industry in 2006.
His personal brand grew even stronger after the disastrous scandal
The Calciopoli is the scandal uncovered in May 2006 by Italian police, where league champions Juventus and other major teams like Milan, Reginna, etc., when a number of illegal telephone interceptions showed a thick network of relations between team managers and referee organizations, being accused of selecting favourable referees.
Every morning, newspapers were reporting on different stories of deals between managers and referees. The outcome was one that shook the grounds of Serie A. Juventus were stripped of their Serie A title and relegated in disgrace. Other top clubs such as AC Milan, Fiorentina and Lazio also incurred hefty fines for their involvements in certain deals.
When the scandal smashed the Italian football industry, Lippi was preparing for the World Cup as the Italian national football team coach. His old club Juventus had been outed as cheats, something that must have affected him deeply, but his focus remained on carving a strong performance out of a national side that was due a good tournament performance. As a highly goal-oriented and focused man, he stuck to his game plan in preparation of the World Cup regardless of the extenuating circumstances.
Just before Italy's quarter-final against Ukraine, Juventus's general manager, Gianluca Pessotto, hurled himself out of a window in an attempted suicide. Juventus were embroiled in the worst scandal football has ever seen. There were five Juventus players in the Italy squad, and Lippi was the man charged with the task of controlling the mood. However, there wasn't much he could do in such circumstances. The captain, Fabio Cannavaro who considered his former teammate a close friend, was devastated by the news. He and his teammates, including Del Piero, flew home from their World Cup training camp to visit Pessotto.
After spending some time at the bedside of their stricken colleague, the Italian players returned. Then Lippi immediately re-calibrated their focus onto football. The quarter-final against Ukraine was successful, dispatching the Eastern Europeans 3-0. In a matter of days, Lippi had turned the doom and gloom of a frankly near-tragic incident into a semi-final for the people of Italy to celebrate. Italy team players were outstanding throughout that tournament, but it was Lippi who made this collection of talented individuals come together under his binding, harmonious philosophy. In the end, Italy won, beating France in that memorable final to give Lippi a World Cup to add to his Champions League.
While the Calciopoli scandal was deathly enough to mark the end of one's football career, and happened during the most important time in preparation of the 2006 World Cup, Lippi successfully masterminded the World Cup winning of the Italy team, without getting distracted or weakened by all suspicions and pressures surrounding him. He wisely and calmly turned the crisis into opportunity, which made his personal brand even stronger and shine through brighter.
His reputation remains intact despite poor performance in China
Lippi is reportedly one of the world's highest-paid coaches, whose annual salary as a national football team coach in China was 20 million euros ($22 million). However, the team's performance under Lippi was not as good as the Chinese fans hoped. Under Lippi's guidance since October 2016, China's national team won only 10 of 30 games, including the team's crushing 0:3 defeat to Iran at the 2019 Asia Cup's quarter-final a week ago.
Given the team's poor showing compared to the tremendous amount of payment Lippi had received, it is not weird to expect that strong criticism towards Lippi would arise among disappointed Chinese football fans. However, after Lippi announced his departure of Chinese national team boss, Chinese fans offered rare support and sympathy to him.
On Weibo, China's Twitter-like social media platform, Hashtag #LippileftChina has gathered nearly 55 million views and about 10,000 comments (as of April 2019), with most fans saying "Lippi is not to blame for the weak Chinese soccer," and "Lippi proves even the world's top-notch coach cannot handle the Chinese men's soccer team."
Some even called Lippi's high pay "compensation for mental suffer," which was just enough to comfort the humiliating and torturous feelings he experienced while coaching China's team.
It implies Lippi's personal brand as a world class coach is so credible and solid that despite his teams' poor performance, Chinese fans tend to lay the blame on the Chinese football team rather than Lippi. That is, although his psychological and philosophical coaching tactics that had previously worked well in Europe and even in Guangzhou Evergrande, didn't work well with Chinese national team for some reasons, his high reputation is undamaged in and outside of China, and is still supported by many Chinese fans, thanks to his well-established personal brand.
We don't know which type of coach Chinese football currently needs. Lippi has been considered to be a coach who has a better understanding of Chinese soccer than other high-profile coaches like Jose Mourinho or Zinedine Zidane, but his way didn't work. Perhaps it's first to increase capabilities of individuals or lead them under strong and somewhat uncompromising leadership before trying to get into their heads to put certain faith in them. Perhaps it's not a time to pursue harmonious cohesion for Chinese football.
How Lippi will be remembered
Lippi may not be the most intriguing character in management, but hidden behind his calm demeanor and stoic face with a cigar protruded from his mouth is definitely no ordinary man who is, as Ferguson described, "in command of himself and his professional domain".
Lippi is a legendary mastermind of numerous monumental achievements in the world football history, who has firm belief in his 'harmonious' coaching psychology, and moreover, has an understanding of how to put such faith into the players' mind. He has won the Champion League and the World Cup, and most of all, won his players. Because of his great man-management and extraordinary level of calmness and concentration, he is and will still be remembered as one of the most respected and finest football coaches in the world who could successfully lead his team to operate as a cohesive unit.
Lippi' personal brand key points
In order to manage people effectively, you need to have a firm belief inside you. Also, you need to know how to get into people's mind, so that they respect and follow your belief.
A person who's always in command of himself and doesn't lose one's calmness earns respect from other people. But it should be consistent no matter what happens.
Admitting one's mistakes or failures is always very hard, but it is what makes one professional and reliable.
Crisis can be a great opportunity. You can use it as a chance to strengthen the power of your personal brand,
If you have a well-established solid personal brand, some poor performances will not consist any obstacles for maintaining good reputation.
www.aicy-create.com
微博 (Weibo):AICY爱曦
百度一下 (Baidu):AICY爱曦
Brizzo
Brizzo is a dynamic and energetic investor, marketing strategist, musician and online reputation specialist. He is the Co-Founder of AICY Create, https://www.aicy-create.com/, a leading marketing agency based in China, with expertise in Personal Branding and China Digital Marketing.
L.b@aicy-create.com
Wechat: aicy-media
Top Two Black Supermodels – What Made Them So Different? by Brizzo
TikTok (Douyin抖音): How to use it for Marketing and Branding in China by Brizzo
【Successful Story】Morgan Freeman's Personal Brand: A Great Man of Trust by Brizzo
Marcello Lippi: The Mastermind's Personal Brand by Brizzo
The Definite Guide to Baidu SEO (2019 Update) by Brizzo
info@aicy-create.com
上海市静安区昌化路655号B6室
©2017 All rights reserved. AICY-Create. Designed by D-One.
Sign-up to our free e-mail course: "Online Reputation Management in China"
Learn everything about China Social Media, WeChat and Weibo, Personal Branding, Influencer Marketing
Please check your email for confirmation!

redpajama_set_name: RedPajamaCommonCrawl


text:
Book Review: "Queens of the Age of Chivalry: England's Medieval Queens" by Alison Weir
On November 28, 2022 November 30, 2022 By hmalagisiIn Book Reviews
When we think of the title "medieval queen," a few things come to mind. They were seen as mere trophy wives who were only suitable for making alliances and giving birth to children. It may be a cruel assessment for a modern audience, but that was the reality of the medieval world. However, the late Plantagenet queens decided to step outside the socially acceptable path for their lives and forged a new one. In Alison Weir's latest nonfiction book, "Queens of the Age of Chivalry: England's Medieval Queens," she explores the lives of five Plantagenet queens who had to adapt quickly to the ever-changing world of late medieval England.
Thank you, Ballantine Books and Net Galley, for sending me a copy of this book. I have read and enjoyed the previous books in England's Medieval Queens series, and I wanted to see which queens would be included in this book.
The years covered in this book are 1299-1399, a time of turmoil, change, and the plague. During that time, five queens forever left their marks on England: Marguerite of France, Isabella of France, Philippa of Hainault, Anne of Bohemia, and Isabella of Valois. Their royal husbands were Edward I, Edward II, Edward III, and Richard II. Since these queens were foreign brides, it was a balancing act between what their home country expected of them and what England expected their new queen to do, which was, in most cases, to give birth to heirs and to stay out of politics.
We begin with Marguerite of France, who was the second wife of Edward I and the step-mother of Edward II; her most extraordinary claim to fame was to try and prevent her son from ever seeing Piers Gaveston, which sadly did not last long. Isabella of France had to deal with Edward II's favoritism to not only Piers Gaveston but to Hugh Despenser the Younger. This led her to join Roger Mortimer and rebel against her husband. This decision would create a black cloud around her reputation for centuries.
As part of the rebellion, Edward III married Philippa of Hainault, who was the closest of these five queens to be the ideal medieval queen. She gave Edward III many heirs that would help define future generations. Richard II's first wife, Anne of Bohemia, was the essence of sophistication, but her death sent him reeling, forcing him to take a child bride named Isabella of Valois.
Being a queen in the late medieval period was not easy, especially with the Black Death, the Hundred Years' War, the Peasants' Revolt, and internal struggles were constantly in play, but the five queens mentioned in this book were able to navigate this tumultuous time to create their legacies. Weir once again weaves fun facts and compelling tales of each queen to give her readers her perspective on their true legacies. If you have enjoyed the previous books in "England's Medieval Queens" series, I would highly recommend you read "Queens of the Age of Chivalry: England's Medieval Queens" by Alison Weir.
Alison WeirAnne of BohemiaBallantine Booksbaron warsBiographiesBlack Deathbook reviewEdward IEdward IIEdward IIIEngland's Medieval QueensHugh Despenser the YoungerHundred Years' WarIsabella of FranceIsabella of ValoisMarguerite of FranceNet GalleynonfictionPeasants' RevoltPhilippa of HainaultPiers GavestonPlantagenetQueens of the Age of ChivalryRichard IIRoger Mortimer
Book Review: "Power, Treason, and Plot in Tudor England: Margaret Clitherow, an Elizabethan Saint" by Tony Morgan
Book Review: "Pursuing a Masterpiece: A Novel" by Sandra Vasoli
One thought on "Book Review: "Queens of the Age of Chivalry: England's Medieval Queens" by Alison Weir"
Richard P.McArthur
Edward II's birth mother was Eleanor of Castile, first wife of Edward I.


text:
Home / Book / Terrorism in Indonesia after "Islamic State"
Terrorism in Indonesia after "Islamic State"
Quinton Temby
Choose an optionHardback Clear
Terrorism in Indonesia after "Islamic State" quantity
ISEAS - Yusof Ishak Institute
The emergence of the Islamic State (IS) movement in Indonesia in 2014 re-energized violent extremism in Indonesia. As a result of effective counterterrorism policing, however, IS networks have been decimated and the structure of jihadism in Indonesia has shifted from organizations to autonomous networks and cells, increasingly organized via the Internet.
Although support for violent extremism in Indonesia remains marginal, cells of IS followers maintain a low-level capacity to conduct lethal attacks against civilian and government targets.
Most IS operations in Indonesia are sporadic and low-level attacks against the Indonesian police. Religious minorities have also been high-profile targets, as in the Surabaya church suicide bombings of 13 May 2018. There are some indications, however, of militants' renewed interest in attacking foreign targets, such as tourists on the resort island of Bali.
Quinton Temby, Author
Quinton Temby is Visiting Fellow in the Indonesia Studies Programme at the ISEAS – Yusof Ishak Institute, Singapore.


Social Media is a game changer for increasing not only your reach but building real followers who can turn into potential buyers of your work. Gone are the days of being owned by Galleries. We can do it ourselves and have control over our own businesses and get to know our own customers in a real way and into the future. Who knows where it can lead.
Don't be afraid to show whats its really like to work in your studio. We are all a little bit nosey and love to see the process, warts and all. Before I decided to organise my first solo exhibition in Smock Alley in Dublin I had built a following on Social Media with my mural work. As I began to promote specifically for this Exhibition I channelled my energy into sharing my journey from Creating to Exhibition, not as a sales strategy but as a Community driven process. I cherish my followers and customers and wanted to share this new project with them. Little did I know it would have such a huge impact on my sales.
I discovered that being authentic and bringing people on the journey with me was very powerful. The level of engagement was off the charts. People love interacting and having a chat about your work and also how it makes them feel, thats what I have discovered. You can have a look at an in a IG that got allot of engagement here. This particular painting sold shortly after I posted this image.
Being consistent is very important, sharing a little bit every day can keep you in the forefront of peoples minds and helps slowly build a following. I try to post once a day although I know your supposed to potentially post three times a day. Personally I don't have time for this, so once or twice is what I strive for.
Social Media is a game changer for increasing not only your reach but building real followers who can turn into potential buyers of your work. Instagram is fantastic for reaching a new audience, and by the smart use of hashtags, profile descriptions and landing pages you can extend to new audiences and build an online following. It is also important yo use your Instagram page to link to your website, blog or shop. I use mine to show people what prints I have available on my website. Its a great opportunity to showcase your work in another way.
It is a good idea to link your IG to Facebook when posting. This gives more opportunities for people to see your post and interact. I have driven sales from both platforms. Some days I might have several conversations going on both of these platforms. I actually love this and the I've made new friends who I chat with online each time I post a new painting. Being a Creative entrepreneur who usually works solo in a studio, can feel lonely and isolating. Social Media, specifically The Biscuit Community has opened up a whole new world for me and my work. I cannot emphasise enough how important Social Media is from both a selling perspective and a personal development / support perspective.


On this website we recommend many pictures abaout Boxer Info that we have collected from various sites tapike.com, and of course what we recommend is the most excellent of picture for Boxer Info. If you like the picture on our website, please do not hesitate to visit again and get inspiration from our website.
And if you want to see more images more we recommend the gallery below, you can see the picture as a reference design from your Boxer Info.
Thank you for seeing gallery of Boxer Info, we would be very happy if you come back.
Similar Keyword Boxer Info : boxer info, boxer info akc, boxer info breed, boxer info dog breed, boxer informal crossword, boxer information, boxer information and facts, boxer information dog, boxer information in hindi, boxer information wikipedia, european boxer information, info about boxer dogs, information about boxer dogs, and more.


An engineering firm, Filtration Service Engineering Ltd, has been fined £30,000 and ordered to pay £15,325 in costs after pleading guilty to serious safety failings after a worker was injured in an explosion. The firm was charged with breaching Section 2(1) of the Health and Safety at Work etc Act 1974.
Clive Dainty, from Kidderminster, was working for Filtration Service Engineering when a 335-litre vessel was being tested due to concerns about the welding. This would usually be done with water, but the firm used compressed air.
This caused the vessel to explode. Half of it flew through the air and hit Mr Dainty, forcing him into a cabinet against a wall. The explosion also threw a fire extinguisher through a nearby wooden staircase.
The Health and Safety Executive determined that, had the firm performed a risk assessment, they would have known that using compressed air was extremely unsafe. They could then have put up safety signs to ensure nobody made the mistake in future.


Louis Metoyer, along with Teri Fukushima, enjoys early New Year's festivities at Gardena's Alzheimer's Day Care Center, which struggles with funding and is losing its longtime director.
Before she was overcome by Alzheimer's disease, Marian Anderson was a firecracker.
She traveled the world as an Air Force courier during the Korean War. Later, she joined a nine-month peace march across the country. She even once drove her Volkswagen bus down to the Panama Canal just for the heck of it.
But eight years ago, this world traveler began forgetting her way around her hometown of Manhattan Beach and became confused about seemingly obvious things.
She was diagnosed with Alzheimer's disease.
For the past five years, the tall, white-haired woman has spent her afternoons at Gardena's Alzheimer's Day Care Center. One recent morning there, the former history and geography teacher from White Middle School in Carson carefully sounded out words in magazine advertisements. She could pronounce the words, but didn't know their meaning.
Later, with a knowing smile, the 82-year-old whistled notes and looked on as a group participated in a word-association game. But exactly what she understood of the gathering around her or the tunes she whistled was not clear to staff members.
What they do know is that the day-care program has been a lifesaver, said Anderson's caretaker and best friend, Madonna Newburg.
The day-care program was founded in Gardena in 1981. Today there are only eight other city-sponsored programs like this one in Los Angeles County, and no others in the South Bay.
The center provides shelter, food, classes, in-house and extracurricular activities, and lots of welcoming smiles and tender care for those suffering from Alzheimer's, Parkinson's disease, stroke disabilities, memory impairments, severe depression or post-traumatic stress syndrome.
It also hosts workshops for caregivers and family members about coping with Alzheimer's disease and memory loss.
But it has recently fallen on hard times.
Sharon Clutterbuck, who has been leading the program for about 20 years, retired on Friday.
With her exit, the director's position is temporarily frozen while the city searches for new funding.
Only a few part-time positions will remain filled in the meantime. But City Manager Mitch Lansdell said he is actively looking to reinstate the position and increase staff at the day-care center.
The center has always survived on grant funding.
About five years ago, that money dried up, and since then, the city has found piecemeal allocations. Now Lansdell is searching for a way to bring an influx of funding to the center.
Lunsdell said the loss of Clutterbuck is a real blow to the center.
Clutterbuck, 65, began working at the center as an intern while she was enrolled at El Camino College. She was interested in the psychology of aging, and felt passionate about helping seniors who are often misunderstood, ignored and victimized.
Not compromising their individual dignity is the key to serving seniors with memory loss, Clutterbuck believes. It's what made her gloss over one senior's memory lapses by telling him, in a lilting voice, "You're just trying to test me," rather than "You're wrong," when he was unable to decipher letters correctly during a bingo game.
Clutterbuck has refined the art of communication with those who have lost the ability to understand words and emotions.
Clutterbuck likens the slow procession of Alzheimer's disease through the brain to birds on a wire.
"Who's to say what birds will fall off and when?" she said, referring to the loss of vocabulary, social skills and other memories to the disease.
Theories about what causes Alzheimer's disease abound. But scientists believe it is associated with two common things: abnormal clumps called amyloid plaques, and tangled bundles of fibers in the brain called neurofibrillary tangles.
Dr. Debra Cherry, executive vice president of the Alzheimer's Association's California Southern chapter, was one of the first staff members at the Gardena Day Care center in 1982. She helped turn it from a senior center into a program for seniors with cognitive impairments.
In the early stages of Alzheimer's, patients forget recent occurrences and are aware that something is wrong.
Over time, all brain functions including judgment, perception, personality and motor control can be affected. Patients lose awareness of what is happening to them.
As the patient becomes increasingly affected, they lose mobility and are eventually bedridden, Cherry said.
Day care can help improve patients' moods, and stimulate them socially and cognitively, she said. As importantly, it gives their caregivers a respite from the constant demands of an Alzheimer's patient who requires the attention a small child would, she said.
"Is it a cure? No. But is it a really good social intervention? Yes," Cherry said.
This week, Art Mortensen spent his days as he has for the past 20 years, socializing and playing at the center.
He remembers his life well up until he had a major stroke in 1985. Since then, things have been scrambled. Usually, he understands only about one in three words, said his wife, Sheila Mortensen.
Before the stroke, Mortensen was a sergeant in charge of search and rescue operations for the Ventura County Sheriff's Department.
Before that, he served in the Navy. For a time, he said, he was a field engineer in anti-submarine warfare. He located enemy submarine signals and determined their depth and location. He once owned a bowling alley and homes in California and Mexico.
His favorite activities at the center, where he is usually the loudest voice in the room, are playing blackjack and word and trivia games. During a recent group game, he shouted out answers to word scrambles in seconds.
Arcfs was scarf. Wnso was snow.
During a word association game, he referenced literary figures with ease – Hemingway and Mark Twain.
Mrs. Mortensen said that they balance the good moments with the bad. "Even though he's highly functional, he has a lot of interruptions in his brain," she said. "Sometimes he remembers and sometimes he doesn't.


text:
Million-Dollar Prize Hints at How Machine Learning May Someday Spot Cancer
Chinese researchers have developed an algorithm that could help make lung cancer diagnosis less error-prone.
Will Knightarchive page
Machine learning often requires massive data sets to develop an effective algorithm, but for this contest, teams were provided with only 2,000 images.
A contest aimed at automating the detection of lung cancer shows how machine learning may be poised to overhaul medical imaging.
The challenge offered $1 million in prizes for the algorithms that most accurately identified signs of lung cancer in low-dose computed tomography images. The winning algorithms won't necessarily be adopted by clinicians, but they could inspire algorithmic innovations that find their way into medical imaging.
Low-dose CT scans have shown great potential in recent years for detecting lung cancer earlier. They use less radiation and do not require a contrast dye to be injected into the body. But diagnosis is very difficult, meaning a high number of false positives and too many unnecessary medical procedures.
A machine-learning technique known as deep learning has proven especially effective for finding patterns in images in recent years (see "10 Breakthrough Technologies 2013: Deep Learning"). There is now growing hope that this and other machine-learning methods may help improve standards of diagnosis in medicine by automatically recognizing patterns that indicate disease—including ones that are too subtle for the human eye to catch.
Deep learning has already been used to detect skin cancer in images with roughly the same number of errors as made by professional dermatologists. And the technique has proven effective for detecting a common cause of blindness in retinal images. There is now growing interest, among doctors and entrepreneurs, in deploying the technique more broadly. As this happens, however, more effort may be needed to make such algorithms explainable (see "The Dark Secret at the Heart of AI").
No one really knows how the most advanced algorithms do what they do. That could be a problem.
Keyvan Farahani, a program director at the National Cancer Institute, which supplied the imaging data used in the contest, says reducing the number of false lung cancer diagnoses made from low-dose CT scans would make a real difference for patients. There are about 222,500 new cases of lung cancer in the U.S. each year, according to the American Cancer Society.
Farahani says existing software for identifying signs of lung cancer are unreliable. "Preliminary results suggest [the top algorithms] are better than what's available already," he says. Farahani does not foresee algorithms taking the place of medical experts, though. "Deep learning will help digest large amounts of data," he says. "I don't think they're going to replace doctors or radiologists."
One of the key challenges in this contest was the fact that only 2,000 images were made available to teams. Machine learning often requires very large data sets in order to develop an effective algorithm. But other data, like details of the equipment used, were included.
The winning team employed a neural network and put extra effort into annotating images to provide more data points. It also used an additional data set, and broke the challenge into two parts: identifying nodules and then diagnosing cancer. It isn't yet clear how the best algorithm might measure up to a doctor, because each algorithm provides a probability rather than a definitive outcome.
"We think that explicitly dividing this problem into two stages is critical, which seems also to be what human experts would do," says Zhe Li, a member of the winning team and a student at Tsinghua University, one of China's foremost academic institutes.
Besides hinting at the potential for deep learning in medical imaging, the lung cancer contest highlights the growing reputation of Chinese AI researchers.
The contest, held on the data science site Kaggle, was organized by Booz Allen Hamilton, a management consulting firm that has arranged several other major data science contests before. The $1 million in prize money came from the Laura and John Arnold Foundation.
Kaggle was founded in 2010 and acquired earlier this year by Google. The site has proven to be a powerful way of crowdsourcing the development of machine-learning algorithms, and is also a popular way to identify talent.
Josh Sullivan, who leads the data science team at Booz Allen Hamilton, says one motivation for the contest is talent acquisition, noting that 238 entrants have also applied for jobs at the company. He adds that the company is making the winning algorithms available for free to maximize the potential benefits to the medical community.
Li, of the winning team, says developing something that might save people's lives is gratifying, but the real reason for taking part was a bit less altruistic. "To be honest, the major motivation is to win the prize money," he says.
by Will Knight


text:
MTA-STS Is a Thing... Well Then (also feat. TLSRPT)
2021-02-07 5 min read Email Sysadmin things Security Tech explained Teknikal_Domain Unable to load comment count
If you're just curious, MTA-STS relates to SMTP, in the same way that HSTS relates to HTTP. Except, naturally, it relies on, you get three guesses… yes, DNS. And this is what it is, and how to set it up.
Officially documented in RFC 8461 , MTA-STS allows for a MTA (mail server) to publish a policy where, if the sending side respects it, will know to only use TLS encryption for mail sent to said MTA.
See, as much as we would like for email to be a 100% secure system, it's not. And all the RFCs have spoken — You cannot require TLS, you have to accept plaintext delivery, meaning, you have to accept delivery on a plaintext port (so, not 465) that did not include a STARTTLS command. The best we can do, however, is for conforming sending MTAs, tell them that we would prefer they use TLS wherever possible, and to refuse to send mail if they cannot. A way this has been done for a while is DANE, or DNS Based Authentication of Named Entities, which uses a special record called a TLSA record, to hold, in the most common case, a hash of your TLS certificate. Postfix has had support for DANE for a while, if you tell it to, it will attempt to fetch a domain's TLSA records before sending to it, verify that they're signed with DNSSEC, and then refuse delivery if they cannot negotiate TLS, or the TLS certificate presented doesn't match the data in the TLSA record. This does require a few things though, namely… DNSSEC, and recomputing hashes every time your certificates rotate, which if you're like me, and use Let's Encrypt, that's every 90 days. MTA-STS attempts to provide something similar, by publishing a policy to tell sending MTAs to only deliver to you with TLS.
The first part is to create the policy file, which, for the domain example.com, much be able to reached at the following URL:
https://mta-sts.example.com/.well-known/mta-sts.txt
Note that the protocol there is HTTPS. This is required. You need a valid TLS certificate on your web server to allow for enforcing TLS on your mail server. Also, note the subdomain, mta-sts. This is, again, required. A MTA-STS policy file is a text file containing one directive per line, like so:
version: STSv1
mode: testing
max_age: 86400
mx: mail.example.com
mx: *.example.net
The version must be STSv1, the mode can either be enforce, testing, or none, the max_age is the age, in seconds, that clients are allowed to cache the policy for, and then each mx lists a domain name that is a valid MX for this domain (in other words, list all the values of your MX records). Going back to the mode directive, enforce is the only one that will actually cause messages to not be delivered if the policy cannot validate (meaning, no matching listed MX has good TLS). Either enforce or testing will send TLSRPT reports (more on that later), and none causes the policy to be discarded, meaning sending MTAs are to act as if no MTA-STS policy exists. Also of note: HTTP redirects and caching are not respected. A request for your policy must be a 200 OK response, or it will fail to be fetched.
After this, you need a single DNS record, again, using an example domain of example.com:
_mta-sts.example.com    IN    TXT    "v=STSv1; id=20210128000031Z"
The v tag is always STSv1, and the id is an alphanumeric string, that identifies a particular policy version. It's value has no value, but if the id changes between fetches, the policy has changed too, and should be re-fetched, ignoring cache. In other words, set this to anything you want, and make sure to change it to something different every time you edit that policy file. Using a timestamp or the first few characters of the file's hash would work just fine.
With these two deployed, in theory, you should be good. Not many MTAs right now support MTA-STS, but Google does, and given how large they are, that means that the majority of email received should likely be guaranteed to be TLS.
But if you want to go one step beyond though…
Configuring TLSRPT
TLSRPT (SMTP TLS Reporting), defined in RFC 8460 , is a standard for sending MTAs to report TLS connectivity issues to receiving MTAs, and works hand-in-hand with MTA-STS. It's effectively the DMARC for SMTP TLS. And unlike MTA-STS, and like DMARC, all you need is a single DNS record, using our ever-beloved example domain:
_smtp._tls.example.com    IN    TXT    "v=TLSRPTv1; rua=mailto:[email protected]"
As with all these, the v tag has a fixed value. And in this case, there's only one other tag, rua, which can contain a comma-separated list of URIs to send reports to. They can either be mailto or https, with mailto then specifying an email address to send reports to, and https specifying an endpoint to POST a report to. Thus, rua=https://reporting.example.com/tlsrpt is perfectly valid.
When reporting, TLS errors are ignored, meaning for https reports, the certificate does not need to be valid, and for mailto reports, MTA-STS and DANE TLSAs are not enforced, and not included in the next report.
That's it. From there, just make sure that whatever you specified in the rua is ready to handle the JSON formatted reports that may be sent to it. Reports are generally generated covering a one-day period, but since the adoption rate of MTA-STS and TLSRPT seems pretty low, chances are only the big ones (again, like Google, which has publicly declared their support) will send you anything.
mailto reporting DKIM records
There is one small footnote to this: When sending a message to a mailto report URI, the DKIM service name (s) used is tlsrpt, not email like with… email. So for a sending MTA, if you send TLSRPT reports, the DKIM key used must have a service field that allows for tlsrpt, or, more likely, has no service field, thus not restricting it's usage. Additionally, a DKIM signature is not allowed to limit the signed body length with the l tag.
DANE DKIM DMARC DNS HSTS MTA-STS TLS TLSA TLSRPT


You are visiting the placeholder page for Mike Bigelow. This page is here because someone used our placeholder utility to look for Mike Bigelow. We created this page automatically in hopes Mike Bigelow would find it. If you are not Mike Bigelow, but are an alumni of Ocean Springs High School, register on this site for free now.


Start earning money with your referrals and turn your time and connections online into money. You get paid for each referral that generates a sale. The system monitors and tracks each and every referral done through the system to all the various suppliers.
Howdy is FREE to join. You pay zero fees signing up on Howdy today.
Once signed up you choose your own sub domain and this becomes your own personal refferal page.
Tracking of each and every referral done through the system with follow ups to confirm sales.
Track Your referrals, At Any Time!
Take charge of your destiny and start earning money off referrals this month.
System is online 24/7, with your own referral page and links – share and you done.
If you want to earn money from referrals you sign up as a crew member and if you are a supplier and want to recieve refferals then sign up as a suppliers today.


Exercise! There's that word again. The one that many of us would like to throw under the rug and forget about every time it comes up. This is especially true if you have joint issues. The Arthritis Foundation has recently reported that 46 million Americans experience some sort of joint condition. That's nearly 1/6 of the U.S. population!
Maybe you've suffered a previous injury to a particular joint or maybe you have arthritis or your joints constantly ache. Or perhaps you shy away from exercising because you don't want to do anything that's going to take a toll on your joints in the long run. Whatever the case may be you can improve your joint health and overall well-being for that matter by participating in some form of low impact exercises.
Walking is a great form of a light cardio workout that's easy on the joints. It gets the blood flowing which improves oxygenation and this helps you think clearer and feel more energetic.
Try to reach for a goal of walking 30 minutes a day or 3 hours a week. If you can't do this then start off with a smaller increment of 10 or 15 minutes and work your way up.
Check out new trails in your neighborhood or local parks or beaches. Some sunshine, fresh air, and new scenery are always great ways to boost your spirits and leave you with a smile once you've finished your walk.
Swimming is a very low impact form of exercise and provides a great workout. You can typically burn in excess of 500 calories per hour by swimming.
Another great way to get in shape in the water is to join a water aerobics class. Water aerobics will help you with your cardiovascular fitness as well as strength, flexibility, and balance.
Swimming is a great way to stay cool in the summer and nothing beats a good workout on a hot summer day without the feeling of being drenched in sweat.
Taking a bike ride is a fantastic way to break up your day and keep it easy on the joints. Many neighborhoods have bike paths or trails that you can ride on to avoid traffic congestion on the roads.
Bicycling is a great cardio workout but also works out your entire body especially the lower body. Your legs, hips, and glutes will gain muscle tone while your waist sheds a few sizes if you cycle on a regular basis.
Cycling can be a fun social outing as well that you can enjoy in the company of friends and family.
There are a variety of stretching exercises that can benefit your joint health. These include yoga, pilates, and other various stretching exercises.
Pilates is a great way to work your core muscles and increase your joint flexibility along the way. It's best to start with a low intensity workout first if you haven't tried pilates before.
Yoga includes a multitude of different body poses that really give your entire body a good stretch. A beginners course is easy on the joints and will soon lead to increased flexibility and strength for both your muscles and joints. And it's a great stress reliever too!
Tai Chi is a Chinese martial art that is not as popular in western cultures but serves as an excellent form of exercise to relieve joint pain.
Tai Chi involves a number of slow, low impact movements that work on your range of motion, stretching, and flexibility while improving your muscle and ligament strength and endurance.
Tai Chi is also a wonderful stress reliever as it focuses on a calmness throughout the workout.
So there you have it! Five easy ways to give your health a boost while remaining easy on your joints. Don't forget to check with your physician before starting any new exercise routine to ensure that it is safe to do so with any specific medical conditions that you may have.


"There are so many great quilt blocks out there I've been itching to try. I just don't like the idea of making the same block repeatedly for one quilt. So, why not a sampler quilt?
"Originally, I intended to do this slowly, one block at a time over many months and when I finished a block share it with you here on the blog. But I thought: why not show you how I made the block with a tutorial."
What do you think of these tutorials?