Housekeeping
Runs a number of housekeeping tasks within the current repository, such as compressing file revisions and removing unreachable objects.
Export project
Export this project with all its related data in order to move your project to a new GitLab instance. Once the export is finished, you can import the file from the "New Project" page.
Once the exported file is ready, you will receive a notification email with a download link.
The following items will be exported:
- Project and wiki repositories
- Project uploads
- Project configuration including web hooks and services
- Issues with comments, merge requests with diffs and comments, labels, milestones, snippets, and other project entities
The following items will NOT be exported:
- Build traces and artifactsFile
- LFS objects
- Container registry images
Archive project
Archiving the project will mark its repository as read-only. It is hidden from the dashboard and doesn't show up in searches.
Archived projects cannot be committed to!
Archive projectRename repository
Transfer project
Remove project
Removing the project will delete its repository and all related resources including issues, merge requests etc.


Connecting you
and your emotions.
We use a sophisticated machine-learning algorithm trained to track the quantity of positive and negative thoughts you have on a regular basis, leveraging sentiment analysis to detect larger trends in your emotional state and mood cycles.
Download Positive.ly from the Google Play Store, and create an account to start dynamic tracking of your mood from your smartphone.
Use your smartphone as you usually would, and in the background Positive.ly will be working continuously with your mobile device to examine what you type on a day-to-day basis. This data helps inform our machine-learning model about your emotional state.
View visual representations of how your emotion states vary as days, weeks, and months pass. This will help inform your own best practices and allow you to make changes to your lifestyle.
Use services such as Active Management and Gratitude Journal to better navigate your emotions and support yourself mentally.
According to a Yale study, increased emotional intelligence correlates with increased verbal and spatial intelligence, decreased anxiety and depression, and positive social functioning. Positive.ly helps you be aware of your feelings and emotions, discriminate among them, and use your newfound knowledge to take proactive steps toward a more positive mindset.
Positive.ly keeps tracks of your emotional fluctations and overall mood over the past 24 hours, as well as larger trends over the previous weeks and months. You can view your most positive thoughts from the past day, as well as how your mood changed chronologically.
If Positive.ly detects consistently low mood ratings or signs of mental illness, it will alert you so you can seek help from primary care physicians and mental health professionals for proper diagnosis and treatment if necessary.
Positive.ly has a built-in gratitude journal to promote a sense of gratefulness and enhance well-being by cultivating gratitude and directing it toward other people. Using a gratitude journal has been shown to improve mood balance and reduce symptoms of depression and anxiety in just one month.
<EMAIL_ADDRESS>+1<PHONE_NUMBER>
1 Chapel Dr
Durham, NC
27708 US


