Dashboard
NB Model Info
M-R Control
MapReduce Job Control
Input Set
Upload Input File To HDFS
Renew Model
Upload New Model
Testing
Testing NB - Classifier
Classifying
Predict New Case
Error Rate
Error Rate From Training


GStreamer-0.10.36
Installation of GStreamer
Install GStreamer by running the
following commands:
sed -i -e '/YYLEX_PARAM/d' \
-e '/parse-param.*scanner/i %lex-param { void *scanner }' \
gst/parse/grammar.y &&
./configure --prefix=/usr \
--disable-static &&
make
To test the results, issue: make
check. There are many other Makefile
targets you can specify for running the
tests, issue make -C tests/check
help to see the complete list.
Now, as the root
user:
make install &&
install -v -m755 -d /usr/share/doc/gstreamer-0.10/design &&
install -v -m644 docs/design/*.txt \
/usr/share/doc/gstreamer-0.10/design &&
if [ -d /usr/share/doc/gstreamer-0.10/faq/html ]; then
chown -v -R root:root \
/usr/share/doc/gstreamer-0.10/*/html
fi
Testing the Installation
To test the functionality of the GStreamer installation, you can run a simple
test as an unprivileged user (you may have to run ldconfig as the root
user before attempting the test).
gst-launch -v fakesrc num_buffers=5 ! fakesink
If the command outputs a series of messages from fakesrc and
fakesink, everything is okay.
Command Explanations
sed ...
gst/parse/grammar.y: This command corrects a
problem caused by the most recent version of Bison.
--disable-static
: This
switch prevents installation of static versions of the libraries.
--enable-gtk-doc
: Use this parameter if
GTK-Doc is installed and you wish
to rebuild and install the API documentation.
--enable-docbook
: This parameter is
used to build HTML, PDF and PostScript versions of the GStreamer User's Manual, FAQ and Writer's
Guide. Note that you must have all the listed dependencies
installed.
chown -v -R root:root
...: The documentation is installed with the
ownership of the user who untarred and built the package. This
command changes the ownership of the installed documentation files
to root:root, and is only executed if the documentation files were
built and installed.
--libexecdir=/usr/lib
: This option puts
the internal support programs into /usr/lib/gstreamer-0.10
instead of /usr/libexec/gstreamer-0.10.
in accordance with
the old version of the FHS used before LFS-7.5.
Contents
Installed Programs:
gst-feedback, gst-feedback-0.10,
gst-inspect, gst-inspect-0.10, gst-launch, gst-launch-0.10,
gst-typefind, gst-typefind-0.10, gst-xmlinspect,
gst-xmlinspect-0.10, gst-xmllaunch and
gst-xmllaunch-0.10
Installed Libraries:
libgstbase-0.10.so, libgstcheck-0.10.so,
libgstcontroller-0.10.so, libgstdataprotocol-0.10.so,
libgstnet-0.10.so and libgstreamer-0.10.so
Installed Directories:
/usr/include/gstreamer-0.10,
/usr/lib/gstreamer-0.10, /usr/libexec/gstreamer-0.10,
/usr/share/gtk-doc/html/gstreamer-0.10,
/usr/share/gtk-doc/html/gstreamer-libs-0.10 and
/usr/share/gtk-doc/html/gstreamer-plugins-0.10
Short Descriptions
|
gst-feedback-0.10
|
generates debug info for GStreamer bug reports.
|
|
gst-inspect-0.10
|
prints information about a GStreamer plugin or element.
|
|
gst-launch-0.10
|
is a tool that builds and runs basic GStreamer pipelines.
|
|
gst-typefind-0.10
|
uses the GStreamer type
finding system to determine the relevant GStreamer plugin to parse or decode
a file, and determine the corresponding MIME type.
|
|
gst-xmlinspect-0.10
|
prints information about a GStreamer plugin or element in XML
document format.
|
|
gst-xmllaunch-0.10
|
is used to build and run a basic GStreamer pipeline, loading it from
an XML description.
|
Last updated on 2014-09-13 17:48:40 -0700


