or "Castle Adamant"
Potted Plot | History | First Night Critics | Did You Know? | Behind the Scenes | Original Cast
First performed at Savoy Theatre, London, on January 5th 1884
Act One. A Pavilion attached to King Hildebrand's Palace.
King Hildebrand and his followers scan the horizon for a sign of ugly, misshapen and ill-tempered King Gama. When he was one year old, Hildebrand's son, Hilarion was betrothed to Princess Ida, King Gama's daughter.
King Gama eventually arrives with his sons but not with his daughter. It seems Ida has set up a women's university and devote themselves entirely to study. No men are allowed.
Hilarian and his friends plan a campaign to enter the university, known as Castle Adamant. In the meantime Gama and his sons will be held in prison.
The second act is set in the gardens of Castle Adamant.
The women are involved in study and when they question the existence of man, Lady Psyche explains what man is.
"Man is course and Man is plain -
Man is more or less insane -
Man's a ribald - Man's a rake,
Man is Nature's sole mistake!"
The elderly Lady Blanche is prepared to deal out punishments to any of the girls who are caught with any kind of men. One girl is expelled for daring to bring a set of chessmen into the university. When alone Lady Blanche reveals that she has ambitions to one day rule the university. She leaves.
Hilarion, Cyril and Florian climb over a wall.
Princess Ida comes across the new entrants. She agrees to accept them into the university provided that they will never marry men. The Princess leaves.
Lady Psyche enters. It turns out that she is Florian's sister so they confide in her.
Melissa, Lady Blanche's daughter arrives and agrees to keep the secret. When Lady Blanche confronts her over the very strange looking women, Melissa persuades her to play along because with the Princess out of the way she would have a better chance to become the head of the university.
Unfortunately during luncheon Cyril has a little too much wine to drink and exposes himself as a man. The three men are arrested but King Hildebrand and his army storm the walls and explains to Ida that she had been betrothed in infancy to Hilarion. A vow she must not break. However she stands firm as the act ends.
Act three is set on the outer walls and courtyard of Castle Adamant.
The girls are set ready for war but, despite their warlike manner, are far from keen on battle. The Princess is in despair over the despondent attitude.
The solders arrive. It is decided that instead of setting the troops against the women Hilarian and his friends should fight it out with Gama's sons. The battle does not last long at all.
Princess Ida agrees to resign from her post as head of the university. Lady Blanche is happy to take over.
The Princess agrees to marry Hilarion, while Psyche and Melissa settle for Cyril and Florian.
Click here for a complete libretto to Princess Ida
| History |
Fourteen years before the Savoy production of "Princess Ida", the Olympic Theatre witnessed the performance of "The Princess"; a whimsical parody of Tennyson's poem, by W.S. Gilbert. This was in the days when the rhymed, punning burlesques of Byron, Burnand, and other clever poets, still flourished. It became Gilbert's ambition to reform and raise the tone of musical plays. He wanted to put an end to the ultra-frivolous stuff and nonsense currently on stage. Gilbert admitted that some of it had actually came from his own pen.
So Gilbert turned to Tennyson and borrowed the characters and theme of the laureate's delightful poem. The outcome was a clever, playful parody in blank verse, relieved by a few light lyrics set to popular tunes from popular grand opera of the time.
Gilbert's first edition of "The Princess" failed to make an impression. He still had faith in the work and decided to resurrect the original play. Now with new music by Arthur Sullivan this could be a worthy successor to "Iolanthe".
In two notable respects "Princess Ida" marked a departure from the author's usual methods. First, the opera was in three acts instead of two; second, it was written in blank verse.
D'Oyly Carte lavished the very best onto the production. The costumes were as gorgeous in effect as they were rich in texture, exquisite in colour and design. The costly silver-gilt armour, specially designed and manufactured in Paris by the famed firm of Le Grange et Cie., excelled in brilliancy and the scenic sets were masterpieces. In short, no previous opera by Gilbert and Sullivan had involved such vast outlay and been so sumptuously placed upon the stage as "Princess Ida".
Princess Ida only lasted nine months at the Savoy. For Gilbert and Sullivan this was a disappointment. Other plays did well to last three months but the two were used to counting in years, not months.
| First night critics |
Theatre
Sportsman
Observer
Sporting Times
Observer
Theatre
Sunday Times
The Athenæum
Observer
Sunday Times
|
|
| Did you know? |
Sullivan was very very sick during the period of composing Princess Ida. This was the worse he had ever been. His kidney trouble gave him such pain that there were times when some doubted whether the work would be ready for the opening. With a scheduled date only four days away, Sullivan collapsed during a rehearsal. there were still two songs still to be composed. Somehow he got himself going again and finished the score in time. On opening night he was in such pain it took two injections of drugs to keep him on his feet while he conducted. When the curtain came down he collapsed again. The public was politely informed that the composer was suffering from "a muscular affection of the neck."
The title-role of Princess Ida was to have been sung by the American operetta star, Lillian Russell, whose beauty and talents were seasoned by reports of scandal off stage and on. Her career had begun, ironically enough, in one of the 'pirate' companies playing H.M.S. Pinafore in New york in 1878-9. By 1883, at the age of 21, she was a celebrity. She had eloped from new york with the English operetta composer Edward Solomon and appeared in London at the Gaiety in Solomon's Virginia and Paul in July 1883. Engaged as Princess ida, she fell foul of Gilbert by missing a rehearsal. According to Sullivan's diary, she sent an apology the next day. To no avail-she was dismissed. She then sued for breach of contract. The action was not settled until November 1884 when an out-of-court payment was made.
| Behind the scenes |
In the early days of the Savoy Theatre, D'Oyly Carte introduced the queue system to theatre goers awaiting admission to the unreserved parts of the theatre. Those who were over-faithful to past traditions vowed that the public would never stand "being marshalled and driven like sheep into their pens." They were wrong.
The crowds would assemble hours before the performance, falling into the ranks of a queue and realized its advantages. Instead of the usual 'push and shove' they had been used to, here was a new rule: "first come first served."
The experiment proved so successful that the system was immediately adopted by every theatrical manager.
Princess Ida was one of the operettas where rehearsals were taking place before the music was actually written. George Grossmith in his book A Society Clown says: "We were rehearsing the whole of the concerted music of the first act. My song, 'I can't think why,' sung by King Gama, was not composed, and the whole of my share of the rehearsals was the following three bars and a half of recitative:
KING GAMA (recitative): Must we till then in prison cell be trust?
HILDEBRAND: You must!
KING GAMA: This seems unnecessarily severe.
At one of the rehearsals, after singing this trifling bit of recitative, I addressed the composer and said: 'Could you tell me, Sir Arthur, what do the words "This seems unnecessarily severe" have reference to?' Sir Arthur replied: 'Beacause you are to be detained in prison, of course.' I replied: 'Thank you. I thought they were reference to my having been detained here three hours a day for the past fortnight to sing them.' The result was that Sir Arthur liberated me from the remainder of the first act rehearsals; and as I had not to put in an appearance in the second act, and had only one unwritten song in the third, I had, for a wonder, a pretty easy time of it."


Home
About
Services
Contact
Home
about
Services
Contact
Building a good customer
experience does not happen by accident.
It happnes by design.
Most Trustworthy Company in the City


=
Donald Trump is publicly considering firing Special Counsel Robert Mueller. This would be a constitutional crisis for our country.


