You can add more option rules in addition to those you specified in the Zend\Console\Getopt constructor, using the addRules() method. The argument to addRules() is the same as the first argument to the class constructor. It is either a string in the format of the short syntax options specification, or else an associative array in the format of a long syntax options specification. See Declaring Getopt Rules for details on the syntax for specifying options.
Using addRules()
1 2 3 4 5 6 | $opts = new Zend\Console\Getopt('abp:');
$opts->addRules(
array(
'verbose|v' => 'Print verbose output'
)
);
|
The example above shows adding the --verbose option with an alias of -v to a set of options defined in the call to the constructor. Notice that you can mix short format options and long format options in the same instance of Zend\Console\Getopt.
In addition to specifying the help strings when declaring option rules in the long format, you can associate help strings with option rules using the setHelp() method. The argument to the setHelp() method is an associative array, in which the key is a flag, and the value is a corresponding help string.
Using setHelp()
1 2 3 4 5 6 7 8 | $opts = new Zend\Console\Getopt('abp:');
$opts->setHelp(
array(
'a' => 'apple option, with no parameter',
'b' => 'banana option, with required integer parameter',
'p' => 'pear option, with optional string parameter'
)
);
|
If you declared options with aliases, you can use any of the aliases as the key of the associative array.
The setHelp() method is the only way to define help strings if you declared the options using the short syntax.
You can declare aliases for options using the setAliases() method. The argument is an associative array, whose key is a flag string declared previously, and whose value is a new alias for that flag. These aliases are merged with any existing aliases. In other words, aliases you declared earlier are still in effect.
An alias may be declared only once. If you try to redefine an alias, a Zend\Console\Getopt\Exception is thrown.
Using setAliases()
1 2 3 4 5 6 7 8 | $opts = new Zend\Console\Getopt('abp:');
$opts->setAliases(
array(
'a' => 'apple',
'a' => 'apfel',
'p' => 'pear'
)
);
|
In the example above, after declaring these aliases, -a, --apple and --apfel are aliases for each other. Also -p and --pear are aliases for each other.
The setAliases() method is the only way to define aliases if you declared the options using the short syntax.
By default, Zend\Console\Getopt uses $_SERVER['argv'] for the array of command-line arguments to parse. You can alternatively specify the array of arguments as the second constructor argument. Finally, you can append more arguments to those already used using the addArguments() method, or you can replace the current array of arguments using the setArguments() method. In both cases, the parameter to these methods is a simple array of strings. The former method appends the array to the current arguments, and the latter method substitutes the array for the current arguments.
Using addArguments() and setArguments()
1 2 3 4 5 6 7 8 | // By default, the constructor uses $_SERVER['argv']
$opts = new Zend\Console\Getopt('abp:');
// Append an array to the existing arguments
$opts->addArguments(array('-a', '-p', 'p_parameter', 'non_option_arg'));
// Substitute a new array for the existing arguments
$opts->setArguments(array('-a', '-p', 'p_parameter', 'non_option_arg'));
|
The third parameter to the Zend\Console\Getopt constructor is an array of configuration options that affect the behavior of the object instance returned. You can also specify configuration options using the setOptions() method, or you can set an individual option using the setOption() method.
Note
Clarifying the Term “option”
The term “option” is used for configuration of the Zend\Console\Getopt class to match terminology used elsewhere in Zend Framework. These are not the same things as the command-line options that are parsed by the Zend\Console\Getopt class.
The currently supported options have const definitions in the class. The options, their const identifiers (with literal values in parentheses) are listed below:
More configuration options may be added as future enhancements of this class.
The two arguments to the setOption() method are a configuration option name and an option value.
Using setOption()
1 2 | $opts = new Zend\Console\Getopt('abp:');
$opts->setOption('ignoreCase', true);
|
The argument to the setOptions() method is an associative array. The keys of this array are the configuration option names, and the values are configuration values. This is also the array format used in the class constructor. The configuration values you specify are merged with the current configuration; you don’t have to list all options.
Using setOptions()
1 2 3 4 5 6 7 | $opts = new Zend\Console\Getopt('abp:');
$opts->setOptions(
array(
'ignoreCase' => true,
'dashDash' => false
)
);
|
The source code of this file is hosted on GitHub. Everyone can update and fix errors in this document with few clicks - no downloads needed.


Kanye West covers entire body in silver for new opera, 'Mary'
Cape Town - Kanye West debuted the new original opera Mary at the Miami Marine Stadium on Sunday, 8 December while covering his body in silver.
The opera, directed by Vanessa Beecroft, follows on the heels of Nebuchadnezzar, Kanye's first opera, which premiered last month at the Hollywood Bowl in Los Angeles.
For the rapper, the opera is a new medium through which to express his commitment to faith and his ever-expanding musical and visual palette according to a statement released to the press.
Mary is an original opera, based on the biblical story of the miraculous events surrounding the birth of Jesus Christ. The Books of Matthew and Luke recount the story of Mary, who was divinely chosen by God to bring forth the Messiah.
Mary brings together elements from different worlds - including opera, fine art, modern dance, and gospel music - to create a new visual interpretation and innovative performance structure. The stage production is performed by the Sunday Service collective, a ministry formed in January of 2019, in collaboration with Access Opera.
With the Sunday Service Collective working alongside a cast of professional opera singers, Mary represents an innovative interpretation of Kanye's own music, gospel standards, and traditional opera alike.
SEE A PICTURE OF KANYE COVERED IN SILVER DURING THE OPERA HERE:
Compiled by Alex Isaacs
(Photo: Getty)


