Similarity package¶
Submodules¶
Similarity.distances module¶
-
Similarity.distances.
ccor
(ts1, ts2)[source]¶ given two standardized time series, compute their cross-correlation using FFT
-
Similarity.distances.
distance
(ts1, ts2, mult=1)[source]¶ Calculates the distance metric using the kernal coefficient
-
Similarity.distances.
kernel_corr
(ts1, ts2, mult=1)[source]¶ compute a kernelized correlation so that we can get a real distance
Similarity.find_most_similar module¶
-
Similarity.find_most_similar.
find_most_similiar
(filename, n, vantage_pts, sm)[source]¶ Finds n most similiar time series to the time series of interest (filename) by using the supplied vantage points
filename: timeseries of interest n: number of similiar timeseries to return (n must be between 1 and 20) vantage_pts: a list of the vantage point numbers
Returns: list of n most similiar filenames
Notes: Correct behavior is not gaurenteed when n > the number of vantage points
-
Similarity.find_most_similar.
find_similarity_of_points_in_radius
(closest_vantage_pt, ts1, radius, sm)[source]¶ Given a vantage point and a radius, find the points that fall within the circle around the vantage point. Then calculates the distance from all of these points to the timeseries of interest.
closest_vantage_pt: number of the vantage point being considered ts1: timeseries of interest radius: radius of circle to consider
Returns: list of tuples (distance, timeseries id) in sorted order
Similarity.generate_time_series module¶
Similarity.pick_vantage_points module¶
-
Similarity.pick_vantage_points.
pick_vantage_points
(arg, sm)[source]¶ Code which picks 20 vantage points and produces a database for each one. The database stores (key,value) pairs where: key = distance from timeseries to vantage point (kernel coefficient) value = id of timeseries (0-999)
returns: list of vantage points (integers from 0-999)
Module contents¶
-
Similarity.
pick_vantage_points
(arg, sm)[source]¶ Code which picks 20 vantage points and produces a database for each one. The database stores (key,value) pairs where: key = distance from timeseries to vantage point (kernel coefficient) value = id of timeseries (0-999)
returns: list of vantage points (integers from 0-999)


User Documentation¶
Features¶
- Data aquisition with our arduino-based interface
- Integrating peaks
- Selecting peaks and see their relativ areas
- Zooming into graphs synchronized (X-axis-scaling affects all graphs)
- Keyboard-shortcuts for all important actions (hover over the buttons to find out more!)
- Free axis-scaling
- Export functionality in several formats (CSV, Peaksimple, HTML, PDF-Reports)
- Automatic Peak-Finding based on Savitzky-Golay-Smoothing and filtering
- Free Baseline-editing using supporting points both, linear and with cubic splines
- Creation of Calibration-Datasets and applying them to measured chromatograms


I'm Kevin Miller
Hi! There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable.
Get to know me
Hi! There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable.
It is a long established fact that a reader will be distracted by the readable content
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
It is a long established fact that a reader will be distracted by the readable content
There are many variations of passages of Lorem Ipsum available, but the majority
Contrary to popular belief, Lorem Ipsum is not simply random text.
It is a long established fact that a reader will be distracted
Lorem ipsum dolor sit amet, consetetur
There are many variations of passages of Lorem Ipsum.
 Atque, tenetur nisi iste, ipsa obcaecati quis laudantium error distinctio excepturi
Lorem ipsum dolor sit amet consectetur adipisicing elit. Atque, tenetur nisi iste, ipsa obcaecati quis laudantium error distinctio excepturi
Lorem ipsum dolor sit amet consectetur adipisicing elit. Atque, tenetur nisi iste, ipsa obcaecati quis laudantium error distinctio excepturi
The standard chunk of Lorem Ipsum used since the 1500s
It is a long established fact that a reader will be distracted by the readable content


2 months learning process of HTML,CSS Overnight learning of PHP
Be Part
Of Our
Story!
Our Amazing Team
Akshita
Developer
Saifil
Developer
Meet
Developer
Making your life easy.
Project Name
Lorem ipsum dolor sit amet consectetur.
Dreams is a free PSD web template built by Mathavan Jaya. Dreams is a modern one page web template designed for almost any purpose. It’s a beautiful template that’s designed with the Bootstrap framework in mind.
You can download the PSD template in this portfolio sample item at FreebiesXpress.com.


Gym environment for moving cubes with simulated TriFingerPro.
More...
|
| def | __init__ (self, initializer=None, action_type=cube_env.ActionType.POSITION, frameskip=1, visualization=False) |
| | Initialize.
- Parameters
-
| initializer | Initializer class for providing initial cube pose and goal pose. If no initializer is provided, we will initialize in a way which is be helpful for learning. |
| action_type | Specify which type of actions to use. See :class:ActionType for details. |
| frameskip | Number of actual control steps to be performed in one call of step(). |
| visualization | If true, the pyBullet GUI is run for |
| visualization. | |
The documentation for this class was generated from the following file:
- example/example_pushing_training_env.py


Are you sure sure you would like to delete this scope?
Clients that have this scope will still be able to ask for it.


This is the project idea list for the current round of open source internships at Creative Commons.
Medium
Currently, we have a license selector on the admin panel that works fine but it can be improved by using the workflow of the new CC Chooser. We also have a set of Gutenberg blocks to insert a license in the content, we can also add a new block that can contain the CC Chooser workflow as well, this will improve the user experience and would be more educational regarding the CC Licenses.
Revamping the admin panel of the plugin, adding the CC Chooser on it as well as a Gutenberg block.
The intern will be expected to:
The intern should be able to plan this process and find the best way to adapt the workflow from the CC Chooser (JavaScript/Vue) to WordPress (PHP).
High
The Creative Commons licenses consist of three layers: 1) Legal code, 2) Human readable deeds, 3) Machine readable (API and RDF). The new license infrastructure does not yet generate the third layer: machine readable data.
Extend the new license infrastructure to generate machine readable licenses information. This project is an opportunity to empower applications, communities, and projects that wish to make the Creative Commons licenses available to their users.
The intern will be expected to:
This project appears simple (ingest data and generate XML), but there are many many important details and strict requirements. I expect the project will broadly have three phases: 1) mimicry, 2) research, and 3) innovation. Applications should:
Medium
Vocabulary currently has some performance issues, related to:
Performance can also be further improved via documentation, and sharing best practices for implementing vocabulary with consumers:
This work will have a strong and measurable impact on all sites using CC Vocabulary. The current live sites using vocabulary are:
We will be updating more CC websites to use Vocabulary in Q1 of this year. These changes will be quantifiable by measuring changes in page size (measured in kilobytes), and reduced load times on the Google-defined metrics "core web vitals": Largest Contentful Paint (LCP), First Input Delay (FID), and Cumulative Layout Shift (CLS).
Applying interns should do some basic performance analysis of some existing CC web properties using Vocabulary. They should also outline how they intend to measure the results of their work, taking special care to capture as much relevant initial data and reporting before their changes are implemented as possible.
This project requires proficiency in CSS/Sass and optionally an understanding of front-end build tooling with NPM. Some JavaScript may likely be useful as well. This is a great opportunity for a developer to learn about front-end performance profiling, "modern" web performance metrics, and many native HTML APIs and specifications for dealing with asset loading.
High
Vocabulary is currently written on top of an existing CSS library, Bulma. There are a few problems with Bulma: naming inconsistencies that confuse developers; difficulty in overriding its existing classes; the large file size, and the more general maintenance burden of relying on a third party library as the base for our design system.
This work would have benefits to performance, and would need to be coordinated with the performance improvements project, but would also benefit the developer experience and ease of use for Vocabulary. Users will no longer need to jump between Bulma’s documentation and Vocabulary’s, and the entire codebase will be colocated and easier to navigate.
The intern will need to assess existing web properties and figma designs to determine which CSS classes from Bulma need to be replicated and integrated into Vocabulary. This also means keeping track of what Bulma features can be ignored. Initially, any Bulma features we’re not using should be kept; they can either be re-implemented manually or their code can be copied directly into vocabulary. Later, once our vocabulary sites have migrated to the new version of Vocabulary without Bulma, we can look at deprecating and removing some of these features.
This intern will need to follow consistent naming conventions and CSS architectural style (Block Element Modifier {BEM}, utility classes, etc.) to ease the burden of this change for users.
Finally, the intern will need to document how to migrate to the version of Vocabulary that makes these changes live, with clear explanations of what code is deprecated, new, or modified.
The intern should outline a plan to audit and access existing Vocabulary implementations and develop a plan to migrate away from Bulma.
High
Queulat is a very good toolset to create forms, metaboxes, and custom post types but it lacks documentation and it could be a problem for the future. We may need to find an alternative to this.
The project would consider a couple of alternatives to completely remove Queulat from the repos that are currently using it.
The intern will be expected to:
The intern is expected to outline a plan to remove this dependency as well as the research about the possible alternatives.
We are open to original ideas for documentation improvements.
Please talk to us on the #cc-dev-internships
channel on Slack or via the mailing list to find a mentor for the project before submitting your proposal.


FreeYourSoul¶
Factions:¶
Renegades
Guardians
Empire
Introduction¶
Welcome to Amerite
Long time ago, goddess was walking along humans, living on the Vakoh, a floating island with a worshipping people, the Guardians while the other humans stayed living below. Granting them favor for their fidelity, they wanted to keep this people by their side. To do so, they shackled their soul into their body in order for them to not be able to die and called them Guardians of Vakoh, with the hope of the guardians worshipping them forever.
But the goddesses didn’t bother ask the permission to do such thing, which irritated some of their followers, whom centuries after centuries living, felt the feeling of wanting more. The Goddesses accepted granting a favor to them, and decided to land Vakoh, the holy island, in the great sea, in order to let the Guardians live aside with the other normal humans.
Centuries passed, and the irritation of some Guardians towards their immortality progressed into hatred. Living side by side with their humans peer made them realize how lonely they were. Seeing loved one leave while they felt trapped on earth. They started calling their divine gift a curse. They asked the goddess to release the soul bounding spell. The Goddess refused as they grew attached to all of their followers. The fidel Guardians didn’t approve and forgive such a disrespectful request and decided to exile them, and renamed them Renegades.
Having to quit the holy island and their goddess protection, they decided to continue living with the humans.
The greed and jealousy of the humans realm combined with the hatred of the Renegades started the holy war. Endless fight between Guardians and Renegades, endless slaughter between humans, mortal believer against immortality seeker of the Empire.
Disgusted by those reactions and the acts human perpetuated, the goddess decided to leave the human realm, letting them fight over.
After 5 years of battle, a truce is made between the Guardians being over-numbered, suffering from capture and torture despite not being able to die, and humans counting countless dead.
A pact is made, the Guardians returned in the holy island and shared some of their knowledge about souls given by the Goddess in order to quench the greed of the humans. The Renegades taken as responsible of the war and departure of the Goddess, didn’t have the right to go back to Vakoh and had to live further in the mountains, still looking for a way to release themselves from their own bodies.


