set timer for 65 minutes
- Novices and Formative Assessment (20/45m)
- Expertise and Memory (30/15m)
- Cognitive Load (20/20m)
- Live Coding (30/45m)
- Lessons and Objectives (30/20m)
Start
- Let’s get started by learning some theory, how it relates to SWC and putting the theory into practice in our workshops.
Cognitive Development & Mental Models
- Effective learning is facilitated by the creation of mental models of a domain
- What do we mean by mental model?
- One example: many of us learned that the ball-and-spring model of molecules
- molecules aren’t balls; their bonds not springs
- but the model does a good job of helping people reason about molecules, chemical compounds and their reactions to one another
Write your primary research domain or area of expertise and one mental model you use to frame and understand your work? This discussion should take about 5 minutes.
Me - Work in the library provide data services - help researchers and students with their research, provide instructions on tools that make them more productive
Review some of the models
- One way to think about the difference b/t novice and “competent practicioner” is the existence of the big picture mental model
- This model has three stages:
- novice is someone who doesn’t know what they don’t know
- has not built a mental model of a domain or how elements of the domain relate
- often reason by analogy and guesswork, misapply other parts of other domains to the new one
- signature of novice is their questions aren’t even wrong
- competent practicioner has a mental model good enough for everyday purposes: Not completely accurate, but useful
- e.g. average drivers mental model of a working car typically doesn’t include the complexity of what a mechanic knows
- can do normal tasks with normal effort under normal circumstances
- expert can easily handle situations that are nonnormative
- We assume most learners coming to SW/D/LC workshop are novices and do not have strong mental models for the concepts we teach
- Our primary goal is not to teach syntax of a particular programming language, but to teach people how to think about programming and data management
- AND about using computers in research more generally
WHY GO SLOW - Why we go slowly
- The transition from novice to competent practitioners involves the construction of right (enough) categories:
- building a new mental model of this new intellectual domain
- goal of education for novices is to help them form correct categories
- until they’ve done that trying to load information on them confuses more than educates
(Discussion) Manual v. Tutorials
Programming books are often categorized into reference manuals and tutorials or guides.
With that in mind, what do you think some of the differences between a manual and a tutorial in terms of novices and competent practitioners? Can one document do a good job of being both?
This discussion should take about 5 minutes.
SEE also: https://swcarpentry.github.io/instructor-training/02-novice/#different-kinds-of-lessons
- One reason software development is so frustrating
- Reference material is opaque to someone who doesn’t know what they don’t know (novice w/o a mental map).
- Likewise, tutorials that help build such a map are too slow and diffuse for people who already have one
- it is poss. to make something that serves both groups, but often easier to address their needs separately
What do you think some implications of this might be for preparing to teach software carpentry?
- An example of the practical implications of this: our Unix lesson only introduces 12 commands and typically spends 2.5 hours to cover
- 12.5 minutes per command may seem very slow, but the lesson’s real purpose is to teach learners about paths, history, wildcards, pipes and filters, command-line arguments, redirection and the other big ideas the shell depends on (and without which ppl can’t understand how to use commands or read their manual pages).
- That model also includes:
- DRY - anything you repeat manually, you’ll ultimately get wrong (so make the computer repeat things for you by using tab completion and the history command)
- Lots of little tools, combined as needed, are more productive than a handful of “kitchen sink” programs (motivates the pipe-and-filter model and segues to functions)
- These two examples illustrates something else as well.
- Learning consists of more than just building mental models & pouring in information
- THAT creating linkages between concepts and facts is as important
- Telling people not to repeat things, and they should think in terms of little pieces loosely joined
- Both set the stage for introducing functions
- Explicitly referring back to pipes and filters when introducing functions helps solidify both ideas
Building Useful Mental Models
-
There are many positive strategies for building mental models: analogies, stories, role-play, and diagrams are ways to represent a structure that can be used as a model
-
However there’s a greater challenges to creating mental models:
It ain’t what you don’t know that gets you into trouble.
It’s what you know for sure that just ain’t so.
— Mark Twain
- Clearing up learners misconceptions is as important as presenting them with correct information.
- Their misconceptions may fall into three categories:
* Simple factual errors, such as believing that St. Louis is the capital of Missouri. These are simple to correct,
but getting the facts right is not enough on its own.
* Broken models, believing that motion and acceleration must be in the same direction. We can address these by having them reason through examples to see contradictions.
* Fundamental beliefs, such as “the world is only a few thousand years old” or “human beings cannot be affecting the planet’s climate”. These usually cannot be addressed in class, since they are deeply connected to the learner’s social identity and often cannot be reasoned away.
Do you have any examples of “broken or misapplied models” you’d like to share? Do you remember how it got corrected?
teaching R -> Stata
- Since SW & D Carpentry are focused on novices, and helping build strong mental models, we’re most interested in the middle category of misconceptions (broken models)
- During teaching, we want to expose broken models so that we can diagnose and provide better ones.
(Discussion) What Happens Next?
An example of how solving problems can help people correct broken mental models,
consider this problem from Epstein’s Thinking Physics.
Imagine that you have placed a cake of ice in a bathtub
and then filled the tub to the rim with water.
When the ice melts,
does the water level go up (so that the tub overflows),
go down,
or stay the same?
The correct answer is that it stays the same;
figuring out why helps people build a model of the relationship between weight, volume, and density.
Accessing mental models
ask the questions?
PUT in doc:
Q: what is: 27 + 15 ?
- 42
- 32
- 312
- 33
- the correct answer is 42, but each of the other answers provides valuable insight
Find the Bug
Choose one wrong answer and write in the Etherpad what the misconception is associated with that wrong answer.
This discussion should take about 10 minutes.
Solution
- If the child answers 32, she is throwing away the carry completely.
- If she answers 312, she knows that she can’t just discard the carried ‘1’,
but doesn’t understand that it’s actually a ten
and needs to be added into the next column.
In other words,
she is treating each column of numbers as unconnected to its neighbors.
- If she answers 33 then she knows she has to carry the 1,
but is carrying it back into the same column it came from.
- each incorrect answer is a plausible distractor with diagnostic power
- plausible means it looks like it could be right
- instructors often use supposedly silly answers like “a fish” on MCQs, but:
- (a) they don’t provide insight
- (b) learners actually don’t find them funny
- diagnostic power means that each of the distractors helps the instructor figure out what to explain to that learner next
Handling Outcomes
Formative assessments allow us as instructors to adapt our instruction to our audience.
What should we do as instructors if the class votes for:
- mostly one of the wrong answers?
- mostly the right answer?
- an even spread among options?
For one of the above, enter your answer in the Etherpad.
This discussion should take about 10 minutes.
- if the majority of the class votes for a single wrong answer, you should go back and work on correcting that misconception
- if most vote for right answer, it’s probably safe to move on
- if answers are pretty evenly split between options, learners are probably randomly guessing and it’s good to go back to where everyone was on the same page
TIPs in SWC
- instructors should use MCQs or some of the kind of formative assessment (coding challenge) at least every 10-15 min to insure the class is learning
- when you give an exercise in S/D/L carpentry, circle the room or have your helpers - use the sticky notes to find folks having difficulty - typically there’s a pattern – talk with your helpers, share
- formative assessments can also be used preemptively:
- if you start an episode or section with an MCQ and everyone gets it, you can skip the part of the lecture
Peer Instruction (SKIP if needed)
No matter how good a teacher is,
she can only say one thing at a time.
How then can she clear up many different misconceptions
in a reasonable time?
Peer instruction is essentially a way to provide one-to-one mentorship in a scalable way.
Despite this,
we usually do not use it in our workshops because
it takes people time to learn a new way to learn—time
that we don’t have in our compressed two-day format.
(Exercise) Modeling Novice Mental Models (https://goo.gl/279azG)
Take 10 minutes to create a multiple choice question related to a topic you intend to teach.
Type it into the GDoc
and explain the diagnostic power of each its distractors,
i.e., what misconception is each distractor meant to identify?
A Note on MCQ Design
- A good MCQ tests for conceptual misunderstanding rather than simple factual knowledge.
If you are having a hard time coming up with diagnostic distractors,
then either you need to think more about your learners’ mental models,
or your question simply isn’t a good starting point for an MCQ.
- When you are trying to come up with distractors,
think about questions that learners asked or problems they had
the last time you taught this subject.
If you haven’t taught it before,
think about your own misconceptions
or ask colleagues about their experiences.
is a set of MCQs designed to gauge understanding of basic Newtonian mechanics. Others exist.
MCQ to determine learners POV
- Designing an MCQ with plausible distractors is useful even if it is never used in class
- it forces the instructor to think about the learners’ mental models and how they might be broken—
- in short,
to put themselves into the learners’ heads
and see the topic from their point of view.
What other kinds of formative assessment you have seen or used? Can you think
how it helps both the instructor and the learner figure out where they are and what they need > to do next?
This discussion should take about 5 minutes.
- Other formative assessments:
- Concept maps
- Have students write their understanding
- Muddiest point: “what is the muddiest point in today’s class”
- Clarity grid - ask waht concepts make the most sense, what is muddy.
key points
- Novices: don’t know what they don’t know
- Competent practitioners: have a usable mental model that’s good enough for everyday purposes.
- Expert: can handle edge cases.
- Goal when teaching novices is to help them construct a usable mental model.
- To do this, must clear up their misconceptions in their prior knowledge.
- Summative assessment: done at the end of teaching to see whether learning took place.
- Formative assessment: done during teaching to guide learning.
- Can use multiple choice questions (MCQs) as formative assessments to diagnose misconceptions.


LinearCosineDecay
A LearningRateSchedule that uses a linear cosine decay schedule.
Inherits From: LearningRateSchedule
tf.compat.v1.keras.experimental.LinearCosineDecay
tf.compat.v2.keras.experimental.LinearCosineDecay
__init__
__init__( initial_learning_rate, decay_steps, num_periods=0.5, alpha=0.0, beta=0.001, name=None )
Applies linear cosine decay to the learning rate.
See [Bello et al., ICML2017] Neural Optimizer Search with RL. https://arxiv.org/abs/1709.07417
For the idea of warm starts here controlled by num_periods
,
see [Loshchilov & Hutter, ICLR2016] SGDR: Stochastic Gradient Descent
with Warm Restarts. https://arxiv.org/abs/1608.03983
Note that linear cosine decay is more aggressive than cosine decay and larger initial learning rates can typically be used.
When training a model, it is often recommended to lower the learning rate as
the training progresses. This schedule applies a linear cosine decay
function to an optimizer step, given a provided initial learning rate.
It requires a step
value to compute the decayed learning rate. You can
just pass a TensorFlow variable that you increment at each training step.
The schedule a 1-arg callable that produces a decayed learning rate when passed the current optimizer step. This can be useful for changing the learning rate value across different invocations of optimizer functions. It is computed as:
def decayed_learning_rate(step): step = min(step, decay_steps) linear_decay = (decay_steps - step) / decay_steps cosine_decay = 0.5 * ( 1 + cos(pi * 2 * num_periods * step / decay_steps)) decayed = (alpha + linear_decay) * cosine_decay + beta return initial_learning_rate * decayed
decay_steps = 1000 lr_decayed_fn = ( tf.keras.experimental.LinearCosineDecay( initial_learning_rate, decay_steps))
You can pass this schedule directly into a tf.keras.optimizers.Optimizer
as the learning rate. The learning rate schedule is also serializable and
deserializable using tf.keras.optimizers.schedules.serialize
and
tf.keras.optimizers.schedules.deserialize
.
initial_learning_rate
: A scalar float32
or float64
Tensor or a Python
number. The initial learning rate.decay_steps
: A scalar int32
or int64
Tensor
or a Python number.
Number of steps to decay over.num_periods
: Number of periods in the cosine part of the decay.
See computation above.alpha
: See computation above.beta
: See computation above.name
: String. Optional name of the operation. Defaults to
'LinearCosineDecay'.A 1-arg callable learning rate schedule that takes the current optimizer
step and outputs the decayed learning rate, a scalar Tensor
of the same
type as initial_learning_rate
.
__call__
__call__(step)
Call self as a function.
from_config
from_config( cls, config )
Instantiates a LearningRateSchedule
from its config.
config
: Output of get_config()
.A LearningRateSchedule
instance.
get_config
get_config()


org.jclouds.vcloud.director.v1_5.features
Interface VdcApi
- All Known Subinterfaces:
- AdminVdcApi
public interface VdcApi
Provides synchronous access to a vDC.
- Author:
- danikov, Adrian Cole
- See Also:
VdcAsyncApi
|
Method Summary |
Media |
addMedia(String vdcUrn,
Media media)
Creates a media (and present upload link for the floppy/iso file). |
Media |
addMedia(URI vdcHref,
Media media)
|
VAppTemplate |
captureVApp(String vdcUrn,
CaptureVAppParams params)
Captures a vApp into vApp template. |
VAppTemplate |
captureVApp(URI vdcHref,
CaptureVAppParams params)
|
Media |
cloneMedia(String vdcUrn,
CloneMediaParams params)
Clones a media into new one. |
Media |
cloneMedia(URI vdcHref,
CloneMediaParams params)
|
VApp |
cloneVApp(String vdcUrn,
CloneVAppParams params)
Clones a vApp into new one. |
VApp |
cloneVApp(URI vdcHref,
CloneVAppParams params)
|
VAppTemplate |
cloneVAppTemplate(String vdcUrn,
CloneVAppTemplateParams params)
Clones a vApp template into new one. |
VAppTemplate |
cloneVAppTemplate(URI vdcHref,
CloneVAppTemplateParams params)
|
VApp |
composeVApp(String vdcUrn,
ComposeVAppParams params)
Composes a new vApp using VMs from other vApps or vApp templates. |
VApp |
composeVApp(URI vdcHref,
ComposeVAppParams params)
|
Vdc |
get(String vdcUrn)
Retrieves a vdc. |
Vdc |
get(URI vdcHref)
|
MetadataApi.Readable |
getMetadataApi(String vdcUrn)
|
MetadataApi.Readable |
getMetadataApi(URI vdcHref)
|
VApp |
instantiateVApp(String vdcUrn,
InstantiateVAppParams params)
Instantiate a vApp template into a new vApp. |
VApp |
instantiateVApp(URI vdcHref,
InstantiateVAppParams params)
|
VAppTemplate |
uploadVAppTemplate(String vdcUrn,
UploadVAppTemplateParams params)
Uploading vApp template to a vDC. |
VAppTemplate |
uploadVAppTemplate(URI vdcHref,
UploadVAppTemplateParams params)
|
get
Vdc get(String vdcUrn)
- Retrieves a vdc.
- Returns:
- the vdc or null if not found
get
Vdc get(URI vdcHref)
captureVApp
VAppTemplate captureVApp(String vdcUrn,
CaptureVAppParams params)
- Captures a vApp into vApp template.
The status of vApp template will be in
UNRESOLVED(0)
until the
capture task is finished.
- Returns:
- a VApp resource which will contain a task. The user should should wait for this task to finish to be able
to use the vApp.
captureVApp
VAppTemplate captureVApp(URI vdcHref,
CaptureVAppParams params)
cloneMedia
Media cloneMedia(String vdcUrn,
CloneMediaParams params)
- Clones a media into new one.
The status of the returned media is
UNRESOLVED(0)
until the task
for cloning finish.
- Returns:
- a Media resource which will contain a task. The user should monitor the contained task status in order to
check when it is completed.
cloneMedia
Media cloneMedia(URI vdcHref,
CloneMediaParams params)
cloneVApp
VApp cloneVApp(String vdcUrn,
CloneVAppParams params)
- Clones a vApp into new one.
The status of vApp will be in
UNRESOLVED(0)
until the clone task is finished.
- Returns:
- a VApp resource which will contain a task. The user should should wait for this task to finish to be able
to use the vApp.
cloneVApp
VApp cloneVApp(URI vdcHref,
CloneVAppParams params)
cloneVAppTemplate
VAppTemplate cloneVAppTemplate(String vdcUrn,
CloneVAppTemplateParams params)
- Clones a vApp template into new one.
The status of vApp template will be in
UNRESOLVED(0)
until the clone
task is finished.
- Returns:
- a VAppTemplate resource which will contain a task. The user should should wait for this task to finish to
be able to use the VAppTemplate.
cloneVAppTemplate
VAppTemplate cloneVAppTemplate(URI vdcHref,
CloneVAppTemplateParams params)
composeVApp
VApp composeVApp(String vdcUrn,
ComposeVAppParams params)
- Composes a new vApp using VMs from other vApps or vApp templates.
The vCloud API supports composing a vApp from any combination of vApp templates, vApps,
or virtual machines. When you compose a vApp, all children of each composition source
become peers in the Children collection of the composed vApp. To compose a vApp, a api
makes a compose vApp request whose body is a ComposeVAppParams element, includes the
following information:
- An InstantiationParams element that applies to the composed vApp itself and any vApp templates referenced in
Item elements.
- A SourcedItem element for each virtual machine, vApp, or vAppTemplate to include in the composition. Each
SourcedItem can contain the following elements:
- A required Source element whose href attribute value is a reference to a vApp template, vApp, or VM to include
in the composition. If the Source element references a VM, the Item must also include an InstantiationParams
element specific to that VM.
- An optional NetworkAssignment element that specifies how the network connections of child VM elements are
mapped to vApp networks in the parent.
If any of the composition items is subject to a EULA, the ComposeVAppParams element must include an
AllEULAsAccepted element that has a value of true, indicating that you accept the EULA. Otherwise, composition
fails. The composed vApp must be deployed and powered on before it can be used. The status of vApp will be
UNRESOLVED(0)
until the
compose task is finished.
- Returns:
- a VApp resource which will contain a task. The user should should wait for this task to finish to be able
to use the vApp.
composeVApp
VApp composeVApp(URI vdcHref,
ComposeVAppParams params)
instantiateVApp
VApp instantiateVApp(String vdcUrn,
InstantiateVAppParams params)
- Instantiate a vApp template into a new vApp.
The status of vApp will be in
UNRESOLVED(0)
until the instantiate task is finished.
POST /vdc/{id}/action/instantiateVAppTemplate
- Returns:
- a VApp resource which will contain a task. The user should should wait for this task to finish to be able
to use the vApp.
instantiateVApp
VApp instantiateVApp(URI vdcHref,
InstantiateVAppParams params)
uploadVAppTemplate
VAppTemplate uploadVAppTemplate(String vdcUrn,
UploadVAppTemplateParams params)
- Uploading vApp template to a vDC.
The operation is separate on several steps:
- creating empty vApp template entity
- uploading an OVF of vApp template
- uploading disks described from the OVF
- finishing task for uploading
The status of vApp template will be
NOT_READY(0)
until the ovf and
all disks are uploaded to the transfer site. After this a task will run on the vApp template uploading.
Note that the empty vApp template's getFiles() returns a file of size -1 after step one above,
because the descriptor.ovf does not yet exist.
- Returns:
- a VAppTemplate resource which will contain a task. The user should should wait for this task to finish to
be able to use the VAppTemplate.
uploadVAppTemplate
VAppTemplate uploadVAppTemplate(URI vdcHref,
UploadVAppTemplateParams params)
addMedia
Media addMedia(String vdcUrn,
Media media)
- Creates a media (and present upload link for the floppy/iso file).
- Returns:
- The response will return a link to transfer site to be able to continue with uploading the media.
addMedia
Media addMedia(URI vdcHref,
Media media)
getMetadataApi
MetadataApi.Readable getMetadataApi(String vdcUrn)
- Returns:
- synchronous access to
Metadata.Readable
features
getMetadataApi
MetadataApi.Readable getMetadataApi(URI vdcHref)
Copyright © 2009-2013 jclouds. All Rights Reserved.


Hello! I'm Tzu yi, Marketing major VCD minor. Going to graduate this quarter, spring 2017 (can't wait!) Can't live without music, raver, and love anything about make up. One fun fact about me: If i have enough time when i'm traveling to a new city, i'll definitely go visit an art museum!
The magically long-haired Rapunzel has spent her entire life in a tower, but now that a runaway thief has stumbled upon her, she is about to discover the world for the first time, and who she really is.