THE HORSE WHISPERER
Release Date: May 15, 1998 Starring: Robert Redford, Kristin Scott Thomas, Sam Neill, Scarlett Johansson, Dianne Wiest, Chris Cooper, Cherry Jones, Catherine Bosworth Directed by: Robert Redford Distributed by: Buena Vista Pictures MPAA Rating: PG-13 (a disturbing accident scene) URL: http://www.execpc.com/~kinnopio/reviews/1998/horse.htm
If there's anything THE HORSE WHISPERER says very well, it's what it has to say about personality, and consequently, characterization. The three or four main characters in the drama, and the ten or so more that are significant supports, are very solid and very believable. And although that should be a given in most movies, it is almost thankfully so in this new Robert Redford film, a painstakingly thorough and mostly powerful motion picture. It's been hailed as the best movie of 1998 thus far, and although it may not warrant itself that award, it is definitely among the top three movies yet.
Redford directs himself for the first time in his thirty-six year career as an actor, and the results are somewhat muddled. His skills as both a director (ORDINARY PEOPLE) and an actor (OUT OF AFRICA) are excellent, but he loses some of his touch when devoting his energies to both positions on the set. Fortunately, the rest of his cast really picks him up, and in the end makes him seem better than he really is. Kristin Scott Thomas (THE ENGLISH PATIENT), Sam Neill (JURASSIC PARK), and Scarlett Johansson (MANNY & LO) all enforce the movie's solidity and concrete characterization. Believable as everyone is, though, the entire cast seems to lack an extra edge or push that would grant them any noteability. No one in the cast astounds or amazes (with the possible exception of Johansson, whose portrayal of a crippled girl is akin to Leonardo DiCaprio's portrayal of a mentally retarded boy in WHAT'S EATING GILBERT GRAPE), and thus the intense character issues are somewhat bland.
The movie begins with Grace (Johansson) and her friend Judith (Catherine Bosworth) out for a horse ride on a winter morning. Tragically, though, their horses slip on icy ground, onto a road andinto the path of an oncoming truck. The collision kills Judith and renders Grace minus her right leg, which severly traumatizes the girl as well as her horse. Annie (Scott Thomas), her mother, in her search for anything to help the girl, chances upon the name of Tom Booker (Redford), a rancher with a gift for helping horses. For lack of anything better, Annie leaves her husband Robert (Neill) behind and takes Grace and the troubled steed out to Montana to meet Tom and see if he can help them at all. It's from here on, throughout the last three-quarters of the movie, that best part of THE HORSE WHISPERER is clearly evident. The photography of Montana - the impregnable mountains, the wide open skies, and the rolling hills - is simply amazing. This movie may certainly garner an Academy Award nomination in this respect.
THE HORSE WHISPERER isn't for the uncomitted viewer. It runs almost three hours in length, and doesn't include a continual excitement factor in movies of similar length, such as Titanic or The Postman. Rather, it relies on important character relationships and the inklings of intense melodrama to keep an anticipatedly intelligent audience very interested. This strategy works - most of the time - as those watching become bent on learning just how Tom Booker will help the horse, or how Annie will deal with her new position in life. Other than its lack of sheer panache, there's nothing wrong with THE HORSE WHISPERER; this is quite possibly the best three-star movie I've ever seen.
FINAL AWARD FOR "THE HORSE WHISPERER": 3.0 stars - a good movie.
-- Craig Roush<EMAIL_ADDRESS>-- Kinnopio's Movie Reviews http://www.execpc.com/~kinnopio
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Class Device¶
Defined in File device.h
Inheritance Relationships¶
Derived Types¶
public marian::cpu::Device
(Class Device)public marian::cpu::WrappedDevice
(Class WrappedDevice)public marian::gpu::Device
(Class Device)
Class Documentation¶
-
class
Device
¶ Subclassed by marian::cpu::Device, marian::cpu::WrappedDevice, marian::gpu::Device
Public Functions
-
virtual
~Device
()¶
-
virtual void
reserve
(size_t size) = 0¶
-
virtual uint8_t *
data
()¶
-
virtual size_t
size
()¶
Protected Functions
-
size_t
align
(size_t size) const¶
-
virtual