| struct | PangoFcFontMap |
| struct | PangoFcFontMapClass |
| #define | PANGO_FC_FONT_FEATURES |
| #define | PANGO_FC_GRAVITY |
| #define | PANGO_FC_VERSION |
| #define | PANGO_FC_PRGNAME |
| PangoFcFontsetKey | |
| PangoFcFontKey |
PangoFcFontMap is a base class for font map implementations using the Fontconfig and FreeType libraries. It is used in the
Xft and FreeTypebackends shipped with Pango, but can also be used when creating new backends. Any backend deriving from this base class will take advantage of the wide range of shapers implemented using FreeType that come with Pango.
PangoContext *
pango_fc_font_map_create_context (PangoFcFontMap *fcfontmap
);
pango_fc_font_map_create_context
has been deprecated since version 1.22 and should not be used in newly-written code.
Use pango_font_map_create_context()
instead.
Creates a new context for this fontmap. This function is intended only for backend implementations deriving from PangoFcFontMap; it is possible that a backend will store additional information needed for correct operation on the PangoContext after calling this function.
Since: 1.4
PangoFcDecoder * (*PangoFcDecoderFindFunc) (FcPattern *pattern
,gpointer user_data
);
Callback function passed to pango_fc_font_map_add_decoder_find_func()
.
pattern |
a fully resolved FcPattern specifying the font on the system |
|
user_data |
user data passed to |
a new reference to a custom decoder for this pattern,
or NULL
if the default decoder handling should be used.
void pango_fc_font_map_add_decoder_find_func (PangoFcFontMap *fcfontmap
,PangoFcDecoderFindFunc findfunc
,gpointer user_data
,GDestroyNotify dnotify
);
This function saves a callback method in the PangoFcFontMap that will be called whenever new fonts are created. If the function returns a PangoFcDecoder, that decoder will be used to determine both coverage via a FcCharSet and a one-to-one mapping of characters to glyphs. This will allow applications to have application-specific encodings for various fonts.
fcfontmap |
The PangoFcFontMap to add this method to. |
|
findfunc |
The PangoFcDecoderFindFunc callback function |
|
user_data |
User data. |
|
dnotify |
A GDestroyNotify callback that will be called when the fontmap is finalized and the decoder is released. |
Since: 1.6
PangoFcDecoder * pango_fc_font_map_find_decoder (PangoFcFontMap *fcfontmap
,FcPattern *pattern
);
Finds the decoder to use for pattern
. Decoders can be added to
a font map using pango_fc_font_map_add_decoder_find_func()
.
Since: 1.26
void
pango_fc_font_map_cache_clear (PangoFcFontMap *fcfontmap
);
Clear all cached information and fontsets for this font map;
this should be called whenever there is a change in the
output of the default_substitute()
virtual function of the
font map, or if fontconfig has been reinitialized to new
configuration.
Since: 1.4
void
pango_fc_font_map_config_changed (PangoFcFontMap *fcfontmap
);
Informs font map that the fontconfig configuration (ie, FcConfig object)
used by this font map has changed. This currently calls
pango_fc_font_map_cache_clear()
which ensures that list of fonts, etc
will be regenerated using the updated configuration.
Since: 1.38
void
pango_fc_font_map_shutdown (PangoFcFontMap *fcfontmap
);
Clears all cached information for the fontmap and marks
all fonts open for the fontmap as dead. (See the shutdown()
virtual function of PangoFcFont.) This function might be used
by a backend when the underlying windowing system for the font
map exits. This function is only intended to be called
only for backend implementations deriving from PangoFcFontMap.
Since: 1.4
void pango_fc_font_map_set_config (PangoFcFontMap *fcfontmap
,FcConfig *fcconfig
);
Set the FcConfig for this font map to use. The default value
is NULL
, which causes Fontconfig to use its global "current config".
You can create a new FcConfig object and use this API to attach it
to a font map.
This is particularly useful for example, if you want to use application fonts with Pango. For that, you would create a fresh FcConfig, add your app fonts to it, and attach it to a new Pango font map.
If fcconfig
is different from the previous config attached to the font map,
pango_fc_font_map_config_changed()
is called.
This function acquires a reference to the FcConfig object; the caller does NOT need to retain a reference.
Since: 1.38
FcConfig *
pango_fc_font_map_get_config (PangoFcFontMap *fcfontmap
);
Fetches FcConfig attached to a font map. See pango_fc_font_map_set_config()
.
Since: 1.38
PangoFontDescription * pango_fc_font_description_from_pattern (FcPattern *pattern
,gboolean include_size
);
Creates a PangoFontDescription that matches the specified
Fontconfig pattern as closely as possible. Many possible Fontconfig
pattern values, such as FC_RASTERIZER
or FC_DPI
, don't make sense in
the context of PangoFontDescription, so will be ignored.
pattern |
||
include_size |
if |
Since: 1.4
gpointer
pango_fc_fontset_key_get_context_key (const PangoFcFontsetKey *key
);
Gets the context key member of key
.
Since: 1.24
const PangoFontDescription *
pango_fc_fontset_key_get_description (const PangoFcFontsetKey *key
);
Gets the font description of key
.
Since: 1.24
PangoLanguage *
pango_fc_fontset_key_get_language (const PangoFcFontsetKey *key
);
Gets the language member of key
.
Since: 1.24
const PangoMatrix *
pango_fc_fontset_key_get_matrix (const PangoFcFontsetKey *key
);
Gets the matrix member of key
.
Since: 1.24
double
pango_fc_fontset_key_get_absolute_size
(const PangoFcFontsetKey *key
);
Gets the absolute font size of key
in Pango units. This is adjusted
for both resolution and transformation matrix.
Since: 1.24
double
pango_fc_fontset_key_get_resolution (const PangoFcFontsetKey *key
);
Gets the resolution of key
Since: 1.24
gpointer
pango_fc_font_key_get_context_key (const PangoFcFontKey *key
);
Gets the context key member of key
.
Since: 1.24
const PangoMatrix *
pango_fc_font_key_get_matrix (const PangoFcFontKey *key
);
Gets the matrix member of key
.
Since: 1.24
const FcPattern *
pango_fc_font_key_get_pattern (const PangoFcFontKey *key
);
Gets the fontconfig pattern member of key
.
Since: 1.24
struct PangoFcFontMap;
PangoFcFontMap is a base class for font map implementations
using the Fontconfig and FreeType libraries. To create a new
backend using Fontconfig and FreeType, you derive from this class
and implement a new_font()
virtual function that creates an
instance deriving from PangoFcFont.
struct PangoFcFontMapClass { /* Deprecated in favor of fontset_key_substitute */ void (*default_substitute) (PangoFcFontMap *fontmap, FcPattern *pattern); /* Deprecated in favor of create_font */ PangoFcFont *(*new_font) (PangoFcFontMap *fontmap, FcPattern *pattern); double (*get_resolution) (PangoFcFontMap *fcfontmap, PangoContext *context); gconstpointer (*context_key_get) (PangoFcFontMap *fcfontmap, PangoContext *context); gpointer (*context_key_copy) (PangoFcFontMap *fcfontmap, gconstpointer key); void (*context_key_free) (PangoFcFontMap *fcfontmap, gpointer key); guint32 (*context_key_hash) (PangoFcFontMap *fcfontmap, gconstpointer key); gboolean (*context_key_equal) (PangoFcFontMap *fcfontmap, gconstpointer key_a, gconstpointer key_b); void (*fontset_key_substitute)(PangoFcFontMap *fontmap, PangoFcFontsetKey *fontsetkey, FcPattern *pattern); PangoFcFont *(*create_font) (PangoFcFontMap *fontmap, PangoFcFontKey *fontkey); };
Class structure for PangoFcFontMap.
Substitutes in default
values for unspecified fields in a FcPattern. This will
be called prior to creating a font for the pattern. May be
|
[nullable] | |
Creates a new PangoFcFont for the specified
pattern of the appropriate type for this font map. The
|
||
Gets the resolution (the scale factor
between logical and absolute font sizes) that the backend
will use for a particular fontmap and context. |
||
Gets an opaque key holding backend
specific options for the context that will affect
fonts created by |
||
Copies a context key. Pango uses this
to make a persistant copy of the value returned from
|
||
Frees a context key copied with
|
||
Gets a hash value for a context key |
||
Compares two context keys for equality. |
||
Substitutes in
default values for unspecified fields in a
FcPattern. This will be called prior to creating a font
for the pattern. May be |
[nullable] | |
Creates a new PangoFcFont for
the specified pattern of the appropriate type for this
font map using information from the font key that is
passed in. The |
[nullable] |
#define PANGO_FC_FONT_FEATURES "fontfeatures"
String representing a fontconfig property name that Pango reads from font patterns to populate list of OpenType features to be enabled for the font by default.
The property will have a number of string elements, each of which is the OpenType feature tag of one feature to enable.
This is equivalent to FC_FONT_FEATURES in versions of fontconfig that have that.
Since: 1.34
#define PANGO_FC_GRAVITY "pangogravity"
String representing a fontconfig property name that Pango sets on any
fontconfig pattern it passes to fontconfig if a PangoGravity other
than PANGO_GRAVITY_SOUTH
is desired.
The property will have a PangoGravity value as a string, like "east". This can be used to write fontconfig configuration rules to choose different fonts for horizontal and vertical writing directions.
Since: 1.20
#define PANGO_FC_VERSION "pangoversion"
String representing a fontconfig property name that Pango sets on any fontconfig pattern it passes to fontconfig.
The property will have an integer value equal to what
pango_version()
returns.
This can be used to write fontconfig configuration rules that only affect
certain pango versions (or only pango-using applications, or only
non-pango-using applications).
Since: 1.20
#define PANGO_FC_PRGNAME "prgname"
String representing a fontconfig property name that Pango sets on any fontconfig pattern it passes to fontconfig.
The property will have a string equal to what
g_get_prgname()
returns.
This can be used to write fontconfig configuration rules that only affect
certain applications.
This is equivalent to FC_PRGNAME in versions of fontconfig that have that.
Since: 1.24
typedef struct _PangoFcFontsetKey PangoFcFontsetKey;
An opaque structure containing all the information needed for loading a fontset with the PangoFc fontmap.
Since: 1.24
typedef struct _PangoFcFontKey PangoFcFontKey;
An opaque structure containing all the information needed for loading a font with the PangoFc fontmap.
Since: 1.24
| The base class for fonts; creating a new Fontconfig-based backend involves deriving from both PangoFcFontMap and PangoFcFont. |


Your article needs a title, so this is required.
Give us a hint out about your article - we call it an intro. You need one.
Your article needs content, so this is required.
You need to add some tags, so this is required.