An offbeat romantic comedy about a woman who doesn't believe true love exists, and the young man who falls for her.
Two teenage cancer patients be- gin a life-affirming journey to visit a reclusive author in Amsterdam.


Pair Coding and Feedback
Pair coding has been an interesting experience in DBC so far. I am definitely more of a private, individual learner, so it has been pretty challenging for me to work on solving challenges with other people. I also am better at formulating my thoughts when I write them down, so that has also been tough since I am not always ‘driving’ while pair coding. I think it is very rewarding to solve a challenge with your pair when your ideas come together; however, there have also been many moments of frustration when neither pair can come up with any sort of solution to the current problem. I have also experienced some frustration when I am working with someone more advanced at a certain topic, and I am not understanding the problem.
It has felt pretty good to read my feedback, since it has all been positive so far. I don’t think any of it has been very helpful yet because I haven’t received a lot of constructive criticism - but I think that will come as I pair more. I have learned something from writing my feedback to other people, though, because I have noticed that I always stress that we should review the challenge we will be working on prior to pairing, and that is my fault as well as my pair’s. The most challenging thing for me when writing feedback for others has been coming up with feedback that is both specific and actionable. A lot of the time, I am still concerned with not offending anyone, since we are all still struggling and learning.


QCameraFocus Class
The QCameraFocus class provides an interface for focus and zoom related camera settings. More...
| Header: | #include <QCameraFocus> |
| qmake: | QT += multimedia |
| Inherits: | QObject |
Public Types
| enum | FocusMode { ManualFocus, HyperfocalFocus, InfinityFocus, AutoFocus, ContinuousFocus, MacroFocus } |
| flags | FocusModes |
| enum | FocusPointMode { FocusPointAuto, FocusPointCenter, FocusPointFaceDetection, FocusPointCustom } |
Properties
|
|
- 1 property inherited from QObject
Public Functions
| QPointF | customFocusPoint() const |
| qreal | digitalZoom() const |
| FocusModes | focusMode() const |
| FocusPointMode | focusPointMode() const |
| QCameraFocusZoneList | focusZones() const |
| bool | isAvailable() const |
| bool | isFocusModeSupported(FocusModes mode) const |
| bool | isFocusPointModeSupported(FocusPointMode mode) const |
| qreal | maximumDigitalZoom() const |
| qreal | maximumOpticalZoom() const |
| qreal | opticalZoom() const |
| void | setCustomFocusPoint(const QPointF &point) |
| void | setFocusMode(FocusModes mode) |
| void | setFocusPointMode(FocusPointMode mode) |
| void | zoomTo(qreal optical, qreal digital) |
- 32 public functions inherited from QObject
Signals
| void | digitalZoomChanged(qreal value) |
| void | focusZonesChanged() |
| void | maximumDigitalZoomChanged(qreal zoom) |
| void | maximumOpticalZoomChanged(qreal zoom) |
| void | opticalZoomChanged(qreal value) |
- 2 signals inherited from QObject
Additional Inherited Members
- 1 public slot inherited from QObject
- 1 public variable inherited from QObject
- 10 static public members inherited from QObject
- 9 protected functions inherited from QObject
- 2 protected variables inherited from QObject
Detailed Description
The QCameraFocus class provides an interface for focus and zoom related camera settings.
On hardware that supports it, this class lets you adjust the focus or zoom (both optical and digital). This also includes things like "Macro" mode for close up work (e.g. reading barcodes, or recognising letters), or "touch to focus" - indicating an interesting area of the viewfinder for the hardware to attempt to focus on.
QCameraFocus *focus = camera->focus(); focus->setFocusPointMode(QCameraFocus::FocusPointCustom); focus->setCustomFocusPoint(QPointF(0.25f, 0.75f)); // A point near the bottom left, 25% away from the corner, near that shiny vase
Zooming can be accomplished in a number of ways - usually the more expensive but higher quality approach is an optical zoom, which allows using the full extent of the camera sensor to gather image pixels. In addition it is possible to digitally zoom, which will generally just enlarge part of the sensor frame and throw away other parts. If the camera hardware supports optical zoom this should generally always be used first. The maximumOpticalZoom() method allows this to be checked. The zoomTo() method allows changing both optical and digital zoom at once.
focus->zoomTo(3.0, 4.0); // Super zoom!
Some notes on autofocus
Some hardware supports a movable focus lens assembly, and typically this hardware also supports automatically focusing via some heuristic. You can influence this via the FocusPointMode setting - typically the center of the frame is brought into focus, but some hardware also supports focusing on any faces detected in the frame, or on a specific point (usually provided by a user in a "touch to focus" scenario).
This class (in combination with QCameraFocusZone) can expose information on what parts of the camera sensor image are in focus or are being used for autofocusing via the focusZones() property:
focus->setFocusPointMode(QCameraFocus::FocusPointAuto); QList<QCameraFocusZone> zones = focus->focusZones(); foreach (QCameraFocusZone zone, zones) { if (zone.status() == QCameraFocusZone::Focused) { // Draw a green box at zone.area() } else if (zone.status() == QCameraFocusZone::Selected) { // This area is selected for autofocusing, but is not in focus // Draw a yellow box at zone.area() } }
See also QCameraFocusZone.
Member Type Documentation
enum QCameraFocus::FocusMode
flags QCameraFocus::FocusModes
| Constant | Value | Description |
|---|---|---|
QCameraFocus::ManualFocus | 0x1 | Manual or fixed focus mode. |
QCameraFocus::HyperfocalFocus | 0x02 | Focus to hyperfocal distance, with the maximum depth of field achieved. All objects at distances from half of this distance out to infinity will be acceptably sharp. |
QCameraFocus::InfinityFocus | 0x04 | Focus strictly to infinity. |
QCameraFocus::AutoFocus | 0x8 | One-shot auto focus mode. |
QCameraFocus::ContinuousFocus | 0x10 | Continuous auto focus mode. |
QCameraFocus::MacroFocus | 0x20 | One shot auto focus to objects close to camera. |
The FocusModes type is a typedef for QFlags<FocusMode>. It stores an OR combination of FocusMode values.
enum QCameraFocus::FocusPointMode
| Constant | Value | Description |
|---|---|---|
QCameraFocus::FocusPointAuto | 0 | Automatically select one or multiple focus points. |
QCameraFocus::FocusPointCenter | 1 | Focus to the frame center. |
QCameraFocus::FocusPointFaceDetection | 2 | Focus on faces in the frame. |
QCameraFocus::FocusPointCustom | 3 | Focus to the custom point, defined by QCameraFocus::customFocusPoint property. |
Property Documentation
customFocusPoint : QPointF
This property represents the position of the custom focus point, in relative frame coordinates: QPointF(0,0) points to the left top frame point, QPointF(0.5,0.5) points to the frame center.
The custom focus point property is used only in FocusPointCustom
focus mode.
Access functions:
| QPointF | customFocusPoint() const |
| void | setCustomFocusPoint(const QPointF &point) |
digitalZoom : const qreal
This property holds the current digital zoom value.
Access functions:
| qreal | digitalZoom() const |
Notifier signal:
| void | digitalZoomChanged(qreal value) |
See also QCameraFocus::opticalZoom.
focusMode : FocusModes
This property holds the current camera focus mode.
This controls the way the camera lens assembly is configured.
Access functions:
| FocusModes | focusMode() const |
| void | setFocusMode(FocusModes mode) |
See also QCameraFocus::isFocusModeSupported().
focusPointMode : FocusPointMode
This property holds the current camera focus point selection mode.
If the camera focus mode is set to use an autofocusing mode, this property controls the way the camera will select areas of the frame to use for autofocusing.
Access functions:
| FocusPointMode | focusPointMode() const |
| void | setFocusPointMode(FocusPointMode mode) |
See also QCameraFocus::isFocusPointModeSupported().
focusZones : const QCameraFocusZoneList
Returns the list of active focus zones.
If QCamera::FocusPointAuto or QCamera::FocusPointFaceDetection focus mode is selected this method returns the list of zones the camera is actually focused on.
The coordinates system is the same as for custom focus points: QPointF(0,0) points to the left top frame point, QPointF(0.5,0.5) points to the frame center.
Access functions:
| QCameraFocusZoneList | focusZones() const |
Notifier signal:
| void | focusZonesChanged() |
opticalZoom : const qreal
This property holds the current optical zoom value.
Access functions:
| qreal | opticalZoom() const |
Notifier signal:
| void | opticalZoomChanged(qreal value) |
See also QCameraFocus::digitalZoom.
Member Function Documentation
[signal]
void QCameraFocus::digitalZoomChanged(qreal value)
Signal emitted when digital zoom value changes to new value.
Note: Notifier signal for property digitalZoom.
[signal]
void QCameraFocus::focusZonesChanged()
This signal is emitted when the set of zones used in autofocusing is changed.
This can change when a zone is focused or loses focus, or new focus zones have been detected.
Note: Notifier signal for property focusZones.
bool QCameraFocus::isAvailable() const
Returns true if focus related settings are supported by this camera.
You may need to also check if any specific features are supported.
bool QCameraFocus::isFocusModeSupported(FocusModes mode) const
Returns true if the focus mode is supported by camera.
bool QCameraFocus::isFocusPointModeSupported(FocusPointMode mode) const
Returns true if focus point mode is supported.
qreal QCameraFocus::maximumDigitalZoom() const
Returns the maximum digital zoom
This will be 1.0
on cameras that do not support digital zoom.
[signal]
void QCameraFocus::maximumDigitalZoomChanged(qreal zoom)
Signal emitted when the maximum supported digital zoom value changed.
The maximum supported zoom value can depend on other camera settings, like capture mode or resolution.
qreal QCameraFocus::maximumOpticalZoom() const
Returns the maximum optical zoom.
This will be 1.0
on cameras that do not support optical zoom.
[signal]
void QCameraFocus::maximumOpticalZoomChanged(qreal zoom)
Signal emitted when the maximum supported optical zoom value changed.
[signal]
void QCameraFocus::opticalZoomChanged(qreal value)
Signal emitted when optical zoom value changes to new value.
Note: Notifier signal for property opticalZoom.
void QCameraFocus::zoomTo(qreal optical, qreal digital)
Set the camera optical and digital zoom values.
Since there may be a physical component to move, the change in zoom value may not be instantaneous.


Language selectors
Language selectors allow users to pick languages from a list. In projects like Wikipedia with 300+ language Wikipedias, or software like MediaWiki with 350+ languages supported, language selection is crucial and can occur in many different contexts.
Using language selectors
Language selectors display a list of languages. The list of languages can be customized and may be different in each component application. In some cases the selection will display all possible languages. In other cases, only the few languages for which a specific piece of content is available may be shown.
The language selectors should be used when users select language as input or for navigation purposes. Language selectors automatically adapt to the number of languages and the screen real state available. In addition, language selectors can be customized with more information and actions.
Depending on the context, the language selectors can include:
- Suggested languages to facilitate finding frequently selected languages by the user.
- Additional details for each language to provide additional metadata in the form of labels or icons.
- Grouping language variants[1] to easily support the selection of closely-related languages.
- Quick actions to access other language-related activities relevant to the context.
- Selection range for cases where more than one language has to be selected at a time.
- Empty states with optional follow-up actions allowing users to expand the available languages.
Designing
The language selectors combine a search input and a menu with the list of languages. In addition, specific elements of the language selectors can be adjusted to address particular needs.
Label
The visual label is optional, due to the specific context language selectors are used in. But a visually hidden label for screen readers is obligatory.
Placeholder text
Placeholder text is obligatory for language selectors. Use Base30 for it.
Suggested languages
The suggested languages section is provided by default to simplify recurrent selection based on frequent and previous choices. They are hidden automatically when the total number of languages is small (less than 10) to avoid unnecessary repetition. Consider hiding the suggested list explicitly when the suggestions may not be useful.
Additional details
Provide a clarifying text or icon next to the language can help to anticipate relevant information such as the title of the page the user will be navigating to. However, given the potentially large number of languages, additional details might increase the information density and make the selection process less fluent.
Grouping language variants
When providing options that are considered variants of the same language such as Swiss German and Austrian German, it is preferred to present related languages grouped under a common family rather than exposing all the individual options.
Additional actions
In addition to picking a language, the selector allows to optionally integrate different kinds of actions that may be relevant:
- Quick actions. Surface secondary general actions related to the whole list of languages. These consist of an icon and a label. When one is provided, the icon will be shown in the language selector directly. When more than one action is provided, a "more" icon will provide access to a separate view will list them.
- Prominent action. One relevant action that is strongly connected to the content can be presented at the top of the list. For example, surfacing missing languages to lead users to create them with follow-up actions (next).
- Follow-up actions on empty states. Provide actions that allow to make the missing language available (by translating, creating, connecting, or any other means).
Selection range
Selecting one language at a time is the default, but cases where more than one language can be selected, the multiple selection version can be more convenient.
See the detailed design specification document for more details.
States of language selectors
Selecting
Interaction with the language selector respects the visual states and interaction of its individual components. For example, hover or focus states, and keyboard manipulation work in the usual way for the search bar and the menu listing the languages.
Searching
Flexible search with typeahead autocompletion is used to filter the language results.
Empty states
The selector shows empty states in different circumstances:
- No languages available.
- Search leads to a language not available for selection.
- Search leads to no known language.
Empty states can be customized to include mechanisms for making more languages available.
Expanded layout
By default language selectors are shown as a modal
element over the current contents and taping outside cancels the selection. The layout adapts responsively:
- On wide screens when the number of languages to select is large (more than 30), the selector becomes wider and uses a 3-column layout.
- On narrow screens the selector expands to the full viewport. In such cases, a header provides the control to close the selector.
The optional section for suggested languages shows up to six languages using a two column layout by default, but using three columns when the list of all languages does so.
Types
Default
By default, the language selector presents list of languages for users to pick one. Making one selection closes the selector automatically. The list of languages adapts dynamically to the number of languages and the space available. Regardless of the layout, it is composed simply by language names.
Other types of language selector provide room for additional information, actions, groupings and selections.
Additional details and actions
A type of language selector allowing for additional details and actions is also available:
- Description labels and/or icons. Language items in the list optionally include an icon and a secondary label to communicate further details.
- Additional actions. Although the main purpose of the selector is still to pick languages, additional actions can be defined. These actions can appear more prominently (on top) or as part of the quick action menu in a corner at the bottom.
Grouping language variants
Support for language variants includes the possibility to expand/collapse groups of related languages. In addition, when a variant is selected a prominent section with other variants allow users to quickly switch between related variants.
Multiple selection
By default the selector is optimized to support selecting one language at a time. Specific types of selector are available to support a different number of languages. In particular, the following cases are supported:
- Multiple selection. Supports selecting a whole list of languages in one go.
- Language pair. Supports selecting two languages. This can be useful when selecting a language pair from a single entry point control.
- All languages. Provides an additional option to select all languages. This can be convenient as a reset option when filtering.


Tourist dies after taking a selfie near a waterfall in Thailand
by natacha larnaudA French tourist died on Thursday after he slipped and fell from a waterfall in Ko Samui, Thailand, authorities said. The 33-year-old man fell from the Na Mueang 2 waterfall, the same spot from which a Spanish tourist died in July.
"It took multiple hours to reach the body because the site was very slippery and steep," Lieutenant Phuvadol Viriyavarangkul of the island's tourist police told AFP. "His friend said he was trying to take a selfie and then he slipped and fell."
According to Viriyavarangkul, the spot is now roped off and has a sign warning hikers of the danger.
A 2018 study published in the Journal of Family Medicine and Primary Care found that some 259 people worldwide have died while taking selfies from 2011 to 2017.
The study found that the three most common selfie-related deaths include drowning, transport-related transports – such as taking a selfie in front of an oncoming train – and falling from heights.
It also notes that "no selfie zones" should be declared across dangerous tourist spots, "especially in places such as water bodies, mountain peaks and over tall buildings" in order to decrease selfie-related deaths.
The highest number of incidents has been reported in India, which accounts for approximately 50% of reported selfie-related deaths. It's followed by Russia and then the United States in third place.


Aqueduct's AI and Machine Learning Software Can Help You:
Save Money and Energy
Aqueduct's insights drive increased bottom-line performance.
Reduce Risk
Aqueduct can help you predict and prevent asset breakdown.
Improve Operational Performance
Optimize oxygen content in your aeration tanks and water horsepower in your pump stations.


--- date: "2016-04-09T16:50:16+02:00" title: Data Wrangling output: learnr::tutorial weight: 1 ---
How do we do it? 🤔
This diagram is taken from the R for Data Science book by Garrett Grolemund and Hadley Wickham, which it is a great resource for learning R. There is a whole community built around it and you could join it and start learning together: R4DS online learning community.
Dataset
To learn and practise how to organise data we will use a gapminder
data set available from the gapminder
package in R. This dataset is put into R by Jennifer Bryan from a tank of data sets available from Gapminder.
Gapminder is an independent Swedish foundation that helps to promote sustainable global development by collecting and analysing relevant data and by developing and designing teaching/learning tools. Gapminder was founded in Sweden by Hans Rosling who was a mastermind for distinctive and insightful storytelling about global development using visual animation.
You can see Hans in action in this BBC documentary The joy of Stats available on YouTube.
Gapminder Data
For each of 142 countries, the package provides values for life expectancy, GDP per capita, and population, every five years, from 1952 to 2007.
Before you can take a look at this data set first run the folowing code
# install necessary packages:
install.packages("dplyr", repos = "http://cran.us.r-project.org")
install.packages("ggplot2", repos = "http://cran.us.r-project.org")
install.packages("gapminder", repos = "http://cran.us.r-project.org")
# have a look at the data
head(gapminder::gapminder)
## # A tibble: 6 x 6
## country continent year lifeExp pop gdpPercap
## <fct> <fct> <int> <dbl> <int> <dbl>
## 1 Afghanistan Asia 1952 28.8 8425333 779.
## 2 Afghanistan Asia 1957 30.3 9240934 821.
## 3 Afghanistan Asia 1962 32.0 10267083 853.
## 4 Afghanistan Asia 1967 34.0 11537966 836.
## 5 Afghanistan Asia 1972 36.1 13079460 740.
## 6 Afghanistan Asia 1977 38.4 14880372 786.
{{% notice note %}} 💡Note that there are 6 columns, each of which we call a variable. {{% /notice %}}
Description: Excerpt of the Gapminder data on life expectancy, GDP per capita, and population by country.
The main data frame gapminder has 1704 rows and 6 variables: - country: factor with 142 levels - continent: factor with 5 levels - year: ranges from 1952 to 2007 in increments of 5 years - lifeExp: life expectancy at birth, in years - pop: population - gdpPercap: GDP per capita
gapminder::gapminder[1:3,]
## # A tibble: 3 x 6
## country continent year lifeExp pop gdpPercap
## <fct> <fct> <int> <dbl> <int> <dbl>
## 1 Afghanistan Asia 1952 28.8 8425333 779.
## 2 Afghanistan Asia 1957 30.3 9240934 821.
## 3 Afghanistan Asia 1962 32.0 10267083 853.
1st look at the data using the following functions: dim()
& head()
library(gapminder)
dim(gapminder)
## [1] 1704 6
head(gapminder, n=10)
## # A tibble: 10 x 6
## country continent year lifeExp pop gdpPercap
## <fct> <fct> <int> <dbl> <int> <dbl>
## 1 Afghanistan Asia 1952 28.8 8425333 779.
## 2 Afghanistan Asia 1957 30.3 9240934 821.
## 3 Afghanistan Asia 1962 32.0 10267083 853.
## 4 Afghanistan Asia 1967 34.0 11537966 836.
## 5 Afghanistan Asia 1972 36.1 13079460 740.
## 6 Afghanistan Asia 1977 38.4 14880372 786.
## 7 Afghanistan Asia 1982 39.9 12881816 978.
## 8 Afghanistan Asia 1987 40.8 13867957 852.
## 9 Afghanistan Asia 1992 41.7 16317921 649.
## 10 Afghanistan Asia 1997 41.8 22227415 635.
Can you tell what each of the two functions does?!
Do we have the information about the structure of the data? 🤔 We can examine the structure using str()
function, but the output could look messy and hard to follow if the data set is big. 🤪
str(gapminder)
## Classes 'tbl_df', 'tbl' and 'data.frame': 1704 obs. of 6 variables:
## $ country : Factor w/ 142 levels "Afghanistan",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ continent: Factor w/ 5 levels "Africa","Americas",..: 3 3 3 3 3 3 3 3 3 3 ...
## $ year : int 1952 1957 1962 1967 1972 1977 1982 1987 1992 1997 ...
## $ lifeExp : num 28.8 30.3 32 34 36.1 ...
## $ pop : int 8425333 9240934 10267083 11537966 13079460 14880372 12881816 13867957 16317921 22227415 ...
## $ gdpPercap: num 779 821 853 836 740 ...
The dplyr
Package
The dplyr
provides a “grammar” (the verbs) for data manipulation and for operating on data frames in a tidy way. The key operator and the essential verbs are:
%>%: the “pipe” operator used to connect multiple verb actions together into a pipeline.
select(): return a subset of the columns of a data frame.
mutate(): add new variables/columns or transform existing variables.
filter(): extract a subset of rows from a data frame based on logical conditions.
arrange(): reorder rows of a data frame according to single or multiple variables.
summarise() / summarize(): reduce each group to a single row by calculating aggregate measures.
We can have a look at the data and its structure by using the glimpse()
function from the dplyr
package.
suppressPackageStartupMessages(library(dplyr))
glimpse(gapminder)
## Observations: 1,704
## Variables: 6
## $ country <fct> Afghanistan, Afghanistan, Afghanistan, Afghanistan, Af…
## $ continent <fct> Asia, Asia, Asia, Asia, Asia, Asia, Asia, Asia, Asia, …
## $ year <int> 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, …
## $ lifeExp <dbl> 28.801, 30.332, 31.997, 34.020, 36.088, 38.438, 39.854…
## $ pop <int> 8425333, 9240934, 10267083, 11537966, 13079460, 148803…
## $ gdpPercap <dbl> 779.4453, 820.8530, 853.1007, 836.1971, 739.9811, 786.…
{{% notice note %}}
🤓💡: Notice how we can prevent display of the messages that appear when uploading the packages by using, in this case, suppressPackageStartupMessages()
!
{{% /notice %}}
Now we have the dplyr
package uploaded, let us learn its verbs. 😇
The pipeline operater: %>%
Left Hand Side (LHS) %>%
Right Hand Side (RHS)
x %>% f(…, y)
f(x,y)
The “pipe” **passes the result of the *LHS as the 1st operator argument of the function on the RHS**.
3 %>% sum(4) <==> sum(3, 4)
%>%
is very practical for chaining together multiple dplyr
functions in a sequence of operations.
Pick variables by their names: select()
,
starts_with("X")
every name that starts with “X”.
ends_with("X")
every name that ends with “X”.
contains("X")
every name that contains “X”.
matches("X")
every name that matches “X”, where “X” can be a regular expression.
num_range("x", 1:5)
the variables named x01, x02, x03, x04, x05.
one_of(x)
=> every name that appears in x, which should be a character vector.
👉 Practice ⏰💻: Select your variables
that ends with letter p
starts with letter co
. Try to do this selection using base R.
😃🙌 Solutions:
gm_pop_gdp <- select(gapminder, ends_with("p"))
head(gm_pop_gdp, n = 1)
## # A tibble: 1 x 3
## lifeExp pop gdpPercap
## <dbl> <int> <dbl>
## 1 28.8 8425333 779.
gm_cc <- select(gapminder, starts_with("co"))
head(gm_cc, n = 1)
## # A tibble: 1 x 2
## country continent
## <fct> <fct>
## 1 Afghanistan Asia
of course all of this could be done using base R for example:
gm_cc <- gapminder[c("country", "continent")]
but it’s less intuitive and often requires more typing.
Create new variables of existing variables: mutate()
It will allow you to add to the data frame df
a new column, z
, which is the multiplication of the columns x
and y
: mutate(df, z = x * y)
.
If we would like to observe lifeExp
measured in months we could create a new column lifeExp_month
:
gapminder2 <- mutate(gapminder, LifeExp_month = lifeExp * 12)
head(gapminder2, n = 2)
## # A tibble: 2 x 7
## country continent year lifeExp pop gdpPercap LifeExp_month
## <fct> <fct> <int> <dbl> <int> <dbl> <dbl>
## 1 Afghanistan Asia 1952 28.8 8425333 779. 346.
## 2 Afghanistan Asia 1957 30.3 9240934 821. 364.
Pick observations by their values: filter()
There is a set of logical operators in R that you can use inside filter()
:
x < y
: TRUE
if x
is less than y
x <= y
: TRUE
if x
is less than or equal to y
x == y
: TRUE
if x
equals y
x != y
: TRUE
if x
does not equal y
x >= y
: TRUE
if x
is greater than or equal to y
x > y
: TRUE
if x
is greater than y
x %in% c(a, b, c)
: TRUE
if x
is in the vector c(a, b, c)
is.na(x)
: Is NA
!is.na(x)
: Is not NA
👉 Practice ⏰💻: Filter your data
Use gapminder2
df
to filter:
only European countries and save it as gapmEU
only European countries from 2000 onward and save it as gapmEU21c
rows where the life expectancy is greater than 80
Don’t forget to use ==
instead of =
! and
Don’t forget the quotes ""
😃🙌 Solutions:
gapmEU <- filter(gapminder2, continent == "Europe")
head(gapmEU, 2)
## # A tibble: 2 x 7
## country continent year lifeExp pop gdpPercap LifeExp_month
## <fct> <fct> <int> <dbl> <int> <dbl> <dbl>
## 1 Albania Europe 1952 55.2 1282697 1601. 663.
## 2 Albania Europe 1957 59.3 1476505 1942. 711.
gapmEU21c <- filter(gapminder2, continent == "Europe" & year >= 2000)
head(gapmEU21c, 2)
## # A tibble: 2 x 7
## country continent year lifeExp pop gdpPercap LifeExp_month
## <fct> <fct> <int> <dbl> <int> <dbl> <dbl>
## 1 Albania Europe 2002 75.7 3508512 4604. 908.
## 2 Albania Europe 2007 76.4 3600523 5937. 917.
filter(gapminder2, lifeExp > 80)
Reorder the rows: arrange()
is used to reorder rows of a data frame (df) according to one of the variables/columns.
If you pass arrange()
a character variable, R will rearrange the rows in alphabetical order according to values of the variable.
If you pass a factor variable, R will rearrange the rows according to the order of the levels in your factor (running levels()
on the variable reveals this order).
👉 Practice ⏰💻: Arranging your data
1) Arrange countries in gapmEU21c
df
by life expectancy in ascending and descending order.
gapminder df
Find the records with the smallest population
Find the records with the largest life expectancy.
😃🙌 Solution 1):
gapmEU21c_h2l <- arrange(gapmEU21c, lifeExp)
head(gapmEU21c_h2l, 2)
## # A tibble: 2 x 7
## country continent year lifeExp pop gdpPercap LifeExp_month
## <fct> <fct> <int> <dbl> <int> <dbl> <dbl>
## 1 Turkey Europe 2002 70.8 67308928 6508. 850.
## 2 Romania Europe 2002 71.3 22404337 7885. 856.
gapmEU21c_l2h <- arrange(gapmEU21c, desc(lifeExp)) # note the use of desc()
head(gapmEU21c_l2h, 2)
## # A tibble: 2 x 7
## country continent year lifeExp pop gdpPercap LifeExp_month
## <fct> <fct> <int> <dbl> <int> <dbl> <dbl>
## 1 Iceland Europe 2007 81.8<PHONE_NUMBER>1. 981.
## 2 Switzerland Europe 2007 81.7 7554661 37506. 980.
😃🙌 Solution 2):
arrange(gapminder, pop)
## # A tibble: 1,704 x 6
## country continent year lifeExp pop gdpPercap
## <fct> <fct> <int> <dbl> <int> <dbl>
## 1 Sao Tome and Principe Africa 1952 46.5 60011 880.
## 2 Sao Tome and Principe Africa 1957 48.9 61325 861.
## 3 Djibouti Africa 1952 34.8 63149 2670.
## 4 Sao Tome and Principe Africa 1962 51.9 65345 1072.
## 5 Sao Tome and Principe Africa 1967 54.4 70787 1385.
## 6 Djibouti Africa 1957 37.3 71851 2865.
## 7 Sao Tome and Principe Africa 1972 56.5 76595 1533.
## 8 Sao Tome and Principe Africa 1977 58.6 86796 1738.
## 9 Djibouti Africa 1962 39.7 89898 3021.
## 10 Sao Tome and Principe Africa 1982 60.4 98593 1890.
## # … with 1,694 more rows
arrange(gapminder, desc(lifeExp))
## # A tibble: 1,704 x 6
## country continent year lifeExp pop gdpPercap
## <fct> <fct> <int> <dbl> <int> <dbl>
## 1 Japan Asia 2007 82.6 127467972 31656.
## 2 Hong Kong, China Asia 2007 82.2 6980412 39725.
## 3 Japan Asia 2002 82 127065841 28605.
## 4 Iceland Europe 2007 81.8<PHONE_NUMBER>1.
## 5 Switzerland Europe 2007 81.7 7554661 37506.
## 6 Hong Kong, China Asia 2002 81.5 6762476 30209.
## 7 Australia Oceania 2007 81.2 20434176 34435.
## 8 Spain Europe 2007 80.9 40448191 28821.
## 9 Sweden Europe 2007 80.9 9031088 33860.
## 10 Israel Asia 2007 80.7 6426679 25523.
## # … with 1,694 more rows
Collapse many values down to a single summary: summarise()
The syntax of summarise() is simple and consistent with the other verbs included in the dplyr
package.
uses the same syntax as mutate()
, but the resulting dataset consists of a single row instead of an entire new column in the case of mutate()
.
builds a new dataset that contains only the summarising statistics.
| Objective | Function | Description |
|---|---|---|
| basic | sum(x) |
Sum of vector x |
| centre | mean(x) |
Mean (average) of vector x |
median(x) |
Median of vector x | |
| spread | sd(x) |
Standard deviation of vector x |
quantile(x, probs) |
Quantile of vector x | |
range(x) |
Range of vector x | |
diff(range(x))) |
Width of the range of vector x | |
min(x) |
Min of vector x | |
max(x) |
Max of vector x | |
abs(x) |
Absolute value of a number x |
👉 Practice ⏰💻: Use summarise()
:
to print out a summary of gapminder containing two variables: max_lifeExp and max_gdpPercap.
to print out a summary of gapminder containing two variables: mean_lifeExp and mean_gdpPercap.
😃🙌 Solution: Summarise your data
summarise(gapminder, max_lifeExp = max(lifeExp), max_gdpPercap = max(gdpPercap))
## # A tibble: 1 x 2
## max_lifeExp max_gdpPercap
## <dbl> <dbl>
## 1 82.6 113523.
summarise(gapminder, mean_lifeExp = mean(lifeExp), mean_gdpPercap = mean(gdpPercap))
## # A tibble: 1 x 2
## mean_lifeExp mean_gdpPercap
## <dbl> <dbl>
## 1 59.5 7215.
Subsetting: group_by()
dplyr’s group_by()
function enables you to group your data. It allows you to create a separate df that splits the original df by a variable.
The function summarise()
can be combined with group_by()
.
| Objective | Function | Description |
|---|---|---|
| Position | first() | First observation of the group |
| last() | Last observation of the group | |
| nth() | n-th observation of the group | |
| Count | n() | Count the number of rows |
| n_distinct() | Count the number of distinct observations |
👉 Practice ⏰💻: Subset your data
😃🙌 Solution:
gapminder %>%
group_by(continent) %>%
summarise(n_distinct(country))
## # A tibble: 5 x 2
## continent `n_distinct(country)`
## <fct> <int>
## 1 Africa 52
## 2 Americas 25
## 3 Asia 33
## 4 Europe 30
## 5 Oceania 2
Let’s %>%
all up!
You can try to get into the habit of using a shortcut for the pipe operator
🗣👥 Confer with your neighbours:
What relationship do you expect to see between population size (pop
) and life expectancy (lifeExp
)?
Look what this code produces
gapminder_pipe <- gapminder %>%
filter(continent == "Europe" & year == 2007) %>%
mutate(pop_e6 = pop / 1000000)
plot(gapminder_pipe$pop_e6, gapminder_pipe$lifeExp, cex = 0.5, col = "red")
tidyr
The tidyr
can help you to create tidy data. Tidy data is data where:
The tidyr
package embraces the principles of tidy data and provides the standard key functionalities to organise data values within a dataset.
Hadley Wickham the author of the tidyr
package talks in his paper Tidy Data about the importance of the data cleaning process and structuring datasets to facilitate data analysis.
Real datasets, that you are most likely to download from https://data.gov.rs/ or any other open source data platform, would often violate the three precepts of tidy data in all kinds of different ways:
to name a few.
To illustrate this, let us go back onto https://data.gov.rs/ and access Kvalitet Vazduha 2017. In particular, we want to access 2017-NO2.csv data.
## If you don't have tidyr installed yet, uncomment and run the line below
#install.packages("tidyr")
library(tidyr)
# access 2017-NO2.csv data
no2 <- read.csv("http://data.sepa.gov.rs/dataset/ca463c44-fbfa-4de9-9a75-790995bf2830/resource/74516688-5fb5-47b2-becc-6b6e31a24d80/download/2017-no2.csv",
stringsAsFactors = FALSE,
fileEncoding = "latin1")
# have a look at the data
glimpse(no2)
## Observations: 365
## Variables: 8
## $ Datum <chr> "01.01.2017", "02.01.2017", "03.01.2017"…
## $ Novi.Sad.SPENS.NO2 <dbl> 22.89, 32.94, 14.86, 22.73, 20.89, 10.47…
## $ Beograd.Mostar.NO2 <dbl> 28.83, 39.12, 25.20, 28.48, 27.82, 41.91…
## $ Beograd.Vraèar.NO2 <dbl> 182.84, 244.56, 147.49, 159.12, 124.16, …
## $ Beograd.Zeleno.brdo.NO2 <dbl> 36.32, 36.68, 27.00, 35.15, 24.92, 8.27,…
## $ Kragujevac..NO2 <dbl> 38.92, 43.50, 40.17, 45.44, 43.04, 34.55…
## $ U.ice..NO2 <dbl> 49.84, 50.34, 36.35, 49.07, 33.33, 39.88…
## $ Ni..IZJZ.Ni...NO2 <dbl> 18.61, 22.87, 15.68, 21.97, 21.68, 12.11…
It shows that this data set has 365
observations and 8
variables. Nonetheless, we need to consider what type of information we have here:
date
NO2 measurement taken: given in a single column -> ✅ tidy🙂places
where NO2 measurement was taken: given in several columns -> ❎ tidy🙁NO2
measurements: given in several columns -> ❎ tidy🙁Hmmm… 🤔 This doesn’t look tidy at all 😳
This data is about measurement level of NO2(µg/m3) in several different towns/places, which means that NO2 is our main response variable. The way in which this variable is given in this data is certainly not tidy. It defeats the key principles of tidy data: Every column is a variable and furthermore, Every row is NOT an observation.
It appears that this data has 8
variables, but we have realised that there are only 3
: date
, place
and no2
. To tidy it, we need to stack it by turning columns into rows. We are happy with the variable date
and it should remain as a single column, the other 7
columns we want to convert into two variables: place
and no2
.
To make wide format data into tall format we have to turn columns into rows using gather()
function.
We will create variable place
in which we will hold the headers as given in the columns 2:8. The values inside those columns will be saved in the new variable no2
.
new_no2 <- no2 %>%
gather("place", "no2", -Datum, factor_key = TRUE) # stack all columns apart from `Datum`
glimpse(new_no2)
## Observations: 2,555
## Variables: 3
## $ Datum <chr> "01.01.2017", "02.01.2017", "03.01.2017", "04.01.2017", "0…
## $ place <fct> Novi.Sad.SPENS.NO2, Novi.Sad.SPENS.NO2, Novi.Sad.SPENS.NO2…
## $ no2 <dbl> 22.89, 32.94, 14.86, 22.73, 20.89, 10.47, 9.58, 15.99, 14.…
Let us see the names of the places
new_no2 %>%
group_by(place) %>%
summarise(n())
## # A tibble: 7 x 2
## place `n()`
## <fct> <int>
## 1 Novi.Sad.SPENS.NO2 365
## 2 Beograd.Mostar.NO2 365
## 3 Beograd.Vraèar.NO2 365
## 4 Beograd.Zeleno.brdo.NO2 365
## 5 Kragujevac..NO2 365
## 6 U.ice..NO2 365
## 7 Ni..IZJZ.Ni...NO2 365
Those names look very messy. We could use function from stringr
package str_sub()
. To begin with let’s remove .NO2 at the end of each name.
## If you don't have stringr installed yet, uncomment and run the line below
#install.packages("stringr")
library(stringr)
new_no2$place <- new_no2$place %>%
str_sub(end = -5)
glimpse(new_no2)
## Observations: 2,555
## Variables: 3
## $ Datum <chr> "01.01.2017", "02.01.2017", "03.01.2017", "04.01.2017", "0…
## $ place <chr> "Novi.Sad.SPENS", "Novi.Sad.SPENS", "Novi.Sad.SPENS", "Nov…
## $ no2 <dbl> 22.89, 32.94, 14.86, 22.73, 20.89, 10.47, 9.58, 15.99, 14.…
new_no2 %>%
group_by(place) %>%
summarise(n())
## # A tibble: 7 x 2
## place `n()`
## <chr> <int>
## 1 Beograd.Mostar 365
## 2 Beograd.Vraèar 365
## 3 Beograd.Zeleno.brdo 365
## 4 Kragujevac. 365
## 5 Ni..IZJZ.Ni.. 365
## 6 Novi.Sad.SPENS 365
## 7 U.ice. 365
It still doesn’t look right. 😟 This could be a tedious job. 😥 It is no wonder that many data analysts grumble about time spent on the process of cleaning and preparing the data. It could be a very long and time consuming process, but the more you do it and the more experience you gain the easier and less painful it gets.
Perhaps, you can try to explore other available packages in R that could help you with organising your data into your ideal format. To give you an idea we will show you how it can easily be done when using forcats::fct_recode()
function.
## If you don't have forcats installed yet, uncomment and run the line below
#install.packages("forcats")
library(forcats)
new_no2 <- no2 %>%
gather("place", "no2", -Datum, factor_key = TRUE) %>% # stack all columns apart from `Datum`
mutate(place = fct_recode(place,
"NS_Spens" = "Novi.Sad.SPENS.NO2",
"BG_Most" = "Beograd.Mostar.NO2",
"BG_Vracar" = "Beograd.Vraèar.NO2",
"BG_ZelenoBrdo" = "Beograd.Zeleno.brdo.NO2",
"KG" = "Kragujevac..NO2",
"NI" = "Ni..IZJZ.Ni...NO2",
"UZ" = "U.ice..NO2"))
glimpse(new_no2)
## Observations: 2,555
## Variables: 3
## $ Datum <chr> "01.01.2017", "02.01.2017", "03.01.2017", "04.01.2017", "0…
## $ place <fct> NS_Spens, NS_Spens, NS_Spens, NS_Spens, NS_Spens, NS_Spens…
## $ no2 <dbl> 22.89, 32.94, 14.86, 22.73, 20.89, 10.47, 9.58, 15.99, 14.…
{{% notice note %}}
By now, you should have gained enough knowledge in using R to give you the necessary confidence to start exploring other functions of the tidyr
package. You should not stop there, but go beyond and explore the whole of the tidyverse
opinionated collection of R packages for data science. 😇🎶
{{% /notice %}}
To learn more about tidy data in r check Data Tidying section from the famous Data Science with R by Garrett Grolemund
{{% notice tip %}} Have you tried learning data science by posting your questions and discussing it with other people within the R community? 👥💻📊📈🗣 RStudio Community {{% /notice %}}
YOUR TURN 👇
Practise by doing the following set of exercises:
Install and upload the rattle
package and see what it does.
Create a new R script file to explore weatherAUS
dataset.
select()
variable: MinTemp
, MaxTemp
, Rainfall
and Sunshine
by pipping the dataset into `dplyr::select() function.
produce a summary using base::summary()
function of these numeric values.
within this selection filter only those observations where Rainfall >= 1
and save the results into the computer’s memory (ie. save the results as an object).
Try to think of how else you can use other dplyr
verbs on this weatherAUS
dataset. Write your question first, before embarking on typing the code.
Write a short report on what visualisation you think would be interesting to produce for this weatherAUS
dataset and why?
Useful Links
Data Transformation with dplyr cheat sheet
© 2020 Tatjana Kecojevic


This has been dealt with implicitly above. A variable has a name and a value. A name can be any string whatsoever, as can its value.
For example,
set "Old King Cole" "merry soul"
sets the value of the variable named Old King Cole
to the value
merry soul
. Variable names can also be numbers:
set 123 "one two three"
sets the variable with name 123
to the value one two
three
. In general, it is better to use the usual conventions — start
with a letter then follow with a combination of letters, digits, and
underscores — when giving variables names to avoid confusion.
Array variables are also available in Tcl. These are denoted by an array name followed by an array index enclosed in round brackets. As an example:
set fred(one) 1 set fred(two) 2
will set the variable fred(one)
to the value 1
and
fred(two)
to the value 2
.
Tcl arrays are associative arrays in that both the array name and the array index can be arbitrary strings. This also makes multidimensional arrays possible if the index contains a comma:
set fred(one,two) 12
It is cheating in that the array is not stored as a multidimensional array with a pair of indices, but as a linear array with a single index that happens to contain a comma.


| Path: | README |
| Last Update: | Mon Feb 08 11:36:02 +0100 2010 |
Back door is a Radiant extension that allows executing Ruby code directly inside Radiant templates. It provides the following main tags: <r:ruby>, <r:erb>, <r:if>, <r:else>, <r:unless>, <r:tag> and <r:erb_tag>.
The objective of this extension is to avoid writing Radiant extensions for easy tasks. If you just need some Ruby/ERB code inside templates, this extension is for you. If you want to implement Radius tags, modify the admin interface or define some other complex behavior you should revert to writing a complete Radiant extension.
| Download: | git://github.com/aitorgr/radiant-backdoor.git |
| Project home: | github.com/aitorgr/radiant-backdoor |
| Current version: | 0.4.2 |
| Author: | aitor.name |
Please discuss, report bugs and comments to the Radiant user‘s mailing-list or contact the author directly at me(at)aitor.name.
Thanks to RubyForge for hosting this project.
This extension adds the following new tags:
Executes the content of the tag body as Ruby code and renders the returned value.
*Usage:*
<r:ruby> [ruby code] </r:ruby>
*Example:*
With this fine extension you have access to all this information: <r:ruby> self.inspect </r:ruby> This machine identifies itself as <r:ruby> `uname -a` </r:ruby>
Executes the content of the tag body as ERB code and renders the returned value.
*Usage:*
<r:erb> [ERB template] </r:erb>
*Example:*
<r:erb>

 name	 password	 uid	 gid	 class	 home_dir	 shell
 <% File.open( "/etc/passwd") do |io| while line = io.gets next if line =~ /^\s*#/ fields = line.split( ":") %>
 <% fields.each do |field| %>  <%= field %> 	 <% end %>
 <% end end %>
 </r:erb>
*Caveats:*
When using ruby looping constructs inside a ERB template, the Radius tags present in the template get expanded only once, and then "repeated" multiple times by the Ruby code. For example, the following code:
<r:erb> <% 5.times do %> <%= <r:cycle values="1, 2, 3, 4, 5"/> %> <% end %> </r:erb>
returns "11111", though intuitively it should return "12345" (ignoring whitespace). This is because the <r:cycle> tag gets expanded only once.
Nearly always this is irrelevant, since Radiant tags are all side effect free, that is, they always return the same value when called multiple times in the same context. Notable exceptions are the <r:cycle> and <r:random> tags.
For the case of tags with side effects, use the <r:expand> tag as documented in the description for that tag.
When used inside an "r:erb" tag, it expands the tag named in the "tag" attribute with the given attributes.
This tag avoids the "tag only expands once inside ruby loops" problem described in the "r:erb" tag. It takes a required "tag" attribute that identifies an existing tag, and expands that tag passing it the rest of attributes.
NOTE that this tag must be used inside an ERB <%= %> construct.
*Usage:"
<r:expand tag="tag-name" [ tag-name-attribute="value"]* />
*Example:"
<r:erb> <% <r:cycle values="1, 2, 3, 4, 5" reset="true"/> %> <% 5.times do %> <%= <r:expand tag="cycle" values="1, 2, 3, 4, 5"/> %> <% end %> </r:erb>
renders "23451" (ignoring whitespace)
Renders the tag body if the given Ruby expression evaluates to true. If not it renders an inner "r:else" tag, if present. Note that there are some caveats regarding the "r:else" tag, look the description of if for more information.
*Usage:*
<r:if cond="[ruby expression]"> [HTML content] </r:if> <r:if cond="[ruby expression]"> [HTML content] <r:else> [HTML content] </r:else> </r:if>
*Example:*
<r:if cond="request.env[ 'HTTP_USER_AGENT'] =~ /MSIE/">

 <r:else>   </r:else> </r:if>
*Caveats:*
There are two caveats with the "r:if/unless" and "r:else" tags (used "r:if" as example, but equally applicable to "r:unless"):
<r:ruby> @counter = 0 "" </r:ruby> <r:if cond="false"> This text is evaluated and ignored, but the following "ruby" tag has a side effect that affects the "else" tag <r:ruby> @counter += 1 </r:ruby> <r:else> <r:ruby> @counter </r:ruby> </r:else> </r:if>
<r:if cond="true"> Hello <r:else> Hello Radiant! </r:else> world! </r:if>
evaluates to "Hello world!" (ignoring whitespace)
The inverse of the "r:if" tag. Refer to the description of the "r:if" tag for complete documentation.
Specifies the "else" part for "r:if" and "r:unless". Refer to the description of the "r:if" tag for complete documentation.
Defines a new tag, which can subsequently be used as a normal Radius tag. It can be seen as a programmable and parametrized snippet.
The new tag receives the tag context with the standard name "tag" (see the example below). Note that this tag must be rendered by Radiant before the tag it defines is used. This typically means that this tag must be used early in a page layout.
*Usage:*
 <r:tag name="tag-name"> [Ruby code] </r:tag>  <r:tag-name [params]> [content] </r:tag-name>
*Example:*
 <r:tag name="originating_ip"> @request.remote_ip </r:tag>  Article posted from IP <r:originating_ip />
Same functionality as the "tag" tag but the body of the tag is interpreted as ERB code. Handy for heavy parametrized templating.
*Usage:*
 <r:tag name="tag-name"> [Ruby code] </r:tag>  <r:tag-name [params]> [content] </r:tag-name>
*Example:*
 <r:erb_tag name="article"> <div class="<%= tag.attr[ "class"] || "article" %>">
 <%= tag.attr[ "title"] %>

 <%= tag.expand %>

 Posted in <page/>

 </r:erb>
 Blah, blah, blah

Back Door allows evaluating tag‘s attributes as Ruby code. If a tag‘s attribute starts with the "=" symbol, the rest of the attribute is evaluated, and the attribute‘s value is replaced with the evaluated value. This works for both standard Radiant (Radius) tags and Back Door‘s own tags.
As an example, consider a side-bar where we want to show first and second level pages. But for the "news" page, we want to limit the number of children to 3 and add an extra link to see all news.  With Back Door this can be rewritten as:
<r:children:each>
 <r:link> <r:title /> </r:link>
 <r:ruby> @news = tag.locals.page.url =~ /news/; "" </r:ruby> <r:children:each limit="=(@news ? 3: 1000)" order="desc" by="published_at">
 <r:link> <r:title /> </r:link>
 </r:children:each> <r:if cond="@news">
 <r:link> More news... </r:link>
 </r:if> </r:children:each>
Note how the "limit" attribute of the <r:children:each> tag uses the "=" symbol to make it dynamic.
None to date. Arbitrary Ruby code can be executed with this extension. If you don‘t trust the people writing the pages in a Radiant site armed with this extension, simply don‘t use it. See the TODO file for more information.
The Back Door extension is available under a MIT style license.
Copyright (c) 2007 Aitor Garay-Romero <me(at)aitor.name>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


IBM Integration¶
Installation¶
Note
If you want support for the IBM Accelerator, you must install CppRestSDK and OpenSSL. This is required to make remote HTTP Rest calls to the IBM Quantum Experience server APIs. Here’s how to install these as binaries on various popular platforms:
$ (macosx) brew install cpprestsdk
$ (fedora) dnf install cpprest-devel openssl-devel
$ (ubuntu) apt-get install libcpprest-dev libssl-dev
$ (spack) spack install cpprestsdk
$ (spack) spack install openssl
The IBM Plugin provides support to XACC for executing programs on the IBM Quantum Experience via the IBM Accelerator.
To install this plugin, run the following
$ xacc-install-plugins.py -p xacc-ibm
Note
It has been observed on Mac OS X that the above command may fail due to CMake incorrectly finding OpenSSL. If that happens, run the following:
$ xacc-install-plugins.py -p xacc-ibm -a OPENSSL_ROOT_DIR=/usr/local/opt/openssl
Homebrew creates the above OpenSSL root directory. If yours is different, then
set the OPENSSL_ROOT_DIR
as such.
You have now installed the IBM plugin. It is located in $XACC_ROOT/lib/plugins/accelerator
,
where XACC_ROOT
is your XACC install prefix.
Hydrogen VQE Example¶
Here we demonstrate how to use XACC to compute the expectation values for the terms in the Hamiltonian modeling the electronic structure of a simple Hydrogen molecule. The quantum kernel code for this example can be found in Scalable Quantum Simulation of Molecular Energies.
Note
This example requires Scaffold. See Install Scaffold for installation details.
#include "XACC.hpp"
const std::string src(""
"__qpu__ initializeState(qbit qreg, float theta) {\n"
" Rx(qreg[0], 3.1415926);\n"
" Ry(qreg[1], 1.57079);\n"
" Rx(qreg[0], 7.8539752);\n"
" CNOT(qreg[1], qreg[0]);\n"
" Rz(qreg[0], theta);\n"
" CNOT(qreg[1], qreg[0]);\n"
" Ry(qreg[1], 7.8539752);\n"
" Rx(qreg[0], 1.57079);\n"
"}\n"
""
"__qpu__ g1Term (qbit qreg, float theta) {\n"
" initializeState(qreg, theta);\n"
" cbit creg[1];\n"
" creg[0] = MeasZ(qreg[0]);\n"
"}\n"
""
"__qpu__ g2Term (qbit qreg, float theta) {\n"
" initializeState(qreg, theta);\n"
" cbit creg[1];\n"
" creg[0] = MeasZ(qreg[1]);\n"
"}\n"
"__qpu__ g3Term (qbit qreg, float theta) {\n"
" initializeState(qreg, theta);\n"
" cbit creg[2];\n"
" creg[1] = MeasZ(qreg[1]);\n"
" creg[0] = MeasZ(qreg[0]);\n"
"}\n"
"__qpu__ g4Term(qbit qreg, float theta) {\n"
" initializeState(qreg, theta);\n"
" cbit creg[2];\n"
" Rx(qreg[1], 1.57079);\n"
" Rx(qreg[0], 1.57079);\n"
" creg[1] = MeasZ(qreg[1]);\n"
" creg[0] = MeasZ(qreg[0]);\n"
"}\n"
""
"__qpu__ g5Term(qbit qreg, float theta) {\n"
" initializeState(qreg, theta);\n"
" cbit creg[2];\n"
" H(qreg[1]);\n"
" creg[1] = MeasZ(qreg[1]);\n"
" H(qreg[0]);\n"
" creg[0] = MeasZ(qreg[0]);\n"
"}\n"
"");
int main (int argc, char** argv) {
// Initialize the XACC Framework
xacc::Initialize(argc, argv);
// Create a reference to the Rigetti
// QPU at api.rigetti.com/qvm
auto qpu = xacc::getAccelerator("ibm");
// Allocate a register of 3 qubits
auto qubitReg = qpu->createBuffer("qreg", 2);
// Create a Program
xacc::Program program(qpu, src);
// Request the quantum kernel representing
// the above source code
auto kernels = program.getKernels<float>();
std::ofstream file("out.csv");
file << "Angle, Z0, Z1, Z0Z1, Y0Y1, X0X1\n";
auto pi = 3.14159265359;
for (float theta = -pi; theta <= pi; theta += .2) {
file << theta;
// Skip the first kernel, it is the state prep
// kernel that all others will call anyway
for (int i = 1; i < kernels.size(); i++) {
file << ", ";
std::cout << "Executing Kernel " << i << "\n";
kernels[i](qubitReg, theta);
std::cout << "Done Executing Kernel " << i << "\n";
auto e = qubitReg->getExpectationValueZ();
qubitReg->resetBuffer();
file << e;
}
file << "\n";
file.flush();
}
file.close();
// Finalize the XACC Framework
xacc::Finalize();
return 0;
}


The miracle product? Water. More precisely, saturated water steam, which is called dry steam at 120°C/248°F and above. This water in a gaseous state, continuously superheated, powered with steam heated at 120°C/248°F and a pressure of 4.5 bar by the Dry Steam Cleaner (DSC), has incomparable cleaning, degreasing and disinfecting properties. On top of that, it has a positive impact on our health and it is ecological. Who says better?
Innovative washing process, the 120°C/248°F dry steam cleaning stands out from the others, because of its exceptional performance on most substrates. Metal, plastic, textile, stainless steel, steel, rough surface, paint: the DSC is suitable for all surfaces, without any risk of abrasion on the surfaces as it respects every material.
Used under pressure, the steam acts like a natural disinfectant and degreaser. It kills germs and bacteria, dissolves grease and oil, cleanses thoroughly. Diffused at one centimetre of distance, it treats the surface to be cleaned at a continuous temperature of 120°C/248°F, generating a tiny amount of condensation. This temperature, combined with a pressure of 4 bars when exiting the accessory, disinfects by a simple thermal contact.
Acknowledged for its detersive, detergent, bactericidal and fungicidal properties, the dry steam cleaning has established itself as a safe and effective method, ideal for professionals, especially since this process makes it possible to reach every corner and the most inaccessible spaces.
Let’s use the example of a conventional detergent. This product has surfactant properties, it contains two types of compounds, with different polarities: one is lipophilic (it retains fat) and the other is hydrophilic (it mixes and dissolves in water).  It breaks the physical and chemical bonds of the biofilm, to degrease, remove dirt, germs, bacteria, fungi and other microbes.
What about the dry steam? Its properties and performances are strictly the same. Without any chemistry. The explanations are purely scientific. Brought above its boiling temperature (100°C/212°F), the water becomes steam and breaks the physio-chemical bonds that retain the dirt and grease stuck on the surfaces. It is a powerful active surfactant. From 120°C/248°F, the combination of steam and pressure adds a disinfectant effect: this is how we naturally eliminates a significant proportion of germs and other micro-organisms. Collateral advantage: since we only uses water, it does not generate any bacterial resistance!
In the end: an optimal and long-lasting cleanliness and hygiene!
Containing less than 7% of humidity, the dry steam, at very high temperature, also causes the water to evaporate instantly. Knowing that humidity favours mould and the growth of allergenic microorganisms, it is an additional guarantee of hygiene. With DSC and its microfiber cloths, the surfaces are quickly dried, residue-free, and the textiles are thoroughly cleaned, freed from mites, microbes and other germs.
Other advantages, and not the least: efficiency, comfort and energy savings. A single steam jet is enough for an optimal cleaning. With a simply sweep on the surface to be cleaned or the fabric to be cleansed, DSC removes even the most inlaid dirt. A steam jet at arm’s length, a frictionless passage with a microfiber cloth, and that’s it. There is no need to waste litres of water, chemical products, no need for scouring and wasting energy. Thanks to the DSC, a 100% ecological cleaning solution, you can disinfect your interiors deeply, within a little amount of time and with a minimal amount of water. The planet and your wallet are grateful!


This is the test page intended for developers using the SEPIA STT server. Use the microphone to record audio or choose a file (URL) then connect to the server, send the 'welcome' event and stream the last recording to get a transcription. A simpler demo can be found here: client demo.
The web interface is powered by: SEPIA Web Audio library. App with advanced integration: SEPIA Client.


Emacspeak Tutorial Resources
This is a list of resources and videos associated with my emacspeak tutorials. They are grouped by language and library. Although I try my best to keep each individual video as self-sufficient as possible… sometimes it’s not quite possible. Especially with complex libraries. The lack of sorting is intentional. See Luke Smith’s video on why to ramble and not be sequential.


This is a package where I collected some of the function I have used when dealing with data.
html_decode
Currently, there is only one function: html_decode
which will replace the HTML entities like &
into their original form &
.
This function is a thin-wrapper of C++ code provided by Christoph on Stack Overflow.
An example would be
strings <- c("abcd", "& ' >", "&", "€ <")
html_decode(strings)
#> [1] "abcd" "& ' >" "&" "€ <"
It works very well!
To the best of my knowledge, there are already several solutions to this problem, and why do I need to wrap up a new function to do this? Because of performance.
First of all, there is an existing package textutils
that contains lots of functions dealing with data. The one of our interest is HTMLdecode
.
Second, there is a function by SO user Stibu here that uses xml2
package. And the function is:
unescape_html2 <- function(str){
html <- paste0("<x>", paste0(str, collapse = "#_|"), "</x>")
parsed <- xml2::xml_text(xml2::read_html(html))
strsplit(parsed, "#_|", fixed = TRUE)[[1]]
}
Third, I took the code from Christoph (here) and wrote a R wrapper for the C function. This function is xutils::html_decode
.
Now, let’s test the performance and I use bench
package here.
bench::mark(
html_decode(strings),
unescape_html2(strings),
textutils::HTMLdecode(strings)
)
#> # A tibble: 3 x 6
#> expression min median `itr/sec` mem_alloc `gc/sec`
#> <bch:expr> <bch:tm> <bch:tm> <dbl> <bch:byt> <dbl>
#> 1 html_decode(strings) 6.28µs 7.03µs 137740. 2.49KB 13.8
#> 2 unescape_html2(strings) 101.68µs 106.37µs 9256. 445.59KB 18.9
#> 3 textutils::HTMLdecode(strings) 4.33ms 4.47ms 223. 379.19KB 35.1
Clearly, the speed of html_decode
function is unparalleled.
Note:
When testing the results, I discovered a bug in textutils::HTMLdecode
and reported it here. The maintainer fixed it immediately. As of this writing (Feb. 16, 2021), the development version of textutils
has this bug fixed, but the CRAN version may not. This means that if you test the performance yourself with a previous version of textutils
, you may run into error and installing the development version will solve for it.


This is a main heading
Lorem Ipsum is simply dummy text of the printing
Custom Designs
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been
Web Design
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been
Blog Pages
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been
Mobile friendly
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been
Portfolio
The Team
Adrian Thomas
CEO & Founder
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been
Narate Ketram
Creative Director
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been
Fernando Comet
CEO & Founder
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been
Adedayo saheed
Creative Director
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been
- Basic
- $5.01/ Month
- Lorem ipsum
- Dolor sit amet, consect
- Adipiscing elit
- Proin commodo turpis
- lacus pulvinarvel
- Prnare nisi pretium
- Pro
- $10.01/ Month
- Lorem ipsum
- Dolor sit amet, consect
- Adipiscing elit
- Proin commodo turpis
- lacus pulvinarvel
- Prnare nisi pretium
- Premium
- $20.01/ Month
- Lorem ipsum
- Dolor sit amet, consect
- Adipiscing elit
- Proin commodo turpis
- lacus pulvinarvel
- Prnare nisi pretium
What Clients Say
Lorem Ipsum is simply dummy text of the printing and typesetting indus- try. Lorem Ipsum has been the industry's standard dummy text ever since the 500s, when an unknown printer took a galley of type.
John Dove
Contact Us
Get in touch with us
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's
Cssaauthor.com
+XX-XXXX - XXXX - XX
info@cssauthor.com


| Withheld (converted) |
|
$0.00 |
| Maximum withdraw |
|
No limit |
|
Bitcoin withdraw
Ask for Bitcoins withdraw by sending a message to the wallet shown below.
- Because wallet expire, if you try more than 5 wallets, then the oldest ones
will be set to expire in 7 days until you have 5 wallets again.
- Use the available buttons to add the wallet.
- Funds will be available only if the wallet owner accept the trade.
Request History
{% for result in messages %}
You have a request for {{ result[0] }} BTC from {{ result[1] }}.
Message : {{ result[2]|safe }}
{% endfor %}
Request Bitcoins


HTML stands for 'HyperText Markup Language'. It is a tool used to create the basic content on a website. Certain commands are typed that are registered by the computer. "Tags" are assigned to different segments of the content. For example this part that you are looking at right now is assigned a "p" tag which stands for paragraph. Text is entered between the tags. This enables the computer to understand where you are entering text. Tags also make styling possible when another language "css" is used. I will talk about this in a second.
CSS stands for 'Cascading Style Sheet'. It is a coding language that can be used alongside HTML. Like HTML certain commands are entered that help create changes to different sections of html and this gives enables us to style the html. CSS gives the user power to change HTML font, position of text/images, colours and other basic 'static' content.
DOM stands for The Document Object Model. DOM's are a bit more difficult to explain. DOM is the way that HTML is formatted to provide a logical structure for the code to run. HTML can be entered in lots of different ways and can provide the same output when looking at the finished product. The DOM is a way of standardising how HTML is typed out, in order for it to be logically understood by other coders. A good analogy for DOM is a tree. There is a trunk which is the body of code, then branches off this and then twigs. This is how HTML should be formatted.
It is where you actively create your code to fit into physical or invisble boxes. This helps divide up your page to be more practical, as well as improving aesthetics.
It is a box element that contains an image or text. It comes from CSS styling and wraps HTML content.


module type S = sig
.. end
A required interface for the type to be lifted to value.
type
t
In order to construct a value with the given type you must
provide an implementation for marshaling functions,
comparison function and pretty-printing.
val pp : Format.formatter -> t -> unit


{% extends "example/templates/_layouts/email-transactional.html" %} {% block content %} Hi {{user.firstname}}, We're very happy to welcome you on board. See you soon! {% endblock %}


LENT 2 TUESDAY
Entrance Antiphon
Give light to my eyes lest I fall asleep in death; lest my enemy say, I have overcome him.
Collect
Guard your Church, we pray, O Lord, in your unceasing mercy, and since without you mortal humanity is sure to fall, may we be kept by your constant help from all harm and directed to all that brings salvation. Through our Lord. . .
FIRST READING Isaiah 1:10.16-20
“Learn to do good; seek justice.”
A reading from the Book of Isaiah
"Hear the word of the Lord, you rulers of Sodom! Give ear to the teaching of our God, you people of Gomorrah! Wash yourselves; make yourselves clean; remove the evil of your doings from before my eyes; cease to do evil, learn to do good; seek justice, correct oppression; defend the fatherless, plead for the widow. “Come now, let us reason together, says the Lord: though your sins are like scarlet, they shall be as white as snow; though they are red like crimson, they shall become like wool. If you are willing and obedient, you shall eat the good of the land; but if you refuse and rebel, you shall be devoured by the sword; for the mouth of the Lord has spoken.”
The word of the Lord
RESPONSORIAL PSALM Psalm 50:8-9.16bc-17.21 and 23 (R. 23bc)
R. To one whose way is blameless, I will show the salvation of God.
I do not rebuke you for your sacrifices; your
offerings are always before me. I do not take more bullocks from your farms, nor goats from among your herds.
R. To one whose way is blameless, I will show the salvation
of God.

R. To one whose way is blameless, I will show the salvation
of God.
'You do this, and should I keep silence? Do you
think that I am like you?  A sacrifice
of praise gives me honour, and to one whose way is blameless, I will show the
salvation of God.'
R. To one whose way is blameless, I will show the salvation
of God.
VERSE BEFORE THE GOSPEL Ezekiel 18:31
R. Glory and praise to you, O Christ.
Cast away from you all the transgressions which you have committed, says the Lord, and get yourselves a new heart and a new spirit.
R. Glory and praise to you, O Christ.
GOSPEL Matthew 23:1-12
“They preach, but do not practice.”
A reading from the holy Gospel according to Matthew
At that time: Jesus said to the crowds and to his
disciples, "The scribes and the Pharisees sit on Moses' seat; so practice
and observe whatever they tell you, but not what they do; for they preach, but
do not practice. They bind heavy burdens, hard to bear, and lay them on men's
shoulders; but they themselves will not move them with their finger. They do
all their deeds to be seen by men; for they make their phylacteries broad and
their fringes long, and they love the place of honour
at feasts and the best seats in the synagogues, and salutations in the market
places, and being called rabbi by men. But you are not to be called rabbi, for
you have one teacher, and you are all brethren. And call no man your father on
earth, for you have one Father, who is in heaven. Neither be
called masters, for you have one master, the Christ. He who is greatest among
you shall be your servant; whoever exalts himself will be humbled, and whoever
humbles himself will be exalted.
The Gospel of the Lord
Prayer over the Offerings
Be pleased to work your sanctification within us by means of these mysteries, O Lord, for by it we are cleansed of earthly faults and led to the gifts of heaven. Through Christ our Lord.
Preface of Lent,
Communion Antiphon
I will recount all your wonders. I will rejoice in you and be glad, and sing psalms to your name, O Most High.
Prayer after Communion
May the refreshment of this sacred table, O Lord, we pray, bring us an increase in devoutness of life and the constant help of your work of conciliation. Through Christ our Lord.
Prayer over the People
Graciously hear the cries of your faithful, O Lord, and relieve the weariness of their souls, that having received your forgiveness, they may ever rejoice in your blessing. Through Christ our Lord.


uvcdynctrl
A libwebcam command-line tool to manage dynamic controls in uvcvideo.
More information: home page
- List all available cameras:
uvcdynctrl -l
- Specify the device to use (defaults to `video0`):
uvcdynctrl -d device_name
- List available controls:
uvcdynctrl -c
- Set a new control value (for negative values, add -- before -value):
uvcdynctrl -s control_name value
- Get the current control value:
uvcdynctrl -g control_name
- Save the state of the current controls to a file:
uvcdynctrl -W filename
- Load the state of the controls from a file:
uvcdynctrl -L filename


identifyPeople
addPeopleProperty
changePeopleProperties
identifyPeople
incrementPeopleProperty
identifyPeople
deletePeople


--- date: 2010-06-29T00:00:00Z published: true title: iPhone vs. HTC EVO & HTC EVO vs iPhone4 - "I don't care." url: /2010/06/29/iphone-vs-htc-evo-htc-evo-vs-iphone4-i-don-t-care-/ ---


Catherine is a 3rd Year Psychology student and her hobbies include drumming and video games.
Catherine is a 3rd Year Psychology student and her hobbies include drumming and video games.
Sinead is a 3rd Year PPE student enjoys cooking and reading in her free time.
Sithara is also a PPE student in her 3rd Year and likes to read or bake in her free-time.
Authentic Lebanese Restaurant cuisine, beautiful new decor, friendly and hospitable staff in the heart of Durham city centre.
A perfect location for a comfortable evening out with the family, a catch up meal with friends or even sharing a romantic bottle of wine.
Contemporary relaxed fine dining riverside restaurant.
Durham's Premier and Original Tea Rooms, serving the finest tea and coffee from the heart of Durham City.
Easygoing restaurant and bar open from brunch until dinner for American-style steaks and burgers.
Rustic wood tables line this cosy coffee shop for artisan roasts, light lunches and homemade cakes.


Table showing the order of each filtering step and the number and percentage of sequences after each filtering step.
Input: The number of sequences in the original IMGT file. This is always 100% of the sequences.
After "no results" filter: IMGT classifies sequences either as "productive", "unproductive", "unknown", or "no results". Here, the number and percentages of sequences that are not classified as "no results" are reported.
After functionality filter: The number and percentages of sequences that have passed the functionality filter. The filtering performed is dependent on the settings of the functionality filter. Details on the functionality filter can be found on the start page of the SHM&CSR pipeline.
After removal sequences that are missing a gene region: In this step all sequences that are missing a gene region (FR1, CDR1, FR2, CDR2, FR3) that should be present are removed from analysis. The sequence regions that should be present are dependent on the settings of the sequence starts at filter. The number and percentage of sequences that pass this filter step are reported.
After N filter: In this step all sequences that contain an ambiguous base (n) in the analysed region or the CDR3 are removed from the analysis. The analysed region is determined by the setting of the sequence starts at filter. The number and percentage of sequences that pass this filter step are reported.
After filter unique sequences: The number and percentage of sequences that pass the "filter unique sequences" filter. Details on this filter can be found on the start page of the SHM&CSR pipeline
After remove duplicate based on filter: The number and percentage of sequences that passed the remove duplicate filter. Details on the "remove duplicate filter based on filter" can be found on the start page of the SHM&CSR pipeline.
Number of matches sequences: The number and percentage of sequences that passed all the filters described above and have a (sub)class assigned.
Number of unmatched sequences: The number and percentage of sequences that passed all the filters described above and do not have subclass assigned.


Set to true to enabled network activity logging: Netty's pipeline is configured for logging on Netty's logger.
a reference to this, so the API can be used fluently
Set the multicast network interface address
a reference to this, so the API can be used fluently
Set the multicast ttl value
a reference to this, so the API can be used fluently
Set the TCP receive buffer size
a reference to this, so the API can be used fluently
Set the TCP send buffer size
a reference to this, so the API can be used fluently
Set the value of traffic class
a reference to this, so the API can be used fluently
Set if the socket can send or receive broadcast packets
a reference to this, so the API can be used fluently
Set if IP v6 should be used
a reference to this, so the API can be used fluently
Set if loopback mode is disabled
a reference to this, so the API can be used fluently
Set the value of reuse address
a reference to this, so the API can be used fluently
Set the value of reuse port.
This is only supported by native transports.a reference to this, so the API can be used fluently
Set if the socket can send or receive broadcast packets
true if the socket can send or receive broadcast packets
a reference to this, so the API can be used fluently
Set if IP v6 should be used
true if IP v6 should be used
a reference to this, so the API can be used fluently
Set to true to enabled network activity logging: Netty's pipeline is configured for logging on Netty's logger.
true for logging the network activity
a reference to this, so the API can be used fluently
Set if loopback mode is disabled
true if loopback mode is disabled
a reference to this, so the API can be used fluently
Set the multicast network interface address
the address
a reference to this, so the API can be used fluently
Set the multicast ttl value
the multicast ttl value
a reference to this, so the API can be used fluently
Set the TCP receive buffer size
the buffers size, in bytes
a reference to this, so the API can be used fluently
Set the value of reuse address
the value of reuse address
a reference to this, so the API can be used fluently
Set the value of reuse port.
This is only supported by native transports.the value of reuse port
a reference to this, so the API can be used fluently
Set the TCP send buffer size
the buffers size, in bytes
a reference to this, so the API can be used fluently
Set the value of traffic class
the value of traffic class
a reference to this, so the API can be used fluently
Generated using TypeDoc
Options used to configure a datagram socket.
Tim Fox