Include css3-animated.js at the end of your file and animations.css in the head.
Once you have done that you can just define "animatedParent" as the parent class which is what will trigger the child class "animated" to animate whichever animation is defined, here we are using "bounceInDown".
Click here to see an example of all the animations.
") ?> It Works!"); ?> "); ?>
If you want to have a set of animations start one after the other then you can set a sequence time in ms using "data-sequence" then define the order with "data-id".
") ?> It Works!"); ?> This animation will start 500ms after"); ?> This animation will start 500ms after"); ?> "); ?>
This will make the make the animation either start before or after it has entered the viewport by the specified ammount. So if you wanted to only start the animation after the user has scrolled 300px past it then setting an offset of -300px would achieve this.
") ?> It Works!"); ?> "); ?>
Adding this will make sure the item only animates once and will not reset when it leaves the viewport.
") ?> It Works!"); ?> "); ?>
Currently you can define 4 speeds, the default which requires nothing then slow, slower and slowest.
") ?> It Works!"); ?> "); ?>
You can now add individual delays to your animations if you don't want to do it with sequencing delays, please refer to the animations css file to see all the delays available.
") ?> It Works!"); ?> "); ?>
You can now call the animations with an on click event. You can can define an out animation for transitioning out with this.
Please note that the target will only animate on view if you wrap it in an animatedParent class. If it is not in this then the animation will only trigger on click.
data-target='clickExample'"); ?>
It Works!"); ?>
You can now call the animations with an on click event. You can can define an out animation for transitioning out with this.
data-sequence='500'"); ?> data-id='1'It Works!"); ?> data-id='2'It Works!"); ?>
This is just a fix that will fix the elements not appearing on IE9 or less, please not that the
animations will not work on IE9 or less.
Place this below the animations.css link in the head of your file.
"); ?>