These are notes for the first lecture of a course I am co-teaching with Seb Bubeck on Competitive analysis via convex optimization.
I want to set the groundwork by reviewing the bandits model in online learning and the standard exponential weights algorithm, and then trying to extend it to the setting of competitive analysis where the analogous problem goes by the name of metrical task systems. Seeing where things go wrong will give us a plan to follow for much of the course. Some of the objects and algorithms in this lecture may appear unmotivated; that will be addressed soon.
Regret minimization
Here we review quickly the basic multi-arm bandits model in online learning. For more background see, e.g., this survey of Bubeck and Cesa-Binachi.
In the standard bandits model, we have a set of experts $\cE = \{1,2,\ldots,N\}$, and loss functions $\ell_1,\ell_2,\ldots$ arriving over time, where $\ell_t : \cE \to [0,1]$.
For the sake of simplicity, we will work in the full information model. At time $t \geq 1$, we have seen $\ell_1,\ldots,\ell_{t-1}$. We choose some strategy $x_t \in \cE$ and incur cost $\ell_t(x_t)$. Our goal is to minimize the total cost incurred: $\sum_{t=1}^T \ell_t(x_t)$. In the setting of adversarial bandits, we will allow ourselves to employ a randomized strategy, playing instead a distribution $p_t : \cE \to [0,1]$ at time $t$.
In the regret minimization framework, we compare our expected loss to that of the optimal fixed strategy: The regret incurred up to time $T$ is
$$R_T \seteq \sum_{t=1}^T \langle p_t, \ell_t\rangle - \min_{x \in \cE} \sum_{t=1}^T \ell_t(x)\,,$$
where for $f,g : \cE \to \R$, we write $\langle f,g\rangle = \sum_{y \in \cE} f(y) g(y)$.
We will bound the regret in two steps. Denote $x_T^* \seteq \argmin_{x \in \cE} \sum_{t=1}^T \ell_t(x)$. Then:
\begin{align} R_T &= \sum_{t=1}^T \langle p_t - p_{t+1},\ell_t\rangle + \sum_{t=1}^T \langle p_{t+1}, \ell_t-\ell_t(x_T^*)\rangle \nonumber \\ &\leq \sum_{t=1}^T \|p_t-p_{t+1}\|_1 + \sum_{t=1}^T \langle p_{t+1}, \ell_t-\ell_t(x_T^*)\rangle,\label{eq:pseudo-regret} \end{align}
where the inequality uses that the losses lie in $[0,1]$.
Continuous-time dynamics
For a number of reasons, the analysis will be much cleaner in continuous time. We can think about the losses as a trajectory $\left\{ \ell_t : \cE \to [0,1] \mid t \geq 0 \right\}$, where the instantaneous loss incurred is $\ell_t\,dt$. As long as we are bounding the expression \eqref{eq:pseudo-regret}, our continuous-time model will be more general than the discrete-time model. The latter can be recovered by considering a trajectory $\{ \ell_t : t \geq 0 \}$ that is piecewise-constant. If we were bounding the regret itself, the continuous-time model would have a time advantage, but once we shift time by one as in \eqref{eq:pseudo-regret}, this advantage disappears.
Now we can analogously bound the regret:
\begin{equation}\label{eq:cont-regret} R_T \leq \int_0^T \|\partial_t p_t\|_1 \,dt + \int_0^T \langle p_t, \ell_t-\ell_t(x_T^*)\rangle\,dt\,, \end{equation}
where $x_T^* \seteq \argmin_{x \in \cE} \int_0^T \ell_t(x)\,dt$.
We will start with $p_0(x) = 1/N$ for every $x \in \cE$, and employ the following exponential-weights strategy for updating $p_t$: \begin{equation}\label{eq:dynamics} \partial_t \log p_t(x) = \eta\left( - \ell_t(x) + \langle p_t, \ell_t\rangle\right), \end{equation} where $\eta > 0$ is a parameter called the learning rate that we will choose soon. This algorithm will be motivated more in the next lecture, but for now one can note that we are simply doing continuous-time gradient descent on the vector $\log p_t(x)$: We are moving in the direction $- \eta \ell_t dt$. The additional additive term in \eqref{eq:dynamics} is there to maintain the constraint that $p_t$ is a probability distribution.
One can see this clearly by rewriting \eqref{eq:dynamics} as: \begin{equation}\label{eq:exp-form} \partial_t p_t(x) = p_t(x) \, \eta \left(- \ell_t(x) + \langle p_t,\ell_t\rangle\right), \end{equation} so that $\sum_{x \in \cE} \partial_t p_t(x) = 0$.
The Lyapunov functional, aka the potential
In order to bound the regret $R_T$, we will employ the philosophy underlying the entire course: If we are incurring more cost than $x_T^*$, we would like to be learning about $x_T^*$ in a suitable sense.
Define: [ D(x; p) \seteq - \log p(x)\,. ] Note that for any $x \in \cE$, we have $D(x; p_0) = \log N$, and $D(x; p_t) \geq 0$ for all $t \geq 0$.
For any $x \in \cE$: \begin{equation}\label{eq:lya} \partial_t D(x;p_t) = - \partial_t \log p_t(x) = \eta \left(\ell_t(x) - \langle p_t,\ell_t\rangle \right). \end{equation} If we think of $D(x;p_t)$ as the “distance” from $p_t$ to $x$, then our distance to $x$ is decreasing proportional to the advantage $x$ has over our strategy $p_t$. Integrating \eqref{eq:lya} over $[0,T]$ gives [ D(x; p_0) - D(x; p_T) = \eta \int_0^T \langle p_t, \ell_t-\ell_t(x)\rangle\,dt ]
Applying this with $x=x_T^*$ and recalling \eqref{eq:cont-regret}, we have
\begin{align*} R_T &\leq \int_0^T \|\partial_t p_t\|_1\,dt + \frac{D(x_0^*;p_0)-D(x_T^*;p_T)}{\eta} \\ &\leq \int_0^T \|\partial_t p_t\|_1\,dt + \frac{\log N}{\eta} \\ &\leq \eta T + \frac{\log N}{\eta}\,, \end{align*}
where the last inequality uses \eqref{eq:exp-form} and the fact that the losses are in $[0,1]$ to write $\|\partial_t p_t\|_1 \leq \eta \|p_t\|_1 = \eta$.
Setting $\eta = \sqrt{\frac{\log N}{T}}$ yields the standard regret bound [ R_T \leq 2 \sqrt{T \log N}\,. ] If one does not know the final time $T$, it is not difficult to see that one can choose a time-dependent learning rate $\eta=\eta(t)=\sqrt{\frac{\log N}{t}}$ to obtain a similar result. result
Competitive analysis
The competitive analysis analog of the bandits framework goes by the name of metrical task systems (MTS). This problem was introduced in 1992 by Borodin, Linial, and Saks.
This setting has three major differences:
- At each time $t \geq 1$, we receive a cost function $c_t : \cE \to [0,\infty)$, and we choose an action $x_t \in \cE$ after receiving $c_t$.
- There is a metric $d$ on $\cE$ that makes $(\cE,d)$ into a metric space, and in addition to the service cost $c_t(x_t)$, we pay a switching cost $d(x_{t-1},x_t)$ for playing $x_t$.
- We compare ourselves against an offline optimum that has the same ability to switch strategies.
Say that an online algorithm $\llangle x_1, x_2, \ldots,x_T\rrangle$ is $\alpha$-competitive if, for every $x_0 \in \cE$ and every cost sequence $c_1,c_2,\ldots,c_T$, it holds that
$$ \sum_{t=1}^T c_t(x_t) + d(x_{t-1},x_t) \leq \alpha\left(\sum_{t=1}^T c_t(x^*_t) + d(x_{t-1}^*, x_t^*)\right) + O(1)\,, $$
where $\llangle x_0^*, x_1^*, x_2^*, \ldots, x_T^*\rrangle$ is the optimal offline strategy with $x_0^*=x_0$, i.e., the optimal strategy in hindsight. The additive $O(1)$ term is a constant that should be independent of the request sequence.
It is conjectured that the competitive ratio is $O(\log N)$ for every $N$-point metric space. In the coming weeks, we will see an $O((\log N)^2)$-competitive algorithm based on upcoming joint work with Bubeck, Cohen, and Y. T. Lee. This improves slightly on the $O((\log N)^2 \log \log N)$ bound of Fiat and Mendel.
Attempting exponential weights
The simplest setting for MTS is when the metric $(\cE,d)$ is uniform, i.e., $d(x,y)=\1_{\{x\neq y\}}$ for $x,y \in \cE$.
Just as in the bandits setting, we can consider a continuous-time trajectory $\left\{ c_t : \cE \to [0,\infty) \mid t \geq 0\right\}$ on cost functions. And we might try to employ a similar strategy: \begin{equation}\label{eq:cost-dynamics} \partial_t \log p_t(x) = - c_t(x) + \langle p_t, c_t\rangle. \end{equation}
But now we run into a major hurdle: Such an algorithm cannot be $\alpha$-competitive for any $\alpha < \infty$.
Suppose we arrange that for some $x_0 \in \cE$ and $t_0 > 0$ and small $\epsilon > 0$, it holds that $p_{t_0}(x_0) = 1-\epsilon$. We can do this by having an adversary play the cost function $c(x)=\1_{\cE \setminus \{x_0\}}(x)$ for a long enough period of time so that any competitive algorithm must put almost all the probability mass on $x_0$.
Now the adversary changes the cost function to $c(x)=\1_{x_0}(x)$. The dynamics specified by \eqref{eq:cost-dynamics} will move much too slowly! Indeed: \[ \partial_t \log p_t(x_0) = -1+(1-p_t(x_0)) = - p_t(x_0), \] i.e., \[ \partial_t p_t(x_0) = - p_t(x_0)^2, \] thus it will take roughly $1/\epsilon$ time before $p_t(x_0) < 1/2$.
Thus our algorithm will incur cost $\asymp 1/\epsilon$ while the optimal offline algorithm incurs cost $O(1)$. In the bandits setting, this was fine because every fixed strategy incurs cost $\asymp 1/\epsilon$. But in the setting of competitive analysis, our algorithm needs to be a lot more nimble to keep up with an offline algorithm that can switch strategies.
The exploration shift
To fix this, we will design an algorithm that devotes a constant fraction of the service cost it is currently incurring to exploring the strategy space. Essentially, this can be achieved by pretending that $p_t(x) \geq 1/(2N)$ for every $x \in \cE$. (Recall that $N = |\cE|$.) This transformation (mixing with the uniform distribution) is not uncommon in the bandit literature. In the setting of metrical task systems, I saw it for the first time in this paper of Bansal, Buchbinder, and Naor on the weighted paging problem.
Define $p_0(x)=\1_{x_0}(x)$ where $x_0 \in X$ is the starting point. Let $\delta > 0$ be a number we will choose soon, and consider the dynamics: \begin{equation}\label{eq:mts-dynamics} \partial_t \log (p_t(x)+\delta) = - \hat{c}_t(x) + \llangle \frac{p_t+\delta}{1+\delta N}, \hat{c}_t\rrangle\,, \end{equation} which can be written equivalently as \begin{equation}\label{eq:mts-move} \partial_t p_t(x) = (p_t(x)+\delta) \left(- \hat{c}_t(x) + \llangle \frac{p_t+\delta}{1+\delta N}, \hat{c}_t\rrangle\right). \end{equation} A natural choice is to take $\hat{c}_t(x)=c_t(x)$, but this presents a problem: Unlike \eqref{eq:cost-dynamics}, these dynamics no longer enforce that $p_t(x) \geq 0$.
Lagrangian multipliers
In this relatively simple setting, we can consider reduced costs $\hat{c}_t(x) \seteq c_t(x)-\lambda_t(x)$ satisfying:
- $\lambda_t(x) \geq 0$ for all $t \geq 0$,
- $p_t(x) = 0 \implies \partial_t p_t(x) \geq 0$,
- $\lambda_t(x) > 0 \implies p_t(x)=0$.
With these constraints in place, the corresponding trajectory $\{p_t : t \geq 0\}$ will always be a probability measure, and we can charge ourselves $\hat{c}_t(x)$ without worrying about cheating, since $p_t(x) \hat{c}_t(x) = p_t(x) c_t(x)$ will always hold. The existence of functions $\{ \lambda_t : \cE \to [0,\infty) \mid t \geq 0\}$ is a slightly subtle issue that will be addressed formally in the coming lectures. These are Lagrangian multipliers corresponding to the constraints $p_t(x) \geq 0$ for $x \in \cE$.
As we will see in future lectures, the Lagrangian multipliers will not adversely affect the potential analysis, but they could cause our algorithm to incur movement cost. In the present setting, things are going in the beneficial direction: The multipliers correspond to reduced costs, and therefore they actually slow down our movement.
The potential analysis
Define now the potential \[ D_{\delta}(x; p) \seteq - \log (p(x)+\delta). \] We are interested in $\partial_t D_{\delta}(x_t^*; p_t)$. Let's first consider the derivative with respect to $x_t^*$. For any $x,y \in \cE$: \[ \left|D_{\delta}(x; p) - D_{\delta}(y ;p)\right| \leq \log(1/\delta)\,. \] Thus for any $T \geq 0$: \begin{equation}\label{eq:first-mts} D_{\delta}(x_{T}^*; p_T) - D_{\delta}(x_0^*, p_0) \leq \log(1/\delta) \sum_{t=1}^{\lfloor T\rfloor} d(x_t^*, x_{t-1}^*) + \int_0^T \partial_t D_{\delta}\left(x^*_{\lfloor t\rfloor}; p_t\right)\,dt\,. \end{equation} To analyze the latter term, use \eqref{eq:mts-dynamics} to observe that for any $x \in \cE$, \[ \partial_t D_{\delta}(x;p_t) = \hat{c}_t(x) - \llangle \frac{p_t+\delta}{1+\delta N}, \hat{c}_t\rrangle, \] hence \[ \int_0^T \partial_t D_{\delta}\left(x_{\lfloor t\rfloor}^*; p_t\right)\,dt = \int_0^T \hat{c}_t(x_t^*)\,dt - \int_0^T \llangle \frac{p_t+\delta}{1+\delta N}, \hat{c}_t\rrangle\,dt\,. \] Plugging this into \eqref{eq:first-mts} and rearranging gives \begin{align}\nonumber (1+& \delta N)^{-1} \int_0^T \langle p_t + \delta, \hat{c}_t\rangle\,dt \\ &\leq \left[ D_{\delta}(x_{0}^*; p_0) - D_{\delta}(x_T^*, p_T) \right] + \log(1/\delta) \sum_{t=1}^{\lfloor T\rfloor} d(x_t^*, x_{t-1}^*) + \int_0^T \hat{c}_t(x_t^*)\,dt \nonumber \\ &\leq \log(1/\delta) \sum_{t=1}^{\lfloor T\rfloor} d(x_t^*, x_{t-1}^*) + \int_0^T c_t(x_t^*)\,dt\,,\label{eq:second-mts} \end{align} where we have used the fact that the term in brackets is nonpositive, and $c_t \geq \hat{c}_t$ pointwise. This looks great: We have bounded the service cost of our algorithm by the movement and service costs of the optimal algorithm. We are left to consider the movement cost of the algorithm.
The movement cost
Here we use a trick from online algorithms: Instead of bounding the total movement cost $\int_0^T \|\partial_t p_t\|_1\,dt,$ we will bound only the incoming movement $\int_0^T \|\left(\partial_t p_t\right)_+\|_1\,dt$.
Since “what goes in must come out (unless it stays there forever),” we have:
$$ \int_0^T \|\partial_t p_t\|_1\,dt \leq 2 \int_0^T \|\left(\partial_t p_t\right)_+\|_1\,dt + 1\,. $$ And now \eqref{eq:mts-move} gives $$ \left\|\left(\partial_t p_t\right)_+\right\|_1 \leq \langle p_t+\delta,\hat{c}_t\rangle\,. $$
Combining this with \eqref{eq:second-mts} and using the fact that $\langle p_t, c_t\rangle = \langle p_t, \hat{c}_t\rangle$ yields \begin{align*} \int_0^T \left(\langle p_t,c_t\rangle + \|\partial_t p_t\|_1\right)\,dt &\leq 1 + 3 \int_0^T \langle p_t + \delta ,\hat{c}_t\rangle\,dt \\ & \leq 1 + 3(1+\delta N) \left[\log(1/\delta) \sum_{t=1}^{\lfloor T\rfloor} d(x_t^*, x_{t-1}^*) + \int_0^T c_t(x_t^*)\,dt\right]. \end{align*} Thus setting $\delta = 1/N$ yields an $O(\log N)$-competitive algorithm for MTS on a uniform metric space.
A comment about absolute continuity
Note that in \eqref{eq:first-mts}, we have used the fundamental theorem of calculus to integrate a derivative. In order for this to be valid, it must be that $\log p_t(x)$ is absolutely continuous as a function of $t$. When we argue formally about the existence of the Lagrangian multipliers $\lambda_t$, we will need to ensure that the resulting trajectory is absolutely continuous.