The following {{ len(sets["difference"]) }} instances are not present in all of the compared test sets, and have therefore been ommitted from the table above:
{{", ".join(sets['difference'])}}
Are you sure that you want to delete this result?
''', modalfooter=''' '''.format(xsrf=xsrf_form_html())) %} {% if fileoptions[".out"] %} {% module Template("modal.html", id="reimportResultModal", modalheading="Reimport Testrun?", modalbody='''Are you sure that you want to reimport this result?
''', modalfooter=''' '''.format(xsrf=xsrf_form_html())) %} {% end %} {% end %}


--- layout: post title: Animalgebra! date: 2007-01-03 00:00:00 categories: amusing animalia personal ---
Whilst Mr Melon enjoys the delights of Costa Rica, he's found time to get some of his artwork mugged up - check out Animalgebra on DeviantArt.


Created by Patrick O'Boyle / @Patrick_OBoyle
“ Extensions are small software programs that can modify and enhance the functionality of the Chrome browser. You write them using web technologies such as HTML, JavaScript, and CSS. ”
How to:
Extensions have 3 main types of files:
“ Every extension has a JSON-formatted manifest file, named manifest.json, that provides important information. ”
“ Content scripts are JavaScript files that run in the context of web pages. By using the standard Document Object Model (DOM), they can read details of the web pages the browser visits, or make changes to them. ”
“ The background page is an HTML page that runs in the extension process. It exists for the lifetime of your extension, and only one instance of it at a time is active. ”
Examples:
(As of Chrome v18, manifest_version is set to 2, as v1 is deprecated)
(At time of writing, Chrome's current stable version is v46)
{
"manifest_version": 2,
"name": "Tab Background Colour Changer",
"version": "1.0",
}
{
// Required
"manifest_version": 2,
"name": "My Extension",
"version": "versionString",
// Recommended
"default_locale": "en",
"description": "A plain text description",
"icons": {...},
// Pick one (or none)
"browser_action": {...},
"page_action": {...},
}
For a complete list, visit Google's Manifest Documentation
{
"name": "My extension",
...
"content_scripts": [
{
"matches": ["http://www.google.com/*"],
"css": ["mystyles.css"],
"js": ["jquery.js", "myscript.js"]
}
],
...
}
{
"name": "My extension",
...
"background": {
"scripts": ["background.js"]
},
...
}
We need to:
{
"manifest_version": 2,
"name": "Tab Background Colour Changer",
"version": "1.0",
"browser_action": { // Create the extension's button
"default_title": "Click to apply background-colour change"
},
"background": {
"scripts": ["background.js"]
},
"options_ui": { // Allows our extension to have an options menu
"page": "options.html",
"chrome_style": true
},
"permissions": [ // Declare the permissions we want from Chrome
"activeTab", // Access the current tab, more on it later
"storage" // Lets us store our users' option preference
]
}
“ The activeTab permission gives an extension temporary access to the currently active tab when the user invokes the extension - for example by clicking its browser action. Access to the tab lasts until the tab is navigated or closed. ”
We want to:
{
// Detects clicks on the Extension Icon (Browser Action Button)
chrome.browserAction.onClicked.addListener(function (tab) {
// When clicked, the code here will run
// Run a piece of JavaScript on the current page
chrome.tabs.executeScript({
// Set the backgroundColor property of the page to red
code: 'document.body.style.backgroundColor="red"'
});
}
}
{
"options_ui": {
// Name of file & location relative to manifest
"page": "options.html",
// Options page will be styled to match Chrome's design
"chrome_style": true
},
}
Background colour selected:
Two functions you'll use:
function saveOptions(){
// Get the user's selected colour value
var colourSelected = document.getElementById("colourSelected").value;
// By using .sync, it will save to their account and persist
chrome.storage.sync.set({
bgColour: colourSelected
}, function() {
// Update the header to let user know their setting was saved.
var status = document.getElementById('status');
status.textContent = 'Successfully updated background colour.';
// After 1.75 seconds, revert the header to it's original text
setTimeout(function() {
status.textContent = 'Background colour selected:';
}, 1750);
});
}
function restoreOptions(){
// Loads the user's selected colour if present
// Otherwise, it gets the default colour
chrome.storage.sync.get({
bgColour: DEFAULT_BG_COLOUR
}, function(details) {
// Jquery used to set the default dropdown value to
// the value to user had previously assigned
$("#colourSelected").val(details.bgColour);
});
}
DEFAULT_BG_COLOUR = "blue";
// Wait for the page to be loaded, then update the dropdown menu
document.addEventListener("DOMContentLoaded", restoreOptions);
// Wait for the "Update Settings" button to be clicked, then update
// the colour value saved to Chrome's storage
document.getElementById("save").addEventListener("click", saveOptions);
Since the user now can choose a colour, we should update our background.js to use that colour, instead of just using red.
chrome.browserAction.onClicked.addListener(function (tab) {
// A default colour to be used if the user has not specified one
var DEFAULT_BG_COLOUR = "blue";
// Call Chrome's storage to get the user's preference
// If they have not specified one, use the default
chrome.storage.sync.get({
bgColour: DEFAULT_BG_COLOUR
}, function(details) {
// Assign our background colour to the one chrome has stored
backgroundColour = details.bgColour;
// Change the background of the current window to the
// background colour the user's / default value
chrome.tabs.executeScript({
code: 'document.body.style.backgroundColor="'
+ backgroundColour + '"'
});
});
});
- Google's Chrome Docs
- Chrome Developers YouTube Channel
Getting Started


16MP + 2MP dual primary camera and 8MP front facing camera with portrait mode.
View details »
Memory, Storage and SIM: 6GB RAM | 128GB internal memory | Dual SIM dual-standby
Memory, Storage and SIM: 8GB RAM | 128GB internal memory | Dual SIM dual-standby


Data Fields
The source data for the LD4HE project is a specific subset of fields from the overall OASIS dataset. These are mandatory fields in the OASIS data input forms, and were identified during the LD4HE project design stage. Each field listed has an OASIS field identifier, a corresponding field name, a brief description of how the data will fit into the overall LD4HE data model, some examples of typical field contents and a JSONPath expression for locating the specific field within the overall data structure. The JSONPath expressions were developed and tested against received example data using the JSONPath online evaluator to ensure correctness.
Field 1 - oasis id
The field contains the unique identifier for the OASIS record. There will be one OASIS identifier per record. Example field values encountered in the example data received to date are "oxfordar1-357078", "jensdigg1-197587" etc.
$.[*].oasisId
Fig. 1: JSONPath expression
Field 2 - event type
The type of investigation activity undertaken. There may be multiple event types per record. The field will contain URIs from the FISH Event Types Thesaurus. Example field values are:
- http://purl.org/heritagedata/schemes/agl_et/concepts/145118 (Building Survey)
- http://purl.org/heritagedata/schemes/agl_et/concepts/145113 (Bosing survey)
- http://purl.org/heritagedata/schemes/agl_et/concepts/145177 (Watching Brief) etc.
<EMAIL_ADDRESS>== 'FISH_EVENT')].subjectUri
Fig. 2: JSONPath expression
Field 3 - reason for investigation
The reason for undertaking an investigation. The field will contain URIs from OASIS Reason for Investigation. Example field values are:
- http://purl.org/heritagedata/schemes/ee833bdc-4cf1-4fbf-9282-29e75655855d/concepts/11e58ff4-9432-4452-a364-6b22e1696944 (Planning requirement)
- http://purl.org/heritagedata/schemes/ee833bdc-4cf1-4fbf-9282-29e75655855d/concepts/48a1fbbc-65aa-4004-84c4-3ad33d0f1fb0 (Post determination)
<EMAIL_ADDRESS>== 'reason')].projectAttrLuId.uri
Fig. 3: JSONPath expression
Field 4 - country
Location of a site. The intention is that this field will contain URIs from OS Open Names - however in the example data the field currently contains textual country names e.g. "England", "Wales", "Northern Ireland", "Scotland"
$.[*].oasisProjDetails.adminAreasMap[*].Country
Fig. 4: JSONPath expression
Field 5 - site name
Free text local name for a site. Example values for the field are "Studfield Hill", "Oxford Botanic Gardens", "Boundary Wall of Former Cinema Site, Sandgate" etc.
$.[*].oasisProjDetails.oasisProjSiteList[*].sitename
Note for field values relating to a specific record (e.g. the site name for oasis_id 'jensdigg1-196788'), JSONPath would be:
<EMAIL_ADDRESS>== 'jensdigg1-196788')].oasisProjDetails.oasisProjSiteList[*].sitename
Fig. 5: JSONPath expression
Field 9a - Grid reference (geom_ngr)
Location of a site. This will store either a point, line or polygon in a single geometry field (using PostGIS), using the OSGB36 crs. Example values for the field are "POINT(556600 256500)", "POINT(154350 54350)". There can be multiple values per record.
<EMAIL_ADDRESS>== 'Point' || @.vectorType == 'Polygon')].geomNgrOut
Fig. 6: JSONPath expression
Field 9b - Grid reference (geom_ll)
Location of a site. This will store either a point, line or polygon in a single geometry field (using PostGIS), using the WGS84 crs. Example values for the field are "POINT(1 55)". There can be multiple values per record.
<EMAIL_ADDRESS>== 'Point' || @.vectorType == 'Polygon')].geomLlOut
Fig. 7: JSONPath expression
Field 15 - county
Location that a site falls within. The intention is that this field will contain URIs from OS Open Names - however in the example data the field currently contains textual county names e.g. "Cambridgeshire", "Somerset", "North Yorkshire", "Shropshire" etc.
$.[*].oasisProjDetails.adminAreasMap[*].County
Fig. 8: JSONPath expression
Field 16 - district
Location that a site falls within. The intention is that this field will contain URIs from OS Open Names - however in the example data the field currently contains textual district names e.g. "South Cambridgeshire", "Sedgemoor", "Hambleton", "Harrogate" etc.
$.[*].oasisProjDetails.adminAreasMap[*].[District/Unitary Authority]
Fig. 9: JSONPath expression
Field 17 - parish
Location that a site falls within. The intention is that this field will contain URIs from OS Open Names - however in the example data the field currently contains textual parish names e.g. "Great Wilbraham", "East Huntspill", "Overton", "Wighill" etc.
$.[*].oasisProjDetails.adminAreasMap[*].Parish
Fig. 10: JSONPath expression
Field 18 - HER
A record refers to the name of the Historic Environment Record organization responsible for an area encompassing the location of a site. Example values for the field are "Bedford Borough HER", "Redcar and Cleveland UAD", "New Forest National Park Authority" etc.
$.[*].oasisReviewersHasOasisList[*].[?(@.level=='2')].name
Fig. 11: JSONPath expression
Field 19 - national body
A record refers to the national body as an organization responsible for the area encompassing the location of a site. Example values for the field are "Historic Environment Scotland", "Royal Commission on the Ancient and Historical Monuments of Wales" etc.
$.[*].oasisReviewersHasOasisList[*].[?(@.level=='4')].name
Fig. 12: JSONPath expression
Field 22 - project title
Descriptive title of the investigation. Example values for the field are often in the form "[Event type] at [Site name]" e.g. "Field Survey at Studfield Hill", "Field Visit at The Sheiling" etc.
$.[*].oasisProjDetails.projName
Fig. 13: JSONPath expression
Field 23a - start date
Start of the overall timespan for an investigation. Example values for the field are "13-Dec-2007 12:00", "01-Apr-2018 12:00" etc.
$.[*].oasisProjDetails.sdate
Fig. 14: JSONPath expression
Field 23b - end date
End of the overall timespan for an investigation. Example values for the field are "13-Dec-2007 12:00", "01-Apr-2018 12:00" etc.
$.[*].oasisProjDetails.edate
Fig. 15: JSONPath expression
Field 24a - methodology
Techniques used in an investigation. The field will contain URIs from FISH Event Types. There can be multiple values per record.
??
Fig. 16: JSONPath expression
Field 24b - description
Brief textual description of an investigation. Example value is: "An archaeological evaluation was undertaken by Cotswold Archaeology in August 2017 at the proposed Clearwater CE Primary School site, Quedgeley, Gloucestershire. A total of seven trenches were excavated. The remains of two modern earthen banks, possibly relating to former flood defences or most probably episodes of landscaping associated with the construction of nearby modern housing, were identified in the south western part of the site. No further features, deposits or finds of archaeological significance were identified during the evaluation."
$.[*].oasisProjDetails.descr
Fig. 17: JSONPath expression
Field 28 - planning application ID
An identifier of a specific type, associated with an investigation. An example value of the field contents is "TR4584358"
<EMAIL_ADDRESS>== 'Planning Application No')].identifier
Fig. 18: JSONPath expression
Field 31 - project codes
Type of code - OASIS Associated ID
??
Fig. 19: JSONPath expression
Field 35 - publication type
The form of publication the report takes. Values will be URIs from OASIS Paper and Digital Archive Component vocabulary; however in the example data the field contains textual values e.g. "REPORT", "MONOGRAPH", "JOURNAL_ARTICLE"
$.[*].oasisProjDetails.oasisProjBiblioList[*].biblioType
Fig. 20: JSONPath expression
Field 91 - type of report
Values will be URIs from OASIS Paper and Digital Archive Component vocabulary
??
Fig. 21: JSONPath expression
Field 36 - title of report
Textual Report title. Example values is "Excavation at edinburgh castle"
$.[*].oasisProjDetails.oasisProjBiblioList[*].title
Fig. 22: JSONPath expression
Field 39 - author / editor
Author / Editor of report. Potential at a future date to assign ISSN to authors via the ADS Library, but the methodology for sustaining this is still not firmly established. Example value for the field is "Smith, Tony"
$.[*].oasisProjDetails.oasisProjBiblioList[*].oasisProjBiblioAuthsList[*].surname
Fig. 23: JSONPath expression
Field 44 - date
Year the report was published/issued. Example values are 1914, 2017 etc.
$.[*].oasisProjDetails.oasisProjBiblioList[*].pubdate
Fig. 24: JSONPath expression
Field 45 - publisher
Name of the Organization responsible for publishing the report. Example values for the field are "ADS", "East Lothian Council Archaeology Service"
$.[*].oasisProjDetails.oasisProjBiblioList[*].publisher
Fig. 25: JSONPath expression
Field 46 - place of issue
Place of publication for the report. The field contains textual names only, not URIs. Examples are "Edinburgh", "Rye" etc.
$.[*].oasisProjDetails.oasisProjBiblioList[*].place
Fig. 26: JSONPath expression
Field 58 - name of organization
??
??
Fig. 27: JSONPath expression
Field 50 - URL
URL of the report - an identifier. An example is https://archaeologydataservice.ac.uk/catalogue/adsdata/arch-841-1/dissemination/pdf/oxfordar1-357078_1.pdf
$.[*].oasisProjDetails.oasisProjBiblioList[*].oasisProjBiblioDetailsList[*].url
Fig. 28: JSONPath expression
Field 50a - DOI
Digital Object Identifier of the report - an identifier. Examples are "10.5284/1018054", "10.5284/1057532", "10.5284/1057505"
$.[*].oasisProjDetails.oasisProjBiblioList[*].oasisProjBiblioDetailsList[*].doi
Fig. 29: JSONPath expression
Field 62 - monument type
URIs from monument type vocabulary corresponding to site location: England / Scotland / Wales. Example values for the field are:
- http://purl.org/heritagedata/schemes/eh_tmt2/concepts/70096 (Henge)
- http://purl.org/heritagedata/schemes/eh_tmt2/concepts/68622 (Farmstead)
- http://purl.org/heritagedata/schemes/eh_tmt2/concepts/70152 (Monastery)
<EMAIL_ADDRESS>== 'FISH_TMT')].subjectUri
Fig. 30: JSONPath expression
Field 63 - monument period
URIs from period vocabulary corresponding to site location: England / Scotland / Wales. Example values for the field are:
- http://purl.org/heritagedata/schemes/eh_period/concepts/NE (Neolithic)
- http://purl.org/heritagedata/schemes/eh_period/concepts/MBA (Middle Bronze Age)
- http://purl.org/heritagedata/schemes/eh_period/concepts/E20 (Early 20th Century)
<EMAIL_ADDRESS>== 'FISH_TMT')].periodId.uri
Fig. 31: JSONPath expression
Field 64 - artefact type
URIs from object types vocabulary according to site location: England & Wales / Scotland. Example values for the field are:
- http://purl.org/heritagedata/schemes/mda_obj/concepts/96380 (Pot)
- http://purl.org/heritagedata/schemes/mda_obj/concepts/96665 (Brooch)
- http://purl.org/heritagedata/schemes/mda_obj/concepts/96057 (Rune Stone)
<EMAIL_ADDRESS>== 'FISH_OBJ')].subjectUri
Fig. 32: JSONPath expression
Field 65 - artefact period
URIs from period vocabulary corresponding to site location: England / Scotland / Wales. Example values for the field are:
- http://purl.org/heritagedata/schemes/eh_period/concepts/NE (Neolithic)
- http://purl.org/heritagedata/schemes/eh_period/concepts/MBA (Middle Bronze Age)
- http://purl.org/heritagedata/schemes/eh_period/concepts/E20 (Early 20th Century)
<EMAIL_ADDRESS>== 'FISH_OBJ')].periodId.uri
Fig. 33: JSONPath expression
Field 70 - research outcomes
Use selection from Research Frameworks list (non-LOD at time of writing). A value from the example data for this field is "Could reassessment of early work at sites of Loudon Hill and Milton help to understand early Roman activity in Scotland?"
$.[*].oasisProjDetails.oasisProjResOutcomesList[*].researchFrameworksId.section
Fig. 34: JSONPath expression
Field OASIS+ - Solid geology
If Geophysical module completed. Will use data from http://data.bgs.ac.uk/downloads.html
??
Fig. 35: JSONPath expression
Field OASIS+ - Drift geology
If Geophysical module completed. Will use data from http://data.bgs.ac.uk/downloads.html
??
Fig. 36: JSONPath expression


Startup Actions¶
The XML Configuration file has iocConfiguration/startupActions/startupAction elements for specifying any number of startup actions. Each startupAction element specifies a type that is an implementation of interface IoC.Configuration.OnApplicationStart.IStartupAction.
When the XML configuration file is loaded IoC.Configuration will call the method IoC.Configuration.OnApplicationStart.IStartupAction.Start() for each startup action specified in startupAction elements.
When the XML configuration file is disposed of (when IoC.Configuration.DiContainerBuilder.IContainerInfo is disposed of), IoC.Configuration.OnApplicationStart.IStartupAction.Stop() is called on each startup action.
Startup actions are integrated into dependency injection mechanism. Therefore, the constructor parameters of IoC.Configuration.OnApplicationStart.IStartupAction implementations specified in startupAction elements will be injected using the bindings specified in XML Configuration file or in modules referenced by the configuration file. Also, parameters and injectedProperties elements can used with startupActions to specify constructor parameter values or to inject properties.
IoC.Configuration waits for up to 15 seconds, to make sure that all startup actions are given enough time to properly stop (e.g., stop the threads if necessary).
Note
If all startup actions have true value of property IStartupAction.ActionExecutionCompleted, before 15 seconds passes, the wait time will be shorter.
Here is an example of startup action elements in configuration file:
<startupActions>
<startupAction type="DynamicallyLoadedAssembly1.Implementations.StartupAction1"
assembly="dynamic1">
<!--Use parameters element to specify constructor parameters if necessary.-->
<!--<parameters></parameters>-->
<!--Use injectedProperties element to inject properties into startup action if necessary.-->
<!--<injectedProperties></injectedProperties>-->
</startupAction>
<startupAction type="DynamicallyLoadedAssembly1.Implementations.StartupAction2"
assembly="dynamic1"></startupAction>
</startupActions>
Here is the definition of interface IoC.Configuration.OnApplicationStart.IStartupAction
public interface IStartupAction
{
/// <summary>
/// If <c>true</c>, the action was successfully stopped.
/// </summary>
bool ActionExecutionCompleted { get; }
/// <summary>
/// Starts the action.
/// </summary>
void Start();
/// <summary>
/// Stops the action.
/// </summary>
void Stop();
}


The SSRS report project in this .sln is part of SSDT-BI for VS 2013. You can download from here: http://www.microsoft.com/en-us/download/details.aspx?id=42313
Installation¶
- Clone the repository: git clone https://www.github.com/gracenote/Repographer.git
- In Visual Studio, open src\Repographer.sln
Deploy the Database¶
- Right-click on Repographer.Database and select “Publish.”
- Name the database “Repographer” and supply a valid connection string.
Deploy the Reports¶
- Right-click on Repographer.Reports and modify the Properties. Change the Report Server URL to the desired server.
- In Repographer.Reports, right-click on the “Repographer” data source and update the connection string to where the database is published.
- Right-click on Repographer.Reports and “Publish”
Compile the Executable¶
- Enable NuGet Restore for the .sln
- Compile Repographer
Once compiled, you can distribute the binaries as a .zip to others in your organization that have use of the tool.
Note: It is highly recommended to put repo.exe on your PATH!


String
and optionally char
literals.
The escaped tab character \t
is not reported, because otherwise it will be invisible.
Examples:
String s = "\'Scare\' quotes";
String t = """
All you need is\n\tLove\n""";
After the quick-fix is applied:
String s = "'Scare' quotes";
String t = """
All you need is
\tLove
""";
New in 2019.3


The widget provides client side methods which can be called with Javascript.
Following methods can be used:
- rotateLeft(degree) - Rotates the image to the left direction.
- rotateRight(degree) - Rotates the image to the right direction.
- resize(width,height) - Resizes the image to the given width and height.
- scale(scaleFactor) - Scales the image with the given factor.
- restoreDefaults() - Restores the default image.
${showcase:getFileContent('/sections/imageRotateAndResize/example-basicUsage.xhtml')}
${showcase:getFileContent('/org/primefaces/extensions/showcase/controller/ImageController.java')}


{% extends 'auth_app/email/email_base.html' %} {% block title %} Cancel review for submission #{{ review.paper.pk }} {% endblock %} {% block subject %} Cancel review for submission #{{ review.paper.pk }} {% endblock %} {% block body %}
Dear {{ first_name }} {{ last_name }},
you were de-assigned from reviewing the submission #{{ review.paper.pk }} "{{ review.paper.title }}".
{% endblock %}


The story:
Justin comes from humble beginnings on the island of Oahu, Hawaii. It is there that he gained his love for lounging, lazing, and procrastination. He lived with his father, who worked as a handy-man doing odd-jobs to put food on the table, and his sister, Lindsay. His free-spirited sister, two years his junior, was his accomplice-in-crime adventuring around the neighborhoods of Kawaii Hai and, later, Aiea. These two rambunctious youth lived out their childhoods in daily juxtaposition, experiencing the beautiful island life, carefree, while enduring the trials and hardships of poverty. Their true escape came in the form of a one-way ticket, out of the quicksand of rising property values and island crowding, to the cheap suburbs of Spokane, Washington.
It is there, in the land of pines and rainy weather, that Linsday and Justin vowed to climb out of the throes of mediocrity and seek out advanced educations. Justin’s path led him to the football fandom Mecca of Washington State University, and Lindsay’s to the hometown comfort and tranquility of Eastern Washington University. It was there that Justin decided his best path towards becoming an educated and productive member of society would be through military service. An attraction to the culture and comparatively higher standards led him to join the Air Force through the Reserve Officers Training Course offered as a cross-town partnership between WSU and the University of Idaho.
After four years of new friendships, new experiences, and new knowledge, Justin was ready to enter active duty in the US Air Force as a 2nd Lieutenant. The first obstacle he faced on his way to becoming a Cyberspace Operations officer was a greuling, merciless technical training school dubbed Undergraduate Cyber Training. He entered the arena with 12 excellent classmates, each driven to establish a new domain in which America would be the leader in the emerging cyber battlefield. During this six month endeavour he was faced with ten hour days in a windowless building learning the dark arts of IT. Along the way he lost teammates, some to challenging courses meant to weed out the History majors, and others to lapses in attention or diligence. A failed block of Undergraduate Cyber Training had big impacts on a young officer’s career. After a failure, the officer had three different options:
- Buckle down, study, pass, and graduate after your class rank has plummetted
- Study and pass, just to fail in a future block
- Don't study and fail the same block again
If options ‘B.’ or ‘C.’ occurred, then the officer faced re-training into a different career field, or possibly even discharge from the Air Force.
Despite the struggles, the support of his then girlfriend and future wife, Colleen, and copious amounts of caffeine, helped guide him to victory over the Air Force’s premier school. He emerged top of the class with Distinguished Graduate accolades and an assignment to the bustling ecosystem of Ramstein Air Base, Germany. It is there he still resides, squandering the money better spent towards retirement, instead for trips to the birthplaces of cultures he can’t fully comprehend with experiences he struggles to remember. So if you, my dear reader, find yourself in the chill of a German morning, be sure to hold out an IPA and say the magic letters, “LT”, and he will come running to meet you.


Uploading and download with s3¶
The two basic functions found in the aws package for interacting with s3 are download_s3 and upload_s3. Users must select a bucket by changing the variable bucket_name. Users must also have the correct permissions on their computer to download from or upload to the bucket of interest.
download_s3(remote_fname, local_fname, bucket_name="ccurtis7.pup")


{% extends 'website/base.html' %} {% load static %} {% block title %}Socials in ECSS{% endblock title %} {% block content %}
At ECSS we run socials to help people de-stress from the madness that is an ECS degree but also to meet people in the department. If you need to procrastinate, make friends, or just chill and forget then this is for you.
As does every society at university, we also run alcoholic events. Two white t-shirt socials a year, the Halloween house crawl, and pub golf are just a few of the nights we have to offer.
Not all of university is getting so drunk you forget your own name, and to accommodate that we run many non-alcoholic and more relaxed events. We have bowling, trips to scoops and pub quizzes planned so keep an eye out for those.


Id: 421
Name: Rich Plutonian
Status: Alive
Species: Alien
Type: Plutonian
Gender: Female
OriginName: Pluto
OriginUrl: https://rickandmortyapi.com/api/location/47
LocationName: Pluto
LocationUrl: https://rickandmortyapi.com/api/location/47
Image: https://rickandmortyapi.com/api/character/avatar/421.jpeg
Episode: ['https://rickandmortyapi.com/api/episode/9']
Url: https://rickandmortyapi.com/api/character/421
Created: 2018-04-15T21:51:50.534Z


Report Safety Info
1.5
miles away
Address:
0000 null street, nothing avenue
Safety Rating:
Cleanliness Rating:
Order Food Online Using
Get Directions
Enter a search query to see search results here...
Report Safety Info
×
General Safety (Lighting, Suspicious Activity, etc.):
Cleanliness:
Comments (Please provide any details which will help future users, such as suspicious activity you have noticed, lighting concerns, etc.):


Mission
To be the service & distribution partner of choice by efficiently delivering; client-focused, tailored, affordable insurance and investment solutions, in the Kenyan Market..
Vision
We e ask questions, we listen well, we partner with strong, stable, well managed and highly rated Insurance companies in order to deliver WOW outcomes!
Core Values
Prowealth delivers "BEST OF THE MARKET" solutions, aided by 3 core values: TRANSPARENCY |RELIABILITY | SERVICE.
Transparency
We deliver with honesty, we respect our clients and we keep our word.
Reliability
We apply ourselves, engage deeply in order to deliver unique solutions, even to uncommon Insurance needs.
Service
We e ask questions, we listen well, we partner with strong, stable, well managed and highly rated Insurance companies in order to deliver WOW outcomes!
Motto
We e ask questions, we listen well, we partner with strong, stable, well managed and highly rated Insurance companies in order to deliver WOW outcomes!


,
Welcome to the SyncPhonic Community. Click on the link below to activate your account!. Have Fun & enjoy...


--- layout: default title: First Page ---
Jerry’s attorney, Andrea Lyon, has gone through every avenue of the legal system seeking justice. Her pleas for relief have continually been denied…
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Neque, ab, nulla sunt aut vel debitis placeat sequi pariatur voluptate doloremque cumque enim culpa at quos dolores beatae obcaecati laboriosam dicta!


Custom list of percentiles to display.
HdrHistogram is used to bucket and store the
full range of values so that any percentile value can be reported with at most 1% error,
e.g. if the 99.9
th percentile is reported as 1400 milliseconds, then that would be at most
14 milliseconds from the true 99.9
th percentile value.


RPItems
About
Sign Up
Log In
New Listing
A place for students to sell things within the RPI Community
Item Information
Category:
Books
Clothing
Electronics
Games
Movies
Music
Tool
Others
Item Name:
Price:
$
Description:
Item URL Picture:
Ideal dimensions: 400px x 400px
Contact Information
Secondary Email (optional):


By now, this book should have sent statements to the LRS.
You should be able to verify this by logging into the ADL LRS using the following credentials:
ebookbp / boilerplate
By now, this book should have sent statements to the LRS.
You should be able to verify this by logging into the ADL LRS using the following credentials:
ebookbp / boilerplate


Before Change
block_addr, all_syn_block_sz))
// Get additional data for the synapse expander
delay_placement = self._delay_placement_index.get((
app_edge.pre_vertex, pre_vertex_slice.lo_atom,
pre_vertex_slice.hi_atom))
generator_data.append(GeneratorData(
synaptic_matrix_offset, delayed_synaptic_matrix_offset,
undelayed_max_n_words, delayed_max_n_words, undelayed_max_synapses,
delayed_max_synapses, pre_slices, pre_slice_index, post_slices,
After Change
pre_slices, pre_slice_index, post_slices, post_slice_index,
pre_vertex_slice, post_vertex_slice, synapse_info,
app_edge.n_delay_stages + 1, machine_time_step)
elif n_bytes_delayed != 0:
raise Exception(
"Found delayed items but no delay "
"machine edge for {}".format(app_edge.label))
// Skip over the normal bytes and write a master pop entry
synaptic_matrix_offset = 0xFFFFFFFF
if n_bytes_undelayed:


DfE enquiries
Central newsdesk 020 7783 8300
General enquiries 0370 000 2288
News story
DfE is looking at induction arrangements for newly qualified teachers to see how they can be improved to better meet the needs of schools.
The Department for Education is looking at the induction arrangements for newly qualified teachers to see how they can be refined, improved and updated to better meet the needs of teachers and schools.
Qualified teachers who are employed in maintained schools in England must, by law, have completed an induction period after their initial training. The induction period usually lasts for 3 terms.
The current regulations and guidance on statutory induction were last updated in 2008, run to more than 70 pages and are based on the needs of the school system in 1999. Some schools say that current process is bureaucratic and can be a barrier to recruiting and retaining good teachers.
The department will informally consult with key stakeholders such as headteachers, induction co-ordinators and newly qualified teachers.
It will consider things like:
Schools Minister Nick Gibb said:
The countries that provide the best education are those that value teachers most highly and train them to the highest standard. We have some of the best teachers in the world, but it is vital that their training and development keeps pace with what schools and pupils need.
Our schools white paper ‘The Importance of Teaching’ sets out how we will do this by reforming initial teacher training, creating new teaching schools and improving professional development.
This is the first step towards a less bureaucratic and more fit for purpose induction programme for our newest teachers, to set them on the path to a successful career.
The department will formally consult on new regulations for the statutory induction period in the autumn term. The consultation will run for 12 weeks. We expect that new arrangements will come into force by September 2012, along with the revised Teachers’ Standards.
The changes to induction arrangements will apply to maintained schools in England. They will also apply to independent schools, academies, free schools and other settings that wish to provide statutory induction for their newly qualified teachers.
Central newsdesk 020 7783 8300
General enquiries 0370 000 2288
Published: 28 April 2011


Toggle navigation
Seeking
Logout
Basic Profile
Summary
Skills
Projects
Education
Others
Add Project
Client:
*
Project Title:
*
Duration:
*
Month
Jan
Feb
Mar
Apr
May
Year
2019
2018
2017
2016
2015
To
Month
Jan
Feb
Mar
Apr
May
Year
2019
2018
2017
2016
2015
Project Location:
Project Details:
*
Role:
Team Size:
Role Description:
Skills Used:
Save Changes
Cancel


The car uses a XL932R4 Rf receiver, if the right, left, front and back output are easy to find on the pcd we cannot use them as it. These outputs drive power to the engine are not suitable with the arduino.
To detected the command pin that we can derive to use the arduino, put a crocodile plug on the mass and test the voltage on Pins while you set a command.
Here the map for hacking the receiver.


--- layout: page title: Portfolio permalink: /services-old-deprecated/ description: This is an individual item from the portfolio. ---


Before Change
def main(argv):
source = argv[1]
dest = argv[2]
with open(".coverage", "rb") as f:
coverage_data = pickle.load(f)
// Prefilter to filenames in dit
filenames = [filename for filename in coverage_data["lines"].keys()
if "dit" in filename]
for filename in filenames:
After Change
for filename in filenames:
new_filename = re.sub(source, dest, filename)
if new_filename != filename:
cd._lines[new_filename] = cd._lines.pop(filename)
cd.write_file(".coverage")
if __name__ == "__main__":


Blockstates
Items
Blocks
Textures
Sounds
Dimensions
DimensonKeys
Advancements
Langs
Asset Manager
Select an asset/data folder to work on
Or select a new one
Open Assets


Module: Mongoid::Persistable::Deletable
- Extended by:
- ActiveSupport::Concern
- Included in:
- Mongoid::Persistable
- Defined in:
- lib/mongoid/persistable/deletable.rb
Overview
Defines behavior for persistence operations that delete documents.
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#delete(options = {}) ⇒ TrueClass
(also: #remove)
Remove the document from the database.
Instance Method Details
#delete(options = {}) ⇒ TrueClass Also known as: remove
Remove the document from the database.
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/mongoid/persistable/deletable.rb', line 23 def delete( = {}) raise Errors::ReadonlyDocument.new(self.class) if readonly? prepare_delete do unless [:persist] == false if () else delete_as_root end end end end |


Designed split-screen features within the platform that allows users to review and process applications much faster and more efficiently.
When processing a list of records, we worked on a feature that allows the user to view the list on the left while seeing the item detail on the right.
When processing a form submission, we worked on a feature that allows the user to complete the current form of the step at the bottom while viewing the application at the top.
UX Designer
9 weeks / 3 sprints
Jan 10th - Mar 11th 2022
1 Product Manager
1 Project Assistant
1 UX Designer
2 Developers
As a processor, I review applications, directly communicate with people, and give them more clarity & insight into the application and review process.
A desire for efficiency
Easily track what work I need to do
Have a centralized place for all work that needs to be done
Make the hand-off process from point A to be point B smoother
Currently, to navigate to a record’s Detail View from a List View, the users have to navigate away from the List View.
Power users may need to navigate through multiple records in a List View quickly and efficiently.
Our goal is to speed up the time it takes to process records, especially in the case of users who need to check multiple records at once.
“Master Detail Views” typically refers to clicking into an item on a list to see the details of that item, side-by-side to the list.
Add an icon button to each list view item
Click the icon button to open the detail view
The detail view overlaps with the list view
Add an icon button to go to master view mode
In master view mode, thr left side becomes a list of cards
Click the list item card to open the detail view on the right
The detail view does not overlap with the list view
Click back and forth arrow buttons to toggle between previously opened detail views
Interact with tabs to toggle between previously opened detail views
When processing or auditing an application, processors or auditors commonly have to reference fields that exist on previous steps.
Processors and auditors currently cannot view a submission’s history while completing a review/approval step without scrolling up and down, navigating away from the page, or attempting to remember the content of that page.
Our goal is to allow the processors to review the data in previous steps while completing their steps, so they can be more efficient with processing applications.
The current step is pinned at the bottom of the page
Click steps navigation to jump to the information of that step quickly
Configure link elements to link the information between the current step and previous steps
The current step is pinned at the bottom of the page
Click the target icon to jump to the previous information quickly
Submission history and the form submission exist on the same page
Submission history appears under each step
Submission history and the form submission exist in separate tabs
Submission history is more organized


Congrats, you made it to our Tank Trubble server!
Just set yourself up below and you're ready to go :)
Username:
Colour:
Let's play!


Room
This room has a password!
Order form link:
There are orders left.
Time left:
Orders
Order subtotal: $0
Order tax/tip/delivery: $0
Order total: $0


Arun Poudyal
E-mail :-<EMAIL_ADDRESS>Website :- www.linkedin.com/in/arun-p-781b39111
Phone :-<PHONE_NUMBER>
Address :- sorhakutte, kathmandu
Objective
Enthusiastic and organized administrator with solid understanding of the Application, System and Networking also mainly focused towards the security aspect of the Working environment.
Work experience
Javra Software Nepal March 2015 — March 2016
- Configured monitoring tools like Nagios and cacti.
- Monitoring internal bandwidth.
- Monitoring and troubleshooting Windows Server and Linux Server.
- Worked with version controls like Subversion and Git.
- Desktop troubleshooting.
- Managing internal networks (Cisco).
NCCS college Feb 2017 — July 2017
- Taught Bachelor's student the system administration course along with the aspect of security
- Used tools like TCPDump and WireShark
- Different protocol analysis like FTP, HTTP/S, SSH etc
- DNS and DHCP concepts
Qualifications
BE Computer Engineer
Certifications
RedHat - Red Hat Certified System Administrator [ CertID : 180-000-127 ]
Education
Computer Engineering Batch 2010
Associate in science Batch 2008
Interests
Love Technology in terms of virtualization, system and networking regarding the knowledge towards security aspects.
Skills
- Programming : C/C++ , Javascript, Python, Bash Scripting.
- OS : Windows, Linux/Unix.
- Network : cisco networking, TCP/IP protocol idea.
- Firewall and proxy handling


Backup Information
If you have a regular backup regimen (and you should), you'll probably want to know where CiphSafe stores various files so they can be included. By default, CiphSafe is a good Mac citizen and stores any files you save into your Documents folder, so if your home folder is included in backups, CiphSafe documents should already be covered. The files are saved with a "csd" extension, so should be easy to spot.
Preferences are like other Mac applications where they are stored in the Preferences folder of the Library folder in your home directory. If you look, there should be a bunch of files with a "plist" extension, one of them being "com.withay.ciphsafe.plist". This stores anything you've changed in the Preferences window, as well as other bits such as window size and locations, table column arrangement, etc.


---
layout: post
title: Asymmetry in Games
date: '2016-09-13T07:06:00-07:00'
tags:
- fromtheinternet
- games
- gaming
tumblr_url: http://beekley.xyz/post/150356447531/asymmetry-in-games
---
Asymmetry in Games
Speaking of asymmetry in games…
I really liked this article, though I don’t agree with it in some places.


Your browser does not support this.
Your browser may not support the Canvas tag, try
FireFox
.
Javascript required.
Javascript is required for this operation, your browser must be able to run it in order to use this game.


Contact Us
A contact form requires some method of emailing the contents of the form to an email address. The most common way to do this is to use some kind of server script (PHP for example). I would be happy to send you the PHP code for the contact form for your chosen template, I charge £20.00GBP for this. Simply contact me for more details.
Name
Email Address
Message
Please enter the answer to this simple maths question (to prevent spam)
Maths Question: 9 + 3 = ?


--- layout: default ---
Color maps are an abstraction born for working with images, but can be applied in other situations as well. Let's start with color maps that are simply images, i.e. the map is an assignment of pixels to colors, specified by the data of an image.
In both of the following processes we'll do the same thing. First we take an image, which to us is a grid of pixels. Next, we make a fresh canvas and go over each of the pixels in that canvas. We use something from the original image to help us pick a color for each pixel.
Pixel Running is a process which gives a streak-like effect to an image:
For each row, starting at the left edge, take the color of the current pixel (in the image) and copy it some number of times to the right. Take the color of the pixel where it stopped and copy that color some number of times. Play with the slider to get a sense of how the maximum length changes the effect, or use a constant length to see how it blockifies the image.
See the Pen Pixel Data Runner by George Hoqqanen (@hoqqanen) on CodePen.
Radial Sampling on the other hand gives a blurred, grainy effect:
For every pixel, pick a random nearby pixel in the corresponding image and color it with that color. If the maximum distance is 0, then only that same pixel will be chosen and the image recreated. If the distance is large, things get noisier. Play with the radius yourself to see.
See the Pen Pixel Data Radial by George Hoqqanen (@hoqqanen) on CodePen.
Rotating pixels allows us to create a wave within the image.
See the Pen Pixel Data Spiral by George Hoqqanen (@hoqqanen) on CodePen.
Here we take 2 or 4 source images and interleave them so that each little 2x2 pixel block features pixels from each. If we used an all-white and all-black image, this would generate a very fine checkerboard. We can change the block size to make a larger checkerboard and make something of a quilt out of chunks of the images.
See the Pen Interlacer by George Hoqqanen (@hoqqanen) on CodePen.
If you haven't looked at this process already, head on over to the diffusion page.
See the Pen Diffusion Variants by George Hoqqanen (@hoqqanen) on CodePen.
So far we've explored how to use image data as a color map, and some of the processes that can be applied to such a map. We can use maps other than images though. For example, we can define color maps through pure functions! What's more, we can use a latent color map to sample colors of objects (beyond pixels) in the canvas that we wish to color. If we define a color map which evolves through time, this can give objects a color which evolves.


class: center, middle ### W4995 Applied Machine Learning # Introduction to Supervised Learning 02/03/20 Andreas C. Müller ??? Hey everybody. Today, we’ll be talking more in-depth about supervised learning, model evaluation and model selection. FIXME: More details on implementing cross-validation? FIXME sklearn API review / summary + pandas vs numpy? FIXME Add code for nested cross-validation FIXME IID vs not IID is relevant even with out "cross" validation for simple validation split FIXME writing your own FIXME ensemble approach to cross-validation? FIXME risk minimization: two kinds of error (estimation and generalization) --- class: center # Supervised Learning .larger[ $$ (x_i, y_i) \propto p(x, y) \text{ i.i.d.}$$ $$ x_i \in \mathbb{R}^p$$ $$ y_i \in \mathbb{R}$$ $$\text{learn }f(x_i) \approx y_i$$ such that $$f(x) \approx y \quad$$ for new $(x, y) \propto p(x, y)$. ] ??? As a reminder, in supervised learning, the dataset we learn form is input-output pairs $(x_i, y_i)$, where $x_i$ is some n-dimensional input, or feature vector, and $y_i$ is the desired output we want to learn to predict. We assume these samples are drawn from some unknown joint distribution $p(x, y)$. You can think of this as there being some (not necessarily deterministic) process that goes from $x_i$ to $y_i$, but that we don’t know. We try to find a function that approximates the output $y_i$ for each known input $x_i$. But we also demand that for new inputs $x$ , and unobserved $y$, $f(x)$ is approximately $y$. I want to go through a simple examples of supervised algorithms today, nearest neighbors --- class: center # Nearest Neighbors ![:scale 40%](images/knn_boundary_test_points.png) $$f(x) = y_i, i = \text{argmin}_j || x_j - x||$$ ??? Let’s say we have this two-class classification dataset here, with two features, one on the x axis and one on the y axis. And we have three new points as marked by the stars here. If I make a prediction using a one nearest neighbor classifier, what will it predict? It will predict the label of the closest data point in the training set. That is basically the simplest machine learning algorithm I can come up with. Here’s the formula: the prediction for a new x is the y_i so that x_i is the closest point in the training set. Ok, so now how do we find out whether this model is any good? --- class: center # Nearest Neighbors ![:scale 40%](images/knn_boundary_k1.png) $$f(x) = y_i, i = \text{argmin}_j || x_j - x||$$ ??? Let’s say we have this two-class classification dataset here, with two features, one on the x axis and one on the y axis. And we have three new points as marked by the stars here. If I make a prediction using a one nearest neighbor classifier, what will it predict? It will predict the label of the closest data point in the training set. That is basically the simplest machine learning algorithm you can think of. Here’s the formula: the prediction for a new x is the y_i so that x_i is the closest point in the training set. Ok, so now how do we find out whether this model and these predictions are any good? --- class: center ![:scale 60%](images/train_test_set_2d_classification.png) ??? The simplest way is to split the data into a training and a test set. So we take some part of the data set, let’s say 75% and the corresponding output, and train the model, and then apply the model on the remaining 25% to compute the accuracy. This test-set accuracy will provide an unbiased estimate of future performance. So if our i.i.d. assumption is correct, and we get a 90% success rate on the test data, we expect about a 90% success rate on any future data, for which we don't have labels. Let's dive into how to build and evaluate this model with scikit-learn. --- # KNN with scikit-learn ```python from sklearn.model_selection import train_test_split X_train, X_test, y_train, y_test = train_test_split(X, y) from sklearn.neighbors import KNeighborsClassifier knn = KNeighborsClassifier(n_neighbors=1) knn.fit(X_train, y_train) print("accuracy: ", knn.score(X_test, y_test))) y_pred = knn.predict(X_test) ``` accuracy: 0.77 ??? We import train_test_split form model selection, which does a random split into 75%/25%. We provide it with the data X, which are our two features, and the labels y. As you might already know, all the models in scikit-learn are implemented in python classes, with a single object used to build and store the model. We start by importing our model, the KneighborsClassifier, and instantiate it with n_neighbors=1. Instantiating the object is when we set any hyper parameter, such as here saying that we only want to look at the neirest neighbor. Then we can call the fit method to build the model, here knn.fit(X_train, y_train) All models in scikit-learn have a fit-method, and all the supervised ones take the data X and the outcomes y. The fit method builds the model and stores any estimated quantities in the model object, here knn. In the case of nearest neighbors, the `fit` methods simply remembers the whole training set. Then, we can use knn.score to make predictions on the test data, and compare them against the true labels y_test. For classification models, the score method will always compute accuracy. Just for illustration purposes, I also call the predict method here. The predict method is what's used to make predictions on any dataset. If we use the score method, it calls predict internally and then compares the outcome to the ground truth that's provided. Who here has not seen this before? --- class: center # Influence of Number of Neighbors ![:scale 50%](images/knn_boundary_k1.png) ??? So this was the predictions as made by one-nearest neighbor. But we can also consider more neighbors, for example three. Here is the three nearest neighbors for each of the points and the corresponding labels. We can then make a prediction by considering the majority among these three neighbors. And as you can see, in this case all the points changed their labels! (I was actually quite surprised when I saw that, I just picked some points at random). Clearly the number of neighbors that we consider matters a lot. But what is the right number? The is a problem you’ll encounter a lot in machine learning, the problem of tuning parameters of the model, also called hyper-parameters, which can not be learned directly from the data. --- class: center # Influence of Number of Neighbors ![:scale 50%](images/knn_boundary_k3.png) ??? So this was the predictions as made by one-nearest neighbor. But we can also consider more neighbors, for example three. Here is the three nearest neighbors for each of the points and the corresponding labels. We can then make a prediction by considering the majority among these three neighbors. And as you can see, in this case all the points changed their labels! (I was actually quite surprised when I saw that, I just picked some points at random). Clearly the number of neighbors that we consider matters a lot. But what is the right number? The is a problem you’ll encounter a lot in machine learning, the problem of tuning parameters of the model, also called hyper-parameters, which can not be learned directly from the data. --- class: center, some-space # Influence of n_neighbors ![:scale 45%](images/knn_boundary_varying_k.png) ??? Here’s an overview of how the classification changes if we consider different numbers of neighbors. You can see as red and blue circles the training data. And the background is colored according to which class a datapoint would be assigned to for each location. For one neighbor, you can see that each point in the training set has a little area around it that would be classified according to it’s label. This means all the training points would be classified correctly, but it leads to a very complex shape of the decision boundary. If we increase the number of neighbors, the boundary between red and blue simplifies, and with 40 neighbors we mostly end up with a line. This also means that now many of the training data points would be labeled incorrectly. --- class: center, spacious # Model complexity ![:scale 75%](images/knn_model_complexity.png) ??? We can look at this in more detail by comparing training and test set scores for the different numbers of neighbors. Here, I did a random 75%/25% split again. This is a very noisy plot as the dataset is very small and I only did a random split, but you can see a trend here. You can see that for a single neighbor, the training score is 1 so perfect accuracy, but the test score is only 70%. If we increase the number of neighbors we consider, the training score goes down, but the test score goes up, with an optimum at 19 and 21, but then both go down again. This is a very typical behavior, that I sketched in a schematic for you. --- class: center, spacious # Overfitting and Underfitting ![:scale 80%](images/overfitting_underfitting_cartoon_train.png) ??? here is a cartoon version of how this chart looks in general, though it's horizontally flipped to the one with saw for knn. This chart has accuracy on the y axis, and the abstract concept of model complexity on the x axis. If we make our machine learning models more complex, we will get better training set accuracy, as the model will be able to capture more of the variations in the data. --- class: center, spacious # Overfitting and Underfitting ![:scale 80%](images/overfitting_underfitting_cartoon_generalization.png) ??? But if we look at the generalization performance, we get a different story. If the model complexity is too low, the model will not be able to capture the main trends, and a more complex model means better generalization. However, if we make the model too complex, generalization performance drops again, because we basically learn to memorize the dataset. --- class: center, spacious # Overfitting and Underfitting ![:scale 80%](images/overfitting_underfitting_cartoon_full.png) ??? If we use too simple a model, this is often called underfitting, while if we use to complex a model, this is called overfitting. And somewhere in the middle is a sweet spot. Most models have some way to tune model complexity, and we’ll see many of them in the next couple of weeks. So going back to nearest neighbors, what parameters correspond to high model complexity and what to low model complexity? high n_neighbors = low complexity! --- # Computational Properties .left-column[ ## Naive - fit: no time - memory: O(n * p) - predict: O(n * p) ] .invisible[.right-column[ ## Kd-tree - fit: O(p * n log n) - memory: O(n * p) - predict: - O(k * log(n))
FOR FIXED p! ]] .reset-column[ n=n_samples p=n_features ] ??? Ok, now for the k nearest neighbors. How would you implement this? (brute force or neighbors structure) When not using a structure: fit no time, memory is the whole dataset, and prediction requires comparing against all data points. If we create a kd-tree or ball tree? Fit takes O(n log n), memory is the same. Prediction might be faster in low dimensions. What’s bad about this? memory scales with data, prediction speed scales with data :-/ --- # Computational Properties .left-column[ ## Naive - fit: no time - memory: O(n * p) - predict: O(n * p) ] .right-column[ ## Kd-tree - fit: O(p * n log n) - memory: O(n * p) - predict: - O(k * log(n))
FOR FIXED p! ] .reset-column[ n=n_samples p=n_features ] ??? Ok, now for the k nearest neighbors. How would you implement this? (brute force or neighbors structure) When not using a structure: fit no time, memory is the whole dataset, and prediction requires comparing against all data points. If we create a kd-tree or ball tree? Fit takes O(n log n), memory is the same. Prediction might be faster in low dimensions. What’s bad about this? memory scales with data, prediction speed scales with data :-/ --- # So far: Train-test-split ![:scale 100%](images/train_test_split_new.png) ??? So far we’ve work with a split of the data into a training and a test set, build the model on the training set, and evaluated on the test set. So now, lets say we want to adjust the parameter n_neigbhbors in k neighbors algorithm, how could we do this? [split, try out different values of k, choose the best on test set] What’s the problem with that? - good for choosing k, overly optimistic for getting accuracy! --- # Threefold split ![:scale 100%](images/train_test_validation_split.png) ??? The simplest way to combat this overfitting to the test set is by using a three-fold split of the data, into a training, a validation and a test set as we just did. We use the training set for model building, the validation set for parameter selection and the test set for a final evaluation of the model. So how many models should you try out on the test set? Only one! Ideally use use the test-set exactly once, otherwise you make a multiple hypothesis testing error! What are downsides of this? We lose a lot of data for evaluation, and the results depend on the particular sampling. --
.smallest[Interesting related read on overfitting in cross-validation [Preventing Overfitting in cross-validation - Ng 1997](20http://robotics.stanford.edu/~ang/papers/cv-final.pdf)] --- class: center # Overfitting the validation set ![:scale 80%](images/overfitting_validation_set_1.png) --- class: center # Overfitting the validation set ![:scale 80%](images/overfitting_validation_set_2.png) --- class: center # Overfitting the validation set ![:scale 80%](images/overfitting_validation_set_3.png) --- class: center # Overfitting the validation set ![:scale 80%](images/overfitting_validation_set_4.png) --- # Threefold Split for Hyper-Parameters .smaller[ ```python X_trainval, X_test, y_trainval, y_test = train_test_split(X, y) X_train, X_val, y_train, y_val = train_test_split(X_trainval, y_trainval) val_scores = [] neighbors = np.arange(1, 15, 2) for i in neighbors: knn = KNeighborsClassifier(n_neighbors=i) knn.fit(X_train, y_train) val_scores.append(knn.score(X_val, y_val)) print(f"best validation score: {np.max(val_scores):.3}") best_n_neighbors = neighbors[np.argmax(val_scores)] print("best n_neighbors:", best_n_neighbors) knn = KNeighborsClassifier(n_neighbors=best_n_neighbors) knn.fit(X_trainval, y_trainval) print(f"test-set score: {knn.score(X_test, y_test):.3f}") ``` ``` best validation score: 0.991 best n_neighbors: 11 test-set score: 0.951 ``` ] ??? Here is an implementation of the three-fold split for selecting the number of neighbors. For each number of neighbors that we want to try, we build a model on the training set, and evaluate it on the validation set. We then pick the best validation set score, here that’s 97.2%, achieved when using three neighbors. We then retrain the model with this parameter, and evaluate on the test set. The retraining step is somewhat optional. We could also just use the best model. But retraining allows us to make better use of all the data. Still, depending on the test-set size we might be using only 70% or 80% of the data, and our results depend on how exactly we split the datasets. So how can we make this more robust? --- # Cross-validation .center[ ![:scale 80%](images/cross_validation_new.png) ] ??? The answer is of course cross-validation. In cross-validation, you split your data into multiple folds, usually 5 or 10, and built multiple models. You start by using fold1 as the test data, and the remaining ones as the training data. You build your model on the training data, and evaluate it on the test fold. For each of the splits of the data, you get a model evaluation and a score. In the end, you can aggregate the scores, for example by taking the mean. What are the pros and cons of this? Each data point is in the test-set exactly once! Takes 5 or 10 times longer! Better data use (larger training sets). Does that solve all problems? No, it replaces only one of the splits, usually the inner one! -- .smaller[ pro: more stable, more data con: slower ] ??? --- class: center, some-space # Cross-validation + test set ![:scale 105%](images/grid_search_cross_validation_new.png) ??? Here is how the workflow looks like when we are using five-fold cross-validation together with a test-set split for adjusting parameters. We start out by splitting of the test data, and then we perform cross-validation on the training set. Once we found the right setting of the parameters, we retrain on the whole training set and evaluate on the test set. --- # Grid-Search with Cross-Validation .smaller[ ```python from sklearn.model_selection import cross_val_score X_train, X_test, y_train, y_test = train_test_split(X, y) cross_val_scores = [] for i in neighbors: knn = KNeighborsClassifier(n_neighbors=i) scores = cross_val_score(knn, X_train, y_train, cv=10) cross_val_scores.append(np.mean(scores)) print(f"best cross-validation score: {np.max(cross_val_scores):.3}") best_n_neighbors = neighbors[np.argmax(cross_val_scores)] print(f"best n_neighbors: {best_n_neighbors}") knn = KNeighborsClassifier(n_neighbors=best_n_neighbors) knn.fit(X_train, y_train) print(f"test-set score: {knn.score(X_test, y_test):.3f}") ``` ``` best cross-validation score: 0.967 best n_neighbors: 9 test-set score: 0.965 ``` ] ??? Here is an implementation of this for k nearest neighbors. We split the data, then we iterate over all parameters and for each of them we do cross-validation. We had seven different values of n_neighbors, and we are running 10 fold cross-validation. How many models to we train in total? 10 * 7 + 1 = 71 (the one is the final model) --- class: center, middle ![:scale 80%](images/gridsearch_workflow.png) ??? Here is a conceptual overview of this way of tuning parameters, we start of with the dataset and a candidate set of parameters we want to try, labeled parameter grid, for example the number of neighbors. We split the dataset in to training and test set. We use cross-validation and the parameter grid to find the best parameters. We use the best parameters and the training set to build a model with the best parameters, and finally evaluate it on the test set. Because this is such a common pattern, there is a helper class for this in scikit-learn, called GridSearch CV, which does most of these steps for you. --- # GridSearchCV .smaller[ ```python from sklearn.model_selection import GridSearchCV X_train, X_test, y_train, y_test = train_test_split(X, y, stratify=y) param_grid = {'n_neighbors': np.arange(1, 30, 2)} grid = GridSearchCV(KNeighborsClassifier(), param_grid=param_grid, cv=10, return_train_score=True) grid.fit(X_train, y_train) print(f"best mean cross-validation score: {grid.best_score_}") print(f"best parameters: {grid.best_params_}") print(f"test-set score: {grid.score(X_test, y_test):.3f}") ``` ``` best mean cross-validation score: 0.967 best parameters: {'n_neighbors': 9} test-set score: 0.993 ``` ] ??? Here is an example. We still need to split our data into training and test set. We declare the parameters we want to search over as a dictionary. In this example the parameter is just n_neighbors and the values we want to try out are a range. The keys of the dictionary are the parameter names and the values are the parameter settings we want to try. If you specify multiple parameters, all possible combinations are tried. This is where the name grid-search comes from - it’s an exhaustive search over all possible parameter combinations that you specify. GridSearchCV is a class, and it behaves just like any other model in scikit-learn, with a fit, predict and score method. It’s what we call a meta-estimator, since you give it one estimator, here the KneighborsClassifier, and from that GridSearchCV constructs a new estimator that does the parameter search for you. You also specify the parameters you want to search, and the cross-validation strategy. Then GridSearchCV does all the other things we talked about, it does the cross-validation and parameter selection, and retrains a model with the best parameter settings that were found. We can check out the best cross-validation score and the best parameter setting with the best_score_ and best_params_ attributes. And finally we can compute the accuracy on the test set, simply but using the score method! That will use the retrained model under the hood. --- class: compact # GridSearchCV Results .tiny[ ```python import pandas as pd results = pd.DataFrame(grid.cv_results_) results.columns ``` ``` Index(['mean_fit_time', 'mean_score_time', 'mean_test_score', 'mean_train_score', 'param_n_neighbors', 'params', 'rank_test_score', 'split0_test_score', 'split0_train_score', 'split1_test_score', 'split1_train_score', 'split2_test_score', 'split2_train_score', 'split3_test_score', 'split3_train_score', 'split4_test_score', 'split4_train_score', 'split5_test_score', 'split5_train_score', 'split6_test_score', 'split6_train_score', 'split7_test_score', 'split7_train_score', 'split8_test_score', 'split8_train_score', 'split9_test_score', 'split9_train_score', 'std_fit_time', 'std_score_time', 'std_test_score', 'std_train_score'], dtype='object') ``` ```python results.params ``` ``` 0 {'n_neighbors': 1} 1 {'n_neighbors': 3} 2 {'n_neighbors': 5} 3 {'n_neighbors': 7} 4 {'n_neighbors': 9} 5 {'n_neighbors': 11} 6 {'n_neighbors': 13} Name: params, dtype: object ``` ] ??? FIXME text size GridSearchCV also computes a lot of interesting statistics for you, which are stored in the cv_results_ attribute. That attribute is a dictionary, but it’s easiest to convert it to a pandas dataframe to look at it. Here you can see the columns. Theres mean fit time, mean score time, mean test scores, mean training scores, standard deviations and scores for each individual split of the data. And there is one row for each setting of the parameters we tried out. --- class: center # n_neighbors Search Results ![:scale 70%](images/grid_search_n_neighbors.png) ??? We can use this for example to plot the results of cross-validation over the different parameters. Here are the mean training score and mean test score together with one standard deviation. --- class: spacious # Nested Cross-Validation - Replace outer split by CV loop - Doesn’t yield single model (inner loop might have different best parameter settings) - Takes a long time, not that useful in practice ??? We could additionally replace the outer split of the data by cross-validation. That would yield what’s known as nested cross-validation. This is sometimes interesting when comparing different models, but it will not actually yield one final model. It will yield one model for each loop of the outer fold, which might have different settings of the parameters. Also, this takes a really long time to train, by an additional factor of 5 or 10, so this is not used very commonly in practice. But let’s dive into the cross-validation a bit more. --- class: center, middle # Cross-Validation Strategies ??? So I mentioned k-fold cross validation, where k is usually 5 or ten, but there are many other strategies. One of the most commonly ones is stratified k-fold cross-validation. --- .center[ ![:scale 90%](images/kfold_cv.png) ] --- class: compact .center[ ![:scale 90%](images/stratified_cv.png) ] .smallest[ Stratified: Ensure relative class frequencies in each fold reflect relative class frequencies on the whole dataset.] ??? The idea behind stratified k-fold cross-validation is that you want the test set to be as representative of the dataset as possible. StratifiedKFold preserves the class frequencies in each fold to be the same as of the overall dataset. Here is and example of a dataset with three classes that are ordered. If you apply standard three-fold to this, the first third of the data would be in the first fold, the second in the second fold and the third in the third fold. Because this data is sorted, that would be particularly bad. If you use stratified cross-validation it would make sure that each fold has exactly 1/3 of the data from each class. This is also helpful if your data is very imbalanced. If some of the classes are very rare, it could otherwise happen that a class is not present at all in a particular fold. --- # Importance of Stratification .smaller[ ```python y.value_counts() ``` ``` 0 60 1 40 ``` ```python from sklearn.model_selection import cross_val_score, KFold, StratifiedKFold from sklearn.dummy import DummyClassifier dc = DummyClassifier('most_frequent') skf = StratifiedKFold(n_splits=5, shuffle=True) res = cross_val_score(dc, X, y, cv=skf) np.mean(res), res.std() ``` ``` (0.6, 0.0) ``` ```python kf = KFold(n_splits=5, shuffle=True) res = cross_val_score(dc, X, y, cv=kf) np.mean(res), res.std() ``` ``` (0.6, 0.063) ``` ] --- class: spacious # Repeated KFold and LeaveOneOut - LeaveOneOut : KFold(n_folds=n_samples)
High variance, takes a long time
.tiny[(see [Raschka](https://arxiv.org/pdf/1811.12808.pdf) for a review and [Varoquaux](https://hal.inria.fr/hal-01545002/file/paper.pdf) for empirical evaluation)] - Better: ShuffleSplit (aka Monte Carlo)
Repeatedly sample a test set with replacement - Even Better: RepeatedKFold.
Apply KFold or StratifiedKFold multiple times with shuffled data. ??? If you want even better estimates of the generalization performance, you could try to increase the number of folds, with the extreme of creating one fold per sample. That’s called “LeaveOneOut cross-validation”. However, because the test-set is so small every time, and the training sets all have very large overlap, this method has very high variance. A better way to get a robust estimate is to run 5-fold or 10-fold cross-validation multiple times, while shuffling the dataset. --- class: compact .center[ ![:scale 100%](images/shuffle_split_cv.png) ] .smaller[Number of iterations and test set size independent] ??? Another interesting variant is shuffle split and stratified shuffle split. In shuffle split, we repeatedly sample disjoint training and test sets randomly. You only have to specify the number of iterations, the training set size and the test set size. This also allows you to run many iterations with reasonably large test-sets. It’s also great if you have a very large training set and you want to subsample it to get quicker results. --- class: compact .center[ ![:scale 100%](images/repeated_stratified_kfold.png) ] .smaller[ Potentially less variance than StratifiedShuffleSplit.
Five times five fold or at most ten times ten fold is sufficient. ] ??? --- class: spacious # Defaults in scikit-learn - 5-fold in 0.22 (used to be 3 fold) - For classification cross-validation is stratified - train_test_split has stratify option: train_test_split(X, y, stratify=y) - No shuffle by default! ??? By default, all cross-validation strategies are five fold. If you do cross-validation for classification, it will be stratified by default. Because of how the interface is done, that’s not true for train_test_split and if you want a stratified train_test_split, which is always a good idea, you should use stratify=y Another thing that’s important to keep in mind is that by default scikit-learn doesn’t shuffle! So if you run cross-validation twice with the default parameters, it will yield exactly the same results. --- class: center, middle # Cross-Validation with non-iid data ??? --- # Grouped Data ### Assume have data (medical, product, user...) from 5 cities - New York, San Francisco, Los Angeles, Chicago, Houston. We can assume data within a city is more correlated then between cities. ### Usage Scenarios - Assume all future users will be in one of these cities: i.i.d. - Assume we want to generalize to predict for a new city: not i.i.d. ??? Shipped product in 4 cities. Might ship in another one? States: you have all the states, no new state will start to exist Similar thing for multiple measurements per patient. Or geospacial data. --- ![:scale 100%](images/group_kfold.png) ??? A somewhat more complicated approach is group k-fold. This is actually for data that doesn’t fulfill our IID assumption and has correlations between samples. The idea is that there are several groups in the data that each contain highly correlated samples. You could think about patient data where you have multiple samples for each patient, then the groups would be which patient a measurement was taken from. If you want to know how well your model generalizes to new patients, you need to ensure that the measurements from each patient are either all in the training set, or all in the test set. And that’s what GroupKFold does. In this example, there are four groups, and we want three folds. The data is divided such that each group is contained in exactly one fold. There are several other cross-validation methods in scikit-learn that use these groups. --- class: center # Correlations in time (and/or space) ![:scale 70%](images/time_series1.png) ??? Not necessarily obvious that there is a time component! Data collection usually happens over time! --- class: center # Correlations in time (and/or space) ![:scale 70%](images/time_series2.png) ??? Not necessarily obvious that there is a time component! Data collection usually happens over time! --- class: center # Correlations in time (and/or space) ![:scale 70%](images/time_series3.png) ??? Not necessarily obvious that there is a time component! Data collection usually happens over time! --- ![:scale 100%](images/time_series_walk_forward_cv.png) ??? Another common case of data that’s not independent is time series. Usually todays stock price is correlated with yesterdays and tomorrows. If you randomly split time series, this makes predictions deceivingly simple. In applications, you usually have data up to some point, and then try to make predictions for the future, in other words, you’re trying to make a forecast. The TimeSeriesSplit in scikit-learn simulates that, by taking increasing chunks of data from the past and making predictions on the next chunk. This is quite different from the other was to do cross-validation, in that the training sets are all overlapping, but it’s more appropriate for time-series. --- ![:scale 100%](images/time_series_cv.png) ??? Another common case of data that’s not independent is time series. Usually todays stock price is correlated with yesterdays and tomorrows. If you randomly split time series, this makes predictions deceivingly simple. In applications, you usually have data up to some point, and then try to make predictions for the future, in other words, you’re trying to make a forecast. The TimeSeriesSplit in scikit-learn simulates that, by taking increasing chunks of data from the past and making predictions on the next chunk. This is quite different from the other was to do cross-validation, in that the training sets are all overlapping, but it’s more appropriate for time-series. --- # Using Cross-Validation Generators .tiny[ ```python from sklearn.model_selection import KFold, StratifiedKFold, ShuffleSplit, RepeatedStratifiedKFold kfold = KFold(n_splits=5) skfold = StratifiedKFold(n_splits=5, shuffle=True) ss = ShuffleSplit(n_splits=20, train_size=.4, test_size=.3) rs = RepeatedStratifiedKFold(n_splits=5, n_repeats=10) print("KFold:") print(cross_val_score(KNeighborsClassifier(), X, y, cv=kfold)) print("StratifiedKFold:") print(cross_val_score(KNeighborsClassifier(), X, y, cv=skfold)) print("ShuffleSplit:") print(cross_val_score(KNeighborsClassifier(), X, y, cv=ss)) print("RepeatedStratifiedKFold:") print(cross_val_score(KNeighborsClassifier(), X, y, cv=rs)) ``` ``` KFold: [0.93 0.96 0.96 0.98 0.96] StratifiedKFold: [0.98 0.96 0.96 0.97 0.96] ShuffleSplit: [0.98 0.96 0.96 0.98 0.94 0.96 0.95 0.98 0.97 0.92 0.94 0.97 0.95 0.92 0.98 0.98 0.97 0.94 0.97 0.95] RepeatedStratifiedKFold: [0.99 0.96 0.97 0.97 0.95 0.98 0.97 0.98 0.97 0.96 0.97 0.99 0.94 0.96 0.96 0.98 0.97 0.96 0.96 0.97 0.97 0.96 0.96 0.96 0.98 0.96 0.97 0.97 0.97 0.96 0.96 0.95 0.96 0.99 0.98 0.93 0.96 0.98 0.98 0.96 0.96 0.95 0.97 0.97 0.96 0.97 0.97 0.97 0.96 0.96] ``` ] ??? Ok, so how do we use these cross-validation generators? We can simply pass the object to the cv parameter of the cross_val_score function, instead of passing a number. Then that generator will be used. Here are some examples for k-neighbors classifier. We instantiate a Kfold object with the number of splits equal to 5, and then pass it to cross_val_score. We can do the same with StratifiedKFold, and we can also shuffle if we like, or we can use Shuffle split. --- # cross_validate function .smaller[ ```python from sklearn.model_selection import cross_validate res = cross_validate(KNeighborsClassifier(), X, y, return_train_score=True, scoring=["accuracy", "roc_auc"]) res_df = pd.DataFrame(res) ``` ``` fit_time score_time test_accuracy test_roc_auc train_accuracy train_roc_auc 0.000839 0.010204 0.965217 0.996609 0.980176 0.997654 0.000870 0.014424 0.956522 0.983689 0.975771 0.998650 0.000603 0.009298 0.982301 0.999329 0.971491 0.996977 0.000698 0.006670 0.955752 0.984071 0.978070 0.997820 0.000611 0.006559 0.964602 0.994634 0.978070 0.998026 ``` ] ??? FIXME alignment --- class: middle # Questions ?