import random
import torch
import torch.multiprocessing as multiprocessing
from torch._C import _set_worker_signal_handlers, _update_worker_pids, \
_remove_worker_pids, _error_if_any_worker_fails
from . import SequentialSampler, RandomSampler, BatchSampler
import signal
import functools
from torch._six import container_abcs
import re
import sys
import threading
import traceback
import os
import time
import atexit
from torch._six import string_classes, int_classes, FileNotFoundError
IS_WINDOWS = sys.platform == "win32"
if IS_WINDOWS:
import ctypes
from ctypes.wintypes import DWORD, BOOL, HANDLE
if sys.version_info[0] == 2:
import Queue as queue
else:
import queue
# NOTE [ Python Traceback Reference Cycle Problem ]
#
# When using sys.exc_info(), it is important to **not** store the exc_info[2],
# which is the traceback, because otherwise you will run into the traceback
# reference cycle problem, i.e., the traceback holding reference to the frame,
# and the frame (which holds reference to all the object in its temporary scope)
# holding reference the traceback.
class ExceptionWrapper(object):
r"""Wraps an exception plus traceback to communicate across threads"""
def __init__(self, exc_info):
# It is important that we don't store exc_info, see
# NOTE [ Python Traceback Reference Cycle Problem ]
self.exc_type = exc_info[0]
self.exc_msg = "".join(traceback.format_exception(*exc_info))
_use_shared_memory = False
r"""Whether to use shared memory in default_collate"""
MP_STATUS_CHECK_INTERVAL = 5.0
r"""Interval (in seconds) to check status of processes to avoid hanging in
multiprocessing data loading. This is mainly used in getting data from
another process, in which case we need to periodically check whether the
sender is alive to prevent hanging."""
if IS_WINDOWS:
# On Windows, the parent ID of the worker process remains unchanged when the manager process
# is gone, and the only way to check it through OS is to let the worker have a process handle
# of the manager and ask if the process status has changed.
class ManagerWatchdog(object):
def __init__(self):
self.manager_pid = os.getppid()
self.kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)
self.kernel32.OpenProcess.argtypes = (DWORD, BOOL, DWORD)
self.kernel32.OpenProcess.restype = HANDLE
self.kernel32.WaitForSingleObject.argtypes = (HANDLE, DWORD)
self.kernel32.WaitForSingleObject.restype = DWORD
# Value obtained from https://msdn.microsoft.com/en-us/library/ms684880.aspx
SYNCHRONIZE = 0x00100000
self.manager_handle = self.kernel32.OpenProcess(SYNCHRONIZE, 0, self.manager_pid)
if not self.manager_handle:
raise ctypes.WinError(ctypes.get_last_error())
self.manager_dead = False
def is_alive(self):
if not self.manager_dead:
# Value obtained from https://msdn.microsoft.com/en-us/library/windows/desktop/ms687032.aspx
self.manager_dead = self.kernel32.WaitForSingleObject(self.manager_handle, 0) == 0
return not self.manager_dead
else:
class ManagerWatchdog(object):
def __init__(self):
self.manager_pid = os.getppid()
self.manager_dead = False
def is_alive(self):
if not self.manager_dead:
self.manager_dead = os.getppid() != self.manager_pid
return not self.manager_dead
def _worker_loop(dataset, index_queue, data_queue, done_event, collate_fn, seed, init_fn, worker_id):
# See NOTE [ Data Loader Multiprocessing Shutdown Logic ] for details on the
# logic of this function.
try:
global _use_shared_memory
_use_shared_memory = True
# Intialize C side signal handlers for SIGBUS and SIGSEGV. Python signal
# module's handlers are executed after Python returns from C low-level
# handlers, likely when the same fatal signal happened again already.
# https://docs.python.org/3/library/signal.html Sec. <IP_ADDRESS>
_set_worker_signal_handlers()
torch.set_num_threads(1)
random.seed(seed)
torch.manual_seed(seed)
data_queue.cancel_join_thread()
if init_fn is not None:
init_fn(worker_id)
watchdog = ManagerWatchdog()
while watchdog.is_alive():
try:
r = index_queue.get(timeout=MP_STATUS_CHECK_INTERVAL)
except queue.Empty:
continue
if r is None:
# Received the final signal
assert done_event.is_set()
return
elif done_event.is_set():
# Done event is set. But I haven't received the final signal
# (None) yet. I will keep continuing until get it, and skip the
# processing steps.
continue
idx, batch_indices = r
try:
samples = collate_fn([dataset[i] for i in batch_indices])
except Exception:
# It is important that we don't store exc_info in a variable,
# see NOTE [ Python Traceback Reference Cycle Problem ]
data_queue.put((idx, ExceptionWrapper(sys.exc_info())))
else:
data_queue.put((idx, samples))
del samples
except KeyboardInterrupt:
# Main process will raise KeyboardInterrupt anyways.
pass
def _pin_memory_loop(in_queue, out_queue, device_id, done_event):
torch.cuda.set_device(device_id)
# See NOTE [ Data Loader Multiprocessing Shutdown Logic ] for details on the
# logic of this function.
while True:
try:
r = in_queue.get(timeout=MP_STATUS_CHECK_INTERVAL)
except queue.Empty:
continue
except Exception:
if done_event.is_set():
# Weird things can happen when shutting down, e.g., fd being
# closed when tensors are shared via fds.
break
raise
if r is None:
assert done_event.is_set()
return
elif done_event.is_set():
# Haven't seen the final signal yet. Keep getting until None.
continue
elif isinstance(r[1], ExceptionWrapper):
out_queue.put(r)
else:
idx, batch = r
try:
batch = pin_memory_batch(batch)
except Exception:
out_queue.put((idx, ExceptionWrapper(sys.exc_info())))
else:
out_queue.put((idx, batch))
numpy_type_map = {
'float64': torch.DoubleTensor,
'float32': torch.FloatTensor,
'float16': torch.HalfTensor,
'int64': torch.LongTensor,
'int32': torch.IntTensor,
'int16': torch.ShortTensor,
'int8': torch.CharTensor,
'uint8': torch.ByteTensor,
}
def default_collate(batch):
r"""Puts each data field into a tensor with outer dimension batch size"""
error_msg = "batch must contain tensors, numbers, dicts or lists; found {}"
elem_type = type(batch[0])
if isinstance(batch[0], torch.Tensor):
out = None
if _use_shared_memory:
# If we're in a background process, concatenate directly into a
# shared memory tensor to avoid an extra copy
numel = sum([x.numel() for x in batch])
storage = batch[0].storage()._new_shared(numel)
out = batch[0].new(storage)
return torch.stack(batch, 0, out=out)
elif elem_type.__module__ == 'numpy' and elem_type.__name__ != 'str_' \
and elem_type.__name__ != 'string_':
elem = batch[0]
if elem_type.__name__ == 'ndarray':
# array of string classes and object
if re.search('[SaUO]', elem.dtype.str) is not None:
raise TypeError(error_msg.format(elem.dtype))
return torch.stack([torch.from_numpy(b) for b in batch], 0)
if elem.shape == (): # scalars
py_type = float if elem.dtype.name.startswith('float') else int
return numpy_type_map[elem.dtype.name](list(map(py_type, batch)))
elif isinstance(batch[0], int_classes):
return torch.LongTensor(batch)
elif isinstance(batch[0], float):
return torch.DoubleTensor(batch)
elif isinstance(batch[0], string_classes):
return batch
elif isinstance(batch[0], container_abcs.Mapping):
return {key: default_collate([d[key] for d in batch]) for key in batch[0]}
elif isinstance(batch[0], container_abcs.Sequence):
transposed = zip(*batch)
return [default_collate(samples) for samples in transposed]
raise TypeError((error_msg.format(type(batch[0]))))
def pin_memory_batch(batch):
if isinstance(batch, torch.Tensor):
return batch.pin_memory()
elif isinstance(batch, string_classes):
return batch
elif isinstance(batch, container_abcs.Mapping):
return {k: pin_memory_batch(sample) for k, sample in batch.items()}
elif isinstance(batch, container_abcs.Sequence):
return [pin_memory_batch(sample) for sample in batch]
else:
return batch
_SIGCHLD_handler_set = False
r"""Whether SIGCHLD handler is set for DataLoader worker failures. Only one
handler needs to be set for all DataLoaders in a process."""
def _set_SIGCHLD_handler():
# Windows doesn't support SIGCHLD handler
if sys.platform == 'win32':
return
# can't set signal in child threads
if not isinstance(threading.current_thread(), threading._MainThread):
return
global _SIGCHLD_handler_set
if _SIGCHLD_handler_set:
return
previous_handler = signal.getsignal(signal.SIGCHLD)
if not callable(previous_handler):
# This doesn't catch default handler, but SIGCHLD default handler is a
# no-op.
previous_handler = None
def handler(signum, frame):
# This following call uses `waitid` with WNOHANG from C side. Therefore,
# Python can still get and update the process status successfully.
_error_if_any_worker_fails()
if previous_handler is not None:
previous_handler(signum, frame)
signal.signal(signal.SIGCHLD, handler)
_SIGCHLD_handler_set = True
_python_exit_status = False
r"""Whether Python is shutting down. This flag is guaranteed to be set before
the Python core library resources are freed, but Python may already be exiting
for some time when this is set.
Hook to set this flag is `_set_python_exit_flag`, and is inspired by a similar
hook in Python 3.7 multiprocessing library:
https://github.com/python/cpython/blob/d4d60134b29290049e28df54f23493de4f1824b6/Lib/multiprocessing/util.py#L277-L327
"""
def _set_python_exit_flag():
global _python_exit_status
_python_exit_status = True
atexit.register(_set_python_exit_flag)
class _DataLoaderIter(object):
r"""Iterates once over the DataLoader's dataset, as specified by the sampler"""
# NOTE [ Data Loader Multiprocessing Shutdown Logic ]
#
# Preliminary:
#
# Our data model looks like this (queues are indicated with curly brackets):
#
# main process ||
# | ||
# {index_queue} ||
# | ||
# worker processes || DATA
# | ||
# {worker_result_queue} || FLOW
# | ||
# pin_memory_thread of main process || DIRECTION
# | ||
# {data_queue} ||
# | ||
# data output \/
#
# P.S. `worker_result_queue` and `pin_memory_thread` part may be omitted if
# `pin_memory=False`.
#
#
# Terminating multiprocessing logic requires very careful design. In
# particular, we need to make sure that
#
# 1. The iterator gracefully exits the workers when its last reference is
# gone or it is depleted.
#
# In this case, the workers should be gracefully exited because the
# main process may still need to continue to run, and we want cleaning
# up code in the workers to be executed (e.g., releasing GPU memory).
# Naturally, we implement the shutdown logic in `__del__` of
# DataLoaderIterator.
#
# We delay the discussion on the logic in this case until later.
#
# 2. The iterator exits the workers when the loader process and/or worker
# processes exits normally or with error.
#
# We set all workers and `pin_memory_thread` to have `daemon=True`.
#
# You may ask, why can't we make the workers non-daemonic, and
# gracefully exit using the same logic as we have in `__del__` when the
# iterator gets deleted (see 1 above)?
#
# First of all, `__del__` is **not** guaranteed to be called when
# interpreter exits. Even if it is called, by the time it executes,
# many Python core library resources may alreay be freed, and even
# simple things like acquiring an internal lock of a queue may hang.
# Therefore, in this case, we actually need to prevent `__del__` from
# being executed, and rely on the automatic termination of daemonic
# children. Thus, we register an `atexit` hook that sets a global flag
# `_python_exit_status`. Since `atexit` hooks are executed in reverse
# order of registration, we are guaranteed that this flag is set before
# library resources we use are freed. (Hooks freeing those resources
# are registered at importing the Python core libraries at the top of
# this file.) So in `__del__`, we check if `_python_exit_status` is set
# or `None` (freed), and perform no-op if so.
#
# Another problem with `__del__` is also related to the library cleanup
# calls. When a process ends, it shuts the all its daemonic children
# down with a SIGTERM (instead of joining them without a timeout).
# Simiarly for threads, but by a different mechanism. This fact,
# together with a few implementation details of multiprocessing, forces
# us to make workers daemonic. All of our problems arise when a
# DataLoader is used in a subprocess, and are caused by multiprocessing
# code which looks more or less like this:
#
# try:
# your_function_using_a_dataloader()
# finally:
# multiprocessing.util._exit_function()
#
# The joining/termination mentioned above happens inside
# `_exit_function()`. Now, if `your_function_using_a_dataloader()`
# throws, the stack trace stored in the exception will prevent the
# frame which uses `DataLoaderIter` to be freed. If the frame has any
# reference to the `DataLoaderIter` (e.g., in a method of the iter),
# its `__del__`, which starts the shutdown procedure, will not be
# called. That, in turn, means that workers aren't notified. Attempting
# to join in `_exit_function` will then result in a hang.
#
# For context, `_exit_function` is also registered as an `atexit` call.
# So it is unclear to me (@ssnl) why this is needed in a finally block.
# The code dates back to 2008 and there is no comment on the original
# PEP 371 or patch https://bugs.python.org/issue3050 (containing both
# the finally block and the `atexit` registration) that explains this.
#
# Another choice is to just shutdown workers with logic in 1 above
# whenever we see an error in `next`. This isn't ideal because
# a. It prevents users from using try-catch to resume data loading.
# b. It doesn't prevent hanging if users have references to the
# iterator.
#
# 3. All processes exit if any of them die unexpectedly by fatal signals.
#
# As shown above, the workers are set as daemonic children of the main
# process. However, automatic cleaning-up of such child processes only
# happens if the parent process exits gracefully (e.g., not via fatal
# signals like SIGKILL). So we must ensure that each process will exit
# even the process that should send/receive data to/from it were
# killed, i.e.,
#
# a. A process won't hang when getting from a queue.
#
# Even with carefully designed data dependencies (i.e., a `put()`
# always corresponding to a `get()`), hanging on `get()` can still
# happen when data in queue is corrupted (e.g., due to
# `cancel_join_thread` or unexpected exit).
#
# For child exit, we register SIGCHLD handler on main process,
# which checks if any of the workers fail in the (Python) handler.
# See DataLoader.cpp.
#
# For `.get()` calls where the sender(s) is not the workers, we
# guard them with timeouts, and check the status of the sender
# when timeout happens:
# + in the workers, the `ManagerWatchdog` class checks the main
# process status.
# + if `pin_memory=True`, when getting from `pin_memory_thread`,
# check `pin_memory_thread` status periodically until `.get()`
# returns or see that `pin_memory_thread` died.
#
# b. A process won't hang when putting into a queue;
#
# We use `mp.Queue` which has a separate background thread to put
# objects from an unbounded buffer array. The background thread is
# daemonic and usually automatically joined when the process
# exits.
#
# However, in case that the receiver has ended abruptly while
# reading from the pipe, the join will hang forever. Therefore,
# for both `worker_result_queue` (worker -> main process/pin_memory_thread)
# and each `index_queue` (main process -> worker), we use
# `q.cancel_join_thread()` in sender process before any `q.put` to
# prevent this automatic join.
#
# Moreover, having all queues called `cancel_join_thread` makes
# implementing graceful shutdown logic in `__del__` much easier.
# It won't need to get from any queue, which would also need to be
# guarded by periodic status checks.
#
# Note that this may leave corrupted data in the queue, but we
# don't care about the data anyways once we are shutting down.
#
#
# Now let's get back to 1:
# how we gracefully exit the workers when the last reference to the
# iteartor is gone.
#
# To achieve this, we implement the following logic along with the design
# choices mentioned above:
#
# [worker processes]
# While loader process is alive:
# Get from index_queue.
# If got a `None`, exit.
# If get anything else,
# Check `done_event`.
# If set, continue to next iteration
# i.e., keep getting until see the `None`, then exit.
# Otherwise, process data.
# If timed out,
# No matter `done_event` is set (still need to see `None`) or not,
# must continue to next iteration .
#
# [pin_memory_thread]
# # No need to check main thread. If this thread is alive, the main loader
# # thread must be alive, because this thread is set as daemonic.
# While True:
# Get from index_queue.
# If got a `None`, exit.
# If get anything else,
# Check `done_event`.
# If set, continue to next iteration
# i.e., keep getting until see the `None`, then exit.
# Otherwise, process data.
#
# NOTE: we don't check the status of the main thread because
# 1. if the process is killed by fatal signal, `pin_memory_thread`
# ends.
# 2. in other cases, either the cleaning-up in __del__ or the
# automatic exit of daemonic thread will take care of it.
# This won't busy-wait either because `.get(timeout)` does not
# busy-wait.
#
# [main process]
# In the DataLoader Iter's `__del__`
# a. Set `done_event` (shared with `pin_memory_thread` and workers).
#
# Note: from here on, the workers & `pin_memory_thread` may exit at
# any time after they receive `None`.
#
# b. Exit `pin_memory_thread`
# i. Put `None` in `worker_result_queue`.
# ii. Join the `pin_memory_thread`.
#
# c. Exit the workers.
# i. Put `None` in each worker's `index_queue`.
# ii. Join the workers.
#
# NOTE: This has to be after (b) because it may leave corrupted data
# in `worker_result_queue`, which `pin_memory_thread` reads
# from.
#
# NOTE: If `pin_memory=False`, there is no `pin_memory_thread` and (b)
# can be omitted
#
# NB: `done_event`s isn't strictly needed. E.g., we can just check for
# `None` from `index_queue`, but it allows us to skip wasting resources
# processing indices already in `index_queue` if we are already shutting
# down.
def __init__(self, loader):
self.dataset = loader.dataset
self.collate_fn = loader.collate_fn
self.batch_sampler = loader.batch_sampler
self.num_workers = loader.num_workers
self.pin_memory = loader.pin_memory and torch.cuda.is_available()
self.timeout = loader.timeout
self.sample_iter = iter(self.batch_sampler)
base_seed = torch.LongTensor(1).random_().item()
if self.num_workers > 0:
self.worker_init_fn = loader.worker_init_fn
self.worker_queue_idx = 0
self.worker_result_queue = multiprocessing.Queue()
self.batches_outstanding = 0
self.worker_pids_set = False
self.shutdown = False
self.send_idx = 0
self.rcvd_idx = 0
self.reorder_dict = {}
self.done_event = multiprocessing.Event()
self.index_queues = []
self.workers = []
for i in range(self.num_workers):
index_queue = multiprocessing.Queue()
index_queue.cancel_join_thread()
w = multiprocessing.Process(
target=_worker_loop,
args=(self.dataset, index_queue,
self.worker_result_queue, self.done_event,
self.collate_fn, base_seed + i,
self.worker_init_fn, i))
w.daemon = True
# NB: Process.start() actually take some time as it needs to
# start a process and pass the arguments over via a pipe.
# Therefore, we only add a worker to self.workers list after
# it started, so that we do not call .join() if program dies
# before it starts, and __del__ tries to join but will get:
# AssertionError: can only join a started process.
w.start()
self.index_queues.append(index_queue)
self.workers.append(w)
if self.pin_memory:
self.data_queue = queue.Queue()
pin_memory_thread = threading.Thread(
target=_pin_memory_loop,
args=(self.worker_result_queue, self.data_queue,
torch.cuda.current_device(), self.done_event))
pin_memory_thread.daemon = True
pin_memory_thread.start()
# Similar to workers (see comment above), we only register
# pin_memory_thread once it is started.
self.pin_memory_thread = pin_memory_thread
else:
self.data_queue = self.worker_result_queue
_update_worker_pids(id(self), tuple(w.pid for w in self.workers))
_set_SIGCHLD_handler()
self.worker_pids_set = True
# prime the prefetch loop
for _ in range(2 * self.num_workers):
self._put_indices()
def __len__(self):
return len(self.batch_sampler)
def _get_batch(self):
# In the non-timeout case, worker exit is covered by SIGCHLD handler.
# But if `pin_memory=True`, we still need account for the possibility
# that `pin_memory_thread` dies.
if self.timeout > 0:
try:
return self.data_queue.get(timeout=self.timeout)
except queue.Empty:
raise RuntimeError('DataLoader timed out after {} seconds'.format(self.timeout))
elif self.pin_memory:
while self.pin_memory_thread.is_alive():
try:
return self.data_queue.get(timeout=MP_STATUS_CHECK_INTERVAL)
except queue.Empty:
continue
else:
# while condition is false, i.e., pin_memory_thread died.
raise RuntimeError('Pin memory thread exited unexpectedly')
# In this case, `self.data_queue` is a `queue.Queue`,. But we don't
# need to call `.task_done()` because we don't use `.join()`.
else:
return self.data_queue.get()
def __next__(self):
if self.num_workers == 0: # same-process loading
indices = next(self.sample_iter) # may raise StopIteration
batch = self.collate_fn([self.dataset[i] for i in indices])
if self.pin_memory:
batch = pin_memory_batch(batch)
return batch
# check if the next sample has already been generated
if self.rcvd_idx in self.reorder_dict:
batch = self.reorder_dict.pop(self.rcvd_idx)
return self._process_next_batch(batch)
if self.batches_outstanding == 0:
self._shutdown_workers()
raise StopIteration
while True:
assert (not self.shutdown and self.batches_outstanding > 0)
idx, batch = self._get_batch()
self.batches_outstanding -= 1
if idx != self.rcvd_idx:
# store out-of-order samples
self.reorder_dict[idx] = batch
continue
return self._process_next_batch(batch)
next = __next__ # Python 2 compatibility
def __iter__(self):
return self
def _put_indices(self):
assert self.batches_outstanding < 2 * self.num_workers
indices = next(self.sample_iter, None)
if indices is None:
return
self.index_queues[self.worker_queue_idx].put((self.send_idx, indices))
self.worker_queue_idx = (self.worker_queue_idx + 1) % self.num_workers
self.batches_outstanding += 1
self.send_idx += 1
def _process_next_batch(self, batch):
self.rcvd_idx += 1
self._put_indices()
if isinstance(batch, ExceptionWrapper):
raise batch.exc_type(batch.exc_msg)
return batch
def __getstate__(self):
# TODO: add limited pickling support for sharing an iterator
# across multiple threads for HOGWILD.
# Probably the best way to do this is by moving the sample pushing
# to a separate thread and then just sharing the data queue
# but signalling the end is tricky without a non-blocking API
raise NotImplementedError("_DataLoaderIter cannot be pickled")
def _shutdown_workers(self):
# See NOTE [ Data Loader Multiprocessing Shutdown Logic ] for details on
# the logic of this function.
if _python_exit_status is True or _python_exit_status is None:
# See (2) of the note. If Python is shutting down, do no-op.
return
# Normal exit when last reference is gone / iterator is depleted.
# See (1) and the second half of the note.
if not self.shutdown:
self.shutdown = True
# Removes pids from the C side data structure first so worker
# termination afterwards won't trigger false positive error report.
if self.worker_pids_set:
_remove_worker_pids(id(self))
self.worker_pids_set = False
self.done_event.set()
# Exit `pin_memory_thread` first because exiting workers may leave
# corrupted data in `worker_result_queue` which `pin_memory_thread`
# reads from.
if hasattr(self, 'pin_memory_thread'):
# Use hasattr in case error happens before we set the attribute.
# First time do `worker_result_queue.put` in this process.
# `cancel_join_thread` in case that `pin_memory_thread` exited.
self.worker_result_queue.cancel_join_thread()
self.worker_result_queue.put(None)
self.pin_memory_thread.join()
# Indicate that no more data will be put on this queue by the
# current process. This **must** be called after
# `pin_memory_thread` is joined because that thread shares the
# same pipe handles with this loader thread. If the handle is
# closed, Py3 will error in this case, but Py2 will just time
# out even if there is data in the queue.
self.worker_result_queue.close()
# Exit workers now.
for q in self.index_queues:
q.put(None)
# Indicate that no more data will be put on this queue by the
# current process.
q.close()
for w in self.workers:
w.join()
def __del__(self):
if self.num_workers > 0:
self._shutdown_workers()
[docs]class DataLoader(object):
r"""
Data loader. Combines a dataset and a sampler, and provides
single- or multi-process iterators over the dataset.
Arguments:
dataset (Dataset): dataset from which to load the data.
batch_size (int, optional): how many samples per batch to load
(default: ``1``).
shuffle (bool, optional): set to ``True`` to have the data reshuffled
at every epoch (default: ``False``).
sampler (Sampler, optional): defines the strategy to draw samples from
the dataset. If specified, ``shuffle`` must be False.
batch_sampler (Sampler, optional): like sampler, but returns a batch of
indices at a time. Mutually exclusive with :attr:`batch_size`,
:attr:`shuffle`, :attr:`sampler`, and :attr:`drop_last`.
num_workers (int, optional): how many subprocesses to use for data
loading. 0 means that the data will be loaded in the main process.
(default: ``0``)
collate_fn (callable, optional): merges a list of samples to form a mini-batch.
pin_memory (bool, optional): If ``True``, the data loader will copy tensors
into CUDA pinned memory before returning them.
drop_last (bool, optional): set to ``True`` to drop the last incomplete batch,
if the dataset size is not divisible by the batch size. If ``False`` and
the size of dataset is not divisible by the batch size, then the last batch
will be smaller. (default: ``False``)
timeout (numeric, optional): if positive, the timeout value for collecting a batch
from workers. Should always be non-negative. (default: ``0``)
worker_init_fn (callable, optional): If not ``None``, this will be called on each
worker subprocess with the worker id (an int in ``[0, num_workers - 1]``) as
input, after seeding and before data loading. (default: ``None``)
.. note:: By default, each worker will have its PyTorch seed set to
``base_seed + worker_id``, where ``base_seed`` is a long generated
by main process using its RNG. However, seeds for other libraies
may be duplicated upon initializing workers (w.g., NumPy), causing
each worker to return identical random numbers. (See
:ref:`dataloader-workers-random-seed` section in FAQ.) You may
use :func:`torch.initial_seed()` to access the PyTorch seed for
each worker in :attr:`worker_init_fn`, and use it to set other
seeds before data loading.
.. warning:: If ``spawn`` start method is used, :attr:`worker_init_fn` cannot be an
unpicklable object, e.g., a lambda function.
"""
__initialized = False
def __init__(self, dataset, batch_size=1, shuffle=False, sampler=None, batch_sampler=None,
num_workers=0, collate_fn=default_collate, pin_memory=False, drop_last=False,
timeout=0, worker_init_fn=None):
self.dataset = dataset
self.batch_size = batch_size
self.num_workers = num_workers
self.collate_fn = collate_fn
self.pin_memory = pin_memory
self.drop_last = drop_last
self.timeout = timeout
self.worker_init_fn = worker_init_fn
if timeout < 0:
raise ValueError('timeout option should be non-negative')
if batch_sampler is not None:
if batch_size > 1 or shuffle or sampler is not None or drop_last:
raise ValueError('batch_sampler option is mutually exclusive '
'with batch_size, shuffle, sampler, and '
'drop_last')
self.batch_size = None
self.drop_last = None
if sampler is not None and shuffle:
raise ValueError('sampler option is mutually exclusive with '
'shuffle')
if self.num_workers < 0:
raise ValueError('num_workers option cannot be negative; '
'use num_workers=0 to disable multiprocessing.')
if batch_sampler is None:
if sampler is None:
if shuffle:
sampler = RandomSampler(dataset)
else:
sampler = SequentialSampler(dataset)
batch_sampler = BatchSampler(sampler, batch_size, drop_last)
self.sampler = sampler
self.batch_sampler = batch_sampler
self.__initialized = True
def __setattr__(self, attr, val):
if self.__initialized and attr in ('batch_size', 'sampler', 'drop_last'):
raise ValueError('{} attribute should not be set after {} is '
'initialized'.format(attr, self.__class__.__name__))
super(DataLoader, self).__setattr__(attr, val)
def __iter__(self):
return _DataLoaderIter(self)
def __len__(self):
return len(self.batch_sampler)