ORIGINAL ARTICLES
Prevalence of voice alteration among educators and its relationship with self-perception
Marcia SimõesI; Maria do Rosário Dias de Oliveira LatorreII
ICurso
de Fonoaudiologia. Faculdade de Medicina. Universidade de São Paulo (USP).
São Paulo, SP, Brasil
IIDepartamento
de Epidemiologia. Faculdade de Saúde Pública. USP. São
Paulo, SP, Brasil
ABSTRACT
OBJECTIVE:
To verify the prevalence of self-reported voice alteration among educators in
crèches, and associated factors.
METHODS: This was a cross-sectional observational study carried out in
2000, in eight crèches in the city of São Paulo at which actions
within the Crèche Program were being developed. This program formed part
of the health promotion activities of a speech therapy investigation laboratory.
The data collection was done by means of a questionnaire that was filled out
by 93 educators, with questions on sociodemographic characteristics, aspects
of the organization and physical environment of the work, habitual voice utilization,
history of illnesses, lifestyle and perceptions regarding voice alterations.
Assessment of hearing perception was done on the participants' voices. The statistical
analysis utilized proportions, central trend measurements, Chi-square test with
Yates correction and multiple logistic regression analysis.
RESULTS: Eighty percent of the educators reported that they had voice
alterations, although only 26% had sought treatment. A large proportion (39%)
reported that they had had their problem for four years or more, that it was
intermittent (82%) and that they had it to a slight or moderate degree (74%).
They believed that the main cause of voice alteration was their use of their
voices (82%), and their principal symptom was hoarseness (54%). Self-reported
voice alteration was statistically associated with presence of voice alteration
observed during assessment and with having had some guidance on voice usage.
CONCLUSIONS: Adequate perception among educators regarding their voice
problems could become an important tool for future work among this population
with a view to diminishing the high prevalence of voice alteration encountered.
Keywords: Child day care centers, manpower. Voice disorders, epidemiology. Risk factors. Socioeconomic factors. Working conditions. Occupational health.
INTRODUCTION
Studies have identified greater presence of dysphonia among teachers than among other professionals. This has also been observed in studies on professional categories attended at voice rehabilitation services.10,12
In the United States, teachers present a mean of twice the number of negative vocal symptoms and physical discomfort as presented by professionals with less demand on their voices.10 In Brazil, teachers who took part in a large study in the State of São Paulo reported a mean of two negative vocal symptoms.4 There is no consensus in the literature regarding the majority of factors associated with the presence of voice alterations.9
Many teachers take sick leave because of voice problems and tend not to seek treatment that might directly resolve the problem. When teachers present voice alterations, this may compromise teaching-learning relationships, since comprehension of the message may be made difficult.1 Voice problems add to other problems that teachers experience, thereby increasing their difficulties in managing their work, health and lives. Environmental factors and factors relating to organizing the workplace have been little studied in relation to teachers' voices.14
It is important that these professionals should be capable of identifying the presence of alterations in their voices. Through this, the chance that they would seek specific treatment would be increased and the development of inadequate adjustments when speaking despite such alterations (a very common situation) would be impeded. The negative adjustments include speaking very loudly and forcefully in noisy environments, using an upper respiratory voice pattern or an inadequate resonance focus, among others. These may lead to overload in the vocal system, thus facilitating the appearance of voice alterations. Early diagnosis would lead to lower impact from the voice alterations over the medium to long term, and would reduce the length of treatment.
National and international studied carried out to investigate the prevalence of self-reported voice alteration have found between 20% and 75% among elementary school, high school and university-level teachers.4,7,10-12
Educators of children who attended crèches perform teaching activities, but there are no Brazilian studies on voice alterations among this group. Therefore, the objective of the present work was to investigate the prevalence of voice alterations among crèche educators and their relationship with self-reported voice alterations.
METHODS
A cross-sectional observational study was carried out in 2000 in eight crèches in the city of São Paulo, in which actions within the Crèche Program were being developed. This Program forms part of a speech therapy investigation laboratory for health promotion. Since 1985, this Program has been directing its actions towards work with educators, children and families in the fields of language, hearing, oral myofunctional system, speech, fluency and voice. Among the eight crèches participating in this study, one was administrated and supervised by the municipal authority of São Paulo (PMSP), four were run under arrangement with PMSP and three were supervised by the social assistance coordination office of the Universidade de São Paulo (Coseas/USP). The age range of the children attended in these crèches was from zero to six years.
All the 108 educators at these eight crèches were invited to participate in the research. Fourteen were unable to take up the invitation because of lack of available time outside of working hours. Among the 94 (87%) who were able to participate, it was decided to exclude one subject, because this was the only man in the group. Thus, 93 educators (all women) took part in the study, corresponding to 86.1% of the total initial population.
The educators received explanations about the research and guidance regarding filling out a questionnaire. This instrument was devised using questions relating to sociodemographic characteristics, aspects of the work and the organization of the work, voice use pattern, history of diseases, lifestyle and perception regarding voice alterations. Its objective was to assist in studies involving teachers' voices,* and a validation process for it is underway.
The questionnaire was returned three days later, and the educators underwent individual voice assessment at this time.3 This assessment was conducted in the crèche itself, in a room that was away from the main activities and therefore more quiet. It was performed by a single speech therapist with experience in the field of voice, who is an author of this paper (MS). Among the various voice parameters evaluated, voice quality was selected as best representing the combination of voice characteristics. Through this, the educators' voices were classified as adequate or altered.
The dependent variable was the presence of voice alteration and the independent variables were the characteristics evaluated in the questionnaire. The Chi-square test with Yates correction was used for investigating associations. Multiple logistic regression analysis was performed using the variables that presented statistical significance in the association test. Odds ratios (OR) were used as the measurement for estimated risk and the Hosmer-Lemeshow test was used to investigate the fit of the multiple logistic regression model. For all the analyses, the significance level utilized was 5%.
This research was granted approval by the Research Ethics Committee of the Faculdade de Saúde Pública of Universidade de São Paulo, and all participants signed a statement of free and informed consent.
RESULTS
The educators' ages ranged from 19 to 56 years, with a mean of 31 years. Their mean length of time in the profession was 6.5 years, and 37% had worked in this profession for nine years or more. They had a high level of education: 49.4% of the educators had completed high school and 36.6% had completed university-level education. The majority of them (97.8%) only worked in one crèche. Around 44% said they made frequent use of their voices in other activities outside of their work, and the main ones among these were in taking care of children (20.4%) and singing in church (17.2%).
Voice alterations were self-reported by 74 educators (79.6%), and 36 of them (48.7%) considered that this alteration was present at the time of the study. Nineteen of the educators (25.7%) had sought treatment, while 20.5% used medications and only 9.5% had sought speech therapy care.
For these professionals, the main causes of voice alteration (more than one cause could be mentioned) were: use of the voice (82.4%), speaking in noisy environments (37.8%) and/or stress (33.8%). Causes related to history of diseases (allergy, infections of the upper airways and colds) appeared less frequently.
Most of the educators believed that their voice problems were intermittent (82.4%). The problems had been present for more than six months (93.2%), and the most frequently reported duration of alteration was four years or more (39.2%). Many of the educators (74.3%) believed that their voice alterations were of slight or moderate degree. Better voice in the morning was cited by 32 educators (43.2%), worse voice in the morning by 30 (40.5%), voice unchanged over the course of the day by 10 (13.5%) and voice varying over the course of the day by two (2.8%). Twenty-two educators (29.7%) had been absent from work because of voice alteration, and the length of this absence ranged from a few hours to five days.
The main negative vocal symptoms cited were: hoarseness (54.1%), tiredness of the voice (51.4%), pitch variation (25.7%) and/or loss of the voice (18.9%). The main negative sensory symptoms were: dryness in the throat (58.1%), throat clearing (48.6%), pain when speaking (29.7%) and/or burning sensation (25.7%). The auditory-perceptive evaluation of the voice identified 79.6% of the 93 professionals with alterations in the quality of their voices. It needs to be clarified that this percentage does not correspond exactly to the educators who reported voice alterations, even though the percentages found were the same.
From the prevalence of voice alterations, the relationship between the educators' self-reported voice alterations and the presence of voice alterations detected by the speech therapy evaluation could be studied. A statistically significant association was found (p=0.0032) and it was seen that, among the educators who reported such alterations, 86.5% really presented them (positive predictive valor), and among those who said they did not have such alterations, 47.4% did not present them in the speech therapy evaluation (negative predictive value). The sensitivity of the instrument utilized was 87% and the specificity was 47%. There was also a statistically significant association between self-reported voice alteration and having received guidance regarding appropriate use of the voice (p=0.0340).
From the multiple logistic regression analysis (Table), self-reported voice alteration was shown to be an independent factor associated with the presence of voice alteration (OR=4.5). The other characteristic selected for the model was the presence of dust, because this also presented an association with voice alteration.
DISCUSSION
The present study was the first in Brazil to analyze the presence of self-reported voice alteration among educators in crèches. Similar studies among teachers working at other teaching levels are more common.9
A high prevalence of voice alterations was observed among the participating educators, and this result is similar to what was found in two literature reviews in voice alterations among teachers working at different teaching levels.5,9 This indicates the need for actions among this population with a view to preparing educators for professional use of their voices, in seeking to diminish the occurrence of problems of this nature among these professionals.
An association was verified between self-reported voice alteration and voice alterations observed in the speech therapy evaluation, thus indicating that the educators in this study were aware of their voice problems. These data were not registered in other studies.2,6,9 The present results indicate the possibility of other approaches towards this population, in which for example an initial screening could be done by the educators themselves. In the light of the sensitivity of 87% and specificity of 47% that were seen, this approach becomes valid, as was seen in an Australian study.8 In the present study, it was not possible to study the relationship between voice symptoms and voice alterations, since the symptoms were only reported by the educators who self-reported voice alterations on the questionnaire.
The educators studied had frequent opportunities to talk to speech therapists about their doubts relating to voice use. This probably kept them a little more alert to this problem, although it was noticed that the educators sought out the speech therapists to clarify more doubts relating to their work with the children than in relation to concerns for their own health. In other studies, no significant association was found between self-reported voice alterations and the presence of voice alterations detected by speech therapists, but it was observed that many teachers perceived their alterations.2,6
Despite the high percentage of educators who reported the presence of voice alterations, it was seen in the present study that few sought treatment, and this finding is similar to what was seen in other studies.9,12,13 It is believed that this resulted from chronically living with the problem, which led the educators to adapt to the situation by means of negative voice adjustments while using their voices professionally, such as speaking loudly and forcefully. This has also been observed in other studies.9,12 Moreover, it was observed that most of the educators reported intermittent voice alterations, as was also seen in an American study.12 This may have made them believe that their voices would always get better naturally, thereby dispensing with any specific assistance. They may not have perceived whether their voices came back worse after each episode, considering that the fundamental factor seemed to be "to have a voice" and not necessarily "to have a good voice". This hypothesis can be reinforced by the observation that most of the participant classified their voice alterations as slight or moderate, i.e. despite the voice alteration, they continued to use their voices in their work, even if the quality of their voices was worse. The altered voice may become the teacher's habitual voice, with the result that the teacher ceases to be concerned about this. Furthermore, there seems to be a belief among teachers that voice problems are inherent to their profession, which may also devalue the possible signs and symptoms.13
The fact that the main way in which treatment was sought was through the use of medications suggests a possible association with self-medication and its risks, although the present study did not investigate whether indications for these medications had been given in previous medical consultations. If the practice of self-medication were to be proven, it must be discouraged and such individuals should be encouraged to seek out specialized services.
Considering that the mean length of time in the profession was 6.5 years and the length of time with voice alterations that was most frequently self-reported was four years or more, it was seen that voice alterations were starting relatively early among these educators. This reinforces the idea that the risk factors have a rapid negative impact on the voice when used without preparation.
The data relating to the causes of the voice alterations cited by the educators were similar to what was found in other studies, considering that poor use of the voice is mentioned in the literature as the principal factor responsible for dysphonia among professional users of the voice.9
Around half of the educators with self-reported voice alterations said that their voices were better in the morning and worsened over the course of the day, while the other half said their voices were worse in the morning and improved during the day. Another study13 found similar data and it is believed that this points towards two different groups with regard to voice alterations: one with voice fatigue after prolonged, excessive or inappropriate use, and the other with a possible condition of hypofunctioning of the vocal folds or with laryngeal alterations present that have the result that the alteration in voice quality does not disappear, even after resting the voice.
The voice symptoms reported by the educators in this study were similar to those found in other studies: dry throat, hoarseness, tiredness of the voice, throat clearing and pain when speaking.9,13 These symptoms are directly related to conditions of excessive or inappropriate use of the voice, and also point out the presence of dust and/or noise in the environment and little hydration during the professional use of the voice.
The absences from work caused by the presence of voice alterations that were seen in the present study were similar to those in other studies conducted outside of Brazil.10,11,13 This is a worrying situation, since such absences were of the order of 30%. The mean number of days off work or absent appears to be sufficient time for the voice to return to the minimum condition for working, but probably without full recovery, which may make it easier for new alterations to emerge.1
In the present study, an association was seen between the presence of self-reported voice alterations and having received guidance for appropriate use of the voice. The statistical significance of this association reinforces the importance of receiving guidance on the appropriate use of the voice. The data suggest that such guidance improved the educators' perception of their voice alterations, although not affecting the occurrence of vocal alteration. It would be important to analyze the content and form of such guidance, to make it effective in diminishing the prevalence of voice alteration among these educators. This guidance should encourage the seeking of treatment, thereby avoiding the gradual onset of negative voice adjustments and accommodation to such patterns among these professionals. It is necessary to involve all the professionals in the institution, and particularly those who are in positions of leadership, since it is not just individual changes regarding voice use that are needed. General modifications relating to all the unfavorable characteristics are also indispensable, and these may include from the routine of daily activities to the physical environment of the crèche itself.
Apart from the benefits educators get from detecting their own voice alterations, such detection is important as a tool for actions to be carried out among larger population groups. These actions must be put into effect in the most rapid and least costly manner for institutions and for the professionals who require them and might benefit from intervention work. Early detection of voice alteration may diminish the amount of time off work, with or without a doctor's note, and the readaptation due to this voice problem. Teachers without voice problems have more choices of work, a factor that must be taken into consideration nowadays. Absence of voice alterations among educators forms part of the appropriate conditions for teaching children.1
Through better perception of their voices, teachers may be able to be more active in disseminating this knowledge among other professionals with whom they have contact, which could change the position that voice problems are inherent to teaching.
In the present work, it was observed that the educators with self-reported voice alterations have a 4.5 times greater chance of really having voice alterations, and that this perception is associated with having received previous guidance on voice use. In this light, it is believed that it is of fundamental importance to invest in programs that would ensure such self-perception, thereby speeding up the development of actions and obtaining positive results among this population.
In conclusion, the present study found a high prevalence of self-reported voice alteration among educators in crèches, and this was directly associated with the presence of voice alterations detected by assessments. Having received guidance on appropriate use of the voice was also shown to be associated with the presence of self-reported voice alterations.
REFERENCES


Support for serial line debugging.
void cons_init(void)
Initialise console.
void cons_putc(uint8_t ch)
Write byte to console.
ch
[in]
void cons_puts(const char *s)
Write string to console.
s
[in]
void cons_puthex8(uint8_t h)
Write 2 digit padded hex to console.
h
[in]
void cons_puthex32(uint32_t h)
Write 8 digit padded hex to console.
h
[in]
void cons_puthex8(const uint8_t *p, uint8_t len)
Write an array of bytes to console as padded hex.
p
[in]
len
[in]
BOOLEAN cons_getch(uint8_t *ch)
Poll console for incoming byte.
ch
[out]
void cons_putdec(int32_t i)
Print signed 32 bit value in decimal.
i
[in]
void cons_putsln(const char *s)
Write string to console followed by newline.
s
[in]


To see the list of forums for your site, click
Forums
in your site's menubar.
Note: The Forums tool is pre-populated with a default forum and topic.
Each forum appears in an enclosed box with its title and short
description displayed (if created). If a full description of the forum
exists, click View Full Description
to view it.
Beneath the forum title, topics are listed by title and include a short description (if created). The following details also appear:
Clicking the title of any forum will open an isolated view of a particular forum and its topics.
Clicking the title of any topic will display a thread of messages for that particular topic. Use the arrows to the left of the messages to expand the threads as needed.
To expand all threads and messages, click Display Entire
Message
. To mark all of the messages as read, click Mark All
As Read
. To open a printable version of the messages, click the
printer icon at the top.
Clicking the title of the thread will open an isolated view of a
particular thread and its individual messages. Each individual
thread appears in an enclosed box with a count of total messages and
unread messages below. Use the View
drop-down list to change the display of messages.
Those with appropriate permissions (e.g., instructors) may see the content of all posts by a particular participant using the statistics function; see Participation statistics.
To open an individual message, click its subject.
In moderated forums, to see messages awaiting your approval, click
Pending Messages
; see Moderating messages in a forum.