Like renting your home, but don't like the hassle? Enough with the endless back and forth emails. Enough with all the complex planning. Lets make it easy!
Upload a photo of the individual, and when the time comes our system will verify that their face matches that photo.


This option is only applicable when the build is done by a remote machine in a remote workspace.
- If you do not select this checkbox (default), the output files are uploaded to Veracode from the remote workspace.
- If you select this checkbox, the output files are copied from the remote machine to a local, temporary directory in Controller and then updated to Veracode.


This former whaling port, with its pre-civil war building beautifully restored, forms a very attractive destination. It lies about 30nm south of Cape Cod and 10nm east of Matha's Vinyard.
Position 41° 18'11" N, 70°06' W (harbour approach)
There are two free dinghy docks located on the town dock.
Toilets and showers are located at the town dock.
Free pump-out at the town pier, or call the Harbour Master.
Last updated March 2015.


Find PDXDoctor
Find
PDX
Doctor ...
SEARCH
×
Error
There was an error processing your request. Please try again..
×
Sorry!
No match found!


| GEOS SDK TechDocs
|
| Threads and Semaphores
| 2 Two Models of Multitasking
The GEOS multitasking system is one of the most sophisticated available for PCs today. It was designed with the latest available technology and was created to serve the following two primary goals:
-
Fast Response
The GEOS multitasking system was designed with a strong emphasis on rapid response to user input. Prompt, visible reaction to user action is the single most important factor contributing to the perception of speed. For example, if a user changes an element in a spreadsheet (requiring the whole spreadsheet to be recomputed) and then pulls down a menu, he wants the menu to appear right away. If the menu does not appear until the computation is finished, the system will seem sluggish. If the computation takes a few seconds or longer, the user may wonder whether the system has crashed altogether.
-
Ease of Programming
Making the programmer's job easy is another motive behind the design of GEOS multitasking. Ideally, the programmer should not need to be aware that his program will run in a multitasking environment. The program should proceed as though it were the only one running on the system. Besides certain "good citizen" rules, application programs are isolated from the multitasking environment. On the other hand, if a programmer wants to take advantage of the multitasking capability of GEOS (by designing a program to perform more than one task concurrently) the system is designed to make this as simple and efficient as possible.
| GEOS SDK TechDocs
|
| Threads and Semaphores
| 2 Two Models of Multitasking