| Package | Description |
|---|---|
| org.apache.fop.afp |
Contains an AFP library.
|
| org.apache.fop.afp.fonts |
Contains a collection of AFP Graphics Object Content Architecture (GOCA) structured objects.
|
| org.apache.fop.afp.goca |
Contains a collection of AFP font related classes.
|
| org.apache.fop.afp.modca |
Contains a collection of AFP Mixed Object Document Content Architecture (MO:DCA) structured objects.
|
| org.apache.fop.render.afp |
An AFP Renderer implementation and supporting classes.
|
| Modifier and Type | Method and Description |
|---|---|
void |
DataStream.createText(AFPTextDataInfo textDataInfo,
int letterSpacing,
int wordSpacing,
Font font,
CharacterSet charSet)
Helper method to create text on the current page, this method delegates
to the current presentation text object in order to construct the text.
|
void |
AFPResourceManager.embedFont(AFPFont afpFont,
CharacterSet charSet)
Handles font embedding.
|
| Modifier and Type | Class and Description |
|---|---|
class |
FopCharacterSet
A Character set for a normal FOP font
|
| Modifier and Type | Field and Description |
|---|---|
protected CharacterSet |
AbstractOutlineFont.charSet
The character set for this font
|
| Modifier and Type | Method and Description |
|---|---|
CharacterSet |
CharacterSetBuilder.build(java.lang.String characterSetName,
java.lang.String codePageName,
java.lang.String encoding,
Typeface typeface,
AFPEventProducer eventProducer)
Load the font details and metrics into the CharacterSetMetric object, this will use the
actual afp code page and character set files to load the object with the necessary metrics.
|
CharacterSet |
CharacterSetBuilder.build(java.lang.String characterSetName,
java.lang.String codePageName,
java.lang.String encoding,
Typeface typeface,
AFPResourceAccessor accessor,
AFPEventProducer eventProducer) |
CharacterSet |
CharacterSetBuilder.buildDBCS(java.lang.String characterSetName,
java.lang.String codePageName,
java.lang.String encoding,
CharacterSetType charsetType,
AFPResourceAccessor accessor,
AFPEventProducer eventProducer)
Load the font details and metrics into the CharacterSetMetric object, this will use the
actual afp code page and character set files to load the object with the necessary metrics.
|
CharacterSet |
CharacterSetBuilder.buildSBCS(java.lang.String characterSetName,
java.lang.String codePageName,
java.lang.String encoding,
AFPResourceAccessor accessor,
AFPEventProducer eventProducer)
Load the font details and metrics into the CharacterSetMetric object, this will use the
actual afp code page and character set files to load the object with the necessary metrics.
|
CharacterSet |
AbstractOutlineFont.getCharacterSet()
Get the character set metrics.
|
CharacterSet |
RasterFont.getCharacterSet(int sizeInMpt)
Get the character set metrics for the specified point size.
|
abstract CharacterSet |
AFPFont.getCharacterSet(int size)
Returns the character set for a given size
|
CharacterSet |
AbstractOutlineFont.getCharacterSet(int size)
Get the character set metrics.
|
| Modifier and Type | Method and Description |
|---|---|
void |
RasterFont.addCharacterSet(int size,
CharacterSet characterSet)
Adds the character set for the given point size
|
| Constructor and Description |
|---|
AbstractOutlineFont(java.lang.String name,
boolean embeddable,
CharacterSet charSet,
AFPEventProducer eventProducer)
Constructor for an outline font.
|
DoubleByteFont(java.lang.String name,
boolean embeddable,
CharacterSet charSet,
AFPEventProducer eventProducer)
Constructor for an double-byte outline font.
|
OutlineFont(java.lang.String name,
boolean embeddable,
CharacterSet charSet,
AFPEventProducer eventProducer)
Construct outline font with specified name and character set.
|
| Constructor and Description |
|---|
GraphicsCharacterString(java.lang.String str,
int x,
int y,
CharacterSet charSet)
Constructor (absolute positioning)
|
| Modifier and Type | Method and Description |
|---|---|
void |
GraphicsObject.addString(java.lang.String str,
int x,
int y,
CharacterSet charSet)
Adds a string
|
| Constructor and Description |
|---|
AFPTrueTypeFont(java.lang.String name,
boolean embeddable,
CharacterSet charSet,
AFPEventProducer eventProducer,
java.lang.String ttc,
java.net.URI uri) |
Copyright 1999-2020 The Apache Software Foundation. All Rights Reserved.