Chapter 7 Reference Systems
“Data are not just numbers, they are numbers with a context”; “In data analysis, context provides meaning” (Cobb and Moore 1997)
7.1 Units of measurement
7.1.1 Quantities
The VIM (International vocabulary of metrology, BIPM et al. (2012)) defines a quantity as a “property of a phenomenon, body, or substance, where the property has a magnitude that can be expressed as a number and a reference”, where “[a] reference can be a measurement unit, a measurement procedure, a reference material, or a combination of such.”
One could argue whether all data is constituted of quantities, but there is no need to argue that proper data handling requires that numbers are accompanied by information on what the numbers mean, and what they are about.
A measurement system consist of base units for base quantities, and derived units for derived quantities. The SI system of units (Bureau International des Poids et Mesures 2006) consist of the seven base units length (metre, m), mass (kilogram, kg), time (second, s), electric current (ampere, A), thermodynamic temperature (kelvin, K), amount of substance (mole, mol), and luminous intensity (candela, cd). Derived units are composed of products of integer powers of base units; exampes are speed (\(\mbox{m}~\mbox{s}^{-1}\)) and density (\(\mbox{kg}~\mbox{m}^{-3}\)).
Many data variables have units that are not expressed as SI base units or derived units. Hand (2004) discusses many such measurement scales, e.g. those used to measure intelligence in social sciences, in the context of measurement units.
7.1.2 Unitless measures
The special case of unitless units can refer to either cases where units cancelled out (e.g. mass fraction: kg/kg, or angle measured in rad: m/m) or to cases where objects or events were counted (e.g. 5 apples). Adding an angle to a count of apples would not make sense; adding 5 apples to 3 oranges may make sense if the result is reinterpreted, e.g. as pieces of fruit. Flater (2018) discusses systems for proper handling of unitless quantities; handling counts could for instance link to domain-specific ontologies pointing out which things were counted, and perhaps identifying super-classes, like fruit.
7.1.3 Units in R
The units
R package (E. Pebesma, Mailund, and Hiebert 2016b) provides units of measurement support for R, by interfacing the udunits2 units database and C library. It allows for setting, converting and deriving units:
library(units)
(a = set_units(1:3, m))
#> Units: [m]
#> [1] 1 2 3
a_km = set_units(1:3, km)
a + a_km
#> Units: [m]
#> [1] 1001 2002 3003
b = set_units(4:6, s)
a / b
#> Units: [m/s]
#> [1] 0.25 0.40 0.50
and raises errors in case of meaningless operations
a + b
#> Error: cannot convert s into m
7.1.4 Datum
For many quantities, the natural origin of values is zero. This works for amounts, and differences between amounts results in meaningful negative values. For locations and times, differences have a natural zero interpretation: length and duration. Absolute location (position) and time need a fixed origin, from which we can meaningfully measure other absolute space-time points: a datum. For space, a datum involves more than one dimension. The combination of a datum and a measurement unit (scale) is a a reference system. The next two sections will deal with temporal and spatial reference systems, and how they are handled in R.
7.2 Temporal Reference Systems
R has two native classes for time-related data: POSIXt
and Date
, which are used for specifying dates, and times.
7.2.1 Date
Date
objects are numeric vectors of class Date
, which contain the number of days since (or in case negative: before) Jan 1, 1970:
(d = as.Date("1970-02-01"))
#> [1] "1970-02-01"
as.numeric(d)
#> [1] 31
We see that the print
method as well as the as.Date
method use ISO 8601 (ISO8601 2000) character strings, which is standard used to read and write dates. We can also modify this to local conventions by specifying a format
:
(d = as.Date("01.02.1970", format = "%d.%m.%Y"))
#> [1] "1970-02-01"
format(d, format = "%d.%m.%Y")
#> [1] "01.02.1970"
The default for format
may depend on the locale settings of the computer used. The help page of ?as.Date
contains further discussion of date systems, and calendars used.
7.2.2 POSIXt
POSIXt
is an R native class for specifying times. It has two subclasses: POSIXct
represents time as a numeric, representing decimal seconds since 1970-01-01 00:00 UTC, and POSIXlt
contains the same information as a list with all time components (second, minute, hour, day of month, month, year) in list components:
t = as.POSIXct("1970-01-01 01:00:00", tz = "UTC")
as.numeric(t)
#> [1] 3600
names(unclass(as.POSIXlt(t)))
#> [1] "sec" "min" "hour" "mday" "mon" "year" "wday" "yday" "isdst"
unclass(as.POSIXlt(t))$hour
#> [1] 1
7.2.3 Time zones
Time zones can be seen as local modifiers of time: where time as numeric value is stored with respect to UTC (universal coordinated time), a local time zone is used to format it, and a time zone can be specified for creation, and formatting:
(t = as.POSIXct("1970-01-01 00:00:00", tz = "PST"))
#> [1] "1970-01-01 PST"
this adds a time zone modifier to t
that redefines the time origin, as
as.numeric(t)
#> [1] 0
To convert POSIXt
to Date
we can use as.Date
; this converts to the local date. Converting back to POSIXct
looses the time of day and time zone information.
(t = as.POSIXct("1970-01-01 23:00:00", tz = "PST"))
#> [1] "1970-01-01 23:00:00 PST"
as.Date(t)
#> [1] "1970-01-01"
format(as.POSIXct(as.Date(t)), tz = "UTC")
#> [1] "1970-01-01"
Working with local time zones is sometimes confusing when the data we work with were not referenced to this time zone. It may help to set
Sys.setenv(TZ="UTC")
at the start of an R script. The effect is, at lease on some platforms, that R thinks it is working in a UTC time zone. This way, the scripts will produce identical outputs, no matter in which time zone it is run.
7.3 Coordinate Reference Systems
We follow Lott (2015) when defining the following concepts (italics indicate literal quoting):
- a coordinate system is a set of mathematical rules for specifying how coordinates are to be assigned to points
- a datum is a parameter or set of parameters that define the position of the origin, the scale, and the orientation of a coordinate system,
- a geodetic datum is a datum describing the relationship of a two- or three-dimensional coordinate system to the Earth, and
- a coordinate reference system is a coordinate system that is related to an object by a datum; for geodetic and vertical datums, the object will be the Earth.
A readable text that further explains these concepts is Iliffe and Lott (2008).
Essentially it boils down to the Earth not following a regular shape. The topography of the Earth is of course known to vary strongly, but also the surface formed by constant gravity at mean sea level, the geoid, is irregular. A commonly used model that is fit to the geoid is an ellipsoid of revolution, which is an ellipse with two identical minor axes. This model can be fit locally to be highly precise, can be fixed for particular tectonic plates (like ETRS89), or can be globally fit (like WGS84).
The definitions above state that coordinates in degrees longitude and latitude can only have a meaning, i.e. can only be understood as Earth coordinates when the datum they relate to is given.
Recomputing coordinates in a new datum is called coordinate transformation.
7.3.1 Projections
When we look at geographical data on a paper map or a screen, or on any flat device, we see the values projected – they are no longer arranged on an a sphere or ellipsoid. Even if we plot degrees longitude/latitude data on a flat x/y plane with unit aspect ratio, we use a projection, called plate carrée.
Note that even for projected data, the data that were projected are associated with a reference ellipsoid (datum). Going from one projection to the other without changing datum is called coordinate conversion, and usually passes through the geodetic coordinates of the datum involved; up to numerical errors this process is lossless and invertible.
7.3.2 Describing Coordinate Reference Systems
Lott (2015) describes a standard for encoding coordinate reference system using well known text; the standard is referred to as WKT2. GDAL and PROJ support this encoding (FIXME: verify this is true by the time this book goes into print).
Traditionally, PROJ used a string representation to encode coordinate reference systems (datums) and projections, called the proj4string. Some of these come from a catalogue (originally) compiled by the European Petroleum Survey Group (now: International Association of Oil & Gas Producers), and have a so-called epsg code.
Package sf
provides a crs
class which is initialised either by an epsg code, like
st_crs(4326)
#> Coordinate Reference System:
#> User input: EPSG:4326
#> wkt:
#> GEOGCRS["WGS 84",
#> DATUM["World Geodetic System 1984",
#> ELLIPSOID["WGS 84",6378137,298.257223563,
#> LENGTHUNIT["metre",1]]],
#> PRIMEM["Greenwich",0,
#> ANGLEUNIT["degree",0.0174532925199433]],
#> CS[ellipsoidal,2],
#> AXIS["geodetic latitude (Lat)",north,
#> ORDER[1],
#> ANGLEUNIT["degree",0.0174532925199433]],
#> AXIS["geodetic longitude (Lon)",east,
#> ORDER[2],
#> ANGLEUNIT["degree",0.0174532925199433]],
#> USAGE[
#> SCOPE["unknown"],
#> AREA["World"],
#> BBOX[-90,-180,90,180]],
#> ID["EPSG",4326]]
or by a PROJ string, like
st_crs("+proj=longlat")
#> Coordinate Reference System:
#> User input: +proj=longlat
#> wkt:
#> GEOGCRS["unknown",
#> DATUM["World Geodetic System 1984",
#> ELLIPSOID["WGS 84",6378137,298.257223563,
#> LENGTHUNIT["metre",1]],
#> ID["EPSG",6326]],
#> PRIMEM["Greenwich",0,
#> ANGLEUNIT["degree",0.0174532925199433],
#> ID["EPSG",8901]],
#> CS[ellipsoidal,2],
#> AXIS["longitude",east,
#> ORDER[1],
#> ANGLEUNIT["degree",0.0174532925199433,
#> ID["EPSG",9122]]],
#> AXIS["latitude",north,
#> ORDER[2],
#> ANGLEUNIT["degree",0.0174532925199433,
#> ID["EPSG",9122]]]]
and can be missing valued
st_crs()
#> Coordinate Reference System: NA
A number of methods are available for crs
objects:
methods(class = "crs")
#> [1] $ coerce format initialize is.na Ops
#> [7] print show slotsFromS3 st_as_text st_crs
#> see '?methods' for accessing help and source code
The Ops
methods are convenience functions, e.g.
st_crs(4326) == st_crs("+proj=longlat")
#> [1] FALSE
but there not all cases semantically identical crs
objects will yield equality in this test.
st_as_text
converts a crs
object into WKT, we print it using cat
:
cat(st_as_text(st_crs(4326), pretty = TRUE))
#> GEOGCS["WGS 84",
#> DATUM["WGS_1984",
#> SPHEROID["WGS 84",6378137,298.257223563]],
#> PRIMEM["Greenwich",0],
#> UNIT["degree",0.0174532925199433,
#> AUTHORITY["EPSG","9122"]],
#> AXIS["Latitude",NORTH],
#> AXIS["Longitude",EAST],
#> AUTHORITY["EPSG","4326"]]
It should be noted that at the time of writing this, a new draft standard for WKT (informally called WKT2, Lott (2015)) is rapidly being implemented in GDAL and PROJ, and can be expected in R once these changes appear in released versions.
st_crs
is also a generic, with methods for
methods(st_crs)
#> [1] st_crs.bbox* st_crs.character* st_crs.crs* st_crs.CRS*
#> [5] st_crs.default* st_crs.numeric* st_crs.Raster* st_crs.sf*
#> [9] st_crs.sfc* st_crs.Spatial* st_crs.stars*
#> see '?methods' for accessing help and source code
The method for sfc
objects can drill further into the underlying data, by adding an argument; a few of these are printed by
st_crs(st_sfc(crs = 4326), parameters = TRUE)[c(1:4, 8)]
#> $SemiMajor
#> 6378137 [m]
#>
#> $SemiMinor
#> 6356752 [m]
#>
#> $InvFlattening
#> [1] 298
#>
#> $IsGeographic
#> [1] TRUE
#>
#> $Wkt
#> [1] "GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AXIS[\"Latitude\",NORTH],AXIS[\"Longitude\",EAST],AUTHORITY[\"EPSG\",\"4326\"]]"
where we see that udunits and GDAL units are integrated. The major axis lengths (SemiMajor
) and inverse flattening are used e.g. to compute great circle distances on the ellipsoid, using the algorithm from Karney (2013). This algorithm is implemented in PROJ, and interfaced by lwgeom::st_geod_distance
, which is called from sf::st_distance
when objects have geodetic coordinates.
References
BIPM, IEC, ILAC IFCC, IUPAP IUPAC, and OIML ISO. 2012. “The International Vocabulary of Metrology–Basic and General Concepts and Associated Terms (Vim), 3rd Edn. Jcgm 200: 2012.” JCGM (Joint Committee for Guides in Metrology). https://www.bipm.org/en/publications/guides/.
Bureau International des Poids et Mesures. 2006. The International System of Units (SI), 8th Edition. Organisation Intergouvernementale de la Convention du Mètre. https://www.bipm.org/en/publications/si-brochure/download.html.
Cobb, George W., and David S. Moore. 1997. “Mathematics, Statistics and Teaching.” The American Mathematical Monthly 104 (9): 801–23. http://www.jstor.org/stable/2975286.
Flater, David. 2018. “Architecture for Software-Assisted Quantity Calculus.” Computer Standards & Interfaces 56: 144–47. doi:10.1016/j.csi.2017.10.002.
Hand, David J. 2004. Measurement: Theory and Practice. A Hodder Arnold Publication.
Iliffe, Jonathan, and Roger Lott. 2008. Datums and Map Projections for Remote Sensing, Gis, and Surveying. Whittles Pub. CRC Press, Scotland, UK.
ISO8601, ISO. 2000. “Data Elements and Interchange Formats–Information Interchange–Representation of Dates and Times.” ISO/Tc154.
Karney, Charles FF. 2013. “Algorithms for Geodesics.” Journal of Geodesy 87 (1). Springer: 43–55. https://link.springer.com/content/pdf/10.1007/s00190-012-0578-z.pdf.
Lott, Roger. 2015. “Geographic Information-Well-Known Text Representation of Coordinate Reference Systems.” Open Geospatial Consortium. http://docs.opengeospatial.org/is/12-063r5/12-063r5.html.
Pebesma, Edzer, Thomas Mailund, and James Hiebert. 2016b. “Measurement Units in R.” The R Journal 8 (2): 486–94. doi:10.32614/RJ-2016-061.