The Tabs module
On this page you'll find some examples from the Tabs module.
In this first example we'll see how you can generate a tabs widget using triples that are formatted as a
collection
in RDF. See API
documentation
for more info about how to use the tabWidget.
The triples belows shows the minimum data you need to start using the tabWidget in combination with
UI.store
.
Note that you would probably use UI.rdf.namedNode
directly from rdflib.js. (E.g. instead of
UI.rdf.namedNode
you would probably make use of namedNode with
import { namedNode } from 'rdflib'
.
In this second example we'll use an unsorted set of triples instead of a collection.
This is the data we will be working with. Note that we've also added labels to the items to help the widget know
how to label the tabs.
Note that we've set option ordered to false in this example.
Finally we can set the items manually by using option items
.
We do not need to use options subject
and predicate
when using items
.
For the remaining examples we'll use option items
to populate our tabs.
Using option backgroundColor
we can set a specific color (in hex value) to our tabs. It will
consider how light a color is when figuring out which color to set to the text. It will also distinguish
between selected and not selected tabs by coloring the selected tab a bit darker.
Using option backgroundColor
we can set a specific color (in hex value) to our tabs. It will
consider how light a color is when figuring out which color to set to the text.
Using option orientation
we can set how the tabs and body should be positioned.
renderTab
allows us to override the default behavior for how tabs are rendered, e.g.
which text should be shown for each tab.
renderTabSettings
functions much like renderMain
, expect that it is triggered by
holding ALT key (Option key on Mac) and clicking on a tab.
Remember to hold ALT while click on a tab to show settings for the given tab.
selectedTab
allows you to set which tab should be opened by when the widget is initially
rendered. It must be used in junction with renderTab
since it relies on dataset.name
being set.
startEmpty
makes it so that a the body of a tab isn't shown when initially rendered.


Search for an entry
Title
Contrary to popular belief, Lorem Ipsum is not simply random ...
11 / 7 / 2018 11:35 PM


A clickable button is marked up as follows:
The <button> tag defines a clickable button.
Inside a <button> element you can put content, like text or images. This is the difference between this element and buttons created with the <input> element.
Tip: Always specify the type attribute for a <button> element. Different browsers use different default types for the <button> element.
Tip: Buttons are often styled with CSS: Try it »
| Attribute | Value | Description |
|---|---|---|
| autofocus | autofocus | Specifies that a button should automatically get focus when the page loads |
| disabled | disabled | Specifies that a button should be disabled |
| form | form_id | Specifies one or more forms the button belongs to |
| formmethod | get post |
Specifies how to send the form-data (which HTTP method to use). Only for type="submit" |
| formtarget | _blank _self _parent _top framename |
Specifies where to display the response after submitting the form. Only for type="submit" |
| name | name | Specifies a name for the button |
| type | button reset submit |
Specifies the type of button |
| value | text | Specifies an initial value for the button |


Name of the skin or part
Destination
List of items
Name of the collection to be added
The collection name
The description
Name of the collection to be removed
Name of the collection to changed to
Generated using TypeDoc
Name of the skin or part


Robotic Arts Intro Fall 2019 (IA277.01)
- Instructor: Lucas Yasunaga Haroldsen<EMAIL_ADDRESS>- Class Site: yasunaga.work/raif19
- syllabus: syllabus.pdf
- Resources: links.html
- Office hours: Tuesday 1 - 4pm
10/18: more listening --- [Serial Communication and Analog input]
Speculative Projection - 5 minutes presentations
Reading
Speculative Everything Chapter 5 A Methodological Playground: Fictional Worlds and Thought Experiments
Frederick Scharmen and Space Settlements Island Three space habitat - Don Davis
Although there have always been design speculations (e.g., car shows, future visions, haute couture fashions shows), design has become so absorbed in industry, so familiar with the dreams of industry, that it is almost impossible to dream its own dreams, let alone social ones.
Review
- Coding Structure
- Digital signals
- digitalRead and digitalWrite
- variables
- if statement
- AND and OR
Today, we will go over together:
- Arduino reference page here!
- Analog input
- Serial Communication --> Serial Monitor and Serial Plotter
- Using potentiometer, photocells, conductive foam
- Setting a threshold for your sensor
- Combining conditional logic to detect ranges(||, &&)
- Analog switches
- Fritzing
Today's Code!
Neoprene bend sensor by plusea article
Technological trend and our senses
A Brief Rant On The Future of Interaction Design
Interview with Eric McLuhan on The Sensus Communis (faculty of senses)
19 senses described from Deciphering Your Senses by Robert Rivlin and Karen Gravelle
From Applied Science by Ben Krasnow
Alexitimia by Paula Gaetano Adi
Bodies.html by Katie Rose Pipkin
Tangible Media Group - Haptic Edge Display
Chris Harrison - Dynamic Physical Buttons
HOMEWORK
Analog Switch
By creating thresholds and looking for specific ranges, we can use the data from a single analog input to control digital signals, almost like several digital inputs.
For homework, I would like you to build off of today's sketch using two analog inputs.
Trigger a digital output(s) or pattern of digital output(s) with two analog sensors.
Analog inputs can be the same or different. Create as many thresholds as you like.
-
Here are some examples:
- Trigger a LED pattern when SensorA and SensorB are both in the range you specified at the same time
- Trigger a LED pattern when SensorA is in range and trigger another kind of pattern when sensorB is in range
- Trigger a LED1 when SensorA is in range and trigger LED2 when the sensorB is in range
-
Steps:
- Familiarize yourself with reading analog inputs
(Potentiomenter/Photocell/variable resistors/or other analog sensors of your choice) - Use the Serial monitor to see what values are coming from your analog sensor
- Decide which ranges of values of your analog sensor will trigger different patterns of digital outputs
Document
- Fritzing drawing or photo of your drawng (schimatic) of your work
- arduino sketch .ino file
Upload documents to google doc in folder named "AnalogInput"


[gecode-users] constraint between variables in different spaces
Mauricio Toro
mauriciotorob at gmail.com
Wed May 21 10:38:54 CEST 2008
Hello all,I want to propagate a constraint between variables in different
spaces.
How can this be done?
For example
mySpace * a = new mySpace();
mySpace * b = new mySpace();
IntVar aa(a,1,10);
IntVar bb(b,1,10);
rel(a,aa,IRT_EQ,2);
a->status();
rel(b,bb,IRT_EQ,aa);
b->status();
std::cout << aa << " " << bb; // should print : 2 2
It does not work this way. Is there a way to do it?
Maybe cloning the variable or something?
Thanks
--
Mauricio Toro Bermudez
Estudiante de Ingeniería de Sistemas
Pontificia Universidad Javeriana, Colombia
Stagiare à l'Ircam
1, place Igor-Stravinsky 75004 Paris,
France de 2008 à 2009
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20080521/9311f16c/attachment.htm>
More information about the gecode-users
mailing list


Watch: Lil Reese Disses DJ Vlad, YNW Melly Murder Case Heats Up, 50 Cent Defends Supporting Tekashi 6ix9ine
by Team SOHHThe rap news cycle never ends. Today, online personality Jonny Fastlane focuses on Lil Reese busting shots, YNW Melly‘s murder case starting up, 50 Cent defending his past support for Tekashi 6ix9ine. Let’s talk hip-hop!


IO class for COS instrument handbook plotting. Can be used to read FITS image and tabular data.
Created on Mar 18, 2009
@author: Sami-Matias Niemi<EMAIL_ADDRESS>for STScI
IO class for COS instrument handbook plotting. Can be used to read FITS image and tabular data as well as ASCII data. As the path of the files is given in the constructor, this is only useful if the data is in same folder... (should be changed?)
A simple function for reading data from a file into a table. Comment lines and empty lines are skipped.
Reads FITS image data to an array. Returns data as a NumPy array.
A simple function to pull out a header keyword value.
Writes data to an ASCII file.
A class to plot COS instrument handbook plots. Each figure is generated by it’s own function.
Note that the same function can be used to generate multiple figures of similar type.
@author: Sami-Matias Niemi<EMAIL_ADDRESS>for STScI
Simple function to separate 1st and 2nd-order light from 230L.
A class to plot COS instrument handbook plots. Each figure is generated by a function.
Fig. 7.3. in the COS IHB, version 1.0, page 72.
Plots the cross-section through an image obtained with the BOA + MIRRORB in both x and y direction. Corresponds to Figs. 7.6 and 7.7 on page 75 at the first COS instrument handbook.
Plots transmission of the COS BOA as a function of wavelength. Corresponds to Fig. 3.4 on page 14 of the first COS instrument handbook.
Plots the cross-section through an image obtained with the BOA. Corresponds to Figure 7.5 on page 74 at the first COS instrument handbook.
Plots an example of a COS FUV spectrum. Corresponds to Figure 4.2 on page 29 at the first COS instrument handbook.
Plots an example of a COS FUV spectrum with annotate. A bug in matplotlib version of STScI installation prevents using this...
Plots the FUV point-source sensitivities for Chapter 13. Old method, still used for NUV.
Plots the FUV point-source sensitivities for Chapter 13.
Plots the FUV point-source sensitivities for Chapter 13.
Creates signal-to-noise plots for COS instrument HB Chapter 15. Bright limit has been set for point source, should be changed if adapted for diffuse source.
Plots the FUV wavelength ranges for given grating setting.
Plots the FUV wavelength ranges for given grating setting.
Plots the FUV wavelength ranges for given grating setting.
Plots the FUV wavelength ranges for given grating setting.
Fig. 8.9 in COS IHB, version 2.0, draft 1
Plots the NUV MAMA flat field. Corresponds to Figure 5.6 on page 53 at the first COS instrument handbook.
Plots FUV point-source sensitivities in units of effective area and throughput.
Plots the FUV BOA point-source sensitivities for three gratings.
Plots the FUV point-source sensitivities for three grating. Corresponds to Figure 5.2 on page 40 at the first COS instrument handbook.
Line Spread Function Comparison plots for Chapter 13.
Plots the cross-section of a point-source image with MIRRORB. Corresponds to Figure 7.4 on page 73 at the first COS instrument handbook.
Plots the NUV MAMA flat field. Corresponds to Figure 5.6 on page 53 at the first COS instrument handbook.
Plots NUV imaging profile for COS. Corresponds to Fig. 6.3 on page 63 at the first COS instrument handbook.
Plots the sensitivity curve for COS NUV imaging with the PSA. Corresponds to Fig. 6.1 on page 61 at the first COS instrument handbook.
Plots NUV point-source sensitivities in units of effective area and throughput.
Plots NUV point-source sensitivities for grating G230L. Corresponds to Figure 5.4 on page 41 at the first COS instrument handbook.
Plots NUV point-source sensitivities for M gratings. Corresponds to Figure 5.3 on page 41 at the first COS instrument handbook.
Test function to plot cross section through and image.
Plots the relative transmission of the COS PSA at 1450A. Corresponds to Fig. 7.1 on page 69 at the first COS instrument handbook.
Does not do very good job with matplotlib 0.99.0. The labels are somewhat tilted respect to the axis.
Surface plotting with Gnuplot. Output is horrible... do NOT use!
Plots the scattered light in the FUV. Corresponds to Fig. 5.1 on page 39 at the first COS instrument handbook.
Plots and example wavecal spectrum of PSA FUV. Corresponds to Figures 13.3 and 13.4 on page 138 of the fist COS instrument handbook.
Plots the point-source sensitivities for Chapter 15.
Plots the point-source sensitivities for Chapter 15.
Plots FUV point-source sensitivities in units of effective area and throughput. Used in Chapter 6 of COS IHB, version 2.0.
Plots NUV point-source sensitivities in units of effective area and throughput. Used in Chapter 6 of COS IHB, version 2.0.
This script works as a wrapper to create plots for the COS instrument handbook. Boolean variables in the main program can be set to False to limit the number of plots.
Calculation of zodiacal and earth shine background requires the use of local fits files (Zodi.fits and earthshine.fits). If these files cannot be found the S/N ration related plots of chapter 15 cannot be done.
This wrapper should always be accompanied with plotting.py which contains a plotting class. This class holds all the plotting functions and is required for running this wrapper.
@note: This wrapper superseeds wrapper.py
@author: Sami-Matias Niemi<EMAIL_ADDRESS>for STScI
Modifies the table containing FUV sensitivity data. Goes through the table and pulls out wavelength and sensitivity information. Goes through both sides (A and B). For the latter channel checks that the wavelength is not 50A, which is inside the gap. Makes sure that the saved wavelengths are not smaller than the first recorded wavelength of the side A. The function could be made faster with array manipulations rather than looping through the data.
Manipulates NUV sensitivity data. Pulls out all central wavelengths for all three stripes. Arranges the data with ascending wavelength.
Manipulates NUV sensitivity data. Finds either the min flux value with given wavelength or takes the median of fluxes at given wavelength.
Returns: NumPy array of fluxes.
A fugdge factor of 96% for encircled energy fraction is being used. These integration times are so short that we can ignore everything else but source counts.
Collapses the spectrum in x (COS dispersion) direction and sums pixels over. @param xline: gives the center point of the spectrum. @param width: gives the number of (plus and minus) pixels summed over in dispersion direction. @note: This could be done easier with numpy.sum()
Collapses the spectrum in y (spatial for FUV) direction and sums pixels over. @param yline: gives the center point of the spectrum. @param width: gives the number of (plus and minus) pixels summed over in spatial direction. @note: This could be done easier with numpy.sum()
Returns: NumPy array of ST magnitudes
Return dispersion relation of a given configuration.
Returns the Earth Shine background value at given wavelength range. Note: Uses hard coded file earthshine.fits, which must be present in the folder this function is called!
Returns the Zodiacal light background value at given wavelength range. Note: Uses hard coded file Zodi.fits, which must be present in the folder this function is called!
Returns: Mean of the sensitivity within required wavelength region.
Sets coordinates to imaging data. @return: x, y, value found from image data
Calculates signal to noise ratio when following variables are given: sensitivity, flux, exposure time, number of pixels, sky backgound, detector background, and gain. For photon counters gain = 1. Number of pixels is used for the background calculations while the sensitivity is used for calculating the total number of counts.
Calculates signal to noise ratio using total counts in resolution element. Input: sensitivity, flux, time, resel, Bsky, Bdet, gain = 1. Returns: Signal-to-noise ratio, source counts, source noise, dark current counts, sky, background, total noise
This script works as a wrapper to create plots for the COS instrument handbook. Boolean variables in the main program can be set to False to limit the number of plots.
Calculation of zodiacal and earth shine background requires the use of local fits files (Zodi.fits and earthshine.fits). If these files cannot be found the S/N ration related plots of chapter 13 cannot be done.
This wrapper should always be accompanied with plotting.py which contains a plotting class. This class holds all the plotting functions and is required for running this wrapper.
@author: Sami-Matias Niemi<EMAIL_ADDRESS>for STScI
Modifies the table containing FUV sensitivity data. Goes through the table and pulls out wavelength and sensitivity information. Goes through both sides (A and B). For the latter channel checks that the wavelength is not 50A, which is inside the gap. Makes sure that the saved wavelengths are not smaller than the first recorded wavelength of the side A. The function could be made faster with array manipulations rather than looping through the data.
Manipulates NUV sensitivity data. Pulls out all central wavelengths for all three stripes. Arranges the data with ascending wavelength.
Manipulates NUV sensitivity data. Finds either the min flux value with given wavelength or takes the median of fluxes at given wavelength.
Returns: NumPy array of fluxes.
Collapses the spectrum in x (COS dispersion) direction and sums pixels over. xline gives the center point of the spectrum. width gives the number of (plus and minus) pixels summed over in dispersion direction.
Collapses the spectrum in y (spatial for FUV) direction and sums pixels over. yline gives the center point of the spectrum. width gives the number of (plus and minus) pixels summed over in spatial direction.
Returns: NumPy array of ST magnitudes
Return dispersion relation of a given configuration.
Returns the Earth Shine background value at given wavelength range. Note: Uses hard coded file earthshine.fits, which must be present in the folder this function is called!
Returns the Zodiacal light background value at given wavelength range. Note: Uses hard coded file Zodi.fits, which must be present in the folder this function is called!
Returns: Mean of the sensitivity within required wavelength region.
Sets coordinates to imaging data. Returns: x, y, value found from image data
Calculates signal to noise ratio when following variables are given: sensitivity, flux, exposure time, number of pixels, sky backgound, detector background, and gain. For photon counters gain = 1. Number of pixels is used for the background calculations while the sensitivity is used for calculating the total number of counts.
Calculates signal to noise ratio using total counts in resolution element. Input: sensitivity, flux, time, resel, Bsky, Bdet, gain = 1. Returns: Signal-to-noise ratio, source counts, source noise, dark current counts, sky, background, total noise


Street Food
We don't play with food
When i was a small boy, my father told me never recommend a church or a woman to anyone. And i have fount it wise never to recommend a restaurant either. Something always goes wrong with the cheese souffle
When i was a small boy, my father told me never recommend a church or a woman to anyone. And i have fount it wise never to recommend a restaurant either. Something always goes wrong with the cheese souffle
There is something profoundly satisfying about sharin a meal. Eating together, breaking bread together, is one of the oldest and most fundamentally unifying of human experiences.
There is something profoundly satisfying about sharing a meal. Eating together, breaking bread together, is one of the oldest and most fundumentally unifying of human experinces.
There is something profoundly satisfying about sharing a meal. Eating together, breaking bread together, is one of the oldest and most fundamentally unifying of human experiences.


Battle over B.C. teachers' new contract continues at NDP convention
by Liza YuzdaSummary
Teacher's Federation president Teri Mooring says they need to make gains
Premier John Horgan says he's confident there is a solution as there's so much common ground
VICTORIA (NEWS 1130) — Teachers are protesting outside the annual BC NDP Convention in Victoria Saturday as contract talks drag on.
It’s been nine months of contract debates, and Teacher’s Federation president Teri Mooring says they need to make gains.
“I am not asking to make up for 16 years of underfunding and our inability to bargain overnight,” she explains. “The bargaining table needs to be funded, that’s why we’re here having conversations with delegates to really raise awareness about the issues.”
But Mooring says that does mean more money.
Meantime, Premier John Horgan says he’s confident there is a solution as there’s so much common ground.
“What we have is a dispute between parties in a collective bargaining negotiations. It’s not a dispute about values, it’s not a dispute about our passion – our equal passion – for education it’s a labour negotiation,” he says. “The contract the teachers took all the way to the Supreme Court is one they signed with the NDP.”
Mooring says they need to see movement in those negotiations and more money long before next year’s budget.


INNOCENCY.
TO wash the hands is an attestation of innocency. To call a man "dirty fingers," is to accuse him of some foul or unjust deed.


3 Effective Methods To Deal With Copyright Infringement In 2019
By John Negoita on Friday, Feb 7, 2020
If you are an online content creator for your blog or website, if you write content, create images or videos, your content was probably stolen at least once.
This can be very frustrating especially because the site publishing the stolen content without your permission might get all the credit you worked so hard to produce.
Not only that, but your SEO efforts might go down the drain and in the end you loose money.
Good news is that there are measures you can take against this kind of situations. Distributing copyrighted content without the author’s permission constitutes copyright infringement and it’s illegal.
The Digital Millennium Copyright Act of 1998 was designed to define the rules of copyright infringement as it pertains to the digital age. It outlines both the protections and consequences for internet service providers (ISPs), users, and copyright owners in the digital landscape.
In this article I will show you a few simple but effective methods to deal with copyright infringement.
Let’s get started.
1. Copyright Infringement - How To Spot It
How To Find Who Stole Your Content
First, you will have to find out if your content has been stolen.
How do you do that?
Finding Text Content Copyright Infringements
Just use Google. Here are just a few Google queries that you can use to detect copyright infringement for text content.
- intitle:“title of your content” to search for pages that have your content’s title in the page title
- inurl:keyword to search for webpages that have a certain keyword in the url
- -site:yoursite.com to exclude your website from the search results. Otherwise your site will show up when you search for your content.
- OR you can use this operator to combine multiple queries. So the query will find results matching either one or another condition
Example: Let’s say you are a photographer and you wrote a piece about “A Photographer’s Journey From Beginner To Pro” example.com/photographer-journey-beginner-pro
To find if your content has been stolen you would do a Google search like this:
intitle:"A Photographer's Journey From Beginner To Pro" OR "A Photographer's Journey From Beginner To Pro" OR inurl:"photographer-journey" -site:example.com
If you want to know more about Google search operators, check out this content marketer’s cheatsheet.
Alternatively, you can use Copyscape which is servivce where you can input your URL and it will search for pages that that copied your content.
Finding Image Copyright Infringements
Can someone use a picture of me without my permission?
No.
Can someone use an image created by me without my permission?
No.
To find if your images have been stolen or are distributed without permission you can also use Google. Google has had for quite some time the ability to search similar images.
Simply go to Google, switch to image search. Either drag and drop your original image onto the search bar or click the Search By Image icon and input the URL of the image or upload the image you want to search. Google will try and find identical or similar images to yours. You will have to spot which images are copyright infringements.
Watermark Your Photos
If don’t want or don’t know how to deal with copyright infringements for photos and images, the best solution is to add a watermark to your photos. You can use graphic design tools like Photoshop, Gimp or even online tools like MockoFun.
I love MockoFun because it’s online and they have loads of pre-made templates for watermarks. Check out this complete guide on how to watermark photos online using MockoFun.
You can easily place your logo or name over photos that you publish online. This will discourage copyright infringements for your images and will also help you when reporing a copyright infringement as evidence that an image belongs to you.
How To Get Notified When Somebody Steals Your Content
I use Google Alerts which is a free service from Google in which you can enter queries like the one above and the service will notify you via email when a match has been found.
2. How To Report To Google A Website For Stealing Content - DMCA Google Notice
Once you identified the stolen content and the website that is posting it without permission you can file a DMCA notice to Google.
There is a DMCA Google service, but it’s not too friendly imho. Anyway, this is the most effective way to stop the copyright infringing material to spread through Google.
Depending on the type of copyright infringement, Google has multiple forms that you can use to submit your DMCA claim.
DMCA Google Notice For Web Results
If you want to file a DMCA report for Google web results go to: DMCA Google Notice For Web Results
These reports act like legal DMCA takedown notices, so Google is forced by law to take action.
You will have to fill in your name and state that you are the copyright holder or legal representative for the copyright holder. Describe what the copyright infringement is and then very important:
- place one or more links to your original content
- place one or more link to the infringing page
The good news is that most of these DMCA takedown notices are handled swiftly by Google and it takes about 24 hours for them to remove the infringing result from their search results.
DMCA Google Notice For Images
If you want to file a DMCA report for Google Image search results go to: DMCA Google Notice For Web Results
The data you need to put in is similar to the DMCA Google report for web search results. The only difference is that, instead of the link to the infringing image, you will have to copy/paste the image search result link. Simply right click on the infringing image search result and copy the link.
YouTube Copyright Infringement Complaints And Other Google DMCA Takedown Reports
Copyright infringement claims extend further than text and images. If you produce other types of content like videos or software and this content gets re-distributed without permission via Google products like YouTube, Google Docs, Google Drive, Fusion Tables, Blogger, Google Photos, Google+ Photos, Picasa Web Albums and Videos, here are the links you can use to file a DMCA report with Google.
- YouTube Copyright Infringement Notification
- Report alleged copyright infringement: Google Photos, Google+ Photos, Picasa Web Albums and Videos
- Report alleged copyright infringement: Google Docs, Google Drive and Fusion Tables
- Report alleged copyright infringement: Blogger
- Report alleged copyright infringement: Google+ (effectively April 2019, Google+ has been closed down, so this tool will also probably be removed)
3. How To Deal With Content Copyright Infringement Outside Google
Reporting copyright infringement to Google will probably get resolved by Google removing the pages with the stolen content from the search results.
But, the content will still be out there. What else can I do to remove stolen content from a website?
Besides hiring a lawyer and suing the site, here are a few other things that anybody can do.
Contact The Hosting Provider Of The Website With The Stolen Content
Learn this term well “DMCA Takedown Notice”. I’m not a lawyer, and in some cases hiring one could be the only way to resolve a copyright infringement case.
But, any person can request to have their copyrighted content taken off a website if it constitutes copyright infringement. Assuming that contacting the website owner and asking him to take down the infringing content has failed, here’s what you can do:
Use a tool for IP whois lookup and input the domain of the infringing website. This will give you info about the hosting provider that hosts the infringing website. Usually this contains a contact email address. Look for something like<EMAIL_ADDRESS>and send them an email explaining the situation.
There are some requirements for the DMCA notice:
- Make it in writing (this includes both hardcopy or digital);
- Sign it (whether in writing of via electronic signature: just put your name) by the copyright owner or agent;
- Identify the original copyrighted work (or works) you claim has been infringed;
- Identify the material that is infringing your copyrighted work;
- Include contact information so the designated agent can reach you, if necessary;
- Include a statement your complaint is in “good faith;”
- Include a statement the information in the notification is accurate; and
- Include a statement that under penalty of perjury you are authorized to act on behalf of the owner of an exclusive right that is allegedly infringed.
Hosting Provider / ISP DMCA Takedown Notice Template
Here’s a DMCA takedown notice template that I use for copyright infringement situations.
Subject: DMCA Takedown Notice
Dear Sir/Madame,
I would like to request the removal of files currently hosted on your servers due the copyright infringement.
My name is [your full name] and I am the copyright owner of the [describe copyrighted content].
The original content can be seen here:[place links to the original content]
I'm referring to the website/webpages displaying copyright infringing content:
[list of infringing website/webpages]
hosted on the server with the IP
[list IP]
My contact details are [full name, address, phone number and email address]
I have a good faith belief that use of the aforementioned material
is not authorized by the copyright owner, its agents, or the law
All information in the notice is accurate, and under penalty of perjury, I am the owner of an exclusive right that is believed infringed.
SIGNED: [your full name to act as digital signature]
[date]
The hosting provider / ISP will probably respond to your complaint in a couple of days and hopefully will take action. If they don’t then you have to contact a lawyer and see what else you can do about them.
Fortunately, there are also other steps you can take to remove copyrighted content from the web.
File DMCA Complaints To Free File Upload And Sharing Services
Very often, websites that steal content, especially software content, ebooks, etc. post it on free file upload and sharing services. There are a lot of these services.
Usually, the copyright infringing website will place the files on multiple such services.
Can I do anything about that?
Yes, you can.
All these file sharing services are obligated by law to list on their websites a link to instructions on how to file a DMCA complaint for copyright infringement.
File Sharing DMCA Abuse Email Addresses
Most of the times they will list an email looking like<EMAIL_ADDRESS>or<EMAIL_ADDRESS>I don’t particullary like these sites (you might imagine why), so I will not list their links. Here’s a list of file sharing sites and the email addresses where they receive DMCA notices:
- RapidGator<EMAIL_ADDRESS>- LittleByte<EMAIL_ADDRESS>- TurboBit<EMAIL_ADDRESS>- NitroFlare<EMAIL_ADDRESS>- PreFiles<EMAIL_ADDRESS>- NovaFile<EMAIL_ADDRESS>- ZippyShare<EMAIL_ADDRESS>- UsersCloud<EMAIL_ADDRESS>- ZoFile<EMAIL_ADDRESS>- FileBlade<EMAIL_ADDRESS>I have personally used these adresses for successufully reporting DMCA copyright infringements.
DMCA Takedown Notice Template I Used For File Sharing Services
Dear Sir/Madame,
I would like to request the removal of a file stored on your websitedue the copyright infringement.
1. My name is [full name] and I am the author of the work contained in the files distributed by your website.
2. Original work:
[link of the oringinal file]
3. Infringing file:
[link in the file sharing website]
4. My contact details are [full name, address, phone number and email address]
5. I have a good faith belief that use of the aforementioned material is not authorized by the copyright owner, its agents, or the law
6. All information in the notice is accurate, and under penalty of perjury, I am the owner of an exclusive right that is believed infringed.
[full name] [date]
How Can Copyright Infringement Affect Your SEO
Copyright Infringement Will Reduce Your Income
If you are monetizing your content, then for sure copyright infringement will be a huge problem.
Obviously, if there are a lot of websites stealing your content and offering it for free, you will get less visitors to your website.
One big SEO signal that Google uses is search result CTR. So, the more clicks you get on a search result, the higher the ranking for that page will be.
Now, consider this, Which search result will get more clicks? One that offers stuff for free or one that doesn’t.
This is why it’s important at least to be aware of the fact that people are not always nice. There are a lot of websites that make money by stealing other people’s work. As unfair as it might sound, those sites are more popular than yours just because they are offering commercial stuff for free.
You will never be able to cut your loses down to 0, but if you keep an eye on things then you will be able to limit them.
Copyright Infringement Will Reduce Your Traffic
Even if your content is not commercial, so you are also offering it for free, still copyright infringement will potentially affect your Google ranking.
First, because Google seems to favor sites with more content. Because the infringing website is probably stealing content from others too it will for sure have more content than you and publish more frequently.
This means that they will rank higher than you.
By filing DMCA notices for those sites you can instantly boost your rankings. I know this from experience. After finding not one but 4 sites that copied content from my website (all ranking above me), I filed a Google DMCA report. In 24 hours the pages were removed from Google search results and I jumped 4 positions up.
Please note that search results on page 1 get 90% of the traffic for a certain keyword. From that aprox 60% go to the positions 1 to 3. So a bost of 4 places up only for one keyword can mean double traffic or even more for that keyword. And that is only for one keyword, and you can imagine that the infringing pages take traffic for more than one keyword.
Conclusions Copyright Infringement And SEO
Fighting against copyright infringement is not easy, it requires work, but you can do it. I hope you find the information in this article useful. If you think this article is missing anything or you want to provide feedback drop me an email at john[at]freeitsolutions.com
Please feel free to quote pieces of the article, but provide a link back to this.


--- title: 'Week 34: Thanksgiving Dinner' draft: yes date: '2018-12-30T10:42:13-07:00' geometry: margin=.1in ---
This is super tardy for Thanksgiving, but since Christmas is around the corner, and often there is a similar food vibe, here we go anyway…
library(dplyr)
library(ggplot2)
library(forcats)
library(stringr)
library(tidyr)
setwd("~/Desktop/tidytuesday/data/2018-11-20")
tg= read.csv("thanksgiving_meals.csv")
Who travels most?
Trying to break down by community type, age, and gender, leaves bins too sparse.
look = tg %>% filter(celebrate=="Yes") %>% group_by(travel, community_type,age,gender) %>% summarise(count=n())
summary(look$count) ## too sparse
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 1.000 4.500 8.000 9.899 13.000 38.000
Let’s first just look at travel by community type.
travelCommunity=tg %>% filter(celebrate=="Yes") %>% group_by(travel, community_type) %>% summarise(count=n()) %>% filter(!is.na(community_type) &!is.na(travel)) %>% left_join(.,tg %>% filter(celebrate=="Yes") %>% group_by(community_type) %>% summarise(total=n())) %>% mutate(percent=count/total)
ggplot(data=travelCommunity, aes(x=travel, y=percent, fill=community_type)) +
geom_bar(stat="identity", position=position_dodge()) +coord_flip()
Ah, labels are a mess! Luckily, there is a natural breakpoint (—).
travelCommunity$travel2=unlist(lapply(strsplit(as.character(travelCommunity$travel),"--"),function(x){paste(x[1],"\n",x[2],collapse="")}))
ggplot(data=travelCommunity, aes(x=travel2, y=percent, fill=community_type)) +
geom_bar(stat="identity", position=position_dodge()) +coord_flip()+xlab("")
Having to specify the xlab
as empty instead of the ylab
that it ends up with due to the coord_flip
was unexpected.
Now let’s look at travel by age.
travelAge=tg %>% filter(celebrate=="Yes") %>% group_by(travel, age) %>% summarise(count=n()) %>% filter(!is.na(age) &!is.na(travel)) %>% left_join(.,tg %>% filter(celebrate=="Yes") %>% group_by( age) %>% summarise(total=n())) %>% mutate(percent=count/total)
travelAge$travel2=unlist(lapply(strsplit(as.character(travelAge$travel),"--"),function(x){paste(x[1],"\n",x[2],collapse="")})) ## similarly break up label
Here we need to reverse the order of age because of the coord_flip
.
ggplot(data=travelAge, aes(x=travel2, y=percent, fill=age)) +
geom_bar(stat="identity", position=position_dodge())+coord_flip() ## need to reverse order of age
All the things that don’t work.
ggplot(data=travelAge, aes(x=travel2, y=percent, fill=age)) +
geom_bar(stat="identity", position=position_dodge())+coord_flip() +scale_x_discrete(limits = rev(levels(travelAge$age))) ## nope
ggplot(data=travelAge, aes(x=travel2, y=percent, fill=age)) +
geom_bar(stat="identity", position=position_dodge())+coord_flip() +scale_y_discrete(limits = rev(levels(travelAge$age))) ## nope
## set limits before flipping?
ggplot(data=travelAge, aes(x=travel2, y=percent, fill=age)) +
geom_bar(stat="identity", position=position_dodge())+scale_y_discrete(limits = rev(levels(travelAge$age)))+coord_flip() ## nope
ggplot(data=travelAge, aes(x=travel2, y=percent, fill=age)) +
geom_bar(stat="identity", position=position_dodge())+scale_x_discrete(limits = rev(levels(travelAge$age)))+coord_flip() ## nope
Finally, the winner!
ggplot(data=travelAge %>% mutate(age=fct_rev(age)), aes(x=travel2, y=percent, fill=age)) +
geom_bar(stat="identity", position=position_dodge())+coord_flip()+scale_fill_discrete( guide = guide_legend(reverse = TRUE))
How about travel by gender?
travelGender=tg %>% filter(celebrate=="Yes") %>% group_by(travel,gender ) %>% summarise(count=n()) %>% filter(!is.na(gender) &!is.na(travel)) %>% left_join(.,tg %>% filter(celebrate=="Yes") %>% group_by( gender) %>% summarise(total=n())) %>% mutate(percent=count/total)
travelGender$travel2=unlist(lapply(strsplit(as.character(travelGender$travel),"--"),function(x){paste(x[1],"\n",x[2],collapse="")})) ## similarly break up label
ggplot(data=travelGender, aes(x=travel2, y=percent, fill=gender)) +
geom_bar(stat="identity", position=position_dodge()) +coord_flip()+xlab("")
Who is shopping and who is working on Black Friday?
There is a small sample size here, so I’m just going to report some simple summary tables.
income = tg %>% filter(celebrate=="Yes") %>% group_by(family_income) %>% summarise(work=length(which(work_retail=="Yes")), shop=length(which(black_friday=="Yes"))) %>% left_join(.,tg %>% filter(celebrate=="Yes") %>% group_by(family_income) %>% summarise(total=n())) %>% mutate(propW=work/total,propS=shop/total) %>% filter(!is.na(family_income))
## Joining, by = "family_income"
tg %>% filter(work_retail=="Yes") %>% group_by(work_black_friday) %>% summarise(count=n())
## # A tibble: 3 x 2
## work_black_friday count
## <fct> <int>
## 1 Doesn't apply 7
## 2 No 20
## 3 Yes 43
## small sample size, can't do much
tg %>% filter(work_retail=="Yes") %>% group_by(gender) %>% summarise(count=n())
## # A tibble: 3 x 2
## gender count
## <fct> <int>
## 1 Female 31
## 2 Male 38
## 3 <NA> 1
tg %>% filter(work_retail=="Yes") %>% group_by(age) %>% summarise(count=n())
## # A tibble: 5 x 2
## age count
## <fct> <int>
## 1 18 - 29 26
## 2 30 - 44 21
## 3 45 - 59 15
## 4 60+ 7
## 5 <NA> 1
tg %>% filter(work_retail=="Yes") %>% group_by(work_black_friday) %>% summarise(count=n())
## # A tibble: 3 x 2
## work_black_friday count
## <fct> <int>
## 1 Doesn't apply 7
## 2 No 20
## 3 Yes 43
byIncome = tg %>% filter(work_retail=="Yes") %>% group_by(family_income) %>% summarise(count=n())
I want to reorder based on money not alphabetical order.
levels(income$family_income) ## want to reorder
## [1] "$0 to $9,999" "$10,000 to $24,999" "$100,000 to $124,999"
## [4] "$125,000 to $149,999" "$150,000 to $174,999" "$175,000 to $199,999"
## [7] "$200,000 and up" "$25,000 to $49,999" "$50,000 to $74,999"
## [10] "$75,000 to $99,999" "Prefer not to answer"
intstep=levels(income$family_income)[order(nchar(levels(income$family_income)))]
intstep ## by number of characters, works except for and up
## [1] "$0 to $9,999" "$200,000 and up" "$10,000 to $24,999"
## [4] "$25,000 to $49,999" "$50,000 to $74,999" "$75,000 to $99,999"
## [7] "$100,000 to $124,999" "$125,000 to $149,999" "$150,000 to $174,999"
## [10] "$175,000 to $199,999" "Prefer not to answer"
test=fct_relevel(income$family_income,c(intstep[1],intstep[3:10],intstep[2],intstep[11]))
levels(test)
## [1] "$0 to $9,999" "$10,000 to $24,999" "$25,000 to $49,999"
## [4] "$50,000 to $74,999" "$75,000 to $99,999" "$100,000 to $124,999"
## [7] "$125,000 to $149,999" "$150,000 to $174,999" "$175,000 to $199,999"
## [10] "$200,000 and up" "Prefer not to answer"
income$family_income=fct_relevel(income$family_income,c(intstep[1],intstep[3:10],intstep[2],intstep[11]))
levels(test)
## [1] "$0 to $9,999" "$10,000 to $24,999" "$25,000 to $49,999"
## [4] "$50,000 to $74,999" "$75,000 to $99,999" "$100,000 to $124,999"
## [7] "$125,000 to $149,999" "$150,000 to $174,999" "$175,000 to $199,999"
## [10] "$200,000 and up" "Prefer not to answer"
byIncome$family_income=fct_relevel(byIncome$family_income,c(intstep[1],intstep[3:10],intstep[2],intstep[11]))
byIncome
## # A tibble: 12 x 2
## family_income count
## <fct> <int>
## 1 $0 to $9,999 10
## 2 $10,000 to $24,999 8
## 3 $100,000 to $124,999 4
## 4 $125,000 to $149,999 1
## 5 $150,000 to $174,999 2
## 6 $175,000 to $199,999 1
## 7 $200,000 and up 5
## 8 $25,000 to $49,999 17
## 9 $50,000 to $74,999 5
## 10 $75,000 to $99,999 9
## 11 Prefer not to answer 7
## 12 <NA> 1
Pie!
The question asks “Which type of pie is typically served at your Thanksgiving dinner? Please select all that apply.” Each column represents a type of pie.
head(tg %>% select(contains("pie")))
## pie1 pie2 pie3 pie4 pie5 pie6 pie7 pie8 pie9 pie10
## 1 Apple <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
## 2 Apple <NA> <NA> Chocolate <NA> <NA> <NA> <NA> Pumpkin <NA>
## 3 Apple <NA> Cherry <NA> <NA> <NA> Peach Pecan Pumpkin Sweet Potato
## 4 <NA> <NA> <NA> <NA> <NA> <NA> <NA> Pecan Pumpkin <NA>
## 5 Apple <NA> <NA> <NA> <NA> <NA> <NA> <NA> Pumpkin <NA>
## 6 <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> Sweet Potato
## pie11 pie12 pie13
## 1 <NA> <NA> <NA>
## 2 <NA> Other (please specify) Derby, Japanese fruit
## 3 <NA> <NA> <NA>
## 4 <NA> <NA> <NA>
## 5 <NA> <NA> <NA>
## 6 <NA> Other (please specify) Blueberry pie
cbind.data.frame(type=(tg %>% select(contains("pie")) %>% apply(.,2,function(x){x[which(!is.na(x))[1]]})),
count=(tg %>% select(contains("pie")) %>% apply(.,2,function(x){length(which(!is.na(x)))}) )) %>% arrange(desc(count))
## type count
## 1 Pumpkin 729
## 2 Apple 514
## 3 Pecan 342
## 4 Sweet Potato 152
## 5 Chocolate 133
## 6 Cherry 113
## 7 Other (please specify) 71
## 8 Derby, Japanese fruit 71
## 9 None 40
## 10 Key lime 39
## 11 Coconut cream 36
## 12 Buttermilk 35
## 13 Peach 34
Since “Other (please specify)” has the same count as “Derby, Japanese fruit”, I’m going to assume this type of pie is where they specified. This will impact the count of pies per household.
tg %>% select(contains("pie")) %>% mutate(numPies=apply(.,1,function(x){length(which(!is.na(x)))})) %>% mutate(isOther=apply(.,1,function(x){as.numeric(!is.na(x[12]))})) %>% mutate(numPiesAdj=numPies-isOther) %>% ggplot(.,aes(numPiesAdj))+geom_histogram(binwidth=1,col="black",fill="white")
Please invite me to the households that serve over five different types of pie per holiday (but perhaps people rotate among types of pies each year and don’t actually have them all at one time).
Veggies
Sides are reported similarly to pie. How do veggies fare in the side dish line up?
sideNum = tg %>% select(contains("side")) %>% apply(.,2,function(x){length(which(!is.na(x)))}) %>% as.data.frame() %>% t() %>% as.data.frame()
sideNames= tg %>% select(contains("side")) %>% apply(.,2,function(x){x[which(!is.na(x))[1]]}) %>% as.data.frame()
names(sideNum)=sideNames[,1]
sideNames[,1]
## [1] Brussel sprouts Carrots
## [3] Cauliflower Corn
## [5] Cornbread Fruit salad
## [7] Green beans/green bean casserole Macaroni and cheese
## [9] Mashed potatoes Rolls/biscuits
## [11] Squash Vegetable salad
## [13] Yams/sweet potato casserole Other (please specify)
## [15] Asian vinagrette salad
## 15 Levels: Asian vinagrette salad Brussel sprouts Carrots ... Yams/sweet potato casserole
veggie=c(1:4,7,11,12,13,14)
sideNum = sideNum %>% gather(side,num) %>% filter(side !="Other (please specify)") %>% mutate(isVeggie=rep(0,nrow(.)))
## other is same as asian vinagrette salad
sideNum$isVeggie[veggie]=rep(1,length(veggie))
ggplot(data=sideNum, aes(x=reorder(side,-num), y=num, fill=as.factor(isVeggie))) +
geom_bar(stat="identity", position=position_dodge()) + theme(axis.text.x = element_text(angle = 45, hjust = 1)) + ylab("number") + xlab("side") + scale_fill_manual(values=c("yellow", "green"), name="is veggie?" )
#https://stackoverflow.com/questions/25664007/reorder-bars-in-geom-bar-ggplot2
Who can compete with potatoes and carbs?
And the most controversial topic: the kids’ table
Yes, I’m a little salty for being at the kids’ table too many times.
Here the question answered was “What’s the age cutoff at your”kids’ table" at Thanksgiving?“. It appears that there is a non-neglible number of people who have a 21+ rule for the kids’ table.
levels(tg$kids_table_age)
## [1] "10 or younger" "11" "12" "13"
## [5] "14" "15" "16" "17"
## [9] "18" "19" "20" "21 or older"
tg$kids_table_age=as.numeric(str_replace_all(as.character(tg$kids_table_age),"or .*",""))
ggplot(tg,aes(kids_table_age))+geom_histogram(binwidth=1,col="black",fill="white")+annotate("text", x = 21, y = 200, label = "Why?!",col="red",size=5)
Happy Holidays!


August 27, 2015
Dear XXX,
My name is Tom Goldenberg and I am very interested in your JavaScript developer opportunity. I am currently seeking a position where I can blend my education, work experience, and passion. My personal career goal is to create software and web applications that enrich the lives of others and connect people together.
Some of the skills I bring to the table are:
I bring a unique blend of work experience that includes a Bachelors in Cultural Studies, a Concentration in South Asian languages, 4 years as a University Sanskrit instructor, and extensive training in web development. This experience will benefit your team because I not only have the educational and technical foundation to successfully perform within this role but also the ability to lead and work dynamically in teams. My linguistic passion is not limited to spoken languages, but applies to programming languages as well. Although I began programming in C, Ruby was my first love for coding, and now I am passionate about the world of JavaScript development.
Since December of 2014, I have been involved in many exciting projects. As a final project at the coding school Dev Bootcamp, my team designed an online language exchange utilizing webRTC video conferencing. I also collaborated with a Fordham University business student to make SoTracks, an event management tool built on Ruby on Rails and ReactJS. Finally, I created the app ChessMentor, a Rails app that connects chess masters to students through online chess games, video conferencing, and hosted payments through Stripe Connect.
I am the perfect fit for the JavaScript developer opportunity not only because I have the experience, but I understand the value ABC Company is adding to its clients and the tech community overall. Please feel free to reach me at<EMAIL_ADDRESS>or<PHONE_NUMBER> for further questions. I look forward to connecting further with you.
Sincerely,
Tom Goldenberg


The $scope View of the World
- The scopes of the application refer to the application model.
- Scopes serve as the glue between the controller and the view.
- Scopes in AngularJS have hierarchy.
- Scopes provide the ability to watch for model changes.
- Scopes are the source of truth.
All properties found on the $scope object are automatically accessible to the view.

Hello {{ name }}

code:
angular.module('myApp', [])
.run(function($rootScope) {
$rootScope.name = "World";
});
Scope characteristics
- They provide observers to watch for model changes.
- They provide the ability to propagate model changes.
- They can be nested.
- Behaviors can be assigned to scopes.
- They can emit and listen for events.
- They provide an execution environment in which expressions are evaluated.
Scope Hierarchies.

Hello {{name}}!

{{name}} from {{department}}

code:
angular.module('scopeExample', [])
.controller('GreetController', function($scope, $rootScope) {
$scope.name = 'World';
$rootScope.department = 'Angular';
})
.controller('ListController', function($scope) {
$scope.names = ['Igor', 'Misko', 'Vojta'];
});
Hierarchies structures
Hierarchies structures
Scope Hierarchies.

Initializing...

code:
var app = angular.module("myApp", []);
app.controller("myController", function($scope) {
$scope.model = '';
$scope.reset = function() {
$scope.model = '';
};
});
angular.element(document).ready(function() {
var template = document.getElementById("myTemplate");
var appDiv = document.getElementById("myApp");
setTimeout(function() {
appDiv.innerHTML = template.innerHTML;
angular.bootstrap(angular.element(appDiv), ['myApp']);
}, 1000);
});


Adept in working in environments with non-negotiable quality, accuracy, and timeline expectations, proven through tenure contributing to an ISO certified manufacturing setting and supervising 10-15 team members to drive compliance. Apply solid work ethic without fail, demonstrating drive for adding value beyond expectations regardless of the role. Possess the maturity, communication skills, and judgment to contribute through independent and team-based projects.
Javascript, jQuery, HTML5, CSS3, Bootstrap, AJAX, JSON, Responsive design, Object Oriented Programming, Source Control/ Git, Technical writing, Markdown, Public speaking, Training.
I am currently working as a Freelance Front End Developer and as the Technical Support Manager at MakerGear, a manufacturer of 3d printers.
I have earned a Certificate of Software Engineering from We Can Code IT and an Associate of Arts from Lakeland Community College with a focus on Science and Business. I am also Comptia A+ and Net+ certified.
Written and formatted in accordance with the company styleguide.
V4 Hotend Removal and Installation
Removing and Installing the V4 nozzle
Perfoming a "Cold Pull"
3D Printing 101 (contributor)


Committed to everyone seeking energy and excitement, we offer endless possibilities to unwind and reenergize.


Module: registration
¶
Coarse to fine optical flow estimator. |
optical_flow_tvl1¶
-
skimage.registration.
optical_flow_tvl1
(reference_image, moving_image, *, attachment=15, tightness=0.3, num_warp=5, num_iter=10, tol=0.0001, prefilter=False, dtype=<class 'numpy.float32'>)[source]¶ Coarse to fine optical flow estimator.
The TV-L1 solver is applied at each level of the image pyramid. TV-L1 is a popular algorithm for optical flow estimation introduced by Zack et al. [1], improved in [2] and detailed in [3].
- Parameters
- reference_imagendarray, shape (M, N[, P[, …]])
The first gray scale image of the sequence.
- moving_imagendarray, shape (M, N[, P[, …]])
The second gray scale image of the sequence.
- attachmentfloat, optional
Attachment parameter (\(\lambda\) in [1]). The smaller this parameter is, the smoother the returned result will be.
- tightnessfloat, optional
Tightness parameter (\(\tau\) in [1]). It should have a small value in order to maintain attachement and regularization parts in correspondence.
- num_warpint, optional
Number of times image1 is warped.
- num_iterint, optional
Number of fixed point iteration.
- tolfloat, optional
Tolerance used as stopping criterion based on the L² distance between two consecutive values of (u, v).
- prefilterbool, optional
Whether to prefilter the estimated optical flow before each image warp. This helps to remove the potential outliers.
- dtypedtype, optional
Output data type: must be floating point. Single precision provides good results and saves memory usage and computation time compared to double precision.
- Returns
- flowndarray, shape ((image0.ndim, M, N[, P[, …]])
The estimated optical flow components for each axis.
Notes
Color images are not supported.
References
- 1(1,2,3)
Zach, C., Pock, T., & Bischof, H. (2007, September). A duality based approach for realtime TV-L 1 optical flow. In Joint pattern recognition symposium (pp. 214-223). Springer, Berlin, Heidelberg. DOI:10.1007/978-3-540-74936-3_22
- 2
Wedel, A., Pock, T., Zach, C., Bischof, H., & Cremers, D. (2009). An improved algorithm for TV-L 1 optical flow. In Statistical and geometrical approaches to visual motion analysis (pp. 23-45). Springer, Berlin, Heidelberg. DOI:10.1007/978-3-642-03061-1_2
- 3
Pérez, J. S., Meinhardt-Llopis, E., & Facciolo, G. (2013). TV-L1 optical flow estimation. Image Processing On Line, 2013, 137-150. DOI:10.5201/ipol.2013.26
Examples
>>> from skimage.color import rgb2gray >>> from skimage.data import stereo_motorcycle >>> from skimage.registration import optical_flow_tvl1 >>> image0, image1, disp = stereo_motorcycle() >>> # --- Convert the images to gray level: color is not supported. >>> image0 = rgb2gray(image0) >>> image1 = rgb2gray(image1) >>> flow = optical_flow_tvl1(image1, image0)


Puppetize Your Infrastructure: Beginning Automation
How Can Puppet Enterprise Help You?
The particulars of every infrastructure will vary, but all sysadmins have some needs in common. They want to be more productive and agile, they want to spend less time fixing recurring problems, and they want keen, timely insight into their infrastructure. In this chapter, we identify some specific needs and provide examples of ways to meet them by using Puppet Enterprise (PE) to automate stuff. If you’ve been an admin for any period of time, these wants should be all too familiar:
-
I want to learn how to use a tool that will make me a more efficient sysadmin, so I can go home earlier (or get to the pub, or my kids’ soccer game, or the weekly gaming session, dragon boat race, naked knitting club meeting, etc.). If you’re reading this, it’s safe to assume the tool you want to learn is PE.
-
I want to know beyond a shadow of a doubt that I can always securely access any machine in my infrastructure to fix things, perform maintenance, or reconfigure something. I don’t want to spend much time on this. I just want it to work.
-
I don’t want to get repeated requests at all hours to fix simple mistakes.
-
I want fast, accurate reporting so that I know what’s going on and can recover from issues quickly, with minimal downtime. I want my post-mortems to read: “I saw what was broken, I ran PE to restore it, the node was down for two minutes.”
-
I want to be able to implement changes quickly and repeatably. Pushing out a new website (shopping cart app, WordPress template, customer database) should be trivial, fast, and reliable (see above re: getting to the pub, etc.).
Below, we’ll run through some examples that will help a hypothetical admin meet all these needs by automating things in her infrastructure using PE (and with the assistance of pre-built modules from the Puppet Forge). We’ve tried to choose things that are low-risk but high-reward. That way you can try them out and can not only build your confidence working with PE, you can also actually start to get your infrastructure into a more automated, less on-fire condition relatively soon. Even if the specific services we discuss aren’t directly applicable to your particular infrastructure, hopefully these examples will help you see methods you can apply to your specific situation and help you understand how and why PE can make you a better, less-stressed admin.
A (not-so) Fictional Scenario
Judy Argyle1 is a sysadmin at a mid-sized flying car manufacturing concern, the National Car Company (NCC). The company is undergoing yet another periodic reorganization, and Judy has been tasked with administering the marketing department’s servers. Previously, the department had been maintaining their own machines and so each server has been provisioned and configured in idiosyncratic ways. This has left an infrastructure that is time-consuming to manage, hard to survey, and very brittle. While you might think that flying cars sell themselves, the fact is, as management is constantly reminding Judy, the marketing department is very important and needs to be up and running 24/7/365.
This new responsibility is not exactly welcome. Judy already has 14 things that consistently set her hair on fire. In addition, NCC is rolling out a new model, the “Enterprise 1701,” which means lots of people are making heavy demands on the IT infrastructure. She needs help. That help is Puppet Enterprise which, luckily, her manager has just approved implementing on a trial basis (since PE is free for up to 10 nodes, getting the approval wasn’t all that hard). If PE can work for the marketing department, Judy will get the go-ahead to deploy it across the enterprise.
To start with, Judy downloads PE and, following the first two sections of this guide and the additional documentation it references, she gets a master, console and database support installed on a spare RHEL box and agents installed on the four servers that constitute the marketing department’s infrastructure. After signing the various certificates and kicking off a puppet run on each agent, she can look at the console to confirm that all the agents are talking to the master. All of this feels pretty familiar to Judy since she took the Puppet Fundamentals Course a few weeks back.
Enough preamble, let’s start automating infrastructure.
Three Things You Can Configuration Manage First
Poor Judy. As we know, the infrastructure of the marketing department is an oddball collection of hardware that was set up ad hoc by a series of interns. Specifically, it consists of the following four servers:
- An Ubuntu box named “web01” that runs Apache to serve up NCC’s main website
- An old RHEL 5 FTP server named “ftp01” that provides NCC’s employees with access to marketing materials
- A Debian server, “crm01”, running customer relationship software, SugarCRM
- A Windows database server, “sql01”, running an SQL db containing customer info.
In addition, there is also the puppet master server, a RHEL box named “puppet.”
Fortunately for Judy, the Puppet Forge has modules that will run three of the four machines. For the fourth, the SugarCRM box (crm01), Judy decides she will write her own module.
Note: In case you’re not familiar with modules, they are self-contained bundles of code and data that use Puppet to express a model for a given piece of infrastructure and interact with the puppet master to build your desired configuration state. A module consists of simple structures of folders and files that deliver manifests and extensions, like custom types or custom facts.) To learn more about the Puppet Forge and the module download and installation process, visit the installing modules page. Important: As of PE 2.8, the Puppet module tool is not compatible with Windows nodes, although modules themselves can be readily applied to Windows systems. In a typical Puppet environment, it is unlikely that a module would need to be installed directly on a Windows agent. However, if you encounter a corner case where installing a module directly on a Windows agent is unavoidable, you can do so by downloading tarballs. You may also need to go the tarball route to get Forge modules if local firewall rules prevent access to the Forge.
Thing One: NTP
The first thing Judy wants to do is get reoriented and comfortable with PE (her Fundamentals class was several weeks and several beers ago). She needs to do something that will show her PE can quickly automate something, anything, across the marketing department’s infrastructure. She needs a real-world task that will prove the concept of automation, preferably something that even her boss can see and understand. She decides to start by managing NTP on all the marketing servers.
Managing NTP is useful in a Puppet Enterprise deployment because it reduces the possibility of certificate expiration. In order to provide the most robust security possible, Puppet’s certificates have short expiration times. This helps guard against things like replay attacks. Syncing time across all nodes reduces the possibility of certificates expiring unintentionally. In addition, having time synced across nodes will help ensure logs are correct and accurate, with events logged in the right order.
Okay, then. Judy starts by ssh’ing into her master and getting her selected module from the Forge by entering sudo /opt/puppet/bin/puppet module install saz-ntp
. The module downloads and installs automatically, as seen on the command line:
[jargyle@puppet ~]$ sudo /opt/puppet/bin/puppet module install saz-ntp
[sudo] password for jargyle:
Preparing to install into /etc/puppetlabs/puppet/modules ...
Downloading from http://forge.puppetlabs.com ...
Installing -- do not interrupt ...
/etc/puppetlabs/puppet/modules
└── saz-ntp (v2.0.3)
Next, Judy opens up the PE console in a supported browser and, using the “Class” tool in the sidebar at the lower left, she clicks the “Add class” button. She names the class “ntp” and clicks the “Create” button.
Now Judy needs to add the new class to all of her *nix-based nodes. Because there is a Windows machine present in the marketing department infrastructure, Judy can’t use the default group, she needs to create a new group for all *nix nodes that excludes the Windows box. In the console, she clicks the “Add group” button in the sidebar’s “Group” tool, she names the new group “nixes” and assigns the “ntp” class to it. Then, in the “Nodes” box, she starts typing the name of the Ubuntu webserver, “web01”, PE autocompletes her entry and adds it to the list. She repeats this for each *nix node, including the puppet master. Then she clicks the “Create” button to add the new group.
Note: Every node with a puppet agent will automatically become a member of the default group after it has completed its first puppet run. In a mixed Windows/*nix/OSX environment, the default group is mainly useful for Live Management tasks and across-the-infrastructure reporting.
PE creates the new “nixes” group, assigns the “ntp” class to all the nodes, and displays the results in the Groups view.
Now Judy wants to get the new class applied to the configuration of the servers in the group. She hops back to her terminal where she is still connected to her master and types sudo /opt/puppet/bin/puppet agent -t
in order to kick off a puppet run manually (she could also just wait the default 30 minutes for the next scheduled puppet run). Puppet runs and the master compiles the updated manifest and then applies the resulting catalog, including the new NTP class, to the “puppet” RHEL box. She repeats the puppet agent -t
command on the other boxes to get them updated as well. (If you like, you can learn more about this workflow to see all the steps in detail.)
To verify NTP is running, Judy ssh’s into “web01” and runs sudo /etc/init.d/ntpd status
; the resulting status message confirms it’s up.
She can also use the console to show her what happened. By clicking on the Nodes tab and then selecting, say, web01, she sees that there are two reports showing the most recents runs. Note that the color of the checkmarks by each node uses the same color key as other UI elements in reports, so blue indicates a successfully changed node, green indicates a successful run with no changes, etc. By clicking on a report, she can view the events in the run and see that the NTP class was successfully applied. She can also see other useful metrics such as how long Puppet runs take (which will be useful if she needs to performance tune her deployment down the road). Drilling down into the reports provides all kinds of details about what exactly PE did and when.
Thing Two: MOTD
Next, Judy decides to move on to managing MOTD on the marketing servers.
This is a good idea on Judy’s part. While MOTD is not (usually) a mission-critical service, it can be a useful tool for communicating with users. MOTD is simple and low-risk, but automating it will keep building her experience and skills to automate similar resources. It’s a very small step to go from automating MOTD to managing other text-like sorts of files like config files, boilerplate, HTML templates, etc.
Of course, that’s not to say that MOTD in some modern systems (e.g., Ubuntu) can’t be complex and powerful. Puppet can automate those kinds of implementations too. But for now, Judy needs to keep things simple. Further, it doesn’t hurt that MOTD management is something she can do quickly and easily to show her boss that she’s taking the right approach and getting tangible results.
As before, she starts by ssh’ing into her master and downloading her selected module by entering sudo /opt/puppet/bin/puppet module install rcoleman-motd
. The module downloads and installs automatically.
The procedure continues just as it did with the NTP module: add the new class in the console and then apply it to the “nixes” group. After the next run, puppet compiles and applies the newly updated catalog, including the new MOTD class. (Note that if desired you can change the interval between automatic puppet runs.)
In this case, rather than going back to the command line, Judy decides to use Live Management to kick off the Puppet run. She does this by clicking Live Management on the main nav bar in the console and, making sure the “nixes” nodes are chosen in the Node selector on the left, she then clicks Control Puppet in the secondary nav bar. Then she clicks the “Run” button to kick off the run.
To make sure the new class works as expected, she logs out of her master and logs back in again to see if the new default MOTD message pops up. When she does that, she sees a new message containing a bunch of facter facts describing the machine and the classes puppet assigned to it on the last run. Cool.
-------------------------------------------------
Welcome to the host named puppet
CentOS 6.4 x86_64
-------------------------------------------------
FQDN: puppet.ps.eng.puppetlabs.net
IP: <IP_ADDRESS>
Processor: Intel(R) Xeon(R) CPU X5650 @ 2.67GHz
Memory: 1.83 GB
Puppet: 2.7.21 (Puppet Enterprise 2.8.1)
Facter: 1.6.17
The following classes have been declared on this node
during the most recent Puppet run against the Puppet
Master located at puppet.ps.eng.puppetlabs.net.
- pe_mcollective::role::console
- ntp
- pe_compliance
- motd
- pe_accounts
- pe_mcollective
- pe_mcollective::role::master
- settings
- default
- pe_mcollective::params
- pe_mcollective::role::console
- pe_mcollective::client::puppet_dashboard
- pe_mcollective::shared_key_files
- ntp::params
- ntp
- pe_compliance
- pe_compliance::agent
- motd
-------------------------------------------------
Now she wants to tweak the MOTD message to identify the marketing department’s machines. In the terminal, she navigates to the default module directory (etc/puppetlabs/puppet/modules
) and locates the “motd” directory. In that directory, she opens up the templates/motd.erb
file in vi and adds a line below line three that reads “Welcome to the NCC Marketing Department”. She kicks off another Puppet run and sure enough, when she logs in to the master again, the new line has been added to the MOTD.
(Note that editing the motd.erb file directly means that Judy will have to be careful if and when updates to the module are published. Running an upgrade could over-write her modified motd.erb and cause her to lose her changes. To avoid future problems, she will either have to create a fork of the module, make a custom wrapper module or, at minimum, make sure to create a duplicate of her custom motd.erb file before upgrading. Forking and wrapping will be discussed in the next chapter.)
In the interest of thoroughness, she ssh’s into the Apache server where she sees that the default MOTD message has been added, but her new welcome message isn’t there yet. Ah, right, a new catalog won’t be compiled until the next puppet run. Judy kicks off a run manually and sure enough, she sees a notice in the run output telling her the new line has been added. A quick double-check by logging back into the Apache server confirms the new message is there.
Easy enough. Now Judy has something to show her boss to prove that Puppet automation works, and she’s confident that PE is correctly controlling and communicating with the infrastructure. She also knows that she can successfully edit text-based files and use PE to deliver those files to chosen elements of the infrastructure.
On to something a little more challenging: using PE to configure and manage Apache.
Thing Three: Apache
This webserver is a consistent thorn in Judy’s side. A lot of people touch it, marketing people. They are constantly tweaking pages, updating forms processing, adding the latest whiz-bang metrics tools, and who knows what else. They are all very nice people, but none of them has the slightest idea how an Apache server works. The most recent problem is that someone has been mucking around in /etc
and has deleted the Virtual Hosts config file. As a result, the site is down and only displaying the Apache default page.
It’s obviously time to get the webserver under automation. Back to the Forge again, where Judy soon finds the Puppet Labs Apache module. Another quick sudo /opt/puppet/bin/puppet module install puppetlabs-apache
on the master node and the module is installed.
Out of the box, the module doesn’t quite match the Apache configuration Judy needs. Since you can’t pass parameters directly via the console, she needs to create a new class that describes how NCC’s Apache configuration is supposed to work. To do that, she needs to build a custom module where she can define the class. On the master, Judy navigates to /etc/puppetlabs/puppet/modules
and she creates the framework for the module with a simple sudo mkdir -p ncc/manifests
. This is the basic directory structure Puppet expects for class definitions in modules.
Next, Judy uses a text editor (vi, nano, whatever) to create a web.pp
file in the new ncc/manifests
directory. Then, along the lines of the example in the module documentation, she writes the following Puppet code to create a new class called ncc::web
:
class ncc::web {
class { 'apache': }
class { 'apache::php': }
apache::vhost { 'www.ncc.com':
priority => '10',
vhost_name => '<IP_ADDRESS>',
port => '80',
docroot => '/var/www/html',
}
}
Note: if this puppet code is opaque and unfamiliar to you, you may wish to spend some time learning about writing manifests. To learn about a specific type, check out the reference guide.
Tip: Don’t edit manifests or templates in Notepad. It will introduce CLRF-style line breaks that can break things, especially in the case of templates used for config files whose applications care about whitespace.
To make sure her code is clean and correct, she writes out the new web.pp
file and then runs it through the puppet syntax checker with puppet parser validate web.pp
. The command returns nothing, indicating the code is clean. (To be extra sure, she could do a quick echo $?
which should return 0
; anything non-zero would indicate an error such as a non-existent file.)
Now Judy goes back to the console where the new class can be added in the usual way, by clicking the “Add class” button and entering ncc::web
, which PE automatically discovers and adds.
Judy obviously doesn’t need to assign the new Apache class to every machine in the default or nixes groups, she only needs it on “web01.” However, knowing that as she moves automation beyond the marketing department she will have more webservers to manage, Judy decides to create a new group specifically for Apache nodes.
In the console, she clicks the “Add group” button in the Group view, she names the new group “webservers” and assigns the “ncc::web” class to it. Then, in the Nodes box she starts typing the name of the Ubuntu webserver, “web01”, to add it. Then she clicks the “Create” button to create the new group. Lastly, she uses Live Management to kick off a puppet run on “web01” to get it configured according to the new class. Looking at the node in the console she can see that the new group has been created, with “web01” as a member and with the class ncc::web
included. The blue checkmark indicates new changes were applied in the last run (specifically, the webservers group was created with “web01” as a member and containing the ncc::web
class).
If the code is working correctly, the new class should have configured the site’s vhost correctly and pointed it at the correct root document directory. A quick look at the output from the puppet run shows that config file has been properly created. Sure enough, when Judy points her browser at NCC’s home page, the site comes up. Looking at the glamor shots of the new model 1701 on the home page, Judy smiles and indulges herself with a mental high-five; thanks to PE, she knows the server is up and staying up no matter much stupid gets thrown at it.
 Any resemblance to any person living or dead is purely coincidental.↩


Woman denies fraud while working as treasurer
by Michael StewardA woman has denied stealing more than £2,500 while working as a treasurer of a group which supported a Suffolk primary school.
Melissa Knights, 40, of Swallows Close, Hollesley, appeared before magistrates in Ipswich on Tuesday charged with three counts of fraud by false representation and one offence of theft.
Magistrates heard that the alleged offences relate to when Knights was treasurer of the Friends of Eyke School (FOES) organisation, which supported the Woodbridge primary school.
Knights denied stealing a total of £2,709 between October 2017 and June 2018 and pleaded not guilty to all charges.
Magistrates declined jurisdiction and the case was sent to crown court.
Knights was granted unconditional bail and will appear at Ipswich Crown Court on December 10.


# A third example with [MathJax](http://www.mathjax.org/) activated
> This *StrapDown*-flavored HTML page comes with MathJax enabled, simply because **we asked the script to do so**.
The last line of this page source (you can read it with "Ctrl+u" in Firefox) imports the script ``strapdown.min.js`` with this URL : ``"strapdown.min.js?src=example5&mathjax=y&theme=united&beacon=y"``.
This way, some options are available:
1. ``mathjax=y`` if you want to load MathJax, with ``$ ... $`` being the default syntax for inline maths and ``$$ ... $$`` for display,
2. ``theme=united`` or ``theme=cyborg`` if you want to load a specific theme (without having to specify it as the ``theme`` attribute of the main ``xmp`` tag containing your Markdown code),
3. ``beacon=y`` if you want to include an invisible [GA Beacon](http://perso.crans.org/besson/beacon.en.html) image in your page,
4. ``pedantic=y`` if you want to force the use of the ["pedantic" option](https://github.com/chjj/marked#pedantic) for [marked](https://github.com/chjj/marked), the Markdown parser used by StrapDown.js (note: you probably don't want that, [pedantic=false is usually better](https://github.com/chuckhoupt/strapdown/commit/1a090729fb717059be0689aa65025de6de67b3cd)). Default is pedantic=false.
5. ``nonavbarfixed=y`` if you prefer the [top navigation bar](https://bootswatch.com/united/#navbar) to not be fixed, but scroll as the rest of the page (*new!*). See [example #8](example8.html),
6. ``keepicon=y`` if you prefer StrapDown.js to keep the favicon included in your HTML document (*new!*). See [example #9](example9.html).
7. ``nonavbar=y`` if you prefer to not have any [top navigation bar](https://bootswatch.com/united/#navbar) (*new!*). See [example #10](example10.html),
***
> These examples are the same as [the previous example](example4.html) directly imported from [the samples from the mathjax.org website](http://www.mathjax.org/demos/tex-samples/).
> The following equations are included in the HTML source code as pure LaTeX code.
***
### The [Lorenz Equations](https://en.wikipedia.org/wiki/Lorenz_system#Overview)
### $$\left\\\{\begin{aligned} \dot{x} & = \sigma(y-x) \\\\ \dot{y} & = \rho x - y - xz \\\\ \dot{z} & = -\beta z + xy \end{aligned}\right. $$
> The previous equation corresponds to the following code, inserted *verbatim* in the Markdown part of this page (*ie.* after the opening ``xmp`` tag and before its closing):
```latex
$$\left\\\{\begin{aligned}
\dot{x} & = \sigma(y-x) \\\\
\dot{y} & = \rho x - y - xz \\\\
\dot{z} & = -\beta z + xy
\end{aligned}\right. $$
```
### The [Cauchy-Schwarz Inequality](https://en.wikipedia.org/wiki/Cauchy%E2%80%93Schwarz_inequality#Rn) (in $\mathbb{R}^n$)
### $$ \left( \sum\_{k=1}^n a\_k b\_k \right)^2 \leq \left( \sum\_{k=1}^n a\_k^2 \right) \left( \sum\_{k=1}^n b\_k^2 \right) $$
> The previous equation corresponds to the following code, inserted *verbatim* in the Markdown part of this page:
```latex
$$ \left( \sum\_{k=1}^n a\_k b\_k \right)^2 \leq \left( \sum\_{k=1}^n a\_k^2 \right) \left( \sum\_{k=1}^n b\_k^2 \right) $$
```
### A [Cross Product](https://en.wikipedia.org/wiki/Cross_product#Coordinate_notation) Formula
### $$\mathbf{V}\_1 \times \mathbf{V}\_2 = \begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\\\ \frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\\\ \frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0 \end{vmatrix} $$
> The previous equation corresponds to the following code, inserted *verbatim* in the Markdown part of this page:
```latex
$$\mathbf{V}\_1 \times \mathbf{V}\_2 = \begin{vmatrix}
\mathbf{i} & \mathbf{j} & \mathbf{k} \\\\
\frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\\\
\frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0
\end{vmatrix} $$
```
### The probability of [getting $k$ heads when flipping $n$ coins](https://en.wikipedia.org/wiki/Bernoulli_process#Binomial_distribution) is
### $$P(E) = {n \choose k} p^k (1-p)^{n-k} $$
> The previous equation corresponds to the following code, inserted *verbatim* in the Markdown part of this page:
```latex
$$P(E) = {n \choose k} p^k (1-p)^{n-k} $$
```
### An Identity of Ramanujan (obviously)
### $$ \frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} = 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} {1+\frac{e^{-8\pi}} {1+\ldots} } } } $$
> The previous equation corresponds to the following code, inserted *verbatim* in the Markdown part of this page:
```latex
$$ \frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} =
1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}}
{1+\frac{e^{-8\pi}} {1+\ldots} } } } $$
```
### A [Rogers-Ramanujan Identity](https://en.wikipedia.org/wiki/Rogers%E2%80%93Ramanujan_identities)
### $$ 1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots = \prod\_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})}, \quad\quad \text{for $|q|<1$}. $$
> The previous equation corresponds to the following code, inserted *verbatim* in the Markdown part of this page:
```latex
$$ 1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots =
\prod\_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})},
\quad\quad \text{for $|q|<1$}. $$
```
### [Maxwell's Equations](https://en.wikipedia.org/wiki/Maxwell%27s_equations)
### $$ \left\\\{\begin{aligned} \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\\\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\\\ \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\\\ \nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned}\right. $$
> The previous equation corresponds to the following code, inserted *verbatim* in the Markdown part of this page:
```latex
$$ \left\\\{\begin{aligned}
\nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\\\
\nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\\\
\nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\\\
\nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned}\right.
$$
```
As you can see, math environment (like ``aligned``) are supported by MathJax, even with the default configuration and no external plugins.
****
### Inline equations are also supported.
Finally, while **display equations** look good for a page of samples, the ability to mix math and text in a paragraph is also important.
This expression $\sqrt{3x-1}+(1+x)^2$ is an example of an **inline equation** (inserted with the code ``$\sqrt{3x-1}+(1+x)^2$``).
As you see, MathJax equations can be used this way as well, without unduly disturbing the spacing between lines.
### End of the examples
That's all for today!
---


${host}
Click the
Rescale
button to restore
Deployment
and/or
Statefulset
replicas
Namespace
Ingress name
Output