Standard and User-Defined Functions
Apache Spark 3.2 / Spark SQL
@jaceklaskowski
/
StackOverflow
/
GitHub
/
LinkedIn
The "Internals" Books:
books.japila.pl
## Agenda 1. [Standard Functions](#/standard-functions) 1. [Standard Functions for Collections](#/standard-functions-collections) 1. [Standard Functions for Date and Time](#/standard-functions-datetime) 1. [User-Defined Functions (UDFs)](#/udf)
## Standard Functions
(1 of 2)
1. **Standard functions** (aka **native functions**) are built-in functions that transform the values of columns into new values * Aggregate functions, e.g. **avg**, **count**, **sum** * Collection functions, e.g. **explode**, **from_json**, **array_\*** * Date time functions, e.g. **current_timestamp**, **to_date**, **window** * Math functions, e.g. **conv**, **factorial**, **pow** * Non-aggregate functions, e.g. **array**, **broadcast**, **expr**, **lit** * Sorting functions, e.g. **asc**, **asc_nulls_first**, **asc_nulls_last** * String functions, e.g. **concat_ws**, **trim**, **upper** * UDF functions, e.g. **callUDF**, **udf** * Window functions, e.g. **rank**, **row_number**
## Standard Functions
(2 of 2)
1. Import **org.apache.spark.sql.functions** object ```scala import org.apache.spark.sql.functions._ ``` 1. Use Dataset operators as "execution environment" *
withColumn
,
select
,
filter
1. Home exercise * Read up [functions object's scaladoc](http://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.sql.functions$)
## Standard Functions for Collections 1. Functions for "Array Algebra" * **array_contains**, **array_distinct**, **array_except**, **array_intersect**, **flatten**, etc. * **arrays_zip**, **arrays_overlap** 1. Functions for "Map Algebra" * **map_concat**, **map_from_entries**, **map_keys**, **map_values** 1. **explode**, **explode_outer** 1. **posexplode**, **posexplode_outer** 1. Review Spark API scaladoc for [functions object](http://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.sql.functions$)
## Standard Functions for Date and Time 1. **unix_timestamp** 1. **to_timestamp** 1. **window** 1. **from_utc_timestamp**, **to_utc_timestamp**, **months_between** 1. Review Spark API scaladoc for [functions object](http://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.sql.functions$) 1. Switch to [The Internals of Spark SQL](https://books.japila.pl/spark-sql-internals/) * [Date and Time Functions](https://books.japila.pl/spark-sql-internals/spark-sql-functions-datetime)
## User-Defined Functions (UDFs) ### « HEADS-UP » > **Use the standard functions whenever possible** before reverting to custom UDFs. > UDFs are a blackbox for Spark Optimizer and does **not even try** to optimize them.
## UDFs — User-Defined Functions 1. User-Defined Function extends the "vocabulary" of Spark SQL 1. Use
udf
function to define a user-defined function ```scala // pure Scala function val myUpperFn = (input: String) => input.toUpperCase // user-defined function val myUpper = udf(myUpperFn) ``` 1. Use UDFs as standard functions *
withColumn
,
select
,
filter
etc. * Also **callUDF** function 1. Switch to [The Internals of Spark SQL](https://books.japila.pl/spark-sql-internals/) * [User-Defined Functions](https://books.japila.pl/spark-sql-internals/spark-sql-udfs/)
## Registering UDFs for SQL queries 1. Use
spark.udf.register
to register a Scala function as a user-defined function ```scala // pure Scala function val myUpperFn = (input: String) => input.toUpperCase // register Scala function as UDF spark.udf.register("myUpper", myUpperFn) // Use myUpper as if it were a standard function sql("select myUpper(name) from people").show ```
## Deterministic UserDefinedFunctions 1. User-defined function is **deterministic** by default * Evaluates to the same result for the same input(s) 1. Use **deterministic** method to find out whether it is or not 1. Use **asNondeterministic** to disable determinism 1. Non-deterministic expressions are not allowed in some logical operators and are excluded in some optimizations
## Recap 1. [Standard Functions](#/standard-functions) 1. [Standard Functions for Collections](#/standard-functions-collections) 1. [Standard Functions for Date and Time](#/standard-functions-datetime) 1. [User-Defined Functions (UDFs)](#/udf)
# Questions? * Read [The Internals of Apache Spark](https://books.japila.pl/apache-spark-internals/) * Read [The Internals of Spark SQL](https://books.japila.pl/spark-sql-internals/) * Read [The Internals of Spark Structured Streaming](https://books.japila.pl/spark-structured-streaming-internals/) * Follow [@jaceklaskowski](https://twitter.com/jaceklaskowski) on twitter * Upvote [my questions and answers on StackOverflow](http://stackoverflow.com/users/1305344/jacek-laskowski)


Welcome to the Beachbody Program Finder
Beachbody has over 20 incredibly effective workout programs in various styles and intensity. Some require only 30 minutes of your time, while others can require up to 90 minutes. We offer a way to find the one that's right for you.


lpstat
Section: Apple Inc. (1)Updated: CUPS
Index Return to Main Contents
NAME
lpstat - print cups status informationSYNOPSIS
lpstat [ -E ] [ -H ] [ -U username ] [ -h hostname[:port] ] [ -l ] [ -W which-jobs ] [ -a [ destination(s) ] ] [ -c [ class(es) ] ] [ -d ] [ -o [ destination(s) ] ] [ -p [ printer(s) ] ] [ -r ] [ -R ] [ -s ] [ -t ] [ -u [ user(s) ] ] [ -v [ printer(s) ] ]DESCRIPTION
lpstat displays status information about the current classes, jobs, and printers. When run with no arguments, lpstat will list jobs queued by the current user.OPTIONS
The lpstat command supports the following options:- -E
-
Forces encryption when connecting to the server. - -H
-
Shows the server hostname and port. - -R
-
Shows the ranking of print jobs. - -U username
-
Specifies an alternate username. - -W which-jobs
-
Specifies which jobs to show, completed or not-completed (the default). This option must appear before the -o option and/or any printer names, otherwise the default (not-completed) value will be used in the request to the scheduler. - -a [printer(s)]
-
Shows the accepting state of printer queues. If no printers are specified then all printers are listed. - -c [class(es)]
-
Shows the printer classes and the printers that belong to them. If no classes are specified then all classes are listed. - -d
-
Shows the current default destination. - -h server[:port]
-
Specifies an alternate server. - -l
-
Shows a long listing of printers, classes, or jobs. - -o [destination(s)]
-
Shows the jobs queue on the specified destinations. If no destinations are specified all jobs are shown. - -p [printer(s)]
-
Shows the printers and whether or not they are enabled for printing. If no printers are specified then all printers are listed. - -r
-
Shows whether the CUPS server is running. - -s
-
Shows a status summary, including the default destination, a list of classes and their member printers, and a list of printers and their associated devices. This is equivalent to using the "-d", "-c", and "-v" options. - -t
-
Shows all status information. This is equivalent to using the "-r", "-d", "-c", "-v", "-a", "-p", and "-o" options. - -u [user(s)]
-
Shows a list of print jobs queued by the specified users. If no users are specified, lists the jobs queued by the current user. - -v [printer(s)]
-
Shows the printers and what device they are attached to. If no printers are specified then all printers are listed.
COMPATIBILITY
Unlike the System V printing system, CUPS allows printer names to contain any printable character except SPACE, TAB, "/", and "#". Also, printer and class names are not case-sensitive.The "-h", "-E", "-U", and "-W" options are unique to CUPS.
The Solaris "-f", "-P", and "-S" options are silently ignored.
SEE ALSO
cancel(1), lp(1),http://localhost:631/help
COPYRIGHT
Copyright 2007-2009 by Apple Inc.
Index
This document was created by man2html, using the manual pages.
Time: 05:29:05 GMT, December 24, 2015


interface PaymentSessionListener
Represents a listener for PaymentSession actions, used to update the host activity when necessary.
onCommunicatingStateChanged |
Notification method called when network communication is beginning or ending. abstract fun onCommunicatingStateChanged(isCommunicating: Boolean): Unit |
onError |
Notification method called when an error has occurred. abstract fun onError(errorCode: Int, errorMessage: String): Unit |
onPaymentSessionDataChanged |
Notification method called when the PaymentSessionData for this session has changed. abstract fun onPaymentSessionDataChanged(data: PaymentSessionData): Unit |


| Name | Hobbies | Favorite Animal |
|---|---|---|
| Arjun Nair | Martial arts/Soccer | |
| Anika Bhat | Violin/Dance | |
| Allison Kennedy | Violin/Tennis | |
| Chris Sprong | Video Games | |
| Rajpal Bal | Sports/Friends | |
| Tim Kravchenko | Computer Games | |
| Aroun Awasthi | Football | |
| Anand Odbayar | Computer | |
| Daniel Chang | Minecraft | |
| Samuel Lim | Tennis | |
| Eric Huang | Chess | |
| Drason Zhang | Video Games | |
| Jeffrey Shen | Rapping | |
| Andrew Zhao | Swimming |


DNTX ICO Admin
0. Load contracts
Token ABI:
Crowdsale ABI:
Current time:
(Z = UTC timezone, ISO8601 format)
1. Publish Crowdsale
Transaction:
Crowdsale Published at:
Token Published at:
2. Manage Crowdsale
Crowdsale at:
Token at:
Is ICO open:
Base rate:
DNTX = 1 ETH
Current rate:
DNTX = 1 ETH
Current state:
ICO Start time:
ICO End time:
ICO Goal:
ETH
Hard Cap:
ETH
ICO Collected:
ETH
Total Collected:
ETH
Current balance:
ETH
Apply before date
Bonus, %
PreICO Setup
Base rate:
DNTX = 1 ETH
PreICO Bonus:
%
ICO Setup
ICO Start time:
ICO End time:
ICO Goal:
ETH
Hard Cap:
ETH
Apply before date
Bonus, %
Manage
Transfer collected Ether from the contract to your wallet
Finalize crowdsale: allow token transfer, change token ownership to yourself (which is required to manage token)
Special Mint
Beneficiary:
Amount:
DNTX
Description:
(reason, why are you sending this tokens)


Humour and Dialect
by Paul Laurence Dunbar
The Photograph
Additional Information
- Year Published: 1913
- Language: English
- Country of Origin: United States of America
- Source: Dunbar, P.L. (1913). The Complete Poems of Paul Laurence Dunbar. New York: Dodd, Mead, and Company.
-
Readability:
- Flesch–Kincaid Level: 6.5
- Word Count: 191
- Genre: Poetry
- ✎ Cite This
Downloads
See dis pictyah in my han’?
Dat’s my gal;
Ain’t she purty? goodness lan’!
Huh name Sal.
Dat’s de very way she be—
Kin’ o’ tickles me to see
Huh a–smilin’ back at me.
She sont me dis photygraph
Jes’ las’ week;
An’ aldough hit made me laugh—
My black cheek
Felt somethin’ a–runnin’ queer;
Bless yo’ soul, it was a tear
Jes’ f’om wishin’ she was here.
Often when I ’s all alone
Layin’ here,
I git t’inkin’ ‘bout my own
Sallie dear;
How she say dat I ’s huh beau,
An’ hit tickles me to know
Dat de gal do love me so.
Some bright day I ’s goin’ back,
Fo’ de la!


Handling Video Files¶
Sometimes it is necessary to read a sequence of images from a standard video file, such as .avi and .mov files.
In a scientific context, it is usually better to avoid these formats in favor of a simple directory of images or a multi-dimensional TIF. Video formats are more difficult to read piecemeal, typically do not support random frame access or research-minded meta data, and use lossy compression if not carefully configured. But video files are in widespread use, and they are easy to share, so it is convenient to be equipped to read and write them when necessary.
Tools for reading video files vary in their ease of installation and use, their disk and memory usage, and their cross-platform compatibility. This is a practical guide.
A Workaround: Convert the Video to an Image Sequence¶
For a one-off solution, the simplest, surest route is to convert the video to a
collection of sequentially-numbered image files, often called an image
sequence. Then the images files can be read into an ImageCollection by
skimage.io.imread_collection
. Converting the video to frames can be done
easily in ImageJ, a cross-platform, GUI-based
program from the bio-imaging community, or FFmpeg, a
powerful command-line utility for manipulating video files.
In FFmpeg, the following command generates an image file from each frame in a video. The files are numbered with five digits, padded on the left with zeros.
ffmpeg -i "video.mov" -f image2 "video-frame%05d.png"
More information is available in an FFmpeg tutorial on image sequences.
Generating an image sequence has disadvantages: they can be large and unwieldy, and generating them can take some time. It is generally preferable to work directly with the original video file. For a more direct solution, we need to execute FFmpeg or LibAV from Python to read frames from the video. FFmpeg and LibAV are two large open-source projects that decode video from the sprawling variety of formats used in the wild. There are several ways to use them from Python. Each, unfortunately, has some disadvantages.
PyAV¶
PyAV uses FFmpeg’s (or LibAV’s) libraries to read image data directly from the video file. It invokes them using Cython bindings, so it is very fast.
import av
v = av.open('path/to/video.mov')
PyAV’s API reflects the way frames are stored in a video file.
for packet in container.demux():
for frame in packet.decode():
if frame.type == 'video':
img = frame.to_image() # PIL/Pillow image
arr = np.asarray(img) # numpy array
# Do something!
Adding Random Access to PyAV¶
The Video class in PIMS invokes PyAV and adds additional functionality to solve a common problem in scientific applications, accessing a video by frame number. Video file formats are designed to be searched in an approximate way, by time, and they do not support an efficient means of seeking a specific frame number. PIMS adds this missing functionality by decoding (but not reading) the entire video at and producing an internal table of contents that supports indexing by frame.
import pims
v = pims.Video('path/to/video.mov')
v[-1] # a 2D numpy array representing the last frame
MoviePy¶
Moviepy invokes FFmpeg through a subprocess, pipes the decoded video from FFmpeg into RAM, and reads it out. This approach is straightforward, but it can be brittle, and it’s not workable for large videos that exceed available RAM. It works on all platforms if FFmpeg is installed.
Since it does not link to FFmpeg’s underlying libraries, it is easier to install but about half as fast.
from moviepy.editor import VideoFileClip
myclip = VideoFileClip("some_video.avi")
Imageio¶
Imageio takes the same approach as MoviePy. It supports a wide range of other image file formats as well.
import imageio
filename = '/tmp/file.mp4'
vid = imageio.get_reader(filename, 'ffmpeg')
for num, image in vid.iter_data():
print(image.mean())
metadata = vid.get_meta_data()
OpenCV¶
Finally, another solution is the VideoReader class in OpenCV, which has bindings to FFmpeg. If you need OpenCV for other reasons, then this may be the best approach.


|
|
Random
generation in the realm of mud areas, rooms,
items, mobs, and so forth is a strange proposition. In the
end, it always boils down to selecting among known, fixed, and constant
alternatives that make sense in a particular context. For
example, a mob that might be named "George" or "A path in the forest"
is certainly random, but doesn't make much sense, so we tend to
restrict our alternatives in some way. Also, selecting evenly
among alternatives, while certainly the most common thing you will do,
also sometimes doesn't make sense. A random Moon description
might include words like "full", "new", "crescent", "half", and "BLUE".
However, just because you want the "BLUE" alternative to be
available, doesn't mean you want it to have an equal chance of
describing your moon as the other choices. Also, sometimes
the context in which an alternative makes sense can be extremely
narrow. Having "a rat" as a random monster in your dungeon
almost always makes sense, except in the "cat room". Again,
judgement must come into play. And lastly, the more random a particular
area is, the more it will seem like every other random area.
Randomness is best used to select overall themes for an area,
which the content reflects, as opposed to every room having random
content and descriptions.
All of these considerations and more have gone into the
devising of a random mud engine, and particularly to the format of the
input data it uses. This engine receives a series of sets of
alternatives which may include a relative weight for each alternative,
and potentially the context in which each alternative applies or
doesn't apply, and then makes selections and instantiates real
mud objects based on those selections. The input to the
engine is a very specifically built XML file, and the output is actual
mud objects (mobs, items, areas, rooms, or all the above) in your game.
The random generator works by
reading a
specially-written XML document
that contains tags describing the object or objects to generate.
For example, area generation looks for tags named
<AREA />, mobs for <MOB />, items for
<ITEM />, rooms for <ROOM />, and so forth.
The embedding of tags can also be significant. For
example, to generate a mob from a given <MOB /> tag, the
tag must either contain a NAME attribute, or a <NAME />
tag embedded inside the <MOB /> tag. Another
example would be that
room tags may contain mob and item tags.
Generation sometimes requires that a specific starting object be named
by ID, in which case an ID attribute may be found on the tag, allowing
it to be referenced globally, no matter where it is embedded.
The basic tag types are AREA, ROOM, MOB, ITEM, and STRING.
Any tag that contains other tags of the same tag type is a
Container tag, and usually has rules in the form of special attributes
for how to select among the alternatives in the container. In
cases where one of something is called for, but multiple options are
available, and no rules are found for how to select among them, a
random roll will be made. In cases where one or more of
something is allowed, and multiple options are available, all the
alternatives found will be selected.
Each basic tag type is used to build an object of that type.
For
instance, the MOB tag is used to build a MOB. Therefore, each
basic
object type must have other tags or attributes to "fill in the
details", such as name, level, and so forth. These Details
may be
defined as variables on the command line using GENERATE or by the
"define" attribute, or may be given as an attribute of the basic tag,
or as other tags inside the parent tag. A Detail given as an
attribute
always supersedes any detail given as internal tags, no matter
what. A
detail found as an defined variable identifier, supersedes both tags and
attributes. See the glossary for more tails on each major tag
type.
Basic
tags may also have special pre-defined variables to help give some
context to help with their parsing, and will often cause variables to
be defined as their details are filled in. Basic tags also
have
certain required details which must be resolved for the
object to be created, and other optional details which may or may not
be given, and which are extremely object-specific. Again, the
glossary entry for each basic tag type will have more information about
this.
Tags are always evaluated recursively, from first to last.
Any tag may contain zero or more of the following
meta-attributes:
| id |
exposes the tag to either the Generate command,
or to the "insert" or "like" attributes. |
| load |
the xml inside the file named is inserted into
the tag |
| from |
similar to from, except only the tag in the file with
the same id is merged with the tag |
| content_load |
the text inside the file names is returned as the
value of the tag. Variables in the content are handled. |
| like |
a comma separated list of other tag "id"s of the
SAME TYPE. These may NOT be container tags. This will allow
the current tag to be parsed as if it contained the same tags
and attributes as the listed tags. This is useful for making
one-off variations on existing tag structures. |
| insert |
a comma separated list of other tag ids. The
targeted tags may be of any type, and may be containers. It
will cause the tags to be parsed and the resulting tags added as
contents of the host tag as if they were already inside it.
Remember, the listed tags will be parsed first, so any "condition",
"select" or other operations will occur. |
| copyof |
a tag "id" or standard class id. This will cause
the stats and attributes and other details of the listed items
into the current object. |
| validate |
a boolean expression which must evaluate to true
for the tag to be finally built into an object. Check
"condition" below for more information.... |
| condition |
the value is a boolean expression which must
evaluate to true for the tag to be included in its parent.
This is similar to "validate" except that "condition" determines
whether a tag is among the allowed choices, whereas "validate"
determines whether, after being chosen, it is finally built into a
final thing (whether string, mob, item, whatever). These
expressions may use boolean operators like AND and OR and NOT (or
!), string constants are always single-quoted 'string', string
comparison operators include = , !=, and IN to check to see if
the lhs string is a substring of the rhs string. Numeric
comparisons may be made as well, and numeric comparison
operators include > < >= <= != =.
Parenthesis may be used to group sub-expressions. Defined
variables may be included, but only if preceded by a $
character. For instance, to check if the variable "bob" is
equal to "bobvalue", you would enter $bob='bobvalue'.
Undefined string ids are treated as ''. Remember
that in XML, a < and > characters can not appear
in attribute values, which is why they must be written as <
and > in your xml. |
| define |
this attribute is only used if its "condition" is
met, and it is "selected" by its parent tag, if applicable.
It is a comma separated list of any combination of the
following:
- "id": either a new or existing identifier, in
which case the value that this tag resolves to will be set to
that identifier, allowing it to be used in "condition", tag values, or
other places.
- "id=value": will set the new or existing
identifier "id" to the given constant "value".
- "id+=number": see below
- "id*=number": see below
- "id-=number": see below
- "id/=number": Will attempt to evaluate the
existing value of the identifier"id" as a number, and perform the given
operation upon it with the "number" given. For instance "bob+=3" will
add the number 3 to the current value of the identifier
"bob". Any undefined "id" will be treated as if it were 0.
When dealing with areas, there is an extra feature of defined
identifiers. An identifier whose name starts with "_" will
persist for every tag and object in the room's "room
group". An identifier whose name starts with "__"
will persist throughout the entire area. Otherwise, any
variables defined using this command will persist only for one room.
|
| predefine |
identical to "define", but always evaluated when
encountered. |
| tagdefine |
identical to "predefine", but the value will be the
post-processed (SELECT, INSERT, etc) tag itself |
| select |
used mostly by container tags, this attribute
allows you to specify how multiple choices are resolved by this
tag. More than one selection may be made, which makes sense
when selecting MOB tags for a ROOM. However,
sometimes it does not, such as when selecting a NAME for a
MOB. In those cases, any remaining multiple-choices are
always selected randomly from. Possible values are:
- "all": always selects every choice.
- "any-X": selects any X** of the choices,
without repeating. Make
sure you have another choices to cover the possible value of X!
- "pick-X": same as "any-X", but the tag choices
will be checked for the
- "pickweight" is container-entry attribute,
and is used only when the parent tag is using 'select="pick-X" ' as a
relative weight when selecting among the choices.
- "limit-x": selects up to X** random choices,
but less is OK too if no more.
- "repeat-X": always selects every choice, and
treats the choices as
if enough of them actually existed to select X** of them,
even if not
enough choices were given.
- "none": always selects none of the choices (why
would anyone use this?!)
- "first": selects the first choice (another
stupid one)
- "last": you guessed it, select the last choice
- "first-X": selects the first X** choices.
- "last-X": selects the last X** choices.
** Where you see X above, this may be a number, or a math formula or
math expression. (see mud help on math formulas/math expressions) |
| merge |
must be "true" if two tags with the same ID are
included in the same xml document. It permits some of the tag
parameters, and all of the content tags, to be merged together into a
single referenced tag. In this circumstance, child tags of
parent tags which are being merged may optionally include "merge=false"
to prevent duplicates from being formed.
Merge
can also be set to "over" to cause one tag with an ID to always
overwrite another with the same id. If more than one tag is set to
merge="over", a number can be added after the word "over" to give
priority. For example, a tag with merge="over9" would always
overwrite a tag with the same ID and merge="over4". |
| pickweight |
a helper attribute for the "select"
attribute, when a "pick" value is used by the select
attribute. See "select" attribute above. |
| action |
used by string-type choices to inform the engine
on how to combine the multiple choices into a single string.
Possible values include:
-
"append": append the tags value to the string as built so far.
-
"replace": completely replace any string build so far with this ones
value.
-
"prepend": always put this strings value at the beginning of the final
string
|
| requires |
a comma-separated list of variable identifiers
which must have already been defined before this tag can be
evaluated. Such variables are usually defined by the user of
the GENERATE command, but can also be defined at parse-time by the
"define" attribute, if you are creative. Each item in the
list is of the format "id=type", so that the parser can check to see
not only if the variable is defined, but that it is defined
properly. Possible types include "#" for a number, "int" for
an integer, "$" for a string, or a semicolon-delimited list of possible
string values. |
Tag values:
A non-container non-basic tag will typically have a string
value. This value may contain any embedded variables or
identifiers, so long as they are preceded with a $ character.
A string beginning with a $ character will be assumed to be an
identifier, and will be searched for within the list of defined
variables and identifiers. If the identifier resolves to a
tag, the tag will be parsed as a string. If the identifier
resolves to
a string, so much the easier.
Defined variables or tag names can also be embedded in {} characters;
for example: ${ame}. When embedded in this way, the name may be
preceeded by:
- "u:" to force to
all-uppercase
- "l:" to force all-lowercase
- "p:" to force plural
- "j:" to force javascript and mobprog-safe
- "1:" to encourage to one line (remove tabs and cr/lf)
- "c:" to force to be capitalized (first letter upper,
rest lower).
- "_:" to remove punctuation and replace spaces with
underscores.
Special
embedded
variables:
- $SYSTEM_RANDOM_NAME:[NUMX]-[NUMY]
generate a random
name with between NUMX and NUMY syllables.
- ${STAT:[STATNAME]} embed the value from another stat
on the same object. STATs are things like NAME, DISPLAY,
DESCRIPTION, etc...
- ${STAT:[PATH]:[TO]:[ANOTHER]:[OBJECT]:[STATNAME]}
embed the value from another objects stat, potentially in a different
room. Where path-to-another-object may be: ROOM to refer to the room
containing the object, NORTH,SOUTH,EAST,WEST,UP,DOWN,NORTHEAST..etc..
to specify a room in a specific direction, ANYROOM to specify any room
connected to this one, MOB to specify any mob in the room, ITEM to
specify any item in the room, AREA to specify the area object, or
AREAGATE to specify a connecting room outside the area. For
example a string such as: "To the east is the residence of
${STAT:ROOM:EAST:MOB:NAME}" would embed the name of a mob in a room to
the east of the current room. This command may internally cause
post-processing if necessary, and so is almost guaranteed to always
work unlike some of the special ROOM_ tags.
- (a(n)) will remove any indefinite or definite
articles from the string immediately following it and replace it (or
insert) either "a" or "an" depending on the first letter of the word.
There are currently two ways to use the Random Generator, one is the
Archon GENERATE command, and the other is the Area type
"StdAutoGenInstance".
Generate Command:
The most straightforward way to access the random generator is using
the Archon GENERATE command. The usage is as follows:
GENERATE [OBJ TYPE] [ID] (FROM [FILENAME]) ([VAR]=[VAL]...)
([DIRECTION])
This command uses an xml file to generate random content for your
mud. This content can be anything from whole areas,
to rooms, mobs, items, or simple strings. By default,
the content is built from the file in
resources/randareas/example.xml, though the builder may
specify his or her own xml file path as one of the many
arguments. The arguments, briefly, are:
| OBJ TYPE |
One of the following: AREA, ROOM, MOB, ITEM, QUEST, or
STRING |
| ID |
one of the "id" xml attributes defined on any tag
in the XML file. Use
GENERATE STRING LIST for a list of all "id" attributes defined in your
file. |
| FROM "path/to/xmlfile.xml" |
An optional argument to specify your own xml
file, with the resources directory being the default root. |
| VAR=VAL |
One or more variables and their
definitions. Many tags will have a
specific set of required variables which must be defined in
order for
the content to be generated. Failing to specify one
of the required
variables will cause an error message listing the variables which
must be defined, and the type of data required for the
variable.
Variable types which list numbers as their data types may also
have
math expressions values (so you can use random numbers).
See the help
on MATH EXPRESSION for more information on this. In addition
to
required variables, you may also use the space to enter one or
more
"override" values. Many object fields (such as
LEVEL for mobs and
items, or NAME, etc) as well as the XML id tags, can have their
"random" values overridden by defining them using the generate
command. |
| DIRECTION |
This applies only to ROOM and AREA object
types. The object, if
successfully generated, will be linked to the current room
that the
player is standing in, in the direction they specify. |
The GENERATE command is an interesting way to deliver large amounts of
dynamic content for your world, though it can never replace
the caring touch of a real, creative builder.
If anyone is interested in writing their own xml content,
please open up the /resources/randareas/example.xml file and
begin reading it and all of the LOADed files. Use those file as an
example on how to construct your own.
Examples of the Generate Command:
generate area maze_dungeon from randareas/example.xml areasize=50
areaname=test level_range=10?20 aggrochance=50 theme=kobolds
south
generate string list
StdAutoGenInstance
Area Type:
The StdAutoGenInstance area type is specially formulated to replace any
rooms of its own with auto-generated rooms and content.
This area type is, firstly, an Instance generator. That means
that each group that goes into the area will have their own unique
generated rooms to play in, which will be different from any other
groups, and will persist until the group gets tired of playing it
(causing the area to time-out and be garbage collected).
This area type also permits the path and name of the top-level random
generation xml file to be specified, where the /resource directory is
considered the default path root.
Lastly, any required or optional variables. Many tags will have a
specific set of required variables which must be defined in
order for
the content to be generated. Failing to specify one
of the required
variables will cause the area generation to fail, putting an error
message in your mud.log file. Variable types which list
numbers as their data types may also have
math expressions values (so you can use random numbers).
See the help
on MATH EXPRESSION for more information on this. In addition
to
required variables, you may also use the space to enter one or
more
"override" values for existing defined things. One special
variable is passivemins which
can be set to the number of minutes an instance will remain passive
before being deleted, with a default of 30 minutes. Another is noreset, which, when set to "true", prevents players from using the special "reset instance" trick.
AREA tags:
As the highest-level possible tag, an area is parsed only with the
variables it is given on the GENERATE command line, and using whatever
it can find in its XML contents for its details. All details
mentioned below will
automatically cause a variable to be defined or re-defined when they
are parsed.
The variable will be called "AREA_DETAILNAME". For instance
"AREA_CLASS" for
class, and "AREA_NAME" for name.
The layout of an area will cause its rooms to be logically grouped up
into streets, "leaf" rooms (rooms with only one exist), and other
logical
groupings. "leaf" rooms are always done first, followed by
streets, and others. The
layout will automatically define certain variables for each room to
help with parsing the rooms
details. These variables include:
- $AREA_NUMLEAFS: the number of leaf rooms for the
whole area
- $ROOMTAG_NODETYPE: one of surround, leaf, offleaf,
street,
square,
interior
- $ROOMTAG_NODERUN: for streets, which way they
run.
Values are
ns, ew, nwse, nesw
- $ROOMTAG_NODEFLAGS: various rooms flags. Values
include:
corner, gate,
intersection, tee, offleaf
- $ROOMTAG_NODEEXITS: comma separated list of all exits
from
a room
- $ROOMTAG_NODEGATEEXIT: if this room is a "gate"
rooms,
which direction
is the gate in.
- $ROOMLINK_N, $ROOMLINK_S, $ROOMLINK_E, $ROOMLINK_W,
etc:
"true" if an exit
exists that way.
- $ROOMTITLE_N, $ROOMTITLE_S, $ROOMTITLE_E,
$ROOMTITLE_W,
etc: if already
done, the title of a room that way.
- $NODETYPE_N, $NODETYPE_S, $NODETYPE_E, $NODETYPE_W,
etc:
type of room node
in that direction, if any.
Required details:
- "CLASS": The CoffeeMud class type to use to create
the area.
- "NAME": The name of the area. Must be
unique to your
MUD.
- "LAYOUT": The name of the layout generator to
use. At
the moment,
supported layouts include MAZE, BOXCITY, BOXCITYSQUARE, CROSS,
GRIDCITY, TREE, APARTMENT
- "SIZE": The number of rooms to create in the area.
Optional objects: (See below for details on these object
tag
types and
their details)
- "AFFECT"
- "BEHAVIOR"
- "ROOM"
Optional details: (See Archon's Guide)
- "CLIMATE"
- "DESCRIPTION"
- "THEME"
- "BLURBS"
- "PREJUDICE"
- "BUDGET"
- "DEVALRATE",
- "INVRESETRATE"
- "IGNOREMASK"
- "PRICEMASKS"
- "AUTHOR"
- "ATMOSPHERE"
ROOM tags:
Parsed with variables from the generate command, and from any defined
variables internal, and from any internal tags and attributes, and from
any variables defined
by its AREA tag. As with areas, its details will cause variables
beginning with ROOM_ to be
defined.
Required details:
- "CLASS"
- "TITLE"
- "DESCRIPTION"
Optional Objects: (See below for details on these object
tag
types and
their details)
- "MOB"
- "ITEM"
- "AFFECT"
- "BEHAVIOR"
- "EXIT"
You can also specify a "LAYOUT" attribute on a room tag,
in
which case
all rooms contained inside that room tag (or inserted, or whatever) are
used to build multiple
rooms from that layout, much as specified above on the AREA tag.
MOB
tags:
Parsed with variables from the generate command, and from any defined
variables internal, and from any internal tags and attributes, and from
any variables defined
by other room tags. As with areas, its details will cause variables
beginning with MOB_ to be
defined.
Required details:
- "CLASS": normally the CoffeeMud class the mob will be
made
from, though
it may also be the word catalog in order to select a mob from your
catalog, in which case
"name" also becomes a required detail.
Optional Objects:
- "MOB"
- "ITEM"
- "AFFECT"
- "ABILITY"
- "BEHAVIOR"
- "FACTION"
Optional details: (See Archon's Guide)
- "RACE"
- "HPMOD"
- "LEVEL"
- "NAME"
- "DISPLAY"
- "DESCRIPTION"
- "MONEY"
- "ALIGNMENT"
- "DISPOSITION"
- "SENSES",
- "ARMOR"
- "DAMAGE"
- "ATTACK"
- "SPEED"
- "TATTS"
- "EXPS"
- "IMG"
- "FACTIONS"
- "VARMONEY"
(plus or minus others depending upon class)
The "RACE" detail can be the name of a race, or resolve
to a
RACE tag,
see below.
ITEM
tags:
Parsed with variables from the generate command, and from any defined
variables internal, and from any internal tags and attributes, and from
any variables defined
by other room tags. As with areas, its details will cause variables
beginning with ITEM_ to be
defined.
Required details:
- "CLASS": normally the CoffeeMud class the item will
be made
from,
though it may also be the word catalog in order to select an item from
your catalog, in which
case "name" also becomes a required detail.
This value may also
start
with the string
"metacraft:", in which case the remainder of the "class" value becomes
either the name of the item to
metacraft, the word "anything", "all", or the words "any-" or
"all-" followed by the ID of the common
skill to use. "metacraft:" class strings may also end with
the
characters "<"
followed by a math expression evaluating to an upper level
limit
for the item to craft, ">"
for a lower level limit,"{" for an upper value limit, "}" for a lower
value limit, or "=" followed by a the base class ID to to filter
in. If the ID of the common skill is "resources" or "farmables",
then raw resource items will be generated instead.
Optional Objects:
- "MOB"
- "ITEM"
- "AFFECT"
- "CONTENT"
- "BEHAVIOR"
- "EXIT"
Optional details: (See Archon's Guide)
- "USES"
- "LEVEL"
- "ABILITY"
- "NAME"
- "DISPLAY"
- "DESCRIPTION"
- "SECRET"
- "PROPERWORN"
- "WORNAND",
- "BASEGOLD"
- "ISGETTABLE"
- "ISREADABLE"
- "ISDROPPABLE"
- "ISREMOVABLE"
- "MATERIAL"
- "DISPOSITION"
- "WEIGHT"
- "ARMOR"
- "DAMAGE"
- "ATTACK"
- "READABLETEXT"
- "IMG"
- "NOWEAR" (set to true to prevent the item from being
automatically worn by mobs)
(plus or minus many many others depending upon class)
"ShopKeeper" type classes may use "SHOPINVENTORY" tags to hold ITEM,
MOB, or ABILITY tags to designate what else is sold. Also,
the
SHOPINVENTORY or
those ITEM, MOB, or ABILITY tags may contain optional PRICE
or
NUMBER attributes.
AFFECT tags:
ABILITY
tags:
CULTURALABILITY
tags:
BEHAVIOR
tags:
Required detail:
Optional Detail:
Optional Details that apply only when this tag applies to a RACE tag:
- "PROFF"
- "LEVEL"
- "QUALIFY"
CONTENT
tags:
Content tags:
A pure container tag that contains one or more ITEM tags, as above.
EXIT
tags:
Exit tags:
Required detail:
Optional Objects:
Optional Details:
- "NAME"
- "DISPLAY"
- "DESCRIPTION"
- "DOOR"
- "LEVEL"
- "ABILITY"
- "ISREADABLE"
- "DISPOSITION"
- "READABLETEXT"
- "HASADOOR"
- "DEFCLOSED"
- "HASALOCK"
- "DEFLOCKED"
- "KEYNAME",
- "CLOSEWORD",
- "OPENWORD",
- "CLOSEDTEXT"
RACE tags:
Required detail:
Optional Objects:
- "WEAPON": tag which should contain an ITEM tag,
denoting
the creatures natural weapon
- "RESOURCES": tag which should contain one or more
ITEM
tags, denoting racial resources
- "OUTFIT": tag which should contain one or more ITEM
tags,
denoting the racial outfit
- "ABILITY"
- "CULTUREABILITY": same as ABILITY tag, but these are
cultural abilities
- "AFFECT"
Optional Details:
- "CAT"
- "VWEIGHT"
- "BWEIGHT"
- "VHEIGHT"
- "FHEIGHT"
- "MHEIGHT"
- "AVAIL"
- "LEAVE",
- "BODYKILL"
- "AGING"
- "HELP"
- "BREATHES"
- "ARRIVE",
- "HEALTHRACE"
- "BODY"
- "WEAPONRACE"
- "DISFLAGS"
- "EVENTRACE"
- "WEAR" - either a bitmask number, or wear locations
names
set equal to
true to forbid, or false to allow, e.g (mouth=true
back=false left_wrist=false)
- "ESTATS","ASTATS","CSTATS","ASTATE","STARTASTATE" -
either
a |
delimited stat list, or a series of var=value, e.g.
(STRENGTH=5 HITS=2 ATTACK=2 etc..)
FACTION tags:
Required details:
QUEST tags:
Optional parameter:
- The
QUEST tag is supremely unique in that it does not represent an object
in your world, or a property of some object in your world, but instead
represents a relationship between players and your world by giving them
tasks to perform. In the end, a QUEST tag must resolve to a
complete Quest Script document/string, which is then submitted to
CoffeeMud's Quest Manager for execution, monitoring, and cleanup.
I won't go into the complete details of what goes into a Quest
Script here, however. Instead, you should check the Game
Builder's Guide for a complete breakdown of a Quest Script.
- Quest
Scripts can be built from the ground up by assembling a String
consisting of each line of the quest script, separated by %0D
characters.
Scripts can also be built, however, by utilizing
one of the existing Quest Maker templates. These are the
templates found in the /resources/quests/templates
directory. They are partially built Quest Scripts which, when
run through the Quest Maker Wizard, can be filled out manually by a
builder. However, those templates can also be run through the
Random Generator to generate randomly what the builder would normally
have to type in manually.
To create a quest script by
running a Template through the random generator, you would specify the
full path or ordinary name (e.g. normal_capture1) of the Template in a
tag parameter on the QUEST tag called QUEST_TEMPLATE_ID. When
this is done, the quest script and its variables are extracted from the
template. The variables in the template then become required
details for the QUEST tag. When those details are resolved into
STRINGs, the values are substituted into the template's quest script
and then returned by the tag.
To discover the required details for a particular template, you should
open up that template *.quest
file and scan down the top part of the file whose lines begin with #.
When you see a line that begins with #$, you know you are looking
at a variable definition whose variable name is a required detail for
the QUEST tag using that template.
- To save you some
time, numerous existing quest templates have already had associated
snippets of Random Generator XML written to demonstrate the above.
These are found in the /resources/quests/random
directory, and can be indirectly accessed from the same /resources/randareas/example.xml
that is used to generate random areas, rooms, mobs, etc. This
means that you can use the GENERATE command to generate a random quest
of any type anywhere in your entire world by entering:
generate quest
all_quests template=normal "expiration=20 minutes"
The
"template" variable specifies that you want any available quest
template. The "expiration" variable definition ensures that the
quest is not saved to your database, and will in fact be destroyed
after running for 20 minutes. If you leave it off, or replace it
with a "duration" definition (see the Game Builders Guide), then the
quest will be writte to the database and become a persistant feature of
your world.
If you look through the examples in /resources/quests/random
, you will see much that is similar to Random Area documents. Strings
and other selections are being chosen from, conditions are set for some
values over others, etc. However, since many of the quest
Templates actually require that an already existing mob, or item, or
even set of mobs in your world be selected as subjects for the quest,
the Random Generator engine had to be extended to support not only the
creation of new mobs, items, rooms, and areas, but the selection of
existing ones inside the world. To do this, see the next section
on the OBJECT tag.
OBJECT tags:
- This
tag type is unique in the sense that it can contain any MOB, ITEM,
AREA, ROOM, or other main object types, intermingled. It is also
unique in that it need not resolve to the creation of any new object at
all, but can instead be used to select from an existing object in your
already existing world.
To do the later, the OBJECT tag
value mnust begin with SELECT: and be followed by an MQL query string.
When this is done, the OBJECT tag will take on the properties of
whatever was selected by the query. See the next section on MQL
for how these queries work.
MQL Stands for MUD Query Language. It's purpose is to
allow
the Archon, or a random quest xml document, to select existing objects
in the game, or the properties of existing objects.
The structure of MQL is similar to SQL in that all MQL
statements are of this structure:
SELECT:
[property, property, ..] FROM
[object set] WHERE
[object comparison, object comparison]
* note the colon : after the word SELECT above.
The SELECT clause defines the properties you wish to be
returned from the MQL statement.
The FROM clause defines the set of objects that you might want to
return the properties of.
The
WHERE clause defines the conditions under which any member of the set
in the FROM clause may be included in the final results.
A FROM clause can be a simple world set term, such as one of
the following:
- A CMFS file path to a CMARE file, such as ::/resources/map/plains.cmare
- AREAS to use
the set of all world areas
- ROOMS to use
the set of all existing world rooms
- NPROOMS to use
the set of all existing world non-property rooms
- MOBS to use
the set of all existing world mobs
- ITEMS to use
the set of all existing world items
- In case where a qualifying object is implied, AREA can be used to refer to
that specific area.
- Another SELECT: statement in parenthesis, such as: SELECT: name from (SELECT * from AREA)
The
FROM clause can also include narrowing suffixes. A narrowing
suffix comes after the simple term, and is separated from it by a
backslash \. For example, if your from clause looks like SELECT * FROM AREAS\ROOM
, then the ROOM portion is the narrowing suffix of the AREAS
term. You can also continue adding more narrowing suffixes as
needed. For example: SELECT
* FROM AREAS\MOBS\EQUIPMENT
. Each suffix narrows or alters the term immediate before
it, and the entire FROM clause will end up reflecting the type of
object described by the final term, whether it be simple, or a
narrowing term.
The following are useful narrowing terms:
- AREAS to use
the unique set of areas in which the prior term is located
- ROOMS to use
the unique set of rooms in which the prior term is located, or which
the prior term contains
- NPROOMS to use
the unique set of rooms in which the prior term is located, or which
the prior term contains, excepting any private property rooms
- EXITS to use
the unique set of exits in which the prior term is located, or which
the prior term contains
- MOBS to
use mobs in a room or area, or nearby mobs for others
- MOB to
use the set of all mob contained in the prior term, or ensure the
simple Mob result of a query
- ITEMS to
use all items in a roow or area, or nearby items for others
- ITEM to
use the set of all items contained in the prior term, or ensure the
simple Item result of a query
- OWNER to use
the set of all item owners of the prior term, if it was items
- FACTIONS to
use a set of all mob factions, where ID is the faction id, and VALUE is
the numeric value
- PLAYERS, PLAYER
to use the set of all players contained in the prior term
- RESOURCES to
use the racial or material components of a mob or item
- NPCS to
use the set of all non-player mobs in a room or area, or nearby npcs
for others
- NPC to
use the set of all non-player mobs contained in the prior term, or
ensure the simple Mob result of a query
- EQUIPMENT to
use the set of all worn items of the prior term
- ABILITIES to
use the set of all abilities of the prior term
- PROPERTIES to
use the set of all uninvokable effects of the prior term
- EFFECTS to
use the set of all permanent or temporary effects on the prior
term
- BEHAVIORS to
use the set of all behaviors of the prior term
Be
careful when using narrowing terms to make sure they make sense for the
term prior to them. For example, if importing mobs from a cmare
file, AREAS will not likely resolve to anything, since the mobs aren't
in the world yet.
The SELECT: clause can include one or more
comma-delimited properties of the objects in the from clause, or
it can be an asterisk *, or a period ., to refer simply to the FROM
objects themselves. It can also be a string or numeric literal,
or an XML tag when embedding MQL in a random quest document.
Different kinds of objects have different kinds of properties,
so it is tricky to define precisely what a legal and illegal object
property might be. Choosing incorrectly will usually just result
in an empty string "".
To summarize, valid property terms include:
- A valid property of an object from the FROM set, e.g NAME, CLASS, etc..
- A string or numeric literal, e.g. "Bob The Builder", 12.34, etc..
- An asterisk * or a period . to refer to the FROM set object
itself.
- Another MQL statement, e.g. (SELECT: * FROM areas\mobs)
- An XML tag id, e.g. $tagname
An example of a legal property might
be the property CLASS, since it applies to everything from areas and
rooms, to mobs, and items. NAME is also a property that almost
all objects have. Beyond this. using the GMODIFY command might be
the simplest way to get a list of valid properties for a specific type
of world object, or objects imported from cmare files.
As
mentioned previously, SELECT: clause properties can be separated by
commas in order to select more than one. For example: SELECT: class, name FROM areas\mobs
would show the class id and name of every mob in your game.
SELECT:
clauses can also include an AS qualifier for each property selected.
This has only the effect of changing the apparent name of the
property for other parts of the system. For an example using the
WHERE command to issue MQL: WHERE
AREA SELECT: class as classid, name as mob_name FROM areas\mobs would
show the same results as the previous example statement, but with
different name tags for the class and name properties. This might
be important when using an embedded SELECT: statement as your FROM
clause, since you can only select properties that the embedded clause
has returned, by the names they were given.
SELECT: clauses,
similar to FROM clauses above, can include narrowing terms. Like
FROM clauses, these narrowing terms are separated by backslashes \.
SELECT clauses, at the moment, only support one narrowing term:
COUNT. The purpose of the COUNT term is to report the number of
times the value of the previous terms appears in the rest of the FROM:
clause. For example, suppose you wanted to know the number of
times each mob name is used, to do that, you might enter SELECT: name, name\count FROM
areas\mobs
Lastly,
SELECT: clause can contain aggregating prefixes before a property term,
which will transform the final result set in some way by aggregating
the rows according to the prefix. Prefixes, like suffixes, are
separated from the property term by a backslash \. The value
aggregating prefixes are:
- MEDIAN to return only the median value of all the property
terms in the existing result set
- MEAN to return the mean value of all the property terms in
the existing result set
- COUNT to return the count of the number of items in
the result set
- UNIQUE to include only one row where the property is of any
given value
For example, to quickly count the mobs in your game, you might enter SELECT: COUNT\* from AREAS\MOBS
The
WHERE clause contains one or more conditions, which you can further
compare using connectors like AND, OR, or parenthesis to group
conditions together. Each condition consists of two terms
separated by a comparator. Value comparitors include = (equal
to), <> (not equal to), > (greater than), < (less than),
>= (greater or equal), <= (less or equal), IN (in a set or object
group, or a substring of), or LIKE (matching a ZAPPERMASK).
A
condition consists of two property terms, similar to those described in
the SELECT: clause above, except that condition terms can not use
aggregating prefixes. Narrowing suffixes, however, are permitted.
For example NAME = 'Bob'
is checking whether the NAME property of an item in the FROM clause is
equal to the string literal "BOB". If it is, when that condition
is true.  This works because NAME is a property of every mob
in the AREAS\MOBS from set, and can be compared with the word "BOB".
Condition
statements are grouped together into conditions using AND or OR.
For example, chaning the above condition to WHERE name="BOB" OR
name="JOE" would expand the number of possible results by one name.
|


Company profile - Canadian Company Capabilities
Third-Party Information Liability Disclaimer
Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.
British Columbia Institute of Technology (BCIT)
Legal Name:
British Columbia Institute of Technology (BCIT)
Operating Name:
BCIT Applied Research
Mailing Address:
3700 Willingdon AveBURNABY, British Columbia
V5G 3H2
Location Address:
4355 Mathissi Pl.BURNABY, British Columbia
V5G 4S8
Tel.:<PHONE_NUMBER>
Fax:<PHONE_NUMBER>
Logo
Company Profile
Innovative Solutions to Real-Life Problems
BCIT applied research activities are focused in areas that engage faculty and students to solve business and industry problems to increase competitive strength. BCIT applied researchers and research groups have a 25-year history of working with industry clients, from independent entrepreneurs with a unique prototype idea to established companies and organizations developing new technologies, products and services. The resulting innovations provide practical solutions to industry's challenges and can produce licensing opportunities, spin-off companies, and new start-ups.
Drawing on faculty from more than 200 technical programs within six BCIT schools, the full-time research staff of our Centre for Applied Research and Innovation, and the research and commercialization assistance experts in our Applied Research Liaison Office, we can assemble project teams with multi-disciplinary skills and expertise. Research projects conducted at BCIT typically involve: design and development of prototype devices, systems and applications; analysis, testing and evaluation of new technologies; commercialization and licensing of new technologies and products. BCITs research clients range from the independent entrepreneur with a unique prototype idea, to established companies and organizations developing new products and services.
Centre for Applied Research and Innovation
The Centre for Applied Research and Innovation employs a team of more than 30 full-time researchers working in fields ranging from human factors and medical device development to smart microgrid research and natural health products:
SMART
The Smart Microgrid Applied Research Team (SMART) converges Information Technology, Communication Engineering and Computing fields to develop prototypes and solutions for complex applied research problems. Our group conducts applied R&D in emerging and next generation technologies and helps stimulate BCs IT industry through joint, collaborative industry, academic, and government research.
MAKE+
MAKE+ is a group of multidisciplinary research staff focused on product and process development, evaluation, applied research projects, and education. The MAKE+ sub group PART (Product and Process Applied Research Team), is the only academic product development group in Canada registered to ISO 9001 and 13485 Quality Management Systems.
NRG
The Natural Health and Food Products Applied Research Team addresses issues of product quality, process improvement and human health using basic and applied science along with state of the art technology. With an emphasis on product sources and quality standards, our projects focus on health policy, regulatory affairs, product formulation, botanical authentication, analytical method development & validation, chemometrics, and therapeutic monitoring for preclinical and clinical studies.
Full profile
Full profile
Contact information
Company description
Product / Service / Licensing
The test bench imparts torsional and bending stresses to the sample repeatedly for a specified duration for accelerated life cycle evaluation. The results are accurate measurement data that Rayne can use to test, verify and validate their designs and materials performance.
Product formulation, commercial scale-up and technology transfer to industry
Development and validation of analytical methods for product characterization and quality control
Product license applications and product formulation patents
Regulatory issues involving SOPs, GMPs, product specifications, product claims, and standards of evidence
HACCP plan design and implementation
Chart a "path from lab to field" for cost-effective technologies and solutions for Canada's evolving Smart Electricity Grid.
Provide opportunities for electrical utility companies, technology providers and researchers to work together to develop architectures, protocols, configurations and models of the evolving Smart Grid.
Enable Canadian researchers to develop and validate technologies required to meet Canadas priorities for co-generation, efficient transmission and distribution of electricity, load control, demand response, advanced metering and integration of clean energy sources into the existing and future grids.
Biotech faculty can design and perform several cell-based assays to identify compounds that have the potential to intervene in the inflammatory processes that have been linked to the development of a number of human illnesses, such as cardiovascular disease, type 2 diabetes and cancer.
AJ00-General Science and Technology
AZ00-Other Research and Development
Market profile
Industry sector market interests:
- Agriculture
- Construction
- Consumer Products
- Culture
- Environment
- Fishery
- Forestry
- Information Technology and Telecommunications
- Manufacturing
- Medical/Biotechnology/Chemical
- Mining/Petroleum/Gas
- Service Industry
- Tourism
- Transportation
- Wholesale/Retail
Third-Party Information Liability Disclaimer
Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.
Contacts
Contact information
Description
Company description
Products, services and licensing
Product / Service / Licensing
The test bench imparts torsional and bending stresses to the sample repeatedly for a specified duration for accelerated life cycle evaluation. The results are accurate measurement data that Rayne can use to test, verify and validate their designs and materials performance.
Product formulation, commercial scale-up and technology transfer to industry
Development and validation of analytical methods for product characterization and quality control
Product license applications and product formulation patents
Regulatory issues involving SOPs, GMPs, product specifications, product claims, and standards of evidence
HACCP plan design and implementation
Chart a "path from lab to field" for cost-effective technologies and solutions for Canada's evolving Smart Electricity Grid.
Provide opportunities for electrical utility companies, technology providers and researchers to work together to develop architectures, protocols, configurations and models of the evolving Smart Grid.
Enable Canadian researchers to develop and validate technologies required to meet Canadas priorities for co-generation, efficient transmission and distribution of electricity, load control, demand response, advanced metering and integration of clean energy sources into the existing and future grids.
Biotech faculty can design and perform several cell-based assays to identify compounds that have the potential to intervene in the inflammatory processes that have been linked to the development of a number of human illnesses, such as cardiovascular disease, type 2 diabetes and cancer.
AJ00-General Science and Technology
AZ00-Other Research and Development
Market
Market profile
Industry sector market interests:
- Agriculture
- Construction
- Consumer Products
- Culture
- Environment
- Fishery
- Forestry
- Information Technology and Telecommunications
- Manufacturing
- Medical/Biotechnology/Chemical
- Mining/Petroleum/Gas
- Service Industry
- Tourism
- Transportation
- Wholesale/Retail


AVG NETA
NAME (BJP)
Age :
62
Sex :
M
Income :
Rs 23 crore
Criminal Record :
42
Education :
10th
Total Assests :
Rs 7,17,000
Liability :
Rs 35,000
PAN ? :
No
AAM AADMI
NAME (BJP)
Age :
62
Sex :
M
Income :
Rs 23 crore
Criminal Record :
42
Education :
10th
Total Assests :
Rs 7,17,000
Liability :
Rs 35,000
PAN ? :
No


Pharmacy sales - NHS prescription prepayment
Registration confirmation
Thank you for registering to sell NHS prescription prepayments.
We will write to you in the next 7 days about your application.
You will not be able to use the online service until we give you a password.
Finished


Currency Convertor
Conversion to Words 🔴
Unit Convertor
Improper to Mixed Fraction
Percentage and Ratio Converter
SPI/CGPA Convertor
Ascending/Descending 🔴
Date
Roman/Arabic Numerals 🔴