Bachelor of Computer Application
Software Orientation
Mahatma Gandhi University
2017 - 2019{% extends 'shared/_MainLayout.html' %} {% load static %} {% block content %}
Software Orientation
Mahatma Gandhi University
2017 - 2019Avodha
June 2021 - September 2021Soften Technologies
May 2019 - August 2019


MBMLLogicFunctions Class Reference
| Inherits from | NSObject |
|---|---|
| Declared in | MBMLLogicFunctions.h |
Overview
This class implements MBML logic functions.
These functions are exposed to the Mockingbird environment via
<Function ... />
declarations in the MBDataEnvironmentModule.xml
file.
For more information on MBML functions, see the MBMLFunction
class.
+ ifOperator:
Implements an if
operator usable within Mockingbird expressions.
+ (id)ifOperator:(NSArray *)params
Parameters
params |
an array containing the input parameters for the function |
|---|
Return Value
The result of the if
operator.
Discussion
This Mockingbird function accepts between one and three input expressions:
The first parameter is the conditional expression, a Mockingbird expression that will be evaluated in a boolean context. If only this parameter is provided and it evaluates to
true
, the result of evaluating the conditional expression in the object context will be returned, whilenil
is returned if the single parameter evaluates tofalse
.An optional true return value, which is returned by the function if the conditional evaluates to
true
.An optional false return value, which is returned if the conditional evaluates to
false
. If this parameter is omitted and the conditional evaluates tofalse
,nil
is returned.
Expression usage
Note: This function is exposed to the Mockingbird environment with a name that differs from that of its implementing method:
^if($year -LT 2015|Past|Present or future?)
The expression above would return the string “Past
” if the
conditional expression $year -LT 2015
evaluates to
true
; otherwise, the string “Present or future?
” is returned.
In the following expression:
^if($year -EQ 2015|This Year)
the string “This Year
” is returned if $year
equals 2015
; if $year
is any other value, nil
is returned.
Finally, assume $cartItems
refers to an array:
^if($cartItems.count)
if $cartItems.count
evaluates to true
in a boolean context (i.e.,
if $cartItems.count
is non-zero), the object value of $cartItems.count
is
returned. Otherwise, if $cartItems.count
is 0
, nil
is returned.
So, if $cartItems
contains 7
items, the expression ^if($cartItems.count)
would yield the result 7
. But if the array containeds no items, nil
would
be returned.
Declared In
MBMLLogicFunctions.h


Our Singapore headquarters boast a dedicated and highly skilled workforce, with over 100 years of combined experience in filter technology.
EVERYWATER has partnered with some of the world’s leading companies. If you would also like to invest in a better tomorrow for all, then we invite you to get in touch with us.


In web serivces or online games, there are often automated programs so that the computers can do the work instead of humans.
This happens without the intention of the developer, so there are regulations placed or even tests that asks whether you are a robot or a human. For example, CAPTCHA is one of them.
In order to really determine whether the user is a robot or a human, the problems need to be something that is hard for robots to solve but easy for humans. If this is not done well, it could produce the opposite effect which is what would want the least.
Louis, after creating the most recent blog, he wants to develop a program that detects spam bots so that they won't leave useless comments on his blog. The system Louis wants to develop is that given an image with two circles, whether they are able to accurately click on the two circles. The images will always be the size of 100 pixel by 100 pixel, and the two black circles in the image will not be overlapped. For example, the following image is an example.
However, thinking a little more about this, this problem isn't so hard for robots to solve.
Angered by the poor detective system Louis created, Marie decided to create a robot program that will accurately detect two circles in the image. If this program could detect the two circles' centers and radii, then Louis would be so embarrassed.
So, let us help Marie develop such program.
In 100 lines, each line has 100 characters and each character being either 0 or 1. 0 or 1 represents the pixel's color. 1 is black, and 0 is white.
The image contains two full circles that have radii greater than or equal to 15 with no overlap. The center and the radius of the circle is always an integer.
The algorithm mentioned below is not required in solving this problem, but if interested, take a look at "Algorithm to color the circle".
Output the first circle and second circle's x-coordinate and y-coordinate for the center and the radius of each circle in respective order. All results should be integers and the radius must be greater than or equal to 15.
The pixel grid is represented as the following:
- The top left is (0, 0), the top right is (99, 0), bottom left is (0, 99), and the bottom right is (99, 99).
It doesn't matter which circle's information you output first.
This is just for reference, so if you aren't interested, you do not have to read.
In order to draw a circle with center (p, q) and radius r, we use an algorithm called Midpoint circle algorithm.
- Into the midpoint circle algorithm, plug in x = r, y = 0, and err = 0.
- For the case that x is greater than or equal to y, we repeat the following:
-> Color all pixels from (p - x, q - y) to (p + x, q - y).
-> Color all pixels from (p - x, q + y) to (p + x, q + y).
-> Color all pixels from (p - y, q - x) to (p + y, q - x).
-> Color all pixels from (p - y, q + x) to (p + y, q + x).
-> Increment y by 1.
-> Increase err by 1 + 2 * y.
-> If 2 * (err - x) + 1 is greater than 0,
--> Decrement x by 1.
--> Increase err by 1 - 2 * x.
These are some example images the input will receive.
Marks will be awarded according to the number of hidden test cases the program passes.
Load widget


Image Classifier
Status:
Loading...
This tool was created with
p5.js
and
ml5js
. The model used is
MobileNet
.


App Features
Gantt Task View
Get a quick and easy overview of your team's tasks and critical path
Calendar Task View
See your team's tasks in a calendar view
Create Meetings
Easily create and invite your team to video calls
Level up and maintain your team streak
Encourage teamwork through gamified task management
Connect to Github
Improve your workflow by connecting to Github easily
Create rewards for your team to redeem
Motivate your team through redeemable rewards
Boost productivity and manage your team - without leaving your home
With the recent COVID pandemic, working from home has become the new norm. Don't let your home office distract you! Power your projects using ProjectQuest
- Track team projects easily with our calendar view
- Gantt chart view allows you to manage critical paths
- Level your character up and defeat the scary deadline monster!
- Motivate your team with awesome treats
Pricing
Three different plans. Three different ways to power your projects.
Free
$0per month
- Single Team
- 10 meetings
- Gantt/Calendar Task View
- Unlimited rewards
- Unlimited Github Connection
Pro
$29per month
- 5 Teams
- 30 meetings
- Gantt/Calendar Task View
- Unlimited rewards
- Unlimited Github Connection
Enterprise
$49per month
- Unlimited Team
- Unlimited meetings
- Gantt/Calendar Task View
- Unlimited rewards
- Unlimited Github Connection
Contact
Have any burning questions? Let us know!
Address
81 Victoria St,
Singapore 188065
Call Us
+1 5589 55488 55
+1 5589 22548 64
Email Us
<EMAIL_ADDRESS>Working Hours
Mon - Fri: 9AM to 5PM
Sunday: 9AM to 1PM