Memcache::getStats
(PECL memcache >= 0.2.0)
Memcache::getStats — 获取服务器统计信息
说明
array Memcache::getStats ([ string $type [, int $slabid [, int $limit = 100 ]]]
)
Memcache::getStats()返回一个关联数据的服务器统计信息。数组key是统计信息名，值就
是统计信息的值。同样你可以使用函数memcache_get_stats()。
参数
type
期望抓取的统计信息类型，可以使用的值有{reset, malloc, maps, cachedump,
slabs, items, sizes}。通过memcached协议指定这些附加参数是为了方便memcache开
发者(检查其中的变动)。
slabid
用于与参数type联合从指定slab分块拷贝数据，cachedump命令会完全占用服务器通常
用于比较严格的调试。
limit
用于和参数type联合来设置cachedump时从服务端获取的实体条数。
返回值
返回关联数组表示的服务器统计信息或者在失败时返回 FALSE
参见
• Memcache::getVersion() - 返回服务器版本信息
• Memcache::getExtendedStats() - 缓存服务器池中所有服务器统计信息
User Contributed Notes 3 notes
===============================================================================
pid Process id of this server process
uptime Number of seconds this server has been running
time Current UNIX time according to the server
version Version string of this server
rusage_user Accumulated user time for this process
rusage_system Accumulated system time for this process
curr_items Current number of items stored by the server
total_items Total number of items stored by this server ever
since it started
bytes Current number of bytes used by this server to store
items
curr_connections Number of open connections
total_connections Total number of connections opened since the server
started running
connection_structures Number of connection structures allocated by the
server
cmd_get Cumulative number of retrieval requests
cmd_set Cumulative number of storage requests
get_hits Number of keys that have been requested and found
present
get_misses Number of items that have been requested and not
found
bytes_read Total number of bytes read by this server from
network
bytes_written Total number of bytes sent by this server to network
limit_maxbytes Number of bytes this server is allowed to use for
storage.
===============================================================================
Here is a memcache stats analyzer method that can be used to print memcache
stats in a nice informative tabular format.
";
echo "
| Memcache Server version: | ".$status ["version"]."
|
";
echo "| Process id of this server process | ".$status [
"pid"]." |
";
echo "| Number of seconds this server has been running | "
.$status ["uptime"]." |
";
echo "| Accumulated user time for this process | ".$status
["rusage_user"]." seconds |
";
echo "| Accumulated system time for this process | ".
$status ["rusage_system"]." seconds |
";
echo "| Total number of items stored by this server ever since it
started | ".$status ["total_items"]." |
";
echo "| Number of open connections | ".$status [
"curr_connections"]." |
";
echo "| Total number of connections opened since the server
started running | ".$status ["total_connections"]." |
";
echo "| Number of connection structures allocated by the server
| ".$status ["connection_structures"]." |
";
echo "| Cumulative number of retrieval requests | ".
$status ["cmd_get"]." |
";
echo "| Cumulative number of storage requests | ".$status
["cmd_set"]." |
";
$percCacheHit=((real)$status ["get_hits"]/ (real)$status ["cmd_get"] *
100);
$percCacheHit=round($percCacheHit,3);
$percCacheMiss=100-$percCacheHit;
echo "| Number of keys that have been requested and found present
| ".$status ["get_hits"]." ($percCacheHit%) |
";
echo "| Number of items that have been requested and not found
td> | ".$status ["get_misses"]."($percCacheMiss%) |
";
$MBRead= (real)$status["bytes_read"]/(1024*1024);
echo "| Total number of bytes read by this server from network
td> | ".$MBRead." Mega Bytes |
";
$MBWrite=(real) $status["bytes_written"]/(1024*1024) ;
echo "| Total number of bytes sent by this server to network
td> | ".$MBWrite." Mega Bytes |
";
$MBSize=(real) $status["limit_maxbytes"]/(1024*1024) ;
echo "| Number of bytes this server is allowed to use for
storage. | ".$MBSize." Mega Bytes |
";
echo "| Number of valid items removed from cache to free memory
for new items. | ".$status ["evictions"]." |
";
echo "";
}
?>
Sample usage:
addServer('memcache_host', 11211);
printDetails($memcache_obj->getStats());
?>
===============================================================================
The stats output from this function and what is output from the
getExtendedStats() are identical except that getExtendedStats() provides
information for all servers used.