#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
=====================
The Xi(Ξ) Term Module
=====================
:copyright: Copyright 2016 Roger Bishop Jones
:license: BSD 2-Clause Licence, see LICENCE for details.
I did consider making this into a class, but I couldn't figure
out what the benefit would be, so for the time being its just
a module defining various functions for making taking apart and
otherwise processing terms.
The terms are represented by triples.
The first element is a number which tells you whether the term
a variable, an abstraction or an application.
In a variable the second element of the tuple is its name and the
third is zero
In an abstraction the second element is the name of the variable
being bound and the third is the body of the abstraction (a term).
In an application the second and third elements of the tuple are
the function and the argument (both terms).
"""
[docs]def MkVar (name:str):
""" construct a term which is a variable
>>> MkVar("Ξ")
(0, 'Ξ', 0)
"""
return (0, name, 0)
[docs]def MkAbs (v:str, b):
""" constructs a term which is an abstraction
>>> MkAbs("∀", MkVar("Ξ"))
(1, '∀', (0, 'Ξ', 0))
"""
return (1, v, b)
[docs]def MkApp (f, a):
""" constructs a term which is an application
>>> MkApp(MkVar("∀"), MkVar("Ξ"))
(2, (0, '∀', 0), (0, 'Ξ', 0))
"""
return(2, f, a)
[docs]def IsVar (t):
""" tests whether a term is a variable
>>> IsVar(MkApp(MkVar("∀"), MkVar("Ξ")))
False
>>> IsVar(MkVar("Ξ"))
True
"""
return t[0] == 0
[docs]def IsAbs (t):
""" tests whether a term is an abstraction
>>> IsAbs(MkAbs("∀", MkVar("Ξ")))
True
>>> IsAbs(MkVar("Ξ"))
False
"""
return t[0] == 1
[docs]def IsApp (t):
""" tests whether a term is an application
>>> IsApp(MkApp(MkVar("∀"), MkVar("Ξ")))
True
>>> IsApp(MkVar("Ξ"))
False
"""
return t[0] == 2
[docs]def DestTerm (t):
""" disassembles a term, returning a 3-tuple in which the first element
is 0, 1 or 2 according as the term is a variable,
abstraction or application, and the next one or two elements are
the immediate constituents.
>>> DestTerm(MkApp(MkVar("∀"), MkVar("Ξ")))
(2, (0, '\u2200', 0), (0, '\u039e', 0))
>>> DestTerm(MkVar("Ξ"))
(0, '\u039e', 0)
"""
return t
[docs]def Frees (t):
""" returns the set of free variables of a term
>>> Frees(MkApp(MkVar("∀"), MkVar("Ξ")))
{'Ξ', '∀'}
>>> Frees(MkVar("Ξ"))
{'Ξ'}
>>> Frees(MkAbs("∀", MkVar("Ξ")))
{'Ξ'}
>>> Frees(MkAbs("Ξ", MkVar("Ξ")))
set()
"""
k = t[0]
if k == 0: return set(t[1])
elif k == 1: return Frees(t[2]) - set(t[1])
elif k == 2: return Frees(t[1]) | Frees(t[2])
if __name__ == '__main__':
import doctest
doctest.testmod()


--- layout: post title: Porteus tagline: " be free anywhere" permalink: /porteus/load-to-ram-config.html categories: [Porteus, DevEnv] tags: [live USB, load to RAM, configuration] ---
As you might expect there are few considerable incentives to use
Porteus
as your DevEnv
:
Linux
;Of course it is not a silver bullet, but sometimes it is useful to utilize its peculiar advantages.
This article might shed a light on a much attractive Porteus'
feature: its capability to load into RAM of your PC when all data
on your HDD stay detached. It might be defined as completely
non-intrusive installation of UNIX OS.
There is an abundance of similar by main features live-USB Linux distributions, but the Load to RAM is a killer one:
As an opposite experience I have had Ubuntu
USB-stick which was
similar by functionality and it was completely ruined after ~70
PC's boot-ing. Seems like incremental changes writing demolished
it. And in addition it is unavoidable there.
Suppose it is enough to ensure you to make your own Porteus
live-USB and take a challenge of total portability.
root
terminal sessionPorteus
Porteus
saves incremental changes in .xzm
format.
# save-changes /mnt/sdc1/porteus/optional/extension_001.xzm
Where /mnt/sdc1/porteus/optional/
is a path to your Porteus
Live-USB, and extension_001.xzm
is a filename itself.
# nano /mnt/sdc1/boot/syslinux/porteus.cfg
Try to configure <CapsLock> as an additional <Ctrl>:
/usr/bin/setxkbmap -option "ctrl:nocaps" /usr/bin/setxkbmap -option "caps:ctrl_modifier"


How to delete module content from modules that allow users to add multiple records. This tutorial demonstrated one of the typical ways that module content can be deleted, however many modules handle content differently. For full details on deleting content for individual module types, see the "Installed Modules" and "Project Modules" sections.
Tip: If the Control Panel, ensure Edit mode is selected.
Tip: To delete content from modules with a single content item such as the HTML and IFrame modules you can either remove all the content or simply delete the module.


Mushrooms - P. cubensis
I had a dinner party last night followed a bit later with a mushroom trip. Six of us tripped, four of whom had also had dinner with us, which finished at around 9PM. The other two (letís call them 'John and Lana') joined us at around 10:30, when I began making the tea. I boiled water, let it stop boiling, put it in a teapot with mushrooms, some lemon juice to help with the extraction and some ginger for flavor and to calm the stomach, a combination that has worked well for me in the past.
I let it steep for about 20 minutes, and then we drank it. The four of us that had had dinner together also ate a small bit, but John and Lana did not.
About 45min to an hour later everyone was starting to have visuals, and also felt a bit queasy. I didn't, but I had taken less, as one of the dinner guests was taking it for the first time and I wanted to be somewhat sober for him (he was fine, had a great time). Lana became rather upset, said it was too much, and I suggested she relax her muscles, drink some water and move around to help flush it. She stood up, remarked she felt a bit better, and John stood up with her. We were both watching her. I was asking her to relax when John locked up and fell over, hitting the ground like a statue. He lay there shaking and stiff, for a few seconds, then snapped out of it. From when he locked up till when he came to took about 10 seconds. When he got up he broke out in a sweat, which lasted a couple of minutes. He tried to describe the experience then, saying the only comparable one was when he had cut himself deeply and passed out after examining the wound.
I prepared a bed for them and checked on them at regular intervals, John threw up a couple of times but was otherwise ok. Lana was of course quite shaken, but they were otherwise fine after that, tripping a good bit, which passed after about two hours. Everyone else missed this and were and enjoying themselves, so I told them Jon had fallen over, he seemed ok now, and that I was keeping an eye on it.
The rest of the night went fine, everyone found their way home in the early morning, I've talked to them and they're all feeling pretty good, just a bit tired.
John and I have taken mushrooms together a lot in the last few years (about once every two months), without difficulties. I've eaten from this batch twice before and John once before, and several friends as well, without any problems. This was the first time I made a tea out of this batch, but a friend of mine had made a tea in the same manner once before.
John and Lana had eaten dinner around seven, John had had two beers between then and when he drank the tea. For dinner they had eaten rice and vegetables with a store-bought Chinese sauce, which contained msg and molasses, among other things. They had not had any other foods or drugs in that period.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


| I l@ve RuBoard |
The algorithms presented in this section enable you to access elements without modifying their values or changing their order.
difference _type
count (InputIterator beg, InputIterator end, const T& value)
difference _type
count_if (InputIterator beg, InputIterator end, UnaryPredicate op)
The first form counts the elements in the range [beg,end) that are equal to value value.
The second form counts the elements in the range [beg,end) for which the unary predicate
op (elem)
yields true.
The type of the return value, difference_type, is the difference type of the iterator:
typename iterator_traits<lnputIterator>::difference_type
(Section 7.5, introduces iterator traits.)[4]
[4] In the original STL the count() and count_if() had a fourth input/output parameter that was used as a counter and the return type was void.
Note that op should not change its state during a function call. See Section 8.1.4, for details.
op should not modify the passed arguments.
Associative containers (sets, multisets, maps, and multimaps) provide a similar member function, count(), to count the number of elements that have a certain value as key (see page 234).
Complexity: linear (numberOfElements comparisons or calls of op() respectively).
The following example counts elements according to different criteria:
// algo/count1.cpp #include "algostuff.hpp" using namespace std; bool isEven (int elem) { return elem % 2 == 0; } int main() { vector<int> coll; int num; INSERT_ELEMENTS(coll,1,9); PRINT_ELEMENTS(coll,"coll: "); // count and print elements with value 4 num = count (coll.begin(), coll.end(), // range 4); // value cout << "number of elements equal to 4: " << num << endl; // count elements with even value num = count_if (coll.begin(), coll.end(), // range isEven); // criterion cout << "number of elements with even value: " num << endl; // count elements that are greater than value 4 num = count_if (coll.begin(), coll.end(), // range bind2nd(greater<int>(),4)); // criterion cout << "number of elements greater than 4: " << num << endl; }
The program has the following output:
coll: 1 2 3 4 5 6 7 8 9 number of elements equal to 4: 1 number of elements with even value: 4 number of elements greater than 4: 5
Instead of using the self-written isEven() function, you could use the following expression:
not1(bind2nd(modulus<int>(),2))
See page 306 for more details regarding this expression.
InputIterator
min_element (InputIterator beg, InputIterator end)
InputIterator
min_element (InputIterator beg, InputIterator end, CompFunc op)
InputIterator
max_element (InputIterator beg, InputIterator end)
InputIterator
max_element (InputIterator beg, InputIterator end, CompFunc op)
All algorithms return the position of the minimum or maximum element in the range [beg,end).
The versions without op compare the elements with operator <.
op is used to compare two elements:
op(elem1 ,elem2)
It should return true when the first element is less than the second element.
If more than one minimum or maximum element exists, they return the first found.
op should not modify the passed arguments.
Complexity: linear (numberOfElements-1 comparisons or calls of op() respectively).
The following program prints the minimum and the maximum of the elements in coll and, by using absLess(), prints the minimum and the maximum of the absolute values:
// algo/minmax1.cpp #include <cstdlib> #include "algostuff.hpp" using namespace std; bool absLess (int elem1, int elem2) { return abs(elem1) < abs (elem2); } int main() { deque<int> coll; INSERT_ELEMENTS(coll,2,8); INSERT_ELEMENTS(coll,-3,5); PRINT_ELEMENTS(coll); // process and print minimum and maximum cout << "minimum: " << *min_element(coll.begin(),coll.end()) << endl; cout << "maximum: " << *max_element(coll.begin(),coll.end()) << endl; // process and print minimum and maximum of absolute values cout << "minimum of absolute values: " << *min_element(coll.begin(),coll.end(), absLess) << endl; cout << "maximum of absolute values: " << *max_element(coll.begin(),coll.end(), absLess) << endl; }
The program has the following output:
2 3 4 5 6 7 8 -3 -2 -1 0 1 2 3 4 5 minimum: -3 maximum: 8 minimum of absolute values: 0 maximum of absolute values: 8
Note that the algorithms return the, position of the maximum or minimum element respectively. Thus, you must use the unary operator * to print their values.
InputIterator
find (InputIterator beg, InputIterator end, const T& value)
InputIterator
find_if (InputIterator beg, InputIterator end, UnaryPredicate op)
The first form returns the position of the first element in the range [beg,end) that has a value equal to value.
The second form returns the position of the first element in the range [beg,end) for which the unary predicate
op(elem)
yields true.
Both forms return end if no matching elements are found.
Note that op should not change its state during a function call. See Section 8.1.4, for details.
op should not modify the passed arguments.
If the range is sorted, you should use the lower_bound(), upper_bound(), equal_range(), or binary_search() algorithms (see Section 9.10).
Associative containers (sets, multisets, maps, and multimaps) provide an equivalent member function, find(), that has logarithmic instead of linear complexity (see page 235).
Complexity: linear (at most, numberOfElements comparisons or calls of op() respectively).
The following example demonstrates how to use find() to find a subrange starting with the first element with value 4 and ending after the second 4, if any:
// algo/find1.cpp #include "algostuff.hpp" using namespace std; int main() { list<int> coll; INSERT_ELEMENTS(coll,1,9); INSERT_ELEMENTS(coll,1,9); PRINT_ELEMENTS(coll,"coll: "); // find first element with value 4 list<int>::iterator pos1; pos1 = find (coll.begin(), coll.end(), // range 4); // value /*find second element with value 4 *- note: continue the search behind the first 4 (if any) */ list<int>::iterator pos2; if (pos1 != coll.end()) { pos2 = find (++pos1, coll.end(), // range 4); // value } /*print all elements from first to second 4 (both included) *- note: now we need the position of the first 4 again (if any) *- note: we have to pass the position behind the second 4 (if any) */ if (pos1!=coll.end() && pos2!=coll.end()) { copy (--pos1, ++pos2, ostream_iterator<int>(cout," ")); cout << endl; } }
To find the second 4 you must increment the position of the first 4. However, incrementing the end() of a collection results in undefined behavior. Thus, if you are not sure, you should check the return value of find() before you increment it. The program has the following output:
coll: 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 4 5 6 7 8 9 1 2 3 4
You can call find() twice for the same range but with two different values. However, you have to be careful to use the results as the beginning and the end of a subrange of elements; otherwise, the subrange might not be valid. See page 97 for a discussion of possible problems and for an example.
The following example demonstrates how to use find_if() to find elements according to very different search criteria:
// algo/find2.cpp #include "algostuff.hpp" using namespace std; int main() { vector<int> coll; vector<int>::iterator pos; INSERT_ELEMENTS(coll,1,9); PRINT_ELEMENTS(coll,"coll: "); // find first element greater than 3 pos = find_if (coll.begin(), coll.end(), // range bind2nd(greater<int>(),3)); // criterion // print its position cout << "the " << distance(coll.begin(),pos) + 1 << ". element is the first greater than 3" << endl; // find first element divisible by 3 pos = find_if (coll.begin(), coll.end(), not1(bind2nd(modulus<int>(),3))); // print its position cout << "the " << distance(coll.begin(),pos) + 1 << ". element is the first divisible by 3" << endl; }
The first call of find() uses a simple function object combined with the bind2nd adapter to search for the first element that is greater than 3. The second call uses a more complicated combination to find the first element that is divisible by 3 without rest.
The program has the following output:
coll: 1 2 3 4 5 6 7 8 9 the 4. element is the first greater than 3 the 3. element is the first divisible by 3
See page 121 for an example that lets find() find the first prime number.
InputIterator
search_n (InputIterator beg, InputIterator end, Size count, const T& value)
InputIterator
search_n (InputIterator beg, InputIterator end, Size count, const T& value, BinaryPredicate op)
The first form returns the position of the first of count consecutive elements in the range [beg,end) that all have a value equal to value.
The second form returns the position of the first of count consecutive elements in the range [beg,end) for which the binary predicate
op(elem, value)
yields true.
Both forms return end if no matching elements are found.
Note that op should not change its state during a function call. See Section 8.1.4, for details.
op should not modify the passed arguments.
These algorithms were not part of the original STL and were not introduced very carefully.
The fact that the second form uses a binary predicate instead of a unary predicate breaks the consistency of the original STL. See the remarks on page 346.
Complexity: linear (at most, numberOfElements*count comparisons or calls of op() respectively).
The following example searches for three consecutive elements that have a value equal to or greater than 3:
// algo/searchn1.cpp #include "algostuff.hpp" using namespace std; int main() { deque<int> coll; INSERT_ELEMENTS(coll,1,9); PRINT_ELEMENTS(coll); // find three consecutive elements with value 4 deque<int>::iterator pos; pos = search_n (coll.begin(), coll.end(), // range 4, // count 3); // value // print result if (pos != coll.end()) { cout << "four consecutive elements with value 3 " << "start with " << distance(coll.begin(),pos) +1 << ". element" << endl; } else { cout << "no four consecutive elements with value 3 found" << endl; } // find three consecutive elements with value greater than 4 pos = search_n (coll.begin(), coll.end(), // range 4, // count 3, // value greater<int>()); // criterion // print result if (pos != coll.end()) { cout << "four consecutive elements with value > 3 " << "start with " << distance(coll.begin(),pos) +1 << ". element" << endl; } else { cout << "no four consecutive elements with value > 3 found" << endl; } }
The program has the following output:
1 2 3 4 5 6 7 8 9 no four consecutive elements with value 3 found four consecutive elements with value > 3 start with 4. element
There is a nasty problem with the second form of search_n(). Consider the second call of search_n():
pos = search_n (coll.begin(), coll.end(), // range 4, // count 3, // value greater<int>()); // criterion
This kind of searching for elements that matches a special criterion does not conform with the rest of the STL. Following the usual concepts of the STL, the call should be as follows:
pos = search_n_if (coll.begin(), coll.end(), // range 4, // count bind2nd(greater<int>(),3)); // criterion
Unfortunately, nobody noticed this inconsistency when these new algorithms were introduced to the standard (they were not part of the original STL). You might argue that the version with four arguments is more convenient. However, it requires a binary predicate even if you only need a unary predicate. For example, to use a self-written unary predicate function, normally you would write:
bool isPrime (int elem); ... pos = search_n_if (coll.begin(), coll.end(), // range 4, // count isPrime); //criterion
However, with the actual definition you must use a binary predicate. So, either you change the signature of your function or you write a simple wrapper:
bool binaryIsPrime (int elem1, int) { return isPrime(elem1); } ... pos = search_n (coll.begin(), coll.end(), // range 4, // count 0, // required dummy value binaryIsPrime); // binary criterion
ForwardIterator1
search (ForwardIterator1 beg, ForwardIterator1 end, ForwardIterator2 searchBeg, ForwardIterator2 searchEnd)
ForwardIterator1
search (ForwardIterator1 beg, ForwardIterator1 end, ForwardIterator2 searchBeg, ForwardIterator2 searchEnd, BinaryPredicate op)
Both forms return the position of the first element of the first subrange matching the range [searchBeg,searchEnd) in the range [beg,end).
In the first form the elements of the subrange have to be equal to the elements of the whole range.
In the second form for every comparison between elements, the call of the binary predicate
op (elem, searchElem)
has to yield true.
Both forms return end if no matching elements are found.
Note that op should not change its state during a function call. See Section 8.1.4, for details.
op should not modify the passed arguments.
See page 97 for a discussion of how to find a subrange for which you know only the first and the last elements.
Complexity: linear (at most, numberOfElements*numberOfSearchElements comparisons or calls of op() respectively).
The following example demonstrates how to find a sequence as the first subrange of another sequence (compare with the example of find_end() on page 351):
// algo/search1.cpp #include "algostuff.hpp" using namespace std; int main() { deque<int> coll; list<int> subcoll; INSERT_ELEMENTS(coll,1,7); INSERT.ELEMENTS(coll,1,7); INSERT_ELEMENTS(subcoll,3,6); PRINT_ELEMENTS(coll, "coll: "); PRINT_ELEMENTS(subcoll,"subcoll: "); // search first occurrence of subcoll in coll deque<int>::iterator pos; pos = search (coll.begin(), coll.end(), // range subcoll.begin(), subcoll.end()); //subrange // loop while subcoll found as subrange of coll while (pos != coll.end()) { // print position of first element cout << "subcoll found starting with element " << distance (coll.begin(),pos) + 1 << endl; // search next occurrence of subcoll ++pos; pos = search (pos, coll.end(), // range subcoll.begin(), subcoll.end()); // subrange } }
The program has the following output:
coll: 1 2 3 4 5 6 7 1 2 3 4 5 6 7 subcoll: 3 4 5 6 subcoll found starting with element 3 subcoll found starting with element 10
The next example demonstrates how to use the second form of the search() algorithm to find a subsequence that matches a more complicated criterion. Here, the subsequence even, odd, and even value is searched:
// algo/search2.cpp #include "algostuff.hpp" using namespace std; // checks whether an element is even or odd bool checkEven (int elem, bool even) { if (even) { return elem % 2 == 0; } else { return elem % 2 == 1; } } int main() { vector<int> coll; INSERT_ELEMENTS(coll,1,9); PRINT_ELEMENTS(coll,"coll: "); /* arguments for checkEven() * - check for: "even odd even" */ bool checkEvenArgs[3] = { true, false, true }; // search first subrange in coll vector<int>::iterator pos; pos = search (coll.begin(), coll.end(), // range checkEvenArgs, checkEvenArgs+3, // subrange values checkEven); // subrange criterion // loop while subrange found while (pos != coll.end()) { // print position of first element cout << "subrange found starting with element " << distance(coll.begin(),pos) + 1 << endl; // search next subrange in coll pos = search (++pos, coll.end(), // range checkEvenArgs, checkEvenArgs+3, // subr. values checkEven); // subr. criterion } }
The program has the following output:
coll: 1 2 3 4 5 6 7 8 9 subrange found starting with element 2 subrange found starting with element 4 subrange found starting with element 6
ForwardIterator
find_end (ForwardIterator beg, ForwardIterator end, ForwardIterator searchBeg, ForwardIterator searchEnd)
ForwardIterator
find_end (ForwardIterator beg, ForwardIterator end, ForwardIterator searchBeg, ForwardIterator searchEnd, BinaryPredicate op)
Both forms return the position of the first element of the last subrange matching the range [saarchBeg,searchEnd) in the range [beg,end).
In the first form the elements of the subrange have to be equal to the elements of the whole range.
In the second form, for every comparison between elements, the call of the binary predicate
op(elem,searchElem)
has to yield true.
Both forms return end if no matching elements are found.
Note that op should not change its state during a function call. See Section 8.1.4, for details.
op should not modify the passed arguments.
See page 97 for a discussion of how to find a subrange for which you only know the first and the last elements.
These algorithms were not part of the original STL. Unfortunately they were called find_end() instead of search_end(), which would be more consistent, because the algorithm used to search the first subrange is called search().
Complexity: linear (at most, numberOfElements*numberOfSearchElements comparisons or calls of op() respectively).
The following example demonstrates how to find a sequence as the last subrange of another sequence (compare with the example of search() on page 348):
// algo/findend1.cpp #include "algostuff.hpp" using namespace std; int main() { deque<int> coll; list<int> subcoll; INSERT_ELEMENTS(coll,1,7); INSERT_ELEMENTS(coll,1,7); INSERT_ELEMENTS(subcoll,3,6); PRINT_ELEMENTS(coll, "coll: "); PRINT_ELEMENTS(subcoll,"subcoll: "); // search last occurrence of subcoll in coll deque<int>::iterator pos; pos = find_end (coll.begin(), coll.end(), // range subcoll.begin(), subcoll.end()); // subrange // loop while subcoll found as subrange of coll deque<int>::iterator end(coll.end()); while (pos != end) { // print position of first element cout << "subcoll found starting with element " << distance(coll.begin(),pos) + 1 << endl; // search next occurrence of subcoll end = pos; pos = find_end (coll.begin(), end, // range subcoll.begin(), subcoll.end()); // subrange } }
The program has the following output:
coll: 1 2 3 4 5 6 7 1 2 3 4 5 6 7 subcoll: 3 4 5 6 subcoll found starting with element 10 subcoll found starting with element 3
For the second form of this algorithm, see the second example of search() on page 349. You can use find_end() in a similar manner.
ForwardIterator
find_first_of (ForwardIterator1 beg, ForwardIterator1 end, ForwardIterator2 searchBeg, ForwardIterator2 searchEnd)
ForwardIterator
find_first_of (ForwardIterator1 beg, ForwardIterator1 end, ForwardIterator2 searchBeg, ForwardIterator2 searchEnd, BinaryPredicate op)
The first form returns the position of the first element in the range [beg,end) that is also in the range [searchBeg,searchEnd).
The second form returns the position of the first element in the range [beg,end) for which any call with all elements of [searchBeg,searchEnd)
op (elem,searchElem)
yields true.
Both forms return end if no matching elements are found.
Note that op should not change its state during a function call. See Section 8.1.4, for details.
op should not modify the passed arguments.
By using reverse iterators, you can find the last of several possible values.
These algorithms were not part of the original STL.
Complexity: linear (at most, numberOfElements comparisons or calls of op() respectively).
The following example demonstrates the use of find_first_of():
// algo/findof1.cpp #include "algostuff.hpp" using namespace std; int main() { vector<int> coll; list<int> searchcoll; INSERT_ELEMENTS(coll,1,11); INSERT_ELEMENTS(searchcoll,3,5); PRINT_ELEMENTS(coll, "coll: "); PRINT_ELEMENTS(searchcoll,"searchcoll: "); // search first occurrence of an element of searchcoll in coll vector<int>::iterator pos; pos = find_first_of (coll.begin(), coll.end(), // range searchcoll.begin(), // beginning of search set searchcoll.end()); // end of search set cout << "first element of searchcoll in coll is element " << distance(coll.begin(),pos) + 1 << endl; // search last occurrence of an element of searchcoll in coll vector<int>::reverse_iterator rpos; rpos = find_first_of (coll.rbegin(), coll.rend(), // range searchcoll.begin(), // beginning of search set searchcoll.end()); // end of search set cout << "last element of searchcoll in coll is element " << distance (coll.begin(),rpos.base()) << endl; }
The second call uses reverse iterators to find the last element that has a value equal to one element in searchcoll. To print the position of the element, base() is called to transform the reverse iterator into an iterator. Thus, you can process the distance from the beginning. Normally you would have to add 1 to the result of distance() because the first element has distance 0 but actually is element 1. However, because base() moves the position of the value to which it refers, you have the same effect (see Section 7.4.1, for the description of base()).
The program has the following output:
coll: 1 2 3 4 5 6 7 8 9 10 11 searchcoll: 3 4 5 first element of searchcoll in coll is element 3 last element of searchcoll in coll is element 5
InputIterator
adjacent_find (InputIterator beg, InputIterator end)
InputIterator
adjacent_find_if (InputIterator beg, InputIterator end, BinaryPredicate op)
The first algorithm returns the first element in the range [beg,end) that has a value equal to the value of the following element.
The second algorithm returns the first element in the range [beg,end) for which the binary predicate
op(elem,nextElem)
yields true.
Both algorithms return end if no matching elements are found.
Note that op should not change its state during a function call. See Section 8.1.4, for details.
op should not modify the passed arguments.
Complexity: linear (at most, numberOfElements comparisons or calls of op() respectively).
The following program demonstrates both forms of adjacent_find():
// algo/adjfindl.cpp #include "algostuff.hpp" using namespace std; // return whether the second object has double the value of the first bool doubled (int elem1, int elem2) { return elem1 * 2 == elem2; } int main() { vector<int> coll; coll.push_back(l); coll.push_back(3); coll.push_back(2); coll.push_back(4); coll.push_back(5); coll.push_back(5); coll.push_back(0); PRINT_ELEMENTS(coll,"coll: "); // search first two elements with equal value vector<int>::iterator pos; pos = adjacent_find (coll.begin(), coll.end()); if (pos != coll.end()) { cout << "first two elements with equal value have position " << distance(coll.begin(),pos) + 1 << endl; } //search first two elements for which the second has double the value of the first pos = adjacent_find (coll.begin(), coll.end(), // range doubled); // criterion if (pos != coll.end()) { cout << "first two elements with second value twice the " << "first have pos. " << distance (coll.begin(),pos) + 1 << endl; } }
The first call of adjacent_find() searches for equal values. The second form uses doubled() to find the first element for which the successor has the double value. The program has the following output:
coll: 1 3 2 4 5 5 0 first two elements with equal value have position 5 first two elements with second value twice the first have pos. 3
bool
equal (InputIterator1 beg, InputIterator1 end, InputIterator2 cmpBeg)
bool
equal (InputIterator1 beg, InputIterator1 end, InputIterator2 cmpBeg, BinaryPredicate op)
The first form returns whether the elements in the range [beg,end) are equal to the elements in the range starting with cmpBeg.
The second form returns whether each call of the binary predicate
op (elem, cmpElem)
with the corresponding elements in the range [beg,end) and in the range starting with cmpBeg yields true.
Note that op should not change its state during a function call. See Section 8.1.4, for details.
op should not modify the passed arguments.
The caller must ensure that the range starting with cmpBeg contains enough elements.
To determine the differences when the sequences are not equal, you should use the mismatch() algorithm (see page 358).
Complexity: linear (at most, numberOfElements comparisons or calls of op() respectively).
The following example demonstrates both forms of equal(). The first call checks whether the elements have values with equal elements. The second call uses an auxiliary predicate function to check whether the elements of both collections have corresponding even and odd elements:
// algo/equal1.cpp #include "algostuff.hpp" using namespace std; bool bothEvenOrOdd (int elem1, int elem2) { return elem1 % 2 == elem2 % 2; } int main() { vector<int> coll1; list<int> coll2; INSERT_ELEMENTS(coll1,1,7); INSERT_ELEMENTS(coll2,3,9); PRINT_ELEMENTS(coll1,"coll1: "); PRINT_ELEMENTS(col12,"col12: "); //check whether both collections are equal if (equal (coll1. begin(), coll1. end(), //first range coll2.begin())) { //second range cout << "coll1 == col12" << endl; } else { cout << "coll1 != coll2" << endl; } //check for corresponding even and odd elements if (equal (coll1.begin(), coll1.end(), //first range coll2. begin(), //second range bothEvenOrOdd)) { //comparison criterion cout << "even and odd elements correspond" << endl; } else { cout << "even and odd elements do not correspond" << endl; } }
The program has the following output:
coll1: 1 2 3 4 5 6 7 coll2: 3 4 5 6 7 8 9 coll1 != coll2 even and odd elements correspond
pair<InputIterator1,InputIterator2>
mismatch (InputIterator1 beg, InputIterator1 end, InputIterator2 cmpBeg)
pair<InputIterator1,InputIterator2>
mismatch (InputIterator1 beg, InputIterator1 end, InputIterator2 cmpBeg, BinaryPredicate op)
The first form returns the first two corresponding elements of range [beg,end) and the range starting with cmpBeg that differ.
The second form returns the first two corresponding elements of range [beg,end) and the range starting with cmpBeg for which the binary predicate
op (elem, cmpElem)
yields true.
If no difference is found, a pair of end and the corresponding element of the second range is returned. Note that this does not mean that both sequences are equal, because the second sequence might contain more elements.
Note that op should not change its state during a function call. See Section 8.1.4, for details.
op should not modify the passed arguments.
The caller must ensure that the range starting with cmpBeg contains enough elements.
To check whether two ranges are equal, you should use the equal() algorithm (see page 356).
Complexity: linear (at most, numberOfElements comparisons or calls of op() respectively).
The following example demonstrates both forms of mismatch():
// algo/misma1.cpp #include "algostuff.hpp" using namespace std; int main() { vector<int> coll1; list<int> coll2; INSERT_ELEMENTS(coll1,1,6); for (int i=1; i<=16; i*=2) { col12.push_back(i); } coll2.push_back(3); PRINT_ELEMENTS(coll1,"coll1: "); PRINT_ELEMENTS(coll2,"coll2: "); //find first mismatch pair<vector<int>::iterator,list<int>::iterator> values; values = mismatch (coll1.begin(), coll1.end(), //first range coll2.begin()); //second range if (values.first == coll1.end()) { cout << "no mismatch" << endl; } else { cout << "first mismatch: " << *values.first << " and " << *values.second << endl; } /*find first position where the element of coll1 is not *less than the corresponding element of coll2 */ values = mismatch (coll1.begin(), coll1.end(), //first range col12. begin(), //second range less_equal<int>() ) //criterion if (values.first == coll1.end()) { cout << "always less-or-equal" << endl; } else { cout << "not less-or-equal: " << *values.first << " and " << *values.second << endl; } }
The first call of mismatch() searches for the first corresponding elements that are not equal. If such elements exist, their values are written to standard output. The second call searches for the first pair of elements in which the element of the first collection is greater than the corresponding element of the second collection, and returns these elements. The program has the following output:
coll1: 1 2 3 4 5 6 coll2: 1 2 4 8 16 3 first mismatch: 3 and 4 not less-or-equal: 6 and 3
bool
lexicographical_compare (InputIterator1 beg1, Input Iterator1 end1, InputIterator2 beg2, InputIterator2 end2)
bool
lexicographical_compare (InputIterator1 begl, InputIterator1 end1, InputIterator2 beg2, InputIterator2 end2, CompFunc op)
Both forms return whether the elements in the range [beg1,end1) are "lexicographically less than" the elements in the range [beg2,end2).
The first form compares the elements by using operator <.
The second form compares the elements by using the binary predicate
op(elem1 ,elem2)
It should return true when elem1 is less than elem2.
Lexicographical comparison means that sequences are compared element-by-element until any of the following occurs:
When two elements are not equal, the result of their comparison is the result of the whole comparison.
When one sequence has no more elements, then the sequence that has no more elements is less than the other. Thus, the comparison yields true if the first sequence is the one that has no more elements.
When both sequences have no more elements, then both sequences are equal, and the result of the comparison is false.
Note that op should not change its state during a function call. See Section 8.1.4, for details.
op should not modify the passed arguments.
Complexity: linear (at most, 2*min(numberOfElements1,numberOfElements2) comparisons or calls of op() respectively).
The following example demonstrates the use of a lexicographical sorting of collections:
// algo/lexico1.cpp #include "algostuff.hpp" using namespace std; void printCollection (const list<int>& l) { PRINT_ELEMENTS(l); } bool lessForCollection (const list<int>& l1, const list<int>& 12) { return lexicographical_compare (l1.begin(), l1.end(), // first range 12.begin(), 12.end()); // second range } int main() { list<int> c1, c2, c3, c4; //fill all collections with the same starting values INSERT_ELEMENTS(c1,1,5); c4 = c3 = c2 = c1; //and now some differences c1.push_back(7); c3.push_back(2); c3.push_back(0); c4.push_back(2); //create collection of collections vector<list<int> > cc; cc.push_back(c1); cc.push_back(c2); cc.push_back(c3); cc.push_back(c4); cc.push_back(c3); cc.push_back(c1); cc.push_back(c4); cc.push_back(c2); //print all collections for_each (cc.begin(), cc.end(), printCollection); cout << endl; //sort collection lexicographically sort (cc.begin(), cc.end(), //range lessForCollection) ; //sorting criterion //print all collections again for_each (cc.begin(), cc.end(), printCollection); }
The vector cc is initialized with several collections (all lists). The call of sort() uses the binary predicate lessForCollection() to compare two collections (see page 397 for a description of sort()). In lessForCollection(), the lexicographical_compare() algorithm is used to compare the collections lexicographically. The program has the following output:
1 2 3 4 5 7 1 2 3 4 5 1 2 3 4 5 2 0 1 2 3 4 5 2 1 2 3 4 5 2 0 1 2 3 4 5 7 1 2 3 4 5 2 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 2 1 2 3 4 5 2 1 2 3 4 5 2 0 1 2 3 4 5 2 0 1 2 3 4 5 7 1 2 3 4 5 7
| I l@ve RuBoard |


Thx for this tutorial. I am newbie to the php,html,javascript and so on. So, can you please help me how
to make some customization, for an beautiful page?
Sure, but not in the comments section of this blog.
If you go to SitePoint forums, create an account,
post your question in the JavaScript forum,
then let me know (via my contact form, for example), I’ll answer you there.
What if one would want arbitrary units? (Say 1 = 1000 or 0.1 but also equals 100000 but also 0.01 and so on and so forth up to one milionth)
(1 = 100000000 should be the highest)
What if one would want to use decimals regardless if he uses , or .
Hi,
I’m afraid I don’t understand your first question.
Regarding the decimals, I would look at the number_format function.
Thx for this tutorial. I am newbie to the php,html,javascript and so on. So, can you please help me how to make some customization, for an beautiful page?
sorry for my english,
Hi there,
Thanks for your comment.
I guess I can help you with your customizations. It depends what you have in mind.
i want use .xml file for this demo, can u show me how i can do that, thanks u so much
Sure, but not in the comments section of this blog.
If you go to SitePoint forums, create an account, post your question in the JavaScript forum, then let me know (via my contact form, for example), I’ll answer you there.


Acknowledgements and Sponsorships
Thanks all of the person who have contributed to the conference.
Contributor lastname
Contributor firstname
Sponsor ID
Sponsor Name
Type
Logo image filename


JavaScript is disabled on your browser.
Skip navigation links
Overview
Package
Class
Tree
Index
Help
Prev Letter
Next Letter
Frames
No Frames
All Classes
A
C
D
E
F
G
I
L
M
N
O
P
R
S
T
V
W
G
getAbout()
- Method in class com.model.
WPPost.Links
getAuthor()
- Method in class com.model.
WPPost
getAuthor()
- Method in class com.model.
WPPost.Links
getCategories()
- Method in class com.model.
WPPost
getCollection()
- Method in class com.model.
WPPost.Links
getCommentStatus()
- Method in class com.model.
WPPost
getContent()
- Method in class com.model.
WPPost
getCount()
- Method in class com.model.
WPPost.VersionHistory
getCuries()
- Method in class com.model.
WPPost.Links
getDate()
- Method in class com.model.
WPPost
getDateGmt()
- Method in class com.model.
WPPost
getEmbeddable()
- Method in class com.model.
WPPost.Author
getEmbeddable()
- Method in class com.model.
WPPost.Reply
getEmbeddable()
- Method in class com.model.
WPPost.WpFeaturedmedium
getEmbeddable()
- Method in class com.model.
WPPost.WpTerm
getExcerpt()
- Method in class com.model.
WPPost
getFeaturedMedia()
- Method in class com.model.
WPPost
getFormat()
- Method in class com.model.
WPPost
getGuid()
- Method in class com.model.
WPPost
getHref()
- Method in class com.model.
WPPost.About
getHref()
- Method in class com.model.
WPPost.Author
getHref()
- Method in class com.model.
WPPost.Collection
getHref()
- Method in class com.model.
WPPost.Cury
getHref()
- Method in class com.model.
WPPost.PredecessorVersion
getHref()
- Method in class com.model.
WPPost.Reply
getHref()
- Method in class com.model.
WPPost.Self
getHref()
- Method in class com.model.
WPPost.VersionHistory
getHref()
- Method in class com.model.
WPPost.WpAttachment
getHref()
- Method in class com.model.
WPPost.WpFeaturedmedium
getHref()
- Method in class com.model.
WPPost.WpTerm
getId()
- Method in class com.model.
WPPost
getId()
- Method in class com.model.
WPPost.PredecessorVersion
getItemCount()
- Method in class com.adapter.
RecyclerViewAdapter
Counter of data.
getLink()
- Method in class com.model.
WPPost
getLinks()
- Method in class com.model.
WPPost
getMeta()
- Method in class com.model.
WPPost
getModified()
- Method in class com.model.
WPPost
getModifiedGmt()
- Method in class com.model.
WPPost
getName()
- Method in class com.model.
WPPost.Cury
getPingStatus()
- Method in class com.model.
WPPost
getPostInfo()
- Method in interface com.f44red.
RetrofitArrayApi
getPredecessorVersion()
- Method in class com.model.
WPPost.Links
getProtected()
- Method in class com.model.
WPPost.Content
getProtected()
- Method in class com.model.
WPPost.Excerpt
getRendered()
- Method in class com.model.
WPPost.Content
getRendered()
- Method in class com.model.
WPPost.Excerpt
getRendered()
- Method in class com.model.
WPPost.Guid
getRendered()
- Method in class com.model.
WPPost.Title
getReplies()
- Method in class com.model.
WPPost.Links
getRetrofit()
- Method in class com.f44red.
MainActivity
getRetrofit sets connection with F44 Red page and loads news.
getSelf()
- Method in class com.model.
WPPost.Links
getSlug()
- Method in class com.model.
WPPost
getStatus()
- Method in class com.model.
WPPost
getSticky()
- Method in class com.model.
WPPost
getTags()
- Method in class com.model.
WPPost
getTaxonomy()
- Method in class com.model.
WPPost.WpTerm
getTemplate()
- Method in class com.model.
WPPost
getTemplated()
- Method in class com.model.
WPPost.Cury
getTitle()
- Method in class com.model.
WPPost
getType()
- Method in class com.model.
WPPost
getVersionHistory()
- Method in class com.model.
WPPost.Links
getWpAttachment()
- Method in class com.model.
WPPost.Links
getWpFeaturedmedia()
- Method in class com.model.
WPPost.Links
getWpTerm()
- Method in class com.model.
WPPost.Links
Guid()
- Constructor for class com.model.
WPPost.Guid
A
C
D
E
F
G
I
L
M
N
O
P
R
S
T
V
W
Skip navigation links
Overview
Package
Class
Tree
Index
Help
Prev Letter
Next Letter
Frames
No Frames
All Classes


From land to air transport, from product sourcing to Conventional collection, from regular to recommended cargo transport, from Local to international, from parcel to bulk cargo,TRIPOD Logistics Ltd will remain your preferred partner
About Us
Since 2017, TRIPOD Logisitcs Ltd has been providing innovative logistics solutions specializing in market tailored products from local consolidated cargo to international container shipping. In partnership with world leaders in logistics, TRIPOD provides services.
Mission
From Rwanda inter-cities Logistics to International services,TRIPOD Logistics Ltd aims at Setting up partnerships for facilitating incoming and outgoing cargo from all African capital cities to/from the world using easy tools.
Services
SukumaMzigo
A Local cargo consolidation and delivery service. Tell us what and where then we deliver at the right cost.
TumaMzigo
Regional and International dispatch and cargo export services.
LetaMzigo
Cargo Import from parcels to containers. Deliver to our warehouses, we deliver to you!
MzigoMove
Import service of passenger cars, utility cars, industrial equipment and construction machinery.
Business Partnership
For companies intending to setting up businesses in our markets (in Rwanda or Rwanda to abroad), TRIPOD Logistics Ltd will remain your preferred for promotion, management and business representation in your target markets.
List of Locations
China, India, Dubai (UAE), S.Korea, Rwanda, Tanzania, Uganda, Burundi, Kenya, Democratic Republic of Congo (DRC), USA & Europe and soon Congo Brazza and Central African Republic.
EasyMzigo Packs
With our Experience, TRIPOD Logistics Ltd is aware of what exactly our market needs. From there we designed special services for our customers in Rwanda and abroad including easy cost estimation, trade finance, payment facilitation and so on.
Contact
Location:
TWIGA Plaza, 3rd Floor
At Junction of KK667 St & KG 693 St
Gisozi-Gakinjiro-Gasabo
Kigali-Rwanda
Email:
<EMAIL_ADDRESS>Call:
+250 780 383 663


(Video) Roberto Firmino wows Liverpool fans with piano skills
by Biscan's BootsRoberto Firmino – a man of many talents.

What’s more – they’re pretty good! Especially our Brazilian striker, who we had absolutely no idea possessed musical ability.
Firmino has had some excellent games this term, but only found the net on three occasions. This isn’t his role, but it would be great if he could add a few more to his game – starting at Selhurst Park this Satirday!
WOW!! This is just another side to our talented Bobby❤How brilliant is this 🤩👏👏👏 #firmino #LFCfamily 🎹🎶🎶 pic.twitter.com/gYxAd9E7m8
— Annie's Anfield 🏆🏆🏆🏆🏆🏆 (@AnnelizaWalsh78) November 21, 2019


(feeds 3-4; time 30 minutes)
| Sesame Oil | 1 tsp |
| Vegetable Oil | 1 tbsp |
| Mirin | 1/4 cup |
| Rice Vinegar | 1/4 cup |
| Soy Sauce | 1/4 cup |
| Fish Sauce | 1 Tbsp |
| Five-Spice Powder *** | 1 tsp |
| Carrot | 1 large |
| Bok Choy | 1 lb |
| Onion | 1 medium |
| Garlic | 7 cloves, finely chopped |
| Mushroom | 1/2 lb (shiitake) |
| Protein | 1 lb (chicken, beef, pork, tofu, etc.) |
Begin heating skillet at low heat. Mince garlic. Cut onion into thinly sliced pieces. Cut protein into bite size pieces. Clean mushrooms and cut into bite size pieces. Peel carrot then cut into bite sized pieces. Cut bok choy bottoms and wash.
Increase skillet heat to medium. Pour sesame oil and vegetable oil. Heat until you can hear the oil sizzling. Throw in carrots, onions, and mushrooms. Sauté until onions have achieved mild translucence. Add protein. Increase heat steadily, make sure your cooking vessel stays hot -- this is very important. Add Mirin, Rice Vinegar, Soy Sauce, Fish Sauce. Sauté until protein is slightly browned. Add garlic. Sauté until you smell the flavors of the vegetables and protein mixing deliciously -- you're probably 15-20 mins into the sauté. Sprinkle Five-Spice Powder. Sauté until all ingredients thus far cooked to your satisfaction -- probably another 5 minutes. At this point you want the heat to be kind of high, maybe even past medium. Inspect the status to make sure it isn't too soggy, if so dial the heat and reduce to your desired level of soupiness. Add Bok Choy. Stir with gusto until Bok Choy is slightly wilted.

Feel free to add thai chilis or other fitting spices as you desire around the time you add the garlic.
*** I made the Five-Spice Powder at home by following this recipe from NYT Cooking


基本概念(二)
订单生命周期¶
一个单子的基本周期包含：
- Arkenstone: AK
- FrontEnd(前置机/网关)
- Trading Engine
| 类型 | 描述 | 支持 |
|---|---|---|
| Pending New | The order has been received by the AK Frontend platform but not yet acknowledged by the trading engine. | Y |
| New | The order has been successfully processed, entered in the order book and acknowledged by the trading engine | Y |
| Pending Cancel Confirmation | The cancel request has been received by the AK Frontend platform but not yet acknowledged by the trading engine | Y |
| Cancelled | The cancel request has been successfully processed and acknowledged by the trading engine. The order has been pulled from the order book. | Y |
| Pending Modification Confirmation | The modification request has been received by the AK platform but not yet acknowledged by the trading engine. | N |
| Filled | The full quantity of the order has been matched to another order creating a trade. The order has no remaining quantity on the order book. | Y |
| Partially Filled | A subset of the order quantity has been matched to another order creating a trade. The order has remaining quantity on the order book. | Y |
| Unknown | The order identifier for which status has been requested does not exist in the system. | Y |
| Rejected | The order was rejected. | Y |
| Expired | The order has been pulled out of the order book because its life expectancy came to an end. | Y |
| 类型 | 描述 | 支持 |
|---|---|---|
| Pending New | 单子进入网关，尚未进入book. | Y |
| New | 进入就交易引擎 | Y |
| Pending Cancel Confirmation | 取消命令进入网关，尚未进入交易引擎 | Y |
| Cancelled | 成功取消 | Y |
| Pending Modification Confirmation | 修改单子，AK 不支持，可以通过取消，再提交单子变相实现 | N |
| Filled | 全部成交. | Y |
| Partially Filled | 部分成交，剩下继续在book 中. | Y |
| Unknown | 非可知状态，系统不存在 | Y |
| Rejected | 单子被拒绝. | Y |
| Expired | 单子被从 book 删除，比如GTD,或者有TTL 设置单子 . | Y |
从订单到持仓¶
单子在最佳价格成交后， 便转换成 Trade, 成交记录将被传递给下游， 做清算结算
Clearing is the activity of determining obligations,
after which the obligations are discharged by settlement prior to the the next trading session.
Order Aggressor Indicator¶
流动性消耗者， 这样的单子是抽走流动性，变相导致价格波动，点差拉大， 每次单子的成交，都会触发这个检查和报告：
- Order Entry
- Market Data
- Post-Matching/Clearing
盘前，盘后不会触发相关检查。
TODO?


75%
09:03
Wednesday, 12 June
Press Home To Unlock
Calculator
Video Player
Temperature Converter
Color Game
Camera
Coming Soon
0
From
To
Waiting...