{foreach $menu as $name => $url} {if (:isset($label) and ($name == $label)} {$name} {else /} {$name} {/if} {/foreach}


Role: UI/UX Designer & Developer (Team of 4 people)
Tools: Sketch, Figma, HTML/CSS, Javascript, and GitHub
The client started the steamed bun vendor business because she loved her mom’s buns and thought that it was so tasty that it should be shared with others. She came up with the idea of selling the bun which happened to coincide with the Starbucks Unicorn drink marketing campaign which she used to her advantage in creating a unique “unicorn” steamed bun that people loved.
1. Cute: The bun itself is very cute and Momma Fung wants to provide customers a “cute experience.”
2. Modest: The website should show off the buns as an experience that is humbling but also exciting to want to try and come back to. The key here is to create an experience that the users can relate to and want to return to.
3. Thankful: The website should show the dedication and appreciation that we have to those that buy and eat our buns.
People are talking about Momma Fung mainly on Instagram, either posting images and tagging Momma Fung or creating hashtags that are related to Momma Fung and steamed buns. People who buy their food will upload pictures, and other people who never had the bun will follow if they see the pictures and also are impressed by the photo or the visual appeal or novelty of the steamed bun.
The goal was to make this website a great source of information, marketing, and contact for both Momma Fung and her clients.
To use our limited time effectively, we made a list to see what's important to users and clients. With the key features written down, we could focus on developing the main functions of the website and strengthening the unique branding of Momma Fung.
We analyzed our 5 competitors with 6 categories: branding, functionality, content, site architecture, design, and navigation. Based on the analysis, we found some good ideas that we could use for our website. The bottom is the takeaways from the competitive analysis.
We conducted a total of 9 interviews and compiled interview data into three personas: the Foodtographer, the Just-Eater, and the Picky Person. From the interview, we could find some useful patterns from potential customers. We analyzed this data to come up with several user scenarios and use cases, which will eventually be the good sources for main functions or features on the website.
For the low sketch prototype, I rapidly drew key pages and menu for the website. The paper prototype helped our team to have better ideas on the wireframe and move on to higher fidelity prototype.
The bottom wireframes are for the mobile version. We used Figma for this step.
In discussion with our clients, our priorities remained mostly the same with small changes. We were prompted by Momma Fung to design and create a functional, responsive website that conveyed the Momma Fung brand (in its colors, content, and tone of voice) that had emphasized catering as well as include a schedule of events and menu that would be accessible for all visitors and customers.
For our creative vision, we maintained the Momma Fung branding by using the colors but used it strategically and sparsely to still maintain a degree of professionalism and minimalism that would otherwise deter potential, older customers who are not too fond of the bright vibrant colors. For our top user needs, we emphasized the social “instagrammable” aspect of Momma Fung through professionally-taken photos, the interactivity of seeing how the buns are made both on the home page and on our story page, and lastly the “Foods n’ Fans” image gallery that features our fans with our buns.


Pick individual goody items for your home decoration!
Pick special gifts for your families and friends!
Pick goody bags for your theme birthday party!
Four colors for choice!
Five colors for choice!
Four in a pack!
Six colors for choice!
Twelve different styles!


Money Play. How should Red play 65?
pips Red=158 White=148
(CorrectAnswer= 0/0, ErrorScore= 0)
All the plays are quite close here. I played 24/13 but that turns out to be the third best play but bot an error.
13/8, 13/7 very narrowly beats 20/9 which leaves the rear checker stranded. 13/8, 13/7 gives meaningful duplication of 3’s and leaves the rear checkers connected. This marginally outweighs the benefits of nearly escaping a rear checker, leaving only 5’s to hit.
The key is to ensure that you at least saw all three moves as viable candidate plays – you can’t make a move if you don’t consider it.
13/8, 13/7 very narrowly beats 20/9 which leaves the rear checker stranded. 13/8, 13/7 gives meaningful duplication of 3’s and leaves the rear checkers connected. This marginally outweighs the benefits of nearly escaping a rear checker, leaving only 5’s to hit.
The key is to ensure that you at least saw all three moves as viable candidate plays – you can’t make a move if you don’t consider it.
1. Cubeful 2-ply 13/8 13/7 Eq.: -0.143 0.474 0.112 0.004 - 0.526 0.158 0.007 2. Cubeful 2-ply 20/9 Eq.: -0.146 (-0.003) 0.472 0.095 0.002 - 0.528 0.154 0.005 3. Cubeful 2-ply 20/14 13/8 Eq.: -0.167 (-0.024) 0.469 0.085 0.002 - 0.531 0.156 0.005 4. Cubeful 2-ply 24/13 Eq.: -0.176 (-0.033) 0.471 0.062 0.001 - 0.529 0.136 0.003 5. Cubeful 2-ply 20/15 13/7 Eq.: -0.193 (-0.050) 0.466 0.091 0.002 - 0.534 0.